/* Офіс Coddy — дизайн-система. Operate-режим: скануваність, спокій, точні деталі. */

/* Кандидати для A/B: усі з повною кирилицею й змінною вагою */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400..800&family=Onest:wght@400..800&family=Golos+Text:wght@400..800&family=Rubik:wght@400..800&family=Montserrat:wght@400..800&family=Manrope:wght@400..800&display=swap");

:root {
  /* палітра: глибокий графіт + лайм-акцент (як у референсі), бурштин = «потребує тебе» */
  --bg: #0b0f1a;
  --surface: #141a2a;
  --surface-2: #1c2438;
  --ink: #f4f6fb;
  --ink-2: #a6afc3;
  --ink-3: #6c7690;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --accent: #d9f55c;
  --accent-ink: #0b0f1a;
  --accent-text: #d9f55c;
  --accent-soft: rgba(217, 245, 92, .14);
  --amber: #f5b043;
  --amber-soft: rgba(245, 176, 67, .16);
  --green: #3dd68c;
  --green-soft: rgba(61, 214, 140, .14);
  --red: #ff6b6b;
  --red-soft: rgba(255, 107, 107, .14);
  --violet: #a78bfa;
  --shadow: 0 10px 28px -14px rgba(0, 0, 0, .8), 0 2px 6px -2px rgba(0, 0, 0, .5);
  --shadow-sheet: 0 -12px 40px -16px rgba(0, 0, 0, .85);
  --r: 16px;
  --r-sm: 11px;
  --nav-h: 118px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f3f7;
  --surface: #ffffff;
  --surface-2: #e9ebf1;
  --ink: #0b0f1a;
  --ink-2: #525a6e;
  --ink-3: #8a91a4;
  --line: rgba(11, 15, 26, .07);
  --line-2: rgba(11, 15, 26, .13);
  --accent: #c9ec3e;
  --accent-ink: #0b0f1a;
  --accent-text: #4b7300;
  --accent-soft: rgba(201, 236, 62, .22);
  --amber: #c96f00;
  --amber-soft: rgba(224, 138, 0, .14);
  --green: #1f8a4c;
  --green-soft: rgba(31, 138, 76, .12);
  --red: #d13b3b;
  --red-soft: rgba(209, 59, 59, .10);
  --violet: #6b46c1;
  --shadow: 0 10px 28px -16px rgba(11, 15, 26, .28), 0 2px 6px -2px rgba(11, 15, 26, .08);
  --shadow-sheet: 0 -12px 40px -16px rgba(11, 15, 26, .35);
  color-scheme: light;
}

/* сцена «Команда»: фігури мають сталі кольори в обох темах — інакше пінгвін білішає в темній */
/* Палітра категорій: один рівень насиченості й світлоти, тому не «рябить» */
:root {
  --c1: #d9f55c; --c2: #7ceec0; --c3: #86d0ff; --c4: #c4b5fd;
  --c5: #ffd08a; --c6: #6fe3d2; --c7: #f0b9ff; --c8: #ffa8a8;
}
:root { --fig: #1c1f26; --fig-2: #3a3f4b; --fig-light: #ffffff; --skin: #e8c4a2; --beak: #f0a33a; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 15px/1.45 var(--font, "Inter"), -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
::selection { background: var(--accent-soft); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 16px; height: 16px; }

/* ── шапка ── */
.top { padding: 16px 16px 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.top .sub { color: var(--ink-2); font-size: 13.5px; margin-top: 3px; line-height: 1.35; }
.top .act { display: flex; align-items: center; gap: 10px; flex: none; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; color: var(--ink); }
.icon-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.icon-btn.ghost { width: 36px; height: 36px; border-radius: 11px; color: var(--ink-2); background: transparent; border-color: var(--line); }
.icon-btn.ghost svg.i { width: 17px; height: 17px; }
.icon-btn:active { transform: scale(.96); }

/* ── екран ── */
.screen { padding: 4px 16px calc(var(--nav-h) + env(safe-area-inset-bottom)); animation: screen-in .32s var(--ease); }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } }
.screen.out { animation: none; opacity: 0; transition: opacity .12s; }
section { margin-top: 22px; }
section > h2 { margin: 0 4px 8px; font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-3); display: flex; justify-content: space-between; align-items: baseline; }
section > h2 .more { text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--accent-text); font-size: 13px; }

