/* Брендбук boldyrevv (как в кабинете клиентов): Gilroy, оранжевый акцент, графит, плашки без обводок */
@font-face { font-family: 'Gilroy'; src: url('/fonts/Gilroy-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Gilroy'; src: url('/fonts/Gilroy-Medium.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Gilroy'; src: url('/fonts/Gilroy-Semibold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Gilroy'; src: url('/fonts/Gilroy-Bold.woff') format('woff'); font-weight: 700; font-display: swap; }

:root {
  --orange: #fc542e;
  --orange-hover: #e8441f;
  --navy: #14191e;
  --bg: #ebedef;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --surface-3: #e4e7ea;
  --text: #12181e;
  --text-2: #5b646d;
  --text-3: #8f979f;
  --accent: var(--orange);
  --accent-soft: #ffe8e1;
  --link: #e2431f;
  --good: #1f8a52;
  --good-soft: #e3f3ea;
  --mid: #a86f00;
  --mid-soft: #fff3d6;
  --bad: #d23a3a;
  --bad-soft: #fde6e6;
  --chart-bar: #d5d9de;
  --chart-ink: #22303e;
  --chart-grid: #eceef0;
  --g-money: #fc542e;
  --g-body: #22303e;
  --g-voice: #8b97a4;
  --radius: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1419; --surface: #182029; --surface-2: #1f2933; --surface-3: #2a3540;
    --text: #f1f2f3; --text-2: #b0b6bc; --text-3: #77808a; --navy: #0a0e12;
    --accent-soft: #3a2119; --link: #ff8562;
    --good: #5fd08f; --good-soft: #17301f; --mid: #f0c25a; --mid-soft: #33290f; --bad: #ff7a7a; --bad-soft: #3a1c1c;
    --chart-bar: #33404c; --chart-ink: #c9ced3; --chart-grid: #232d37; --g-body: #c9ced3; --g-voice: #6f7c89;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1419; --surface: #182029; --surface-2: #1f2933; --surface-3: #2a3540;
  --text: #f1f2f3; --text-2: #b0b6bc; --text-3: #77808a; --navy: #0a0e12;
  --accent-soft: #3a2119; --link: #ff8562;
  --good: #5fd08f; --good-soft: #17301f; --mid: #f0c25a; --mid-soft: #33290f; --bad: #ff7a7a; --bad-soft: #3a1c1c;
  --chart-bar: #33404c; --chart-ink: #c9ced3; --chart-grid: #232d37; --g-body: #c9ced3; --g-voice: #6f7c89;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.45 'Gilroy', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.loading { padding: 80px 16px; text-align: center; color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Шапка и навигация ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px);
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; }
.logo img { height: 28px; display: block; }
.logo .on-dark { display: none; }
:root[data-theme="dark"] .logo .on-light { display: none; }
:root[data-theme="dark"] .logo .on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .logo .on-light { display: none; }
  :root:not([data-theme]) .logo .on-dark { display: block; }
}
.logo small { font-weight: 500; font-size: 12px; color: var(--text-3); padding-left: 10px; border-left: 1px solid var(--surface-3); line-height: 1.15; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border-radius: 999px; margin-left: 12px; }
.tabs a { padding: 8px 16px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: 14px; white-space: nowrap; }
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a.on { background: var(--text); color: var(--surface); }
.top-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); display: grid; place-items: center; color: var(--text-2); flex: none; }
.icon-btn:hover { color: var(--text); }
.icon-btn.on { background: var(--text); color: var(--surface); }
.icon-btn svg { width: 18px; height: 18px; }
.bottom-nav { display: none; }

.main { max-width: 1180px; margin: 0 auto; padding: 8px 28px 64px; }

