/*
 * Web cabinet styles — the visual language of the SquadWay prototype (W-* screens):
 * Onest for the interface, Unbounded for headings, warm neutral ground, clay accent.
 * Plain CSS with custom properties and nesting; no framework.
 */

:root {
  --ground: #F3F1EC;
  --surface: #FFFFFF;
  --surface-subtle: #F7F5F1;
  --segmented: #E9E5DD;
  --line: #E3DFD7;
  --line-strong: #D9D4CA;
  --line-soft: #EFEBE4;
  --ink: #15171A;
  --ink-2: #3F434A;
  --ink-3: #555B63;
  --muted: #6B7079;
  --accent: #C2410C;
  --accent-soft: #FBE7DC;
  --accent-text: #9A3412;
  --danger: #B42318;
  --danger-soft: #FBE4E1;
  --danger-text: #7F1D1D;
  --success-soft: #DDF0E4;
  --success-text: #1C6B3E;
  --info-soft: #E3E9FB;
  --info-text: #1E3A8A;
  --warning-soft: #FBEFD5;
  --warning-text: #92400E;
  --night: #15171A;
  --night-2: #23272C;
  --night-muted: #B7BBC2;
  --font-ui: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Unbounded", "Onest", system-ui, sans-serif;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-pop: 0 12px 32px rgba(21, 23, 26, 0.18);
  --focus: 0 0 0 3px rgba(194, 65, 12, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 15px/1.45 var(--font-ui);
}

h1, h2, h3 { margin: 0; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: var(--accent); }

:focus-visible { outline: none; box-shadow: var(--focus); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon { flex-shrink: 0; }

.muted { color: var(--muted); }
.prewrap { margin: 0; white-space: pre-line; }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--tight { gap: 4px; }
.stack--sm { gap: 8px; }
.stack--lg { gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--tight { gap: 8px; }
.row--top { align-items: flex-start; }
.spacer { margin-left: auto; }

/* ---------- buttons ---------- */

.btn {
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: 600 14px var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);

  &:hover { background: var(--surface-subtle); }
  &[disabled], &[aria-disabled="true"] { opacity: 0.5; cursor: default; }
}

.btn--primary { background: var(--ink); border-color: var(--ink); color: #FFFFFF; &:hover { background: #2B2E33; } }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #FFFFFF; &:hover { background: #962018; } }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-3); &:hover { background: var(--segmented); } }
.btn--link { background: none; border: 0; height: auto; padding: 0; color: var(--accent); &:hover { background: none; text-decoration: underline; } }
.btn--lg { height: 44px; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; padding: 0; }

.button-to { display: inline; }
form.button_to { display: inline-flex; }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field__label { font-size: 13px; font-weight: 500; color: var(--ink-3); }

.field__hint { font-size: 12px; color: var(--muted); }
.field__error { font-size: 12px; font-weight: 500; color: var(--danger); }

.field__error { font-size: 13px; color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 400 15px var(--font-ui);

  &:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
  &[aria-invalid="true"] { border-color: var(--danger); }
}

.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.45; }

.input--code {
  height: 56px;
  font: 600 28px var(--font-ui);
  letter-spacing: 0.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;

  & input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); flex-shrink: 0; }
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid > .field--wide { grid-column: 1 / -1; }
/* A trainer's location: name, address and type (ACC-03). */
.form-grid.form-grid--location { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 160px; }

.form-errors {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: 14px;

  & ul { margin: 6px 0 0; padding-left: 18px; }
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);

  &::before, &::after { content: ""; flex: 1; height: 1px; background: var(--line); }
}

/* ---------- segmented control, chips, badges ---------- */

.segmented {
  display: inline-grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  padding: 4px;
  border-radius: var(--radius);
  background: var(--segmented);

  & > * {
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    color: var(--ink-3);
    font: 600 14px var(--font-ui);
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    cursor: pointer;
  }

  & > [aria-current="page"], & > [aria-pressed="true"], & > :has(input:checked) {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(21, 23, 26, 0.08);
  }

  & input { position: absolute; opacity: 0; pointer-events: none; }
  & .count { color: var(--muted); }
}

.segmented--lg > * { height: 36px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  color: var(--ink);
  font: 500 14px var(--font-ui);
  text-decoration: none;
  cursor: pointer;

  &[aria-pressed="true"], &[aria-current="true"], &:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
  & input { position: absolute; opacity: 0; pointer-events: none; }
}

.badge {
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--segmented);
  color: var(--ink-2);
}

.badge--success { background: var(--success-soft); color: var(--success-text); }
.badge--info { background: var(--info-soft); color: var(--info-text); }
.badge--warning { background: var(--warning-soft); color: var(--warning-text); }
.badge--danger { background: var(--danger-soft); color: var(--danger-text); }
.badge--accent { background: var(--accent-soft); color: var(--accent-text); }

.tag {
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--ink);
  color: #FFFFFF;
  font: 600 14px var(--font-ui);

  & img { width: 100%; height: 100%; object-fit: cover; }
}

.avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.avatar--lg { width: 64px; height: 64px; font-size: 20px; }
.avatar--soft { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- switch ---------- */

.switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
  flex-shrink: 0;

  & input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }

  & .switch__track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--line-strong);
    transition: background 0.15s;
  }

  & .switch__track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    border-radius: 999px;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(21, 23, 26, 0.2);
    transition: left 0.15s;
  }

  & input:checked + .switch__track { background: var(--success-text); }
  & input:checked + .switch__track::after { left: 22px; }
  & input:focus-visible + .switch__track { box-shadow: var(--focus); }
  & input:disabled { cursor: default; }
  & input:disabled + .switch__track { opacity: 0.5; }
}

/* ---------- cards, lists ---------- */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.card--flush { padding: 0; gap: 0; overflow: hidden; }

