/* Calendar Mini App. Tokens: plans/design/seda-miniapps-2026-10-11/ds/project/tokens.json (handoff-calendar §1). */

/* Onest, self-hosted (SIL OFL 1.1, fonts/OFL.txt): the CSP allows only 'self'. Same files as the assistant app. */
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/onest-cyrillic-ext-400-normal.woff2) format('woff2'); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/onest-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/onest-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/onest-cyrillic-ext-500-normal.woff2) format('woff2'); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/onest-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/onest-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/onest-cyrillic-ext-600-normal.woff2) format('woff2'); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/onest-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/onest-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/onest-cyrillic-ext-700-normal.woff2) format('woff2'); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/onest-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/onest-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --canvas: var(--tg-theme-secondary-bg-color, #EFF4F3);
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #FFFFFF));
  --card-raised: #FFFFFF;
  --dock: rgba(239, 244, 243, 0.78);
  --line: #DDE3E1; --line-input: #8B948F;
  --text: #121816; --text-2: #5D6864; --text-3: #9AA39F;
  --brand: #0F2B27; --brand-pressed: #1A3D37; --on-brand: #F4EFE3; --brand-soft: #E4ECE8;
  --link: #1F5A4E;
  --gold: #E9A86A; --gold-pressed: #D59558; --on-gold: #0F2B27; --gold-ink: #945E26; --gold-soft: #FEEBDA;
  --ok: #407658; --ok-soft: #E3F1E8;
  --urgent: #121816; --urgent-soft: #DDE3E1;
  --danger: #8D544F; --danger-soft: #F9E3E3;
  --focus: #1F5A4E; --scrim: rgba(15, 20, 18, 0.65);
  --shadow-raised: 0 2px 8px rgba(15, 43, 39, 0.08);
  --shadow-toast: 0 8px 24px rgba(15, 43, 39, 0.18);
  --shadow-sheet: 0 -8px 32px rgba(15, 43, 39, 0.16);

  --font: "Onest", "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-number: 40px; --lh-number: 44px;
  --fs-title: 22px;  --lh-title: 28px;
  --fs-heading: 17px; --lh-heading: 22px;
  --fs-body: 16px;   --lh-body: 22px;
  --fs-label: 16px;  --lh-label: 22px;
  --fs-secondary: 14px; --lh-secondary: 20px;
  --fs-caption: 13px; --lh-caption: 18px;
  --fs-prose: 17px; --lh-prose: 1.6;
  --fs-lead: 19px; --lh-lead: 1.5;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px;
  --tap: 44px; --row: 56px; --dock-h: 64px;
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;

  --dur-press: 120ms; --dur-fast: 160ms; --dur-base: 220ms; --dur-sheet: 280ms; --dur-exit: 150ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-color: cubic-bezier(0.25, 0.1, 0.25, 1);

  --card-border: none;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --canvas: #0F1412; --card: #1A211E; --card-raised: #232B27; --dock: rgba(15, 20, 18, 0.72);
  --line: #2E3733; --line-input: #6E7A74;
  --text: #EAF0EF; --text-2: #A9B3AE; --text-3: #66706C;
  --brand: #35776A; --brand-pressed: #2C6358; --on-brand: #F4EFE3; --brand-soft: #1E312C;
  --link: #8FD3BC;
  --gold: #E9A86A; --gold-pressed: #D59558; --on-gold: #0F2B27; --gold-ink: #F3B67F; --gold-soft: #342619;
  --ok: #82BA99; --ok-soft: #1B2F26; --urgent: #EAF0EF; --urgent-soft: #2E3733;
  --danger: #CA8C87; --danger-soft: #3A2020;
  --focus: #8FD3BC; --scrim: rgba(0, 0, 0, 0.7);
  --shadow-raised: none; --shadow-toast: none; --shadow-sheet: none;
  --card-border: 1px solid var(--line);
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-press: 0ms; --dur-fast: 0ms; --dur-base: 0ms; --dur-sheet: 0ms; --dur-exit: 0ms; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ul, ol, dl { margin: 0; padding: 0; }
ul, ol { list-style: none; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1:focus, h1:focus-visible { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.boot { padding: 40px 16px; text-align: center; color: var(--text-2); font-size: var(--fs-secondary); line-height: var(--lh-secondary); }

/* ---------- screens ---------- */

.screen {
  max-width: 560px;
  margin: 0 auto;
  min-height: var(--tg-viewport-stable-height, 100vh);
  padding: 12px 16px 32px;
  display: flex;
  flex-direction: column;
}
.screen.tabbed { padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
.screen.second { padding: 20px 16px 32px; }
.screen.stack { padding: 20px 16px calc(32px + env(safe-area-inset-bottom, 0px)); }
.stack-body { flex: 1; display: flex; flex-direction: column; }
.screen.with-cta { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

.h1 {
  padding: 8px 0 20px;
  font-size: var(--fs-title);
  line-height: var(--lh-title);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.h1.before-number { padding-bottom: 16px; }
.second .h1 { padding: 6px 0 20px; }

.title-line {
  font-size: var(--fs-title);
  line-height: var(--lh-title);
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 0 0 4px;
  text-wrap: balance;
}

.meta { font-size: var(--fs-secondary); line-height: var(--lh-secondary); color: var(--text-2); font-variant-numeric: tabular-nums; }
.meta.danger { color: var(--danger); }
.caption { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.caption.center { text-align: center; padding: 16px 0 0; }
.footer-note { padding: 16px 4px 0; }

/* section head: tracked caps caption */
.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 4px 8px;
}
.head.after-card { padding-top: 24px; }
.head h2 {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}
.head h2.plain { text-transform: none; letter-spacing: 0; }
.head-aside { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.head-link {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 500;
  color: var(--link);
  background: none;
  border: 0;
  padding: 13px 0;
  margin: -13px 0;
  cursor: pointer;
  white-space: nowrap;
}

/* ---------- number answer ---------- */

.number { display: flex; flex-direction: column; gap: 2px; padding: 0 0 16px; }
.number-value {
  font-size: var(--fs-number);
  line-height: var(--lh-number);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--gold-ink);
}
.number-word { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 700; letter-spacing: -0.01em; }
.number-caption { font-size: var(--fs-secondary); line-height: var(--lh-secondary); color: var(--text-2); }
.number.compact { padding-bottom: 12px; }

/* ---------- cards and rows ---------- */

.card {
  background: var(--card);
  border: var(--card-border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.card + .card { margin-top: 12px; }
.card-pad { padding: 16px; }

.rows > li { position: relative; }
.rows > li + li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.rows.dotted > li + li::before { left: 32px; }
.sep { height: 1px; background: var(--line); margin-left: 16px; }

/* deadline row: dot · body link · «Сдано» tick */
.lrow {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 72px;
  padding: 12px 8px 12px 16px;
  transition: background-color var(--dur-fast) var(--ease-color);
}
.lrow.dense { min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.lrow:has(.lrow-body:active) { background: var(--brand-soft); }
.kdot { width: 8px; height: 8px; border-radius: var(--r-pill); flex: none; background: var(--text-3); }
.kdot.k-payment { background: var(--brand); }
.kdot.k-report { background: var(--ok); }
.kdot.k-notice { background: var(--text-3); }
.lrow-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lrow-title { font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: 600; overflow-wrap: anywhere; }
.lrow.is-done .lrow-title { color: var(--text-2); }

.tick {
  width: var(--tap);
  height: var(--tap);
  flex: none;
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out);
}
.tick:active { transform: scale(0.97); }
.tick:disabled { cursor: default; }
.tick-ring {
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-brand);
  transition: background-color var(--dur-fast) var(--ease-color), border-color var(--dur-fast) var(--ease-color);
}
.tick-ring svg { width: 16px; height: 16px; opacity: 0; transition: opacity var(--dur-fast) var(--ease-color); }
.tick[aria-pressed="true"] .tick-ring { width: 24px; height: 24px; border-color: var(--brand); background: var(--brand); }
.tick[aria-pressed="true"] .tick-ring svg { opacity: 1; }
.tick.small .tick-ring { width: 24px; height: 24px; }
.tick[aria-busy="true"] .tick-ring { opacity: 0.4; }

/* setting / fact row: heading + one meta (+ chevron) */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--row);
  padding: 8px 12px 8px 16px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.row.static { cursor: default; padding-right: 16px; }
.row-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-title { font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: 600; overflow-wrap: anywhere; }
.row-title.plain { font-weight: 400; font-size: var(--fs-body); line-height: var(--lh-body); }
.chev { width: 20px; height: 20px; flex: none; color: var(--text-3); }
a.row:active, button.row:active { background: var(--brand-soft); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-sm);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) var(--ease-color);
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:active { background: var(--brand-pressed); }
.btn-secondary { background: var(--brand-soft); color: var(--brand); }
:root[data-theme="dark"] .btn-secondary { color: var(--text); }
.btn-danger { background: var(--danger); color: var(--on-brand); }
/* dark: on-brand on the light danger fill is 2.4:1; the dark ink is 5.46:1 */
:root[data-theme="dark"] .btn-danger { color: var(--on-gold); }
.btn-small { width: auto; height: var(--tap); padding: 0 14px; border-radius: 10px; flex: none; }
.btn-stack { display: flex; flex-direction: column; gap: 8px; padding: 0 0 24px; }
.btn-under { margin-top: 12px; }

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 0 16px;
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  font-weight: 600;
  color: var(--link);
  cursor: pointer;
}
.text-btn.danger { color: var(--danger); }
.text-btn.bare { padding: 0; height: 44px; width: auto; }
.text-btn svg { width: 18px; height: 18px; }
.links { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 24px 0 0; }

/* done status on the deadline screen */
.status-done {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 48px;
  padding: 0 0 0 4px;
}
.status-done .status-word { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: 600; }
.status-done .disc { width: 24px; height: 24px; border-radius: var(--r-pill); background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; }
.status-done .disc svg { width: 16px; height: 16px; }
.status-done .text-btn { width: auto; padding: 0 4px; }

/* choice chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.row1 { flex-wrap: nowrap; }
.chip {
  flex: 1 0 auto;
  min-width: 72px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-input);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--text);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) var(--ease-color), border-color var(--dur-fast) var(--ease-color);
}
.chips.row1 .chip { flex: 1 1 0; min-width: 0; padding: 0 8px; }
.chips.row1 .chip.wide { flex: 1.3 1 0; }
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }
:root[data-theme="dark"] .chip[aria-pressed="true"] { color: var(--text); border-color: var(--link); }
.chip.solo { flex: 0 0 auto; }
/* a separate yes/no toggle under a choice group: its own row, never read as one more option */
.chips.own-row { margin-top: 12px; }

.q-head { font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: 600; padding: 32px 0 12px; }
.q-meta { padding: 0 0 12px; margin-top: -12px; }
.q-note { padding: 12px 0 0; }
.q-error { padding: 12px 0 0; color: var(--danger); font-size: var(--fs-secondary); line-height: var(--lh-secondary); }

/* native MainButton fallback (browser, old clients) */
.cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--canvas);
}
.has-tabs .cta-bar { bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px)); }
.cta-bar .btn { max-width: 528px; margin: 0 auto; display: flex; }
.stack-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 24px; }
.stack-foot .btn { display: flex; }