/* список-панель: рядки всередині однієї поверхні, без карток-у-картках */
.panel { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 52px; position: relative; }
.row + .row { border-top: 1px solid var(--line); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t.wrap { white-space: normal; overflow-wrap: break-word; }
.row .d { color: var(--ink-2); font-size: 13px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { flex: none; color: var(--ink-2); font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
/* Довгий дедлайн («прострочено · 20 жовтня») переноситься сам, а не відбирає місце в назви задачі. */
.row .end:has(.due) { flex: 0 1 auto; max-width: 40%; }
.row.tap { cursor: pointer; }
.row.tap:active { background: var(--surface-2); }
.row .chev { color: var(--ink-3); }
.empty { padding: 26px 16px; text-align: center; color: var(--ink-2); font-size: 14px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }
.note { color: var(--ink-3); font-size: 12.5px; margin: 8px 6px 0; }
.err { background: var(--red-soft); color: var(--red); padding: 12px 14px; border-radius: var(--r-sm); margin: 12px 0; font-weight: 600; }

/* сьогодні: підсумок дня */
.pulse { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.pulse button { border: 0; background: var(--surface); border-radius: var(--r); padding: 12px 12px 10px; text-align: left; box-shadow: var(--shadow); color: var(--ink); min-height: 74px; display: flex; flex-direction: column; justify-content: space-between; }
.pulse button:active { transform: scale(.98); }
.pulse .n { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.pulse .l { color: var(--ink-2); font-size: 12.5px; margin-top: 5px; font-weight: 600; white-space: nowrap; }
.pulse button.hot { background: var(--amber-soft); }
.pulse button.hot .n { color: var(--amber); }

/* таймлайн подій */
.time { width: 46px; flex: none; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; line-height: 1.2; }
.time small { display: block; color: var(--ink-3); font-weight: 600; font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-3); }
.dot.now { position: relative; }
.dot.now::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; color: inherit; animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
.row.live { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.row.live .t { font-weight: 700; }
@keyframes ping { 0% { transform: scale(.9); opacity: .8; } 70%, 100% { transform: scale(2.1); opacity: 0; } }
.row.past { opacity: .55; }
.meet { border: 0; background: var(--accent-soft); color: var(--accent-text); border-radius: 9px; padding: 6px 10px; font-weight: 700; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }

/* чекбокс задачі */
.check { width: 24px; height: 24px; border-radius: 8px; border: 1.8px solid var(--line-2); flex: none; display: grid; place-items: center; background: transparent; color: var(--accent-ink); transition: background .18s, border-color .18s; }
.check svg { opacity: 0; transform: scale(.6); transition: opacity .18s, transform .22s var(--ease); }
.row.done .check { background: var(--green); border-color: var(--green); }
.row.done .check svg { opacity: 1; transform: scale(1); }
.row.done .t { text-decoration: line-through; color: var(--ink-3); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 7px;
  background: var(--tagc); color: #0b0f1a; vertical-align: 1px; letter-spacing: .01em; }
.due { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.due.over { color: var(--red); font-weight: 700; } .due.today { color: var(--ink-2); }

/* чипи-сегменти */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; margin-top: 10px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 7px 13px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .c { opacity: .7; margin-left: 4px; }

/* вхідні: картка спаму */
.score { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; }
.score.hi { color: var(--red); } .score.mid { color: var(--amber); }
.reasons { margin: 6px 0 0; padding-left: 16px; color: var(--ink-2); font-size: 13px; }
.reasons li { margin: 2px 0; }
.actions { display: flex; gap: 8px; margin-top: 10px; }
.btn { border: 0; border-radius: 10px; padding: 9px 12px; font-weight: 700; font-size: 13.5px; background: var(--surface-2); color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.good { background: var(--green-soft); color: var(--green); }
.btn:disabled { opacity: .45; }
.btn:active { transform: scale(.97); }
.block { padding: 12px 14px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.quick button { border: 0; background: var(--surface); border-radius: var(--r); padding: 14px 10px 12px; box-shadow: var(--shadow); color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.quick button svg { color: var(--accent-text); width: 24px; height: 24px; }
.quick button:active { transform: scale(.97); }
.block + .block { border-top: 1px solid var(--line); }
.who { font-weight: 700; }
.who small { color: var(--ink-3); font-weight: 600; margin-left: 6px; }

/* календар: стрічка тижня */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 10px; }
.day { border: 0; background: transparent; border-radius: 12px; padding: 8px 0 6px; text-align: center; color: var(--ink-2); }
.day b { display: block; font-size: 17px; color: var(--ink); font-weight: 700; line-height: 1.2; }
.day small { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.day .marks { display: flex; justify-content: center; gap: 3px; height: 6px; margin-top: 4px; }
.day .marks i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }
.day.on { background: var(--ink); color: var(--bg); }
.day.on b, .day.on small { color: var(--bg); }
.day.today b { color: var(--accent-text); } .day.on.today b { color: var(--bg); }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 10px 4px 0; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.weeknav { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.weeknav .title { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }

/* гроші */
.money-hero { padding: 16px 14px 12px; }
.money-hero .sum { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.money-hero .cmp { color: var(--ink-2); font-size: 13.5px; margin-top: 6px; }
.money-hero .cmp b { color: var(--ink); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 56px; margin-top: 14px; }
.bars div { flex: 1; background: var(--accent-soft); border-radius: 5px 5px 2px 2px; position: relative; min-height: 3px;
  transform-origin: bottom; animation: growY .6s cubic-bezier(.22, 1, .36, 1) backwards; }
@keyframes growY { from { transform: scaleY(0); } }
.bars div:nth-child(2) { animation-delay: .05s; } .bars div:nth-child(3) { animation-delay: .1s; }
.bars div:nth-child(4) { animation-delay: .15s; } .bars div:nth-child(5) { animation-delay: .2s; } .bars div:nth-child(6) { animation-delay: .25s; }
.bars div.cur { background: var(--accent); }
.bars div span { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--ink-3); font-weight: 700; margin-top: 4px; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: -.01em; }

/* ефективність */
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.metric { background: var(--surface); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); animation: rise .45s cubic-bezier(.22, 1, .36, 1) backwards; }
.metric:nth-child(2) { animation-delay: .05s; } .metric:nth-child(3) { animation-delay: .1s; } .metric:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.metric .k { color: var(--ink-2); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.metric .v { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; line-height: 1; font-variant-numeric: tabular-nums; }
.metric .v small { font-size: 14px; font-weight: 700; color: var(--ink-3); margin-left: 3px; }
.metric .c { margin-top: 7px; font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.metric .c.up { color: var(--green); } .metric .c.down { color: var(--red); } .metric .c.flat { color: var(--ink-3); }
.bars2 { display: grid; gap: 8px; padding: 12px 14px; }
.bars2 .b { display: grid; grid-template-columns: minmax(84px, 34%) 1fr 30px; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; }
.bars2 .b i { display: block; height: 9px; border-radius: 5px; background: var(--accent); min-width: 5px;
  transform-origin: left center; animation: grow .7s cubic-bezier(.22, 1, .36, 1) backwards; }
@keyframes grow { from { transform: scaleX(0); opacity: .4; } }
.bars2 .b:nth-child(2) i { animation-delay: .06s; } .bars2 .b:nth-child(3) i { animation-delay: .12s; }
.bars2 .b:nth-child(4) i { animation-delay: .18s; } .bars2 .b:nth-child(5) i { animation-delay: .24s; }
.bars2 .b:nth-child(6) i { animation-delay: .3s; }
.bars2 .b > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars2 .b > span:last-child { text-align: right; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.report { padding: 14px; font-size: 14.5px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; }
.report b { color: var(--ink); }
.seg { display: flex; gap: 6px; margin-top: 12px; background: var(--surface); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.seg button { flex: 1; border: 0; background: none; color: var(--ink-2); font-weight: 700; font-size: 13.5px; padding: 9px 4px; border-radius: 999px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.periodnav { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.periodnav .title { font-weight: 800; font-size: 16px; letter-spacing: -.01em; text-align: center; }
.periodnav .title small { display: block; font-weight: 600; font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* команда */
/* Сцена — «освітлена кімната»: свої сталі кольори в обох темах, щоб фігури читались і на темному */
.scene { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; margin-top: 12px; }
.scene svg { display: block; width: 100%; height: auto; }
.legend { display: grid; gap: 8px; margin-top: 12px; }
.member { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); border: 0; text-align: left; color: var(--ink); width: 100%; }
.member .av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.member .st { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.member .pill { margin-left: auto; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.member .pill.working { background: var(--green-soft); color: var(--green); }
.member .pill.alert { background: var(--amber-soft); color: var(--amber); }

/* анімації сцени: два кадри спрайта, як у 16-біт */
@keyframes frames { 0%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes frames-b { 0%, 49.9% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes glow { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
@keyframes lamp { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes keys { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.scene .frame-a { animation: frames 1.1s steps(1) infinite; }
.scene .frame-b { animation: frames-b 1.1s steps(1) infinite; }
.scene .working .frame-a, .scene .working .frame-b { animation-duration: .5s; }
.scene .screen-glow { animation: glow 1.4s ease-in-out infinite; }
.scene .alert .lamp { animation: lamp .7s steps(1) infinite; }
.scene .type-key { animation: keys .5s steps(1) infinite; } .scene .type-key.k2 { animation-delay: .25s; }
.scene .spin { animation: spin 6s linear infinite; transform-origin: center; transform-box: fill-box; }
.scene.office, .scene.lounge { background: #1b1e2b; }
@keyframes bulb { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.scene .bulb { animation: bulb 1.6s steps(1) infinite; } .scene .bulb.b1 { animation-delay: .4s; } .scene .bulb.b2 { animation-delay: .8s; } .scene .bulb.b3 { animation-delay: 1.2s; }
@keyframes steam { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: .8; } 100% { transform: translateY(-10px); opacity: 0; } }
.scene .steam { animation: steam 2.2s ease-out infinite; }
@keyframes neon { 0%, 100% { opacity: 1; } 50% { opacity: .75; } }
.scene .neon { animation: neon 2.4s ease-in-out infinite; }
.style-switch { display: flex; gap: 6px; margin-top: 10px; }
.duties { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.duties li { margin: 3px 0; }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat3 div { background: var(--bg); border-radius: 12px; padding: 10px; }
.stat3 b { display: block; font-size: 20px; letter-spacing: -.02em; }
.stat3 span { color: var(--ink-2); font-size: 12px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── нижня навігація: «рідка» — активна іконка сидить у кульці, що випливає з панелі ── */
nav.tabs { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 62px; z-index: 20; }
nav.tabs .goo { position: absolute; inset: -30px 0 0 0; filter: url(#goo); pointer-events: none; contain: paint; }

nav.tabs .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 64px; border-radius: 22px; background: var(--surface); }
/* Рух кульки — ЛИШЕ анімацією: transition + animation разом давали ривок.
   will-change і translateZ виносять її на власний шар, інакше goo-фільтр
   перемальовує всю панель кожен кадр і на телефоні це помітно смикається. */
nav.tabs .bead { position: absolute; left: 0; bottom: 42px; width: 44px; height: 44px; margin-left: -22px; border-radius: 50%;
  background: var(--surface); transform: translateX(var(--x, 39px)) translateZ(0); will-change: transform; }
nav.tabs .bead.melt { animation: melt .4s cubic-bezier(.22, 1, .36, 1); }
@keyframes melt {
  0% { transform: translateX(var(--from)) translateZ(0) scale(1); }
  45% { transform: translateX(calc(var(--from) + (var(--x) - var(--from)) * .55)) translateZ(0) scale(1.3, .6); }
  100% { transform: translateX(var(--x)) translateZ(0) scale(1); }
}
nav.tabs::before { content: ""; position: absolute; inset: 0; border-radius: 22px; box-shadow: 0 0 0 1px var(--line); pointer-events: none; }
:root[data-theme="dark"] nav.tabs::before { box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .06); }
nav.tabs .items { position: absolute; inset: 0; display: flex; }
nav.tabs button { flex: 1; border: 0; background: none; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0; padding: 0 0 8px; position: relative; }
nav.tabs button .ic { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; transition: transform .4s cubic-bezier(.22, 1, .36, 1), color .25s ease, background .25s ease; will-change: transform; }
nav.tabs button .ic svg.i { width: 22px; height: 22px; }
nav.tabs button .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .01em; line-height: 1; margin-top: -2px; transition: color .3s ease, transform .4s cubic-bezier(.22, 1, .36, 1), opacity .3s; }
nav.tabs button.on { color: var(--accent-text); }
nav.tabs button.on .ic { transform: translateY(-18px); background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
nav.tabs button.on .lbl { color: var(--ink); transform: translateY(-2px); }
nav.tabs button:active .ic { transform: scale(.92); }
nav.tabs button.on:active .ic { transform: translateY(-18px) scale(.94); }
nav.tabs button .badge { position: absolute; top: 6px; right: 4px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--amber); color: #fff; font-size: 11px; line-height: 17px; font-weight: 800; }

/* ── нижній лист (форми) ── */
.scrim { position: fixed; inset: 0; background: rgba(10, 12, 16, .45); opacity: 0; transition: opacity .25s; z-index: 30; }
.scrim.on { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-sheet); padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .38s var(--ease); z-index: 31; max-height: 88vh; overflow-y: auto; }
.sheet.on { transform: translateY(0); }
.sheet .grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 12px; }
.sheet h3 { margin: 0 0 12px; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; height: 48px; border: 1px solid var(--line-2); background: var(--bg); border-radius: var(--r-sm); padding: 0 12px; font-size: 16px; outline: 0; line-height: 46px; }
.field textarea { height: auto; padding: 11px 12px; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.field-row .field { min-width: 0; }
.field input[type="date"], .field input[type="time"] { -webkit-appearance: none; appearance: none; min-width: 0; width: 100%; display: block; text-align: left; -webkit-min-logical-width: 0; }
.sheet .submit { width: 100%; margin-top: 4px; padding: 13px; border-radius: 12px; font-size: 15.5px; justify-content: center; }
.menu { display: grid; gap: 6px; }
.menu button { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border: 0; background: var(--bg); border-radius: 12px; text-align: left; color: var(--ink); font-weight: 700; }
.menu button svg { color: var(--accent-text); }
.fontrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border: 0; background: var(--bg); border-radius: 12px; color: var(--ink); width: 100%; text-align: left; }
.fontrow.on { outline: 2px solid var(--accent); }
.fontrow .name { display: block; font-weight: 700; font-size: 15px; }
.fontrow .sample { display: block; color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.menu button small { display: block; font-weight: 500; color: var(--ink-2); font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 6px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .2s, transform .3s var(--ease); z-index: 40; pointer-events: none; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-weight: 700; background: none; border: 0; padding: 0; font-size: 14px; }
.skeleton { height: 52px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sk 1.2s linear infinite; margin-top: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