@media (max-width: 860px) {
  .top { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .tabs { display: none; }
  .logo small { display: none; }
  .main { padding: 4px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 11px; font-weight: 500; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.on { color: var(--accent); }
}

/* ---------- Заголовки ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 12px 0 20px; }
.page-head .title { flex: 1; min-width: 220px; }
.eyebrow { font-size: 13px; color: var(--text-3); font-weight: 500; margin-bottom: 6px; }
.h1 { font-size: 40px; line-height: 1.05; font-weight: 500; letter-spacing: -0.025em; }
.section-title { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; margin: 30px 0 12px; }
@media (max-width: 860px) { .h1 { font-size: 30px; } .section-title { font-size: 20px; margin-top: 26px; } }

/* ---------- Переключатели ---------- */
.seg { display: inline-flex; gap: 2px; padding: 4px; background: var(--surface); border-radius: 999px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: 14px; white-space: nowrap; }
.seg button.on { background: var(--text); color: var(--surface); }
.seg.accent button.on { background: var(--accent); color: #fff; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--orange-hover); }
.btn.dark { background: var(--text); color: var(--surface); }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.block { width: 100%; }
/* Ссылки на минутки: подпись с датой обрезается многоточием, а не растягивает страницу на телефоне */
.minute-link { justify-content: space-between; min-width: 0; }
.minute-link .faint { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.btn svg { width: 16px; height: 16px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--link); font-weight: 500; }

/* ---------- Карточки и плитки ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card.tone { background: color-mix(in srgb, var(--surface) 55%, var(--bg)); }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; font-weight: 600; }
.card-head .hint { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.card-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); } }
.tiles { margin-bottom: 12px; }
.tile { background: var(--surface); border-radius: var(--radius-md); padding: 16px; min-height: 128px; display: flex; flex-direction: column; min-width: 0; }
.tile .t-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.tile .t-value { font-size: 36px; line-height: 1; font-weight: 500; letter-spacing: -0.03em; margin-top: auto; padding-top: 14px; white-space: nowrap; }
.tile .t-value small { font-size: 17px; letter-spacing: 0; margin-left: 3px; color: var(--text-3); }
.tile .t-foot { font-size: 12px; color: var(--text-3); margin-top: 8px; min-height: 16px; }
.tile.dark { background: var(--navy); color: #fff; }
.tile.dark .t-label { color: rgba(255,255,255,.72); }
.tile.dark .t-foot, .tile.dark .t-value small { color: rgba(255,255,255,.55); }
@media (max-width: 400px) { .tile { padding: 14px; min-height: 112px; } .tile .t-value { font-size: 28px; } }
.meter { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.tile.dark .meter, .hero .meter { background: rgba(255,255,255,.14); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.mid { background: var(--mid-soft); color: var(--mid); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.accent { background: var(--accent-soft); color: var(--link); }
.pct-good { color: var(--good); } .pct-mid { color: var(--mid); } .pct-bad { color: var(--bad); } .pct-none { color: var(--text-3); }

.chart-wrap { position: relative; height: 240px; }
.chart-wrap.short { height: 190px; }
.chart-wrap.tall { height: 300px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.dash { height: 2px; border-radius: 0; vertical-align: 3px; width: 14px; }
.empty { color: var(--text-3); font-size: 14px; padding: 18px 0; text-align: center; }
.note { font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.note.warn { background: var(--mid-soft); color: var(--mid); }
.note.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- Дневник ---------- */
.day-nav { display: flex; align-items: center; gap: 8px; margin: 10px 0 14px; }
.day-nav .icon-btn { width: 44px; height: 44px; }
.day-nav .icon-btn:disabled { opacity: .3; cursor: default; }
.day-nav .day-title { flex: 1; text-align: center; min-width: 0; }
.day-nav .day-title b { display: block; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.day-nav .day-title span { font-size: 13px; color: var(--text-3); }

.hero { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 18px 20px; }
.hero .big { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.hero .big small { font-size: 16px; color: rgba(255,255,255,.6); letter-spacing: 0; }
.hero .meter i { background: var(--accent); }
.hero .sub { font-size: 13px; color: rgba(255,255,255,.6); margin-top: 8px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; background: var(--surface); border-radius: 999px; margin: 12px 0; position: sticky; top: calc(64px + env(safe-area-inset-top)); z-index: 10; }
.steps button { border: 0; background: transparent; border-radius: 999px; padding: 9px 4px; font-weight: 500; font-size: 14px; color: var(--text-2); position: relative; white-space: nowrap; }
.steps button.on { background: var(--text); color: var(--surface); }
.steps button .dot { position: absolute; top: 6px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.steps button.on .dot { display: none; }
@media (max-width: 380px) { .steps button { font-size: 13px; } }

.form-card { background: var(--surface); border-radius: var(--radius); padding: 6px 18px; }
.form-card + .form-card { margin-top: 12px; }
.form-card h3 { font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 14px 0 4px; }
.trow { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-height: 64px; }
.trow + .trow, .trow + .tnote + .trow { box-shadow: 0 -1px 0 var(--surface-2); }
.trow .tname { flex: 1; min-width: 0; font-weight: 500; font-size: 16px; line-height: 1.25; }
.trow .tname small { display: block; font-weight: 400; font-size: 13px; color: var(--text-3); margin-top: 2px; }
.trow .tname .pending { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: 2px; }
.trow.tap { cursor: pointer; user-select: none; }
.tnote { padding: 0 0 12px; }

.switch { width: 58px; height: 34px; border-radius: 999px; background: var(--surface-3); position: relative; flex: none; transition: background .15s; border: 0; padding: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .15s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(24px); }

.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface-2); font-size: 22px; line-height: 1; color: var(--text); display: grid; place-items: center; }
.stepper button:active { background: var(--surface-3); }
.stepper button.plus { background: var(--text); color: var(--surface); }
.stepper input { width: 56px; height: 44px; text-align: center; border: 0; background: transparent; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; padding: 0; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper.wide input { width: 72px; }
.stepper .unit { font-size: 13px; color: var(--text-3); margin-left: -6px; margin-right: 4px; }

.sleep-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 4px 0 14px; }
.sleep-box .half { background: var(--surface-2); border-radius: var(--radius-md); padding: 10px 4px 8px; text-align: center; min-width: 0; }
.sleep-box .half label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.sleep-box .stepper { justify-content: center; gap: 0; }
.sleep-box .stepper button { width: 36px; height: 36px; flex: none; background: var(--surface); }
.sleep-box .stepper button.plus { background: var(--surface); color: var(--text); }
.sleep-box .stepper input { width: 58px; min-width: 0; font-size: 18px; }
.sleep-sum { display: flex; gap: 8px; align-items: center; padding-bottom: 14px; flex-wrap: wrap; }

.channels { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 12px 0 4px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.channels::-webkit-scrollbar { display: none; }
.channels button { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--surface-2); color: var(--text-2); font-weight: 500; font-size: 14px; white-space: nowrap; }
.channels button.on { background: var(--accent); color: #fff; }
.channels button b { font-weight: 600; margin-left: 4px; opacity: .8; }

.field { display: block; padding: 10px 0; }
.field > span { display: block; font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%; border: 0; border-radius: var(--radius-sm); background: var(--surface-2); padding: 12px 14px; font-size: 16px; outline: none; min-height: 46px;
}
.input:focus, .textarea:focus, .select:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.select { appearance: none; padding-right: 36px; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f979f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; }
.input.sm { min-height: 40px; padding: 8px 12px; font-size: 15px; }

.dots { display: flex; gap: 8px; }
.dots button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface-2); font-weight: 600; color: var(--text-2); }
.dots button.on { background: var(--accent); color: #fff; }
.dots button.fill { background: var(--accent-soft); color: var(--link); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tags button { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--surface-2); color: var(--text-2); font-weight: 500; font-size: 14px; }
.tags button.on { background: var(--text); color: var(--surface); }
.wins { display: grid; gap: 8px; }
.wins .row { display: flex; gap: 8px; align-items: center; }
.wins .row b { width: 22px; flex: none; color: var(--text-3); font-weight: 600; text-align: center; }

.step-foot { display: flex; gap: 8px; margin: 14px 0 0; }
.step-foot .btn { flex: 1; height: 52px; }
.saved { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 40; background: var(--text); color: var(--surface); padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; opacity: 0; transition: opacity .2s; pointer-events: none; }
.saved.show { opacity: .92; }
.saved.err { background: var(--bad); color: #fff; }
@media (min-width: 861px) { .saved { bottom: 24px; } }

.video-mini { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.video-mini + .video-mini { box-shadow: 0 -1px 0 var(--surface-2); }
.video-mini .vt { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Лента ---------- */
.feed-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 30px 0 12px; }
.feed-head .section-title { margin: 0; flex: 1; }
.feed { display: grid; gap: 10px; }
.entry-card { background: var(--surface); border-radius: var(--radius-md); padding: 14px 16px; cursor: pointer; }
.entry-card .ec-head { display: flex; gap: 10px; align-items: center; }
.entry-card .ec-date { font-weight: 600; }
.entry-card .ec-state { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.entry-card .ec-head .chip { margin-left: auto; }
.entry-card ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.entry-card p { margin: 6px 0 0; color: var(--text-2); font-size: 14px; white-space: pre-wrap; }
mark { background: var(--accent-soft); color: inherit; border-radius: 3px; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; padding: 8px 8px; white-space: nowrap; }
table.t td { padding: 10px 8px; border-top: 1px solid var(--surface-2); vertical-align: middle; }
table.t th:first-child, table.t td:first-child { padding-left: 0; }
table.t .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.group td { font-weight: 600; padding-top: 16px; border-top: 0; }
table.t tr.flag td:first-child { color: var(--bad); }
.mark-ok { color: var(--good); font-weight: 700; }
.mark-no { color: var(--text-3); }

/* ---------- Календарь-сетка ---------- */
.cal { display: grid; gap: 14px; }
.cal-row { display: grid; grid-template-columns: 92px repeat(12, minmax(0, 18px)); gap: 5px; align-items: center; }
.cal-row .lbl { font-size: 13px; color: var(--text-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-week { display: grid; grid-template-rows: repeat(7, 1fr); gap: 2px; }
.cal-week i { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.cal-week i.on { background: var(--accent); }
.cal-week i.miss { background: var(--surface-3); }
.cal-week i.future { background: transparent; box-shadow: inset 0 0 0 1px var(--surface-2); }
.cal-week i.out { visibility: hidden; }
.cal-head { font-size: 11px; color: var(--text-3); text-align: center; }
@media (max-width: 520px) { .cal-row { grid-template-columns: 58px repeat(12, minmax(0, 18px)); gap: 3px; } .cal-row .lbl { font-size: 11px; } .cal-week { gap: 1px; } }

/* ---------- Ролики ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.board .col { background: color-mix(in srgb, var(--surface) 55%, var(--bg)); border-radius: var(--radius-md); padding: 10px; min-height: 80px; }
.board .col h4 { margin: 2px 4px 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.vcard { background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; margin-bottom: 8px; font-size: 14px; }
.vcard b { font-weight: 600; display: block; }
.vcard span { color: var(--text-3); font-size: 12px; }
@media (max-width: 860px) {
  .board { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px; }
  .board .col { scroll-snap-align: start; }
}

/* ---------- Окна ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(10,14,18,.5); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: var(--radius) var(--radius) 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
.modal h2 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.modal .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.modal .actions .btn { flex: 1; }
@media (min-width: 700px) { .modal-back { align-items: center; } .modal { border-radius: var(--radius); } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 420px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: center; padding: 10px 0; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- Сводка ---------- */
.week-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)); gap: 12px; }
.week-hero .tile .t-value { font-size: 44px; }
@media (max-width: 860px) { .week-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); } .week-hero .tile:first-child { grid-column: 1 / -1; } .week-hero .tile { min-height: 110px; } .week-hero .tile .t-value { font-size: 28px; } .week-hero .tile:first-child .t-value { font-size: 52px; } }
.week-nav { display: flex; align-items: center; gap: 6px; }
.signals { display: grid; gap: 8px; margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.kv div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.kv span { display: block; font-size: 12px; color: var(--text-3); }
.kv b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Настройки ---------- */
.set-list .item { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.set-list .item + .item { box-shadow: 0 -1px 0 var(--surface-2); }
.set-list .item .nm { flex: 1; min-width: 0; font-weight: 500; }
.set-list .item .nm small { display: block; color: var(--text-3); font-weight: 400; font-size: 13px; }
.set-list .item.off .nm { color: var(--text-3); }
.list-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.list-edit .chip { font-size: 14px; padding: 6px 6px 6px 12px; font-weight: 500; }
.list-edit .chip button { border: 0; background: var(--surface-3); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; padding: 0; color: var(--text-2); }
.list-edit .chip button svg { width: 12px; height: 12px; }
.weeks-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.weeks-pick button { border: 0; border-radius: var(--radius-sm); padding: 10px 0; background: var(--surface-2); font-weight: 600; color: var(--text-2); }
.weeks-pick button.on { background: var(--mid-soft); color: var(--mid); }

/* ---------- Вход ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 28px 24px; }
.auth h1 { font-size: 26px; font-weight: 500; margin: 18px 0 6px; letter-spacing: -0.02em; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 8px; }

/* ---------- Печать недельной сводки в PDF ---------- */
@media print {
  .top, .bottom-nav, .no-print, .saved { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .card, .tile { break-inside: avoid; }
}