/* ---------- segmented ---------- */

.segs {
  display: flex;
  min-height: calc(var(--tap) + 8px);
  padding: 4px;
  gap: 4px;
  background: var(--card);
  border: var(--card-border);
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}
.seg {
  flex: 1;
  min-height: var(--tap);
  border: 0;
  border-radius: var(--r-xs);
  background: none;
  color: var(--text-2);
  font-size: var(--fs-secondary);
  line-height: var(--lh-secondary);
  font-weight: 500;
  cursor: pointer;
}
.seg[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
:root[data-theme="dark"] .seg[aria-selected="true"] { color: var(--text); }

/* ---------- task card ---------- */

.task { padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 8px; }
.task + .task { margin-top: 12px; }
.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-top .lrow-body { gap: 2px; }
.task-count { font-size: var(--fs-secondary); line-height: var(--lh-secondary); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.steps { display: flex; flex-direction: column; }
.step { display: flex; align-items: center; gap: 4px; min-height: 48px; margin-left: -10px; }
.step-text { flex: 1; display: flex; flex-direction: column; }
.step-name { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 500; }
.task.is-done .lrow-title { color: var(--text-2); }

/* ---------- empty state ---------- */

.empty {
  background: var(--card);
  border: var(--card-border);
  border-radius: var(--r-lg);
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--r-lg);
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}
:root[data-theme="dark"] .empty-icon { color: var(--link); }
.empty-icon svg { width: 28px; height: 28px; }
.empty-text { display: flex; flex-direction: column; gap: 4px; }
.empty-title { font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: 600; }
.empty .btn { width: auto; }
.line-empty { padding: 16px; text-align: center; color: var(--text-2); font-size: var(--fs-body); line-height: var(--lh-body); }

/* reminder problem card on «Ближайшее» */
.alert-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.alert-card .row-title { font-size: var(--fs-heading); }

/* ---------- month grid ---------- */

.month { padding: 8px 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.month-nav { display: flex; align-items: center; justify-content: space-between; }
.month-title { font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: 600; }
.icon-btn {
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
:root[data-theme="dark"] .icon-btn { color: var(--link); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:first-child { margin-left: -12px; }
.icon-btn:last-child { margin-right: -12px; }
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.icon-btn:active:not(:disabled) { background: var(--brand-soft); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 44px); gap: 3px; justify-content: space-between; }
.cal-head span { text-align: center; font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; color: var(--text-2); }
.cal-day {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text);
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-color);
}
.cal-day:active { background: var(--brand-soft); }
.cal-day.has { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
:root[data-theme="dark"] .cal-day.has { color: var(--text); }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--brand); color: var(--brand); font-weight: 600; }
:root[data-theme="dark"] .cal-day.is-today { box-shadow: inset 0 0 0 2px var(--link); color: var(--link); }
.cal-day[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--brand); }
:root[data-theme="dark"] .cal-day[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--link); }
.cal-day .kdot { width: 6px; height: 6px; }
.cal-day .kdot.k-done { background: var(--text-3); }
.cal-loading .cal-day { opacity: 0.4; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 6px 0 0; }
.legend li { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; color: var(--text-2); }