.card__title { font-size: 17px; font-weight: 600; }
.stat { margin: 0; font: 600 40px/1 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.card__header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.list { display: flex; flex-direction: column; }

.list__row {
  min-height: 60px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  color: var(--ink);
  text-decoration: none;

  &:last-child { border-bottom: 0; }
}

a.list__row:hover { background: var(--surface-subtle); }

.list__head {
  min-height: 44px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.clients-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 140px 120px; }

.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person__meta { font-size: 13px; color: var(--muted); }

.empty {
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  color: var(--ink-3);

  & .icon { color: var(--muted); }
}

.dl { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; white-space: pre-line; }

/* ---------- flash ---------- */

.flash {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 60;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #FFFFFF;
  font: 500 15px var(--font-ui);
  box-shadow: 0 8px 24px rgba(21, 23, 26, 0.24);
  animation: flash-in 0.22s ease both, flash-out 0.3s ease 5s forwards;

  & .icon { flex-shrink: 0; color: #6FCF97; }
}

.flash--alert { background: var(--danger); }

@keyframes flash-in { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes flash-out { to { opacity: 0; visibility: hidden; } }

/* ---------- cabinet shell ---------- */

.shell { min-height: 100vh; display: flex; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #FFFFFF;
}

.brand__name { font: 700 17px var(--font-display); letter-spacing: -0.01em; }

.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-section__title { padding: 0 12px 6px; }

.nav-link {
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font: 500 14px var(--font-ui);
  text-decoration: none;

  &:hover { background: var(--surface-subtle); }
  &[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
  & .count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
  /* #43: what waits in a module — unread messages — as a red pill. */
  & .count--alert { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #FFFFFF; font-weight: 700; }
}

.sidebar__footer { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }

.account {
  border-top: 1px solid var(--line-soft);
  padding: 12px 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.account__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.account__name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  min-height: 72px;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--ground);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar__title { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.topbar__title h1 { font-size: 22px; }

.content { padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 24px; }

.columns { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }

.hero {
  padding: 24px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--night);
  color: #FFFFFF;

  & .muted { color: var(--night-muted); }
}

.hero__title { font: 600 24px/1.3 var(--font-display); letter-spacing: -0.01em; }

.action-tile {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;

  &:hover { border-color: var(--line-strong); background: var(--surface-subtle); }
}

.action-tile__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* ---------- auth & onboarding ---------- */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 600px) minmax(0, 1fr); }

.auth__aside {
  padding: 48px;
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: #FFFFFF;

  & .brand { color: #FFFFFF; padding: 0; }
}

.auth__pitch { margin: auto 0; display: flex; flex-direction: column; gap: 40px; }
.auth__headline { font: 600 36px/1.15 var(--font-display); letter-spacing: -0.01em; max-width: 460px; }

.features { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 24px; }

.feature { display: flex; align-items: flex-start; gap: 16px; }

.feature__icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--night-2);
  color: #F9844A;
}

.feature__title { font-size: 16px; font-weight: 600; }
.feature__text { font-size: 14px; color: var(--night-muted); }

.auth__footnote { margin: 0; font-size: 13px; color: #9097A1; }

.auth__main { padding: 48px; display: flex; align-items: center; justify-content: center; }
.auth__form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.auth__title { font: 600 28px/1.2 var(--font-display); letter-spacing: -0.01em; }

.onboarding { min-height: 100vh; display: flex; flex-direction: column; }

.onboarding__header {
  height: 72px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.onboarding__header > :last-child { justify-self: end; }
.onboarding__main { flex: 1; padding: 40px 32px 64px; display: flex; justify-content: center; }
.onboarding__body { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 24px; }
.onboarding__body--narrow { max-width: 480px; }
.onboarding__title { font: 600 28px/1.2 var(--font-display); letter-spacing: -0.01em; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

.choice {
  position: relative;
  padding: 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  cursor: pointer;

  &:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
  & input { position: absolute; opacity: 0; pointer-events: none; }
  & .choice__title { font-weight: 600; font-size: 16px; }
  & .choice__text { font-size: 14px; color: var(--ink-3); }
}

/* ---------- settings ---------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }

.tabs > a {
  height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;

  &[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
}

/* W-Settings-*: the section menu beside the section. */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings__body { min-width: 0; display: flex; flex-direction: column; gap: 24px; }

.settings-menu {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;

  @media (max-width: 960px) { position: static; flex-direction: row; flex-wrap: wrap; }
}

.settings-menu__item {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  color: var(--ink-2);
  font: 500 14px var(--font-ui);
  text-decoration: none;

  &:hover { background: var(--surface-subtle); }
  &[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; }
}

@media (max-width: 960px) { .settings { grid-template-columns: minmax(0, 1fr); } }

/* W-Settings-Modules: modules on, then the ones to switch on. */
.module-group { background: var(--surface); border-radius: var(--radius-lg); padding: 20px 20px 8px; display: flex; flex-direction: column; }
.module-group__head { padding-bottom: 12px; display: flex; flex-direction: column; gap: 2px; }
.module-group__title { font-size: 17px; font-weight: 600; & .module-group__count { color: var(--muted); font-weight: 500; } }

.module-row {
  min-height: 64px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) minmax(0, 240px) auto;
  gap: 16px;
  align-items: center;

  @media (max-width: 960px) { grid-template-columns: 36px minmax(0, 1fr) auto; & .module-row__deps { grid-column: 2; grid-row: 2; } }
}

.module-row__name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.module-row__text { font-size: 13px; color: var(--muted); }
.module-row__deps { font-size: 13px; color: var(--muted); }

.module-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ground);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* A setting with its explanation and a switch on the right (ACC-16 «Ділитися планами»). */
.setting-row { display: flex; align-items: center; gap: 24px; & > .stack { flex: 1; min-width: 0; } }

.note-line { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-3); & .icon { flex-shrink: 0; margin-top: 1px; } }

/* MOD-13: «Більше можливостей» — modules off, one button each (C-Today-Start in the cabinet). */
.more-modules { padding: 20px 20px 4px; gap: 0; }
.more-modules__head { padding-bottom: 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; & .btn--icon { margin: -8px -8px 0 0; } }
.more-modules__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); column-gap: 24px; }
.more-modules__row { min-height: 64px; padding: 8px 0; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; & .stack { flex: 1; min-width: 0; } }
.more-modules__name { font-weight: 500; }
.more-modules__all {
  min-height: 48px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.notice {
  padding: 14px 16px;
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--warning-soft);
  color: var(--warning-text);
  font-size: 14px;
}

.notice--info { background: var(--info-soft); color: var(--info-text); }

/* ---------- invitation ---------- */

.invite-code {
  font: 600 24px var(--font-ui);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.qr { width: 176px; height: 176px; padding: 8px; border-radius: var(--radius); background: #FFFFFF; border: 1px solid var(--line); flex-shrink: 0; }

.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-size: 13px; color: var(--ink-3); }

/* ---------- modal ---------- */

.modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pop);

  &::backdrop { background: rgba(21, 23, 26, 0.45); }
}

.modal__header { padding: 20px 24px 0; display: flex; align-items: center; gap: 12px; }
.modal__heading { margin-right: auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.modal__title { font: 600 20px var(--font-ui); }

/* A side panel: the log of a workout (W-Client-Log). */
.modal--drawer {
  width: min(600px, 100vw);
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  border-radius: 0;
}
/* A panel under the bell: the notification centre (W-Notifications). */
.modal--panel {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 96px);
  margin: 72px 32px auto auto;

  @media (max-width: 640px) { margin: 72px auto auto; }
}
.modal__body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
/* A card inside a dialog is a bordered box (W-Session): the dialog is white like the card. */
.modal .card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; gap: 10px; }
.modal .card--flush { padding: 0; gap: 0; }
.modal .card--flush .list__row { min-height: 44px; padding: 8px 14px; }
.modal__footer { padding: 0 24px 24px; display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- module intro (W-ModuleIntro) and hint (S-ModuleHint) ---------- */

.intro {
  width: min(560px, calc(100vw - 32px));
  padding: 24px;
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pop);

  &::backdrop { background: rgba(21, 23, 26, 0.6); }
}

.intro__step { display: flex; flex-direction: column; gap: 20px; }
.intro__top { display: flex; align-items: center; gap: 12px; & .btn--icon { margin: -8px -8px -8px auto; } & form.button_to { margin-left: auto; } }
.intro__count { margin-right: auto; font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.intro__art { height: 200px; border-radius: var(--radius-lg); background: var(--accent-soft); display: flex; align-items: center; justify-content: center; gap: 16px; }
.intro__badge { width: 72px; height: 72px; border-radius: 999px; background: var(--surface); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.intro__chip { height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--accent-text); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.intro__chip--action { height: 48px; padding: 0 20px; border-radius: 14px; background: var(--ink); color: #FFFFFF; font-size: 15px; }
.intro__menu { width: 220px; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--surface); color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent); display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.intro__title { font: 600 22px/1.2 var(--font-display); letter-spacing: -0.02em; }
.intro__text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-3); }
.intro__progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; & span { height: 8px; border-radius: 999px; background: var(--segmented); } & .is-done { background: var(--accent); } }
.intro__actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.intro__back { margin-right: auto; padding-left: 8px; }