/* ---------- intro / done ---------- */

.intro { padding: 64px 24px calc(32px + env(safe-area-inset-bottom, 0px)); }
.intro-body { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.intro-mark {
  width: 88px;
  height: 88px;
  border-radius: var(--r-lg);
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}
:root[data-theme="dark"] .intro-mark { color: var(--link); }
.intro-mark svg { width: 40px; height: 40px; }
.intro .h1 { padding: 0; text-align: center; }
.points { width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 8px 0 0; }
.points li { display: flex; align-items: center; gap: 14px; min-height: 56px; }
.point-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: var(--card-border);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
:root[data-theme="dark"] .point-icon { color: var(--link); }
.point-icon svg { width: 22px; height: 22px; }
.intro .meta { text-align: center; }

.done-mark { width: 64px; height: 64px; margin: 12px 0 4px; }
.done-mark svg { width: 28px; height: 28px; }

/* ---------- article ---------- */

.prose { display: flex; flex-direction: column; gap: 14px; max-width: 34em; color: var(--text); hyphens: auto; -webkit-hyphens: auto; }
.prose p, .prose li { font-size: var(--fs-prose); line-height: var(--lh-prose); text-wrap: pretty; }
.prose p.lead { font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: 500; }
.prose h2, .todo-head {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  padding-top: 14px;
  margin-bottom: -6px;
  text-wrap: balance;
}
.prose h3 { font-size: var(--fs-prose); line-height: var(--lh-heading); font-weight: 600; text-wrap: balance; }
.prose ul, .prose ol { display: flex; flex-direction: column; gap: 8px; padding-left: 22px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose .lead-in { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; hyphens: none; }
:root[data-theme="dark"] .prose h2, :root[data-theme="dark"] .todo-head { color: var(--link); }
.article .h1 { padding-bottom: 8px; }
.article .h1 + .prose { margin-top: 12px; }
.article .fact { margin-bottom: 20px; }
.todo { margin-top: 14px; }
.todo-head { padding-top: 14px; margin-bottom: 8px; }
.checklist { display: flex; flex-direction: column; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-prose); line-height: var(--lh-prose); }
.check-mark { flex: none; width: 24px; height: 27px; display: flex; align-items: center; color: var(--brand); }
.check-mark svg { width: 20px; height: 20px; }
:root[data-theme="dark"] .check-mark { color: var(--link); }
.article .footer-note { padding-top: 32px; }
.chip-status {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  margin: 0 0 16px;
  border-radius: var(--r-pill);
  background: var(--gold-soft);
  color: var(--text);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 500;
}
.article .card { margin-top: 20px; }

/* ---------- skeleton ---------- */

.skel-wrap { display: flex; flex-direction: column; gap: 8px; }
.skel { height: 72px; border-radius: var(--r-md); background: var(--card); border: var(--card-border); animation: breathe 1.6s var(--ease-in-out) infinite; }
.skel.num { width: 64px; height: 40px; border-radius: var(--r-xs); margin-bottom: 16px; }
.skel.tall { height: 180px; }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ---------- error state ---------- */

.state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 48px 0; text-align: center; }
.state-text { display: flex; flex-direction: column; gap: 4px; }
.state-title { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 700; letter-spacing: -0.01em; }
.state .btn { width: auto; min-width: 160px; }

/* ---------- toast ---------- */

.toast-slot {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.has-tabs .toast-slot { bottom: calc(var(--dock-h) + 28px + env(safe-area-inset-bottom, 0px)); }
.toast {
  pointer-events: auto;
  width: 100%;
  max-width: 528px;
  min-height: 52px;
  padding: 6px 8px 6px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--r-md);
  background: var(--card-raised);
  border: var(--card-border);
  box-shadow: var(--shadow-toast);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  animation: toast-in var(--dur-base) var(--ease-out);
}
.toast > span { flex: 1; }
.toast-btn {
  flex: none;
  height: var(--tap);
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--link);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  font-weight: 600;
  cursor: pointer;
}
.toast-error > span { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- confirm sheet ---------- */

.sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--scrim);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in var(--dur-sheet) var(--ease-out);
}
.sheet {
  width: 100%;
  max-width: 560px;
  background: var(--card-raised);
  border-top: var(--card-border);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-sheet);
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: sheet-in var(--dur-sheet) var(--ease-out);
}
.grabber { width: 36px; height: 4px; border-radius: var(--r-pill); background: var(--line); align-self: center; margin-bottom: 12px; }
.sheet-title { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 700; letter-spacing: -0.01em; }
.sheet .meta { padding-bottom: 16px; }
.sheet .text-btn { justify-content: center; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- dock tab bar ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 4px 16px env(safe-area-inset-bottom, 0px);
  background: var(--dock);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--line);
}
/* Cells size to their label (not equal fifths): short labels give their room to «Ближайшее». */
.tabbar-inner { max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; height: 60px; }
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 56px;
  color: var(--text-2);
}
.tab-icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 30px; border-radius: var(--r-pill); transition: background-color var(--dur-fast) var(--ease-color); }
.tab-icon svg { width: 24px; height: 24px; }
.tab-label { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* Active tab = solid brand pill + bold label: the pale --brand-soft pill blended into the dock. */
.tab[aria-current="page"] { color: var(--brand); }
.tab[aria-current="page"] .tab-icon { background: var(--brand); color: var(--on-brand); }
.tab[aria-current="page"] .tab-label { font-weight: 700; }
:root[data-theme="dark"] .tab[aria-current="page"] { color: var(--link); }
:root[data-theme="dark"] .tab[aria-current="page"] .tab-icon { color: var(--on-brand); }
@media (max-width: 360px) { .tabbar { padding-left: 0; padding-right: 0; } .tab-label { letter-spacing: -0.03em; } }