.intro-list { display: flex; flex-direction: column; margin: -8px 0; }
.intro-list__row { min-height: 60px; padding: 8px 0; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; &:first-child { border-top: 0; } &:hover .intro-list__name { color: var(--accent); } }
.intro-list__name { font-weight: 600; }

.module-hint {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;

  &::backdrop { background: rgba(21, 23, 26, 0.55); }
}

.module-hint__item { position: fixed; background: var(--surface); color: var(--accent-text); font-weight: 600; box-shadow: 0 0 0 3px var(--accent); }
.module-hint__bubble {
  position: fixed;
  width: 320px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(21, 23, 26, 0.24);
  display: flex;
  flex-direction: column;
  gap: 8px;

  &::before { content: ""; position: absolute; left: -7px; top: calc(var(--arrow-top, 32px) - 8px); width: 16px; height: 16px; background: var(--surface); transform: rotate(45deg); border-radius: 3px; }
}
.module-hint__eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
.module-hint__title { font-size: 16px; font-weight: 600; }
.module-hint__text { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-3); }
.module-hint__actions { justify-content: flex-end; padding-top: 4px; }

/* The account menu opens upward from the bottom of the sidebar. */
.account { position: relative; }
.menu.account__menu { position: static; }
.account__menu > summary { list-style: none; &::-webkit-details-marker { display: none; } }
.menu__list.menu__list--up { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; width: auto; gap: 0; }


/* ---------- placeholder pages ---------- */

.placeholder {
  max-width: 560px;
  margin: 48px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ---------- smaller screens (NFR-12: the cabinet works from 1024 px; nothing breaks below) ---------- */

@media (max-width: 1100px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
  .clients-grid { grid-template-columns: minmax(0, 1fr) 120px; }
  .clients-grid > :nth-child(2), .clients-grid > :nth-child(3) { display: none; }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { position: static; width: auto; height: auto; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__aside { display: none; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .form-grid, .form-grid.form-grid--location { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Charts drawn on the server (ChartsHelper). */
.chart { width: 100%; height: auto; display: block; }
.chart__grid { stroke: var(--line); stroke-dasharray: 4 4; }
.chart__axis { fill: var(--muted); font: 12px var(--font-ui); }
.chart__line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.chart__dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart__dot--last { fill: var(--accent); }

/* ---------- notifications (W-Notifications, W-Settings-Notifications) ---------- */

.bell { position: relative; }
.bell--unread::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 2px solid var(--ground);
  background: var(--accent);
}

.notifications__filter { display: grid; }
.notifications__day { display: flex; flex-direction: column; gap: 4px; }
.notifications__settings { align-self: center; display: inline-flex; align-items: center; gap: 8px; }

.notification {
  margin: 0 -8px;
  padding: 8px;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  color: var(--ink-3);
  text-decoration: none;

  &:hover { background: var(--surface-subtle); }
  &:focus-visible { box-shadow: var(--focus); outline: none; }
}
.notification--unread { color: var(--ink); }
.notification__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.notification__title { font-weight: 500; }
.notification--unread .notification__title { font-weight: 600; }
.notification__body { color: var(--muted); font-size: 13px; }
.notification__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.notification__dot { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); }

.notification-settings__intro { padding: 20px 20px 12px; display: flex; flex-direction: column; gap: 4px; & p { margin: 0; } }

.notification-setting {
  padding: 12px 20px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(var(--channels, 2), 112px);
  gap: 12px;
  align-items: center;

  @media (max-width: 640px) { grid-template-columns: minmax(0, 1fr) repeat(2, 88px); }
}
.notification-settings--3 { --channels: 3; }
.notification-setting--head {
  padding-block: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);

  & > span:not(:first-child) { text-align: center; }
}
.notification-setting__title { font-weight: 500; }
.notification-setting__time { margin-top: 4px; & .select { width: auto; height: 36px; padding: 0 10px; font-size: 14px; } }
.notification-setting__channel {
  justify-content: center;
  min-height: 44px;

  & .icon { display: none; }
  &:has(input:checked) { font-weight: 600; & .icon { display: inline; } }
  &:has(input:focus-visible) { box-shadow: var(--focus); }
}

.quiet-hours__title { flex: 1; & p { margin: 0; } }
.quiet-hours { align-items: flex-end; }
.quiet-hours__dash { padding-bottom: 12px; color: var(--muted); }
.quiet-hours__note { display: inline-flex; align-items: center; gap: 6px; padding-bottom: 12px; }

/* ---------- W-Components: menus, pickers, dialogs, toasts, empty states, table rows ---------- */

/* «Меню дій» (data-sheet): radius 14, from 240 px, rows 40 px; the row under the pointer is ground. */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
}
.menu__heading { padding: 8px 12px 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.menu__item {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: 500 14px var(--font-ui);
  text-align: left;
  text-decoration: none;
  cursor: pointer;

  &:hover, &:focus-visible { background: var(--ground); }
}
.menu__item--danger { color: var(--danger); }
/* A two-line item: the action and, under it, its detail (the support address, #41). */
.menu__item--stacked { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; padding-block: 6px; }

/* A dialog's quiet button (W-Components «Скасувати»): ground, no border. */
.btn--soft { background: var(--ground); border-color: var(--ground); color: var(--ink); &:hover { background: var(--segmented); } }

/* «Підтвердження» (data-turbo-confirm, confirm.js): 400 px, radius 20, the title in Onest 18. */
.confirm {
  width: min(400px, calc(100vw - 32px));
  padding: 24px;
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(21, 23, 26, 0.24);

  &::backdrop { background: rgba(21, 23, 26, 0.45); }
}
.confirm__form { display: flex; flex-direction: column; gap: 8px; }
.confirm__title { font: 600 18px var(--font-ui); }
.confirm__body { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink-3); }
.confirm__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* «Порожня таблиця»: a 72 px circle with the icon, a title, a line of text, one action. */
.empty {
  padding: 36px 32px;
  gap: 12px;

  & > .icon:first-child {
    width: 72px;
    height: 72px;
    padding: 20px;
    border-radius: 999px;
    background: var(--segmented);
    color: var(--ink-2);
  }
  & > strong { margin-top: 4px; font-size: 17px; font-weight: 600; color: var(--ink); }
  & > span { max-width: 320px; font-size: 14px; line-height: 1.45; color: var(--ink-3); }
  & > .btn { margin-top: 8px; }
}

/* Keys as the design writes them: «Ctrl K», «Esc», «Enter». */
.kbd {
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  background: var(--ground);
  color: var(--ink-3);
  font: 600 12px var(--font-ui);
}
.kbd--button { height: 28px; padding: 0 8px; border: 1px solid var(--line-strong); cursor: pointer; }

/* ---------- top bar: search, «Створити», the bell (W-Home) ---------- */

.search-trigger {
  width: 340px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--muted);
  font: 400 14px var(--font-ui);
  text-decoration: none;

  &:hover { border-color: var(--ink-3); }
}
.search-trigger__kbd { margin-left: auto; padding: 2px 6px; height: auto; }

.create-menu__button { padding: 0 14px 0 12px; gap: 6px; }

.bell { background: var(--surface); }

.account .avatar { width: 36px; height: 36px; font-size: 13px; background: var(--ink); color: #FFFFFF; }

@media (max-width: 900px) {
  .search-trigger { width: 40px; padding: 0; justify-content: center; }
  .search-trigger__text, .search-trigger__kbd, .create-menu__text { display: none; }
  .create-menu__button { padding: 0 10px; }
}

/* ---------- W-Search: the search in a dialog ---------- */

.palette {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 128px);
  margin: 96px auto auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(21, 23, 26, 0.24);

  &[open] { display: flex; flex-direction: column; }
  &::backdrop { background: rgba(21, 23, 26, 0.45); }
}
.palette__bar { height: 56px; flex-shrink: 0; padding: 0 12px 0 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); }
.palette__field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.palette__input { flex: 1; min-width: 0; height: 40px; border: 0; padding: 0; background: transparent; font: 400 18px var(--font-ui); color: var(--ink); outline: none; &:focus-visible { box-shadow: none; } &::-webkit-search-cancel-button { display: none; } }
.palette__list { padding: 8px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.palette__group { display: flex; flex-direction: column; }
.palette__group--actions { border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 4px; }
.palette__heading { padding: 8px 12px 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.palette__item {
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;

  &[aria-current="true"] { background: var(--ground); }
  &:not([aria-current="true"]) .palette__enter { display: none; }
}
.palette__icon { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--segmented); color: var(--ink-2); }
.palette__icon--accent { background: var(--accent-soft); color: var(--accent-text); }
.palette__icon--info { background: var(--info-soft); color: var(--info-text); }
.palette__icon--plain { background: var(--ground); color: var(--ink); }
.palette__title { font-size: 14px; font-weight: 600; }
.palette__title--grow { flex: 1; }
.palette__meta { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette__enter { background: var(--surface); border: 1px solid var(--line-strong); }
.palette__empty { margin: 0; padding: 16px 12px; font-size: 14px; color: var(--muted); }
.palette__hint { margin: 0; padding: 12px 20px; border-top: 1px solid var(--line-soft); background: var(--surface-subtle); font-size: 12px; color: var(--muted); }
.flash--alert .icon { color: #FFFFFF; }

/* ---------- shared helpers of the cabinet's tables and cards (#30) ---------- */

.btn--sm { height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #FFFFFF; &:hover { background: #A8380A; } }
.btn--night { background: var(--night-2); border-color: var(--night-2); color: #FFFFFF; &:hover { background: #2E3339; } }
.btn--text { background: transparent; border-color: transparent; color: var(--accent); &:hover { background: transparent; color: var(--accent-text); } }
.btn--warning-soft { height: 32px; padding: 0 10px; background: var(--warning-soft); border-color: var(--warning-soft); color: var(--warning-text); &:hover { background: #F6E3BC; } }
.text-link { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; &:hover { color: var(--accent-text); } }
.muted-2 { color: var(--ink-3); }
.tabular { font-variant-numeric: tabular-nums; }

.avatar--md { width: 36px; height: 36px; font-size: 13px; }
.avatar--big { width: 48px; height: 48px; font-size: 16px; }
.avatar--accent { background: var(--accent-soft); color: var(--accent-text); }
.avatar--info { background: var(--info-soft); color: var(--info-text); }
.avatar--success { background: var(--success-soft); color: #14532D; }
.avatar--warning { background: var(--warning-soft); color: var(--warning-text); }
.avatar--neutral { background: var(--segmented); color: var(--ink-2); }

/* ---------- W-Home, W-Home-Empty ---------- */

.home { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.home__main, .home__side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (max-width: 1100px) { .home { grid-template-columns: minmax(0, 1fr); } }

.home-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat-card { background: var(--surface); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; }
.stat-card__label { font-size: 13px; color: var(--ink-3); }
.stat-card__value { font: 600 28px/1.25 var(--font-display); font-variant-numeric: tabular-nums; }
.stat-card__of { font-size: 16px; color: var(--muted); }
.stat-card__note { font-size: 12px; color: var(--muted); }
.stat-card__note--link { font-weight: 600; color: var(--accent); }

.home-table, .home-feed, .attention, .first-steps { padding: 20px 20px 8px; gap: 0; }
.home-table .card__header, .first-steps .card__header { padding-bottom: 12px; }
.home-feed .card__header, .attention .card__header { padding-bottom: 8px; }
.today-grid { display: grid; grid-template-columns: 60px minmax(0, 1fr) minmax(0, 1fr) 152px 100px; gap: 10px; align-items: center; }
.home-table__head { padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.home-table__row { min-height: 60px; border-bottom: 1px solid var(--line-soft); font-size: 14px; &:last-child { border-bottom: 0; } & .person { color: var(--ink); text-decoration: none; } }
.home-table__end { justify-self: end; text-align: right; }
.home-table__empty { margin: 0; padding: 4px 0 20px; color: var(--muted); font-size: 14px; }
.today-time { display: flex; align-items: center; gap: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.today-time__bar { width: 4px; height: 28px; border-radius: 999px; background: var(--svc, var(--accent)); flex-shrink: 0; }
.today-time--past { color: var(--muted); & .today-time__bar { opacity: 0.35; } }

.home-feed__row { display: flex; align-items: center; gap: 12px; min-height: 60px; border-top: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; font-size: 14px; }
.home-feed__icon { width: 36px; height: 36px; border-radius: 999px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.home-feed__icon--accent { background: var(--accent-soft); color: var(--accent-text); }
.home-feed__icon--info { background: var(--info-soft); color: var(--info-text); }
.home-feed__time { font-variant-numeric: tabular-nums; }

.next-session { background: var(--night); color: #FFFFFF; border-radius: var(--radius-xl); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.next-session__head { display: flex; justify-content: space-between; align-items: flex-start; }
.next-session__when { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--night-muted); }
.next-session__time { font: 600 34px var(--font-display); font-variant-numeric: tabular-nums; }
.next-session__name { font-size: 17px; font-weight: 600; }
.next-session__meta { font-size: 14px; color: var(--night-muted); }
.next-session__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.next-session__chip { height: 24px; padding: 0 8px; border-radius: 6px; display: inline-flex; align-items: center; background: var(--night-2); color: #F2F0EB; font: 600 12px var(--font-ui); }
.next-session__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; & .btn { height: 44px; } }
.next-session__note { font-size: 12px; color: #9097A1; }

.attention__row { display: flex; align-items: center; gap: 12px; min-height: 60px; border-top: 1px solid var(--line-soft); }
.attention__person { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; & .person__name { font-size: 14px; } }
.attention__text { font-size: 13px; }
.attention__text--danger { color: var(--danger-text); }
.attention__text--warning { color: var(--warning-text); }
.attention__action { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }

.hero__progress { display: flex; flex-direction: column; gap: 8px; }
.hero__progress-head { display: flex; align-items: baseline; gap: 12px; }
.hero__progress-title { font-size: 15px; font-weight: 600; margin-right: auto; }
.hero__progress-note { font-size: 13px; color: var(--night-muted); }
.hero__bar { width: 100%; height: 8px; border: 0; border-radius: 999px; appearance: none; overflow: hidden; background: var(--night-2);
  &::-webkit-progress-bar { background: var(--night-2); }
  &::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
  &::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
}

.first-steps__row { display: flex; align-items: center; gap: 14px; min-height: 64px; border-top: 1px solid var(--line-soft); }
.first-steps__mark { width: 28px; height: 28px; border-radius: 999px; border: 1.5px solid var(--line-strong); color: var(--ink-3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font: 600 13px var(--font-ui); }
.first-steps__mark--current { border-color: var(--ink); color: var(--ink); }
.first-steps__mark--done { border: 0; background: var(--success-text); color: #FFFFFF; }
.first-steps__title { font-size: 15px; font-weight: 600; }
.first-steps__title--done { flex: 1; font-weight: 500; color: var(--muted); text-decoration: line-through; }
.first-steps__ready { font-size: 13px; font-weight: 600; color: var(--success-text); }

.first-today { padding: 20px; gap: 14px; }
.first-today__empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 4px; text-align: center; & strong { font-size: 15px; } }
.first-today__icon { width: 48px; height: 48px; border-radius: 14px; background: var(--ground); color: var(--muted); display: flex; align-items: center; justify-content: center; }

.link-card { padding: 20px; flex-direction: row; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.link-card__icon { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-text); }

/* ---------- W-Clients cells the modules draw ---------- */

.cell-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-stack:has(.cell-bar) { gap: 6px; }
.cell-note { font-size: 13px; color: var(--ink-3); & strong { font-weight: 600; color: var(--ink); } }
.cell-note--warning { color: var(--warning-text); }
.cell-note--danger { color: var(--danger); }
.cell-note--strong { font-weight: 600; }
.cell-muted { font-size: 13px; color: var(--muted); }
.cell-plain { color: var(--ink-3); }
.cell-danger { color: var(--danger); font-weight: 600; }
.cell-bar { width: 120px; height: 6px; border: 0; border-radius: 999px; display: block; appearance: none; overflow: hidden; background: var(--segmented);
  &::-webkit-progress-bar { background: var(--segmented); }
  &::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
  &::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
}
.cell-bar--few { background: var(--warning-soft); &::-webkit-progress-bar { background: var(--warning-soft); } &::-webkit-progress-value { background: var(--warning-text); } &::-moz-progress-bar { background: var(--warning-text); } }
.cell-bar--used-up { background: var(--danger-soft); &::-webkit-progress-bar { background: var(--danger-soft); } }

/* ---------- W-Clients, W-Clients-Selected, W-Clients-Empty ---------- */

.clients-toolbar { display: flex; flex-direction: column; gap: 12px; }
.clients-toolbar__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.clients-toolbar__tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clients-toolbar__label { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-right: 4px; }

.search-field {
  width: 280px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--muted);

  & input { flex: 1; min-width: 0; height: 36px; border: 0; padding: 0; background: transparent; font: 400 14px var(--font-ui); color: var(--ink); outline: none; }
  & input:focus-visible { box-shadow: none; }
  &:focus-within { border-color: var(--ink); }
}

.filters-menu__count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #FFFFFF; font: 700 12px var(--font-ui); }
.menu__check { gap: 10px; & input { width: 18px; height: 18px; accent-color: var(--ink); } }
.menu__list--form { padding: 12px; gap: 10px; min-width: 260px; }

.clients-form { display: flex; flex-direction: column; gap: 12px; }
.bulk-bar {
  min-height: 56px;
  padding: 8px 12px 8px 20px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--night);
  color: #FFFFFF;

  &[hidden] { display: none; }
}
.bulk-bar__count { font-size: 15px; font-weight: 600; margin-right: 12px; }
.bulk-bar__action { height: 36px; padding: 0 12px; border: 0; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; background: var(--night-2); color: #FFFFFF; font: 600 14px var(--font-ui); cursor: pointer; list-style: none; &:hover { background: #2E3339; } }
.bulk-bar__menu > .menu__list { color: var(--ink); }
.bulk-bar__clear { margin-left: auto; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: #FFFFFF; font: 600 14px var(--font-ui); cursor: pointer; }

.clients-table__row {
  min-height: 60px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 130px 104px 32px;
  gap: 16px;
  align-items: center;
  font-size: 14px;

  &.is-selected { background: var(--accent-soft); }
  & .person { color: var(--ink); text-decoration: none; }
}
/* The modules' columns between «Теги» and «Канал»: as many as the enabled modules give. */
.clients-table--cols-1 .clients-table__row { grid-template-columns: 20px minmax(0, 1fr) 130px 165px 104px 32px; }
.clients-table--cols-2 .clients-table__row { grid-template-columns: 20px minmax(0, 1fr) 130px 165px 170px 104px 32px; }
.clients-table--cols-3 .clients-table__row { grid-template-columns: 20px minmax(0, 1fr) 130px 160px 170px 160px 104px 32px; }
.clients-table--cols-4 .clients-table__row { grid-template-columns: 20px minmax(0, 1fr) 130px repeat(4, 150px) 104px 32px; }
.clients-table__head { min-height: 48px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.clients-table__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.clients-table__footer { min-height: 56px; padding: 0 20px; display: flex; align-items: center; gap: 8px; }
.clients-table .empty { padding: 48px 24px; }

/* The design's checkbox on a bare input (tables, pick lists); a label.checkbox above is a row of a box and its text. */
input.checkbox { flex-shrink: 0; width: 20px; height: 20px; margin: 0; border: 1.5px solid var(--line-strong); border-radius: 6px; appearance: none; background: var(--surface); display: grid; place-content: center; cursor: pointer;
  &:checked, &:indeterminate { background: var(--ink); border-color: var(--ink); }
  &:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid #FFFFFF; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
  &:indeterminate::after { content: ""; width: 10px; height: 2px; background: #FFFFFF; border-radius: 2px; }
}

.row-menu__button { width: 32px; height: 32px; border-radius: 8px; color: var(--ink-3); }
.pager { width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--ink); text-decoration: none;
  &[aria-disabled="true"] { color: var(--line-strong); }
}

.clients-empty { min-height: calc(100dvh - 168px); align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 48px 32px; }
.clients-empty__icon { width: 88px; height: 88px; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.clients-empty__title { font: 600 24px var(--font-display); letter-spacing: -0.01em; }
.clients-empty__text { margin: 0; max-width: 560px; font-size: 15px; line-height: 1.5; color: var(--ink-3); }
.row--center { justify-content: center; }
.clients-empty__steps { margin: 16px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: min(960px, 100%); text-align: left; }
.clients-empty__step { min-height: 104px; padding: 18px; border-radius: var(--radius-lg); background: var(--ground); display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; gap: 12px; & strong { grid-column: 1 / -1; align-self: end; font-size: 15px; } }
.clients-empty__number { width: 32px; height: 32px; border-radius: 999px; background: var(--surface); color: var(--accent); display: flex; align-items: center; justify-content: center; font: 700 15px var(--font-display); }
.clients-empty__step-icon { justify-self: end; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
.clients-empty__step-icon--open { color: var(--info-text); }
.clients-empty__step-icon--ready { color: var(--success-text); }

@media (max-width: 900px) {
  .clients-table { overflow-x: auto; }
  .clients-table__row { min-width: 1120px; }
  .search-field { width: 100%; }
  .clients-empty__steps { grid-template-columns: 1fr; }
}

/* ---------- W-Client: the header, the tabs, «Огляд» ---------- */

.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted);
  & a { color: var(--muted); font-weight: 500; text-decoration: none; }
  & a[aria-current="page"] { color: var(--ink); }
}
.client-head { padding: 20px; flex-direction: row; align-items: center; gap: 20px; }
.client-head__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.client-head__name { font: 600 22px/28px var(--font-display); letter-spacing: -0.01em; }
.client-head__facts { font-size: 14px; line-height: 20px; color: var(--ink-3); }
.client-head__chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.client-head__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
@media (max-width: 900px) { .client-head { flex-wrap: wrap; } .client-head__actions { width: 100%; } }

.client-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); overflow-x: auto;
  & a { height: 44px; display: flex; align-items: center; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font: 500 15px var(--font-ui); text-decoration: none; white-space: nowrap; }
  & a[aria-current="page"] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 600; }
}

.client-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.client-overview__column { display: flex; flex-direction: column; gap: 24px; min-width: 0; & > .card { padding: 20px; gap: 12px; } }
@media (max-width: 1100px) { .client-overview { grid-template-columns: minmax(0, 1fr); } }

.goal-card__percent { font-size: 14px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.goal-card__title { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat--md { font-size: 34px; line-height: 40px; }
.widget-chart .card__title { font-size: 15px; }

.limitations { padding: 16px 20px; border-radius: var(--radius-lg); display: flex; gap: 12px; align-items: flex-start; background: var(--warning-soft); color: var(--warning-text); }
.limitations__title { font-size: 15px; font-weight: 600; }
.limitations__text { font-size: 14px; line-height: 1.45; }

.list-card { padding: 20px 20px 8px !important; gap: 0 !important; }
.list-card .card__header { padding-bottom: 8px; }
.list-card__row { min-height: 52px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
a.list-card__row:hover { background: var(--surface-subtle); }
.list-card__bar { width: 4px; height: 36px; border-radius: 999px; background: var(--svc, var(--accent)); flex-shrink: 0; }
.list-card__title { font-size: 15px; font-weight: 600; }
.list-card__date { width: 48px; flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.list-card__empty { margin: 0; padding: 12px 0 16px; border-top: 1px solid var(--line-soft); font-size: 14px; color: var(--muted); }
.record-mark { width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }

.note-card { color: var(--ink); text-decoration: none; }
.note-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note-card__private { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.note-card__text { font-size: 14px; line-height: 1.45; color: var(--ink-3); & strong { color: var(--ink); } }
.chips--tight { gap: 6px; }
/* W-Client-Notes: the notes beside the card's history. */
.client-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .client-notes { grid-template-columns: minmax(0, 1fr); } }
.notes-list { display: flex; flex-direction: column; }
.notes-list__row { padding: 10px 0; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  font-size: 14px; & time { padding-top: 2px; } & .btn--icon { margin: -6px 0; } }
.history-list { display: flex; flex-direction: column; }
.history-list__row { padding: 10px 0; border-top: 1px solid var(--line-soft); display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.history-list__icon { width: 28px; height: 28px; flex-shrink: 0; border-radius: 999px; background: var(--surface-subtle); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; }

/* ---------- W-AddClient, W-AddClient-Card: one dialog, two tabs ---------- */

.modal--medium { width: min(680px, calc(100vw - 32px)); }
.dialog-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line-soft);
  & a { height: 40px; margin-bottom: -1px; display: flex; align-items: center; border-bottom: 2px solid transparent; color: var(--muted); font: 500 14px var(--font-ui); text-decoration: none; }
  & a[aria-current="page"] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 600; }
}
.invite-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding-top: 4px; }
.invite-grid__qr { display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* #55: «Додаток для залу» on the first day. */
.app-card__qr { flex: none; width: 120px; height: 120px; padding: 10px; border-radius: var(--radius); background: var(--surface-subtle); & img { width: 100%; height: 100%; } }
.invite-qr { width: 200px; height: 200px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; background: var(--surface); & img { width: 100%; height: 100%; } }
.center { text-align: center; }
.input--readonly { background: var(--ground); font-weight: 500; }
.btn--info-soft { background: var(--info-soft); border-color: var(--info-soft); color: var(--info-text); &:hover { background: #D6DFF8; } }
.or-divider { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted);
  &::before, &::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
}
.notice--plain { background: var(--ground); color: var(--ink-3); & b { color: var(--ink); font-weight: 600; } }
.card-form-package { padding: 12px 16px; border-radius: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: center; background: var(--ground); }
.switch-row { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; & strong { font-size: 14px; } }
@media (max-width: 640px) { .invite-grid, .card-form-package { grid-template-columns: minmax(0, 1fr); } }
.invite-grid .invite-code { font-size: 20px; white-space: nowrap; letter-spacing: 0.02em; }

/* ---------- W-EndCoop ---------- */

.end-summary { padding: 12px 14px; border-radius: 14px; display: flex; align-items: center; gap: 12px; background: var(--ground); }
.end-list { display: flex; flex-direction: column;
  & li { min-height: 44px; padding: 8px 0; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; font-size: 14px; line-height: 1.4; }
  & li:first-child { border-top: 0; }
}
.end-list__icon { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--segmented); color: var(--ink-2); }
.end-list__icon--success { background: var(--success-soft); color: var(--success-text); }
.end-list__icon--warning { background: var(--warning-soft); color: var(--warning-text); }
.end-list__icon--danger { background: var(--danger-soft); color: var(--danger); }
.modal__actions--plain { border-top: 0; }

@media (max-width: 640px) {
  /* W-Home on a phone: today's sessions as time, client and action; the figures two by two. */
  .today-grid { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .today-grid > :nth-child(3), .today-grid > :nth-child(4) { display: none; }
  .home-table__head { display: none; }
  .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- W-Settings-Security ---------- */
.security { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start;
  & > .security__sessions, & > .security__delete { grid-column: 1 / -1; }
  @media (max-width: 900px) { grid-template-columns: minmax(0, 1fr); } }
.session-row { grid-template-columns: minmax(0, 1fr) 160px 110px; min-height: 52px; & > :last-child { justify-self: end; } }
.session-more > summary { cursor: pointer; list-style: none; min-height: 44px; &::-webkit-details-marker { display: none; } }
.security__delete { flex-direction: row; align-items: center; gap: 16px; border: 1px solid var(--danger-soft); }
/* W-DeleteAccount: a warning sign, what happens, the data first, then the word and the tick. */
.delete-account { display: flex; flex-direction: column; gap: 14px; }
.delete-account__icon { align-self: center; width: 52px; height: 52px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); display: grid; place-items: center; }
.delete-account__title { margin: 0; text-align: center; font: 600 20px/1.3 var(--font-display); }
.delete-account__list { margin: 0; padding: 4px 14px; list-style: none; border-radius: var(--radius); background: var(--surface-subtle);
  & li { display: flex; gap: 10px; align-items: center; padding: 10px 0; font-size: 14px; border-bottom: 1px solid var(--line-soft); }
  & li:last-child { border-bottom: 0; } & svg { color: var(--ink-3); flex-shrink: 0; } }
.delete-account__export, .delete-account form:has(.delete-account__export) { width: 100%; justify-content: center; }
.delete-account-page { max-width: 560px; }

/* ---------- W-Settings-Profile ---------- */
.avatar--xl { width: 72px; height: 72px; font-size: 24px; & img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; } }
.profile-photo { gap: 16px; }
.profile-photo__pick { position: relative; cursor: pointer; & input { position: absolute; inset: 0; opacity: 0; cursor: pointer; } }
.input--static { display: flex; align-items: center; gap: 8px; background: var(--surface-subtle); }
.settings-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start;
  @media (max-width: 900px) { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 861px) { .settings-pair .form-grid--location { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 110px; } }
.settings-pair fieldset > legend.field__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Onboarding: the step and its bars in the header. */
.onboarding__step { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 600; }
.onboarding__bars { display: flex; gap: 4px; & span { width: 38px; height: 4px; border-radius: 2px; background: var(--line); } & .is-done { background: var(--accent); } }

/* W-Chats (#43): the conversations, the open one and the client beside it, the whole height. */
.content:has(> .chat) { padding: 0; }
.chat { display: grid; grid-template-columns: 340px minmax(0, 1fr) 300px; height: calc(100dvh - 72px); min-height: 480px; border-top: 1px solid var(--line); }
.chat-list { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-right: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.chat-list__search { width: 100%; }
.chat-list__filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chat-list__empty { padding: 8px 4px; }
.chat-list__items { list-style: none; margin: 0 -16px; padding: 0; overflow-y: auto; }
.chat-row__link { display: flex; gap: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-soft); }
.chat-row__link:hover { background: var(--surface-subtle); }
.chat-row__link[aria-current="page"] { background: var(--accent-soft); }
.chat-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.chat-row__top, .chat-row__bottom { display: flex; align-items: center; gap: 8px; }
.chat-row__name { flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row__time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chat-row__time--unread { color: var(--accent-text); font-weight: 600; }
.chat-row__preview { flex: 1; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #FFFFFF; font: 700 12px var(--font-ui); }
.chat-empty { display: grid; place-items: center; grid-column: span 2; }

.chat-conversation { display: flex; flex-direction: column; min-width: 0; background: var(--ground); }
.chat-conversation__head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-conversation__who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-conversation__name { font-weight: 600; font-size: 16px; }
.chat-messages { flex: 1; list-style: none; margin: 0; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.chat-day { align-self: center; margin: 8px 0; & span { padding: 4px 10px; border-radius: 999px; background: var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); } }
.chat-message { display: flex; }
.chat-message--mine { justify-content: flex-end; }
.chat-bubble { max-width: min(560px, 80%); padding: 8px 12px; border-radius: 16px; background: var(--surface-subtle); display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.4; }
.chat-message--theirs .chat-bubble { border-bottom-left-radius: 6px; }
.chat-message--mine .chat-bubble { background: var(--ink); color: #FFFFFF; border-bottom-right-radius: 6px; }
.chat-bubble__text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble__context { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 600; & a { color: inherit; } }
.chat-bubble__sticker { display: block; width: 112px; height: 112px; }
/* MSG-04 (#55): «Тренування виконано» in the conversation. */
.chat-workout { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.chat-workout__icon { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.chat-workout__link { color: var(--accent-text); font-weight: 600; font-size: 13px; }
.chat-bubble__quote { padding: 4px 8px; border-left: 3px solid var(--accent); border-radius: 4px; background: rgb(0 0 0 / 0.06); font-size: 12px; }
.chat-bubble__meta { align-self: flex-end; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.chat-composer { padding: 12px 20px 16px; border-top: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.chat-composer__quick { display: flex; gap: 8px; flex-wrap: wrap; }
.chat-composer__form { display: flex; align-items: flex-end; gap: 10px; }
.chat-composer__input { flex: 1; height: auto; min-height: 44px; max-height: 160px; padding: 10px 14px; resize: none; line-height: 1.45; }
.chat-composer__note { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }

.chat-client { padding: 20px; border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.chat-client__head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 16px; border-radius: 16px; background: var(--ground); text-align: center; }
.chat-client__name { font-weight: 600; font-size: 16px; }
.chat-client__chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.chat-client__open { font-weight: 600; font-size: 14px; color: var(--accent-text); }

.quick-replies { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.quick-replies__row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); & span { flex: 1; } }
.radio-row { display: flex; align-items: center; gap: 10px; min-height: 40px; }

@media (max-width: 1100px) {
  .chat { grid-template-columns: 300px minmax(0, 1fr); }
  .chat-client { display: none; }
}
@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat-list:has(+ .chat-conversation) { display: none; }
}

/* «Досягнення» (#47): the offer under a workout's log, the client's collection, the sticker choices. */
.radio-row--top { align-items: flex-start; & input { margin-top: 3px; } }
.achievement-image { display: block; flex-shrink: 0; }
.achievement-image--missing { filter: grayscale(1) contrast(0.45) brightness(1.25); opacity: 0.5; }
.achievement-offer { flex-direction: row; align-items: center; gap: 16px; }
.achievement-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; justify-items: center; }
.achievement-choices { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.achievement-choice {
  width: 100%; min-height: 150px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer; font: inherit;
  &:hover { border-color: var(--ink); }
}
.achievement-choice__name { font-weight: 600; font-size: 14px; }

/* ---------- broadcasts (W-Broadcasts, W-Broadcast-New, W-AutoMessages, #45) ---------- */

.notice--danger { background: var(--danger-soft); color: var(--danger-text); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.broadcast-pad { padding: 20px 20px 12px; }
.broadcast-lead { display: flex; align-items: center; gap: 16px; & p { flex: 1; margin: 0; } }
.broadcast-grow { flex: 1; min-width: 0; }
.broadcast-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;

  & th { padding: 8px 12px; text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-soft); }
  & td { padding: 10px 12px; height: 60px; border-bottom: 1px solid var(--line-soft); }
  & tr:last-child td { border-bottom: 0; }
  & th:first-child, & td:first-child { padding-left: 20px; }
  & th:last-child, & td:last-child { padding-right: 20px; }
}
.table__end { text-align: right; }
.broadcast-name { display: inline-flex; align-items: center; gap: 12px; }
.broadcast-icon { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--success-soft); color: var(--success-text); }
.broadcast-icon--waiting { background: var(--warning-soft); color: var(--warning-text); }
.broadcast-channel { gap: 4px; }
.broadcast-legend { display: inline-flex; gap: 14px; & span { display: inline-flex; align-items: center; gap: 6px; } }
.broadcast-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; background: var(--line); }
.broadcast-dot--read { background: var(--ink); }
.broadcast-dot--delivered { background: var(--muted); }
.broadcast-read { display: inline-flex; align-items: center; gap: 6px; }
.broadcast-bar { position: relative; width: 96px; height: 6px; margin-left: 6px; display: inline-block; }
.broadcast-bar progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 6px;
  appearance: none;
  border: 0;
  border-radius: 3px;
  background: transparent;
  &::-webkit-progress-bar { background: transparent; }
  &::-moz-progress-bar { border-radius: 3px; }
}
.broadcast-bar__delivered { background: var(--line) !important; &::-webkit-progress-bar { background: var(--line); border-radius: 3px; } &::-webkit-progress-value { background: var(--muted); border-radius: 3px; } &::-moz-progress-bar { background: var(--muted); } }
.broadcast-bar__read { &::-webkit-progress-value { background: var(--ink); border-radius: 3px; } &::-moz-progress-bar { background: var(--ink); } }

.broadcast-page { display: flex; flex-direction: column; gap: 16px; }
.broadcast-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.broadcast-section { padding-top: 16px; border-top: 1px solid var(--line-soft); border-left: 0; border-right: 0; border-bottom: 0; margin: 0; }
.broadcast-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.broadcast-option {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;

  & input { position: absolute; opacity: 0; pointer-events: none; }
  &:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
}
.broadcast-option__mark { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; }
.broadcast-option:has(input:checked) .broadcast-option__mark { border: 5px solid var(--ink); }
.broadcast-clients { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.chip--on { background: var(--ink); border-color: var(--ink); color: #FFFFFF; cursor: default; }
.chip--off { color: var(--muted); border-style: dashed; cursor: not-allowed; }
.chip--variable { height: 26px; padding: 0 8px; border: 0; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; }
.broadcast-text { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.textarea--bare { width: 100%; border: 0; background: transparent; outline: 0; box-shadow: none; }
.broadcast-text__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line-soft); }
.avatar-stack { display: inline-flex; & > * + * { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); } }
.broadcast-preview { padding: 14px; border-radius: var(--radius-lg); background: var(--info-soft); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; & p { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); font-size: 14px; } }
.broadcast-preview__who { color: var(--info-text); font-weight: 600; }
.broadcast-push { padding: 12px; border-radius: var(--radius); background: var(--ground); display: flex; align-items: flex-start; gap: 10px; }
.broadcast-push__icon { width: 28px; height: 28px; border-radius: 7px; flex: none; display: grid; place-items: center; background: var(--accent); color: #FFFFFF; }
.broadcast-push__text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.broadcast-footer { display: flex; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }

.auto-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.auto-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.auto-item[aria-current="true"] { background: var(--accent-soft); & .auto-item__when { color: var(--accent-text); } }
.auto-item__when { font-size: 12px; color: var(--muted); }
.auto-item__link { color: var(--ink); text-decoration: none; & strong { font-size: 14px; } }

@media (max-width: 1100px) {
  .broadcast-grid, .auto-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Telegram bot (#49): W-Settings-Telegram, the chat's status line ---------- */
.chat-conversation__warning { color: var(--warning-text); }
.telegram-icon { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--info-soft); color: var(--info-text); }
.check-list { list-style: none; margin: 8px 0 0; padding: 0; & li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); color: var(--ink); } & li:first-child { border-top: 0; } & .icon { color: var(--success-text); flex-shrink: 0; } }
.telegram-link { display: grid; grid-template-columns: 1fr minmax(300px, 380px); gap: 24px; align-items: start; margin-top: 16px; }
.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; & li { display: flex; align-items: center; gap: 12px; } }
.steps-list__number { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--segmented); font-size: 13px; font-weight: 600; }
/* #65: the link's QR code beside the steps, the phone offer from Telegram (TG-13). */
.telegram-qr { margin: 0; display: grid; justify-items: center; gap: 8px; padding: 16px; border-radius: 14px; background: #FFFFFF; border: 1px solid var(--line);
  svg { width: 180px; height: 180px; } }
.telegram-phone { border: 1px solid #F3D9A9; }
.telegram-phone__actions { display: flex; gap: 8px; }
.telegram-code { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-radius: 14px; background: var(--segmented); }
.telegram-code__digits { font-family: var(--font-display, inherit); font-size: 32px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink); }
.telegram-unlink { color: var(--danger); align-self: flex-start; }

/* W-Settings-Stickers (#68): the trainer's own stickers — the list, the builder and the upload. */
.sticker-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 16px; }
.sticker-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; min-width: 0; & > .stack { min-width: 0; flex: 1; } }
.sticker-row__image { flex-shrink: 0; }
.sticker-row__actions { display: flex; gap: 6px; flex-shrink: 0; & form { display: contents; } }
.sticker-builder { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.sticker-builder__actions { display: flex; justify-content: flex-end; gap: 8px; }
.sticker-preview {
  margin: 0; padding: 12px; border-radius: var(--radius-lg); background: var(--surface-subtle);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  /* #92: pinned under the sticky top bar (its height is measured by sticker_builder_controller.js). */
  position: sticky; top: calc(var(--topbar-height, 72px) + 16px); z-index: 4;
  & img { width: 176px; height: 176px; }
}
/* An uploaded picture on a checkerboard, so its transparency shows. */
.sticker-preview--checker {
  background-color: #FFFFFF;
  background-image: conic-gradient(#E4E1DA 25%, transparent 0 50%, #E4E1DA 0 75%, transparent 0);
  background-size: 16px 16px;
  min-height: 200px; justify-content: center;
}
.sticker-options { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; & legend { margin-bottom: 8px; } }
.sticker-option {
  position: relative; min-width: 44px; height: 44px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); background: var(--surface); cursor: pointer; font-size: 14px;
  & input { position: absolute; opacity: 0; pointer-events: none; }
  &:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
  &:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
}
.sticker-option--swatch { padding: 0; width: 44px; border-radius: 50%; }
/* #89: a pose is a picture over its caption. */
.sticker-option--pose { flex-direction: column; gap: 2px; width: 88px; height: auto; padding: 6px; & img { display: block; } & .small { font-size: 11px; letter-spacing: 0.02em; } }
.sticker-label { text-transform: uppercase; }
.sticker-field__hint { display: flex; justify-content: space-between; gap: 8px; }

@media (max-width: 720px) {
  .sticker-builder { grid-template-columns: minmax(0, 1fr); }
  /* On a narrow screen the preview is a smaller block pinned right under the top bar; the settings
     scroll beneath it (#92). */
  .sticker-preview {
    top: var(--topbar-height, 72px); padding: 8px; border-bottom: 1px solid var(--line); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    & img { width: 128px; height: 128px; }
    & figcaption { display: none; }
  }
}

/* /testers: the test version in Expo Go; the QR code is for a computer — a phone taps the button. */
.testers-qr { margin: 0; display: grid; justify-items: center; gap: 8px; padding: 16px; border-radius: 14px; background: #FFFFFF; border: 1px solid var(--line); & svg { width: 200px; height: 200px; } }
@media (max-width: 600px) { .testers-qr { display: none; } }

/* ---------- #94: hints beside settings, pinned save buttons ---------- */

.hint { position: relative; display: inline-flex; vertical-align: middle; }
.hint__button {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;

  &:hover, &[aria-expanded="true"] { color: var(--ink); background: var(--ground); }
  &:focus-visible { outline: none; box-shadow: var(--focus); }
}
.hint__text {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 20; width: min(300px, 80vw);
  padding: 12px 14px; border-radius: var(--radius); background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop);
  font: 400 13px/1.45 var(--font-ui); text-align: left; white-space: normal;

  &[hidden] { display: none; }
}

/* The save button of a long form stays at the bottom of the window (or of the dialog) and the last
   field is never hidden under it: the bar sits in the flow, it only sticks while the form is taller. */
form :is(.row, .modal__actions, .sticker-builder__actions):last-child:has(> input.btn--primary[type="submit"]) {
  position: sticky; bottom: 0; z-index: 6;
  padding: 12px 0; background: var(--ground); border-top: 1px solid var(--line-soft);
}
.modal form :is(.row, .modal__actions):last-child:has(> input.btn--primary[type="submit"]) { background: var(--surface); }
