/* Склад. Общая основа с задачником (шрифты, каркас), своё — таблицы-накладные с цифрами по правому краю. */
:root {
  --paper: #ECEFF3;
  --surface: #FFFFFF;
  --ink: #121C2B;
  --ink-2: #55637A;
  --ink-3: #8A95A6;
  --line: #D6DCE4;
  --wash: #F5F7F9;
  --accent: #2F8F6B;
  --on-accent: #FFFFFF;
  --late: #E0422F;
  --ok: #17915A;
  --review: #5A55D6;
  --rail: #121C2B;
  --display: 'Sofia Sans Condensed', 'Arial Narrow', 'DejaVu Sans Condensed', 'Roboto Condensed', sans-serif;
  --body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, 'Inter', sans-serif;
  --r: 14px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }

/* ---------- календарь генуборок ---------- */
.ccal-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 12px; }
.ccal-kpi { padding: 10px 12px; border-radius: 12px; background: var(--wash); }
.ccal-kpi span { display: block; font-size: 12px; color: var(--ink-2); }
.ccal-kpi b { font-size: 22px; font-family: var(--display); }
.ccal-kpi.plan b { color: color-mix(in srgb, var(--accent) 80%, var(--ink)); }
.ccal-kpi.done b { color: var(--ok); }
.ccal-kpi.late b { color: var(--late); }
.ccal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.ccal-d { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 96px; padding: 6px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; font: inherit; cursor: pointer; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ccal-d:hover { border-color: var(--ink-3); }
.ccal-d:active { transform: scale(.98); }
.ccal-d.we { background: var(--wash); }
.ccal-d.past { opacity: .7; }
.ccal-d.today { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); opacity: 1; }
.ccal-d.sel { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); opacity: 1; }
.ccal-n { align-self: flex-start; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.ccal-d.today .ccal-n { background: var(--accent); color: var(--on-accent); }
.ccal-cs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ccal-c { display: block; font-size: 11px; line-height: 1.35; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ccal-c.plan { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: color-mix(in srgb, var(--accent) 72%, var(--ink)); }
.ccal-c.done { background: color-mix(in srgb, var(--ok) 13%, var(--surface)); color: var(--ok); }
.ccal-c.late { background: color-mix(in srgb, var(--late) 14%, var(--surface)); color: var(--late); }
.ccal-more { font-size: 11px; color: var(--ink-3); padding-left: 6px; font-weight: 600; }
.ccal-dots { display: none; gap: 3px; justify-content: center; flex-wrap: wrap; max-width: 100%; }
.ccal-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.ccal-dots i.done { background: var(--ok); }
.ccal-dots i.late { background: var(--late); }
.ccal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.ccal-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ccal-legend .plan { background: var(--surface); border: 1.5px solid var(--ink-3); box-sizing: border-box; }
.ccal-legend .done { background: var(--ok); }
.ccal-legend .late { background: var(--late); }
.ccal-day { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.ccal-day h3 { margin: 0 0 8px; font-size: 16px; }
.ccal-st { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; margin-right: 6px; }
.ccal-st.plan { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: color-mix(in srgb, var(--accent) 72%, var(--ink)); }
.ccal-st.done { background: color-mix(in srgb, var(--ok) 13%, var(--surface)); color: var(--ok); }
.ccal-st.late { background: color-mix(in srgb, var(--late) 14%, var(--surface)); color: var(--late); }
/* генуборки: клетка целиком окрашена по статусу, внутри — название точки */
.ccal-g { gap: 5px; }
.ccal-d { min-height: 80px; padding: 6px; gap: 4px; border: 1px solid var(--line); border-radius: 12px; align-items: stretch; text-align: left; transition: transform .12s, box-shadow .12s; }
.ccal-d.st-plan { background: var(--surface); border-color: var(--line); }
.ccal-d.st-done { background: color-mix(in srgb, var(--ok) 13%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 32%, var(--line)); }
.ccal-d.st-late { background: color-mix(in srgb, var(--late) 11%, var(--surface)); border-color: color-mix(in srgb, var(--late) 45%, var(--line)); }
.ccal-d.off { background: var(--wash); border-style: dashed; }
.ccal-d.past { opacity: .62; }
.ccal-d.today, .ccal-d.sel { opacity: 1; }
.ccal-p { font-size: 12px; font-weight: 650; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.st-plan .ccal-p { color: var(--ink); }
.st-done .ccal-p { color: var(--ok); }
.st-late .ccal-p { color: var(--late); }
.ccal-off { font-size: 11px; color: var(--ink-3); }
.ccal-d .ccal-more { padding: 0; font-size: 10.5px; }
.ccal-edit { display: flex; gap: 8px; margin: 8px 0 4px; }
.ccal-edit select { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.cl-hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: 8px; margin: 4px 0 12px; }
.cl-hero > div { border-radius: 14px; padding: 12px 14px; background: var(--wash); min-width: 0; }
.cl-hero .now { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.cl-hero .now.done { background: color-mix(in srgb, var(--ok) 15%, var(--surface)); }
.cl-hero .now.late { background: color-mix(in srgb, var(--late) 12%, var(--surface)); }
.cl-hero span { display: block; font-size: 12px; color: var(--ink-2); }
.cl-hero b { display: block; font-size: 19px; line-height: 1.2; margin-top: 3px; overflow-wrap: anywhere; }
.cl-hero .nxt b { font-size: 15px; }
.cl-hero small { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.cl-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.cl-stats span { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--wash); color: var(--ink-2); }
.cl-stats b { color: var(--ink); }
.cl-stats .late b { color: var(--late); }
.cl-help { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.cl-help summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.cl-help p { margin: 6px 0 0; }
.cl-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cl-pt { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); min-width: 0; }
.cl-pt-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cl-pt-h b { font-size: 15.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-pill { flex: none; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: color-mix(in srgb, var(--accent) 78%, var(--ink)); }
.cl-pill.today { background: var(--accent); color: var(--on-accent, #fff); }
.cl-pill.late { background: color-mix(in srgb, var(--late) 14%, var(--surface)); color: var(--late); }
.cl-pt-m { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.cl-pt-a { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.cl-pt details { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.cl-pt summary { cursor: pointer; }
.cl-hist { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
/* генуборки списком по дням (как в старой программе) */
.gl-tabs { margin: 0 0 12px; max-width: 360px; }
.gl-list { list-style: none; margin: 8px 0 0; padding: 0; }
.gl-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.gl-list > .gl-row:last-child { border-bottom: 0; }
.gl-row.today { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-radius: 12px; border-bottom-color: transparent; padding: 12px 10px; margin: 2px -6px; }
.gl-row.past { opacity: .55; }
.gl-row.gl-none .gl-m b { color: var(--ink-3); font-weight: 500; }
.gl-week { list-style: none; height: 0; border-top: 2px solid var(--line); margin: 6px 0 2px; }
.gl-d { flex: none; width: 76px; }
.gl-d b { display: block; font-size: 15px; line-height: 1.2; }
.gl-d small { display: block; font-size: 12.5px; color: var(--ink-2); }
.gl-row.today .gl-d b, .gl-row.today .gl-d small { color: var(--accent); font-weight: 700; }
.gl-m { flex: 1; min-width: 0; }
.gl-m b { display: block; font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-m small { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.gl-m small.gl-ok { color: var(--ok); font-weight: 600; }
.gl-m small.gl-man { color: var(--ink-3); }
.gl-sel { flex: none; width: 150px; max-width: 40%; font: inherit; font-size: 13px; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.gl-row .btn.small { flex: none; }
@media (max-width: 640px) {
  .gl-d { width: 62px; }
  .gl-row { gap: 8px; }
  .gl-sel { width: 120px; max-width: 36%; font-size: 12.5px; }
  .gl-m b { font-size: 15px; }
}
.cl-hist .chip { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--wash); }
@media (max-width: 640px) {
  .ccal-g { gap: 3px; }
  .ccal-d { min-height: 60px; padding: 4px 3px; border-radius: 9px; gap: 2px; }
  .ccal-n { align-self: flex-start; height: 20px; min-width: 20px; padding: 0 4px; font-size: 12px; }
  .ccal-p { font-size: 9.5px; letter-spacing: -.15px; line-height: 1.15; }
  .ccal-off { font-size: 9.5px; }
  .ccal-cs, .ccal-dots { display: none; }
  .cl-hero b { font-size: 17px; }
}

/* ---------- календарь привозов (Движения) ---------- */
.dcal { margin-bottom: 14px; --amber: #D99A06; }
.dcal-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 6px; }
.dcal-nav b { min-width: 140px; text-align: center; font-size: 17px; }
.dcal-nav .btn:disabled { opacity: .3; cursor: default; }
.dcal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.dcal-w { text-align: center; font-size: 12px; color: var(--ink-3); padding-bottom: 2px; }
.dcal-d { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; padding: 2px; border: 1.5px solid transparent; border-radius: 10px; background: var(--wash); color: var(--ink); line-height: 1.1; }
.dcal-d span { font-weight: 600; font-size: 15px; }
.dcal-d small { font-size: 11px; min-height: 12px; font-weight: 600; }
.dcal-d.all { background: color-mix(in srgb, var(--ok) 20%, var(--surface)); }
.dcal-d.all small { color: var(--ok); }
.dcal-d.part { background: color-mix(in srgb, var(--amber) 22%, var(--surface)); }
.dcal-d.part small { color: color-mix(in srgb, var(--amber) 75%, var(--ink)); }
.dcal-d.none { color: var(--ink-3); }
.dcal-d.future { background: transparent; color: var(--ink-3); opacity: .55; }
.dcal-d.today { border-color: var(--ink-3); }
.dcal-d.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.dcal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.dcal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dcal-legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--wash); border: 1px solid var(--line); }
.dcal-legend i.all { background: color-mix(in srgb, var(--ok) 35%, var(--surface)); border-color: transparent; }
.dcal-legend i.part { background: color-mix(in srgb, var(--amber) 40%, var(--surface)); border-color: transparent; }
.dcal-day { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 4px; }
.dcal-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dcal-dot.ok { background: var(--ok); }
.dcal-dot.bad { background: var(--late); }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.boot { padding: 40vh 24px 0; text-align: center; color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- каркас ---------- */
.shell { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px); }
.rail { display: none; }
.top { display: flex; align-items: flex-end; gap: 12px; padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px 10px; }
.top-titles { flex: 1; min-width: 0; }
.top-date { font-size: 13.5px; color: var(--ink-2); }
.top h1 { font: 800 34px/1 var(--display); letter-spacing: -.005em; margin-top: 2px; }
.me-btn { border: 0; background: none; padding: 0; border-radius: 50%; }
.announce { margin: 4px 16px 10px; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 500; font-size: 14.5px; }
.view { padding: 0 16px; }
.lead { font-size: 16px; color: var(--ink-2); margin: 2px 0 18px; max-width: 46ch; }
.lead b { color: var(--ink); font-weight: 600; }
.lead .late { color: var(--late); font-weight: 600; }

.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; background: var(--surface); border-top: 1px solid var(--line); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 500; color: var(--ink-2); text-decoration: none; position: relative; }
.nav a svg { width: 24px; height: 24px; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav a[aria-current="page"]::before { content: ''; position: absolute; top: 0; width: 28px; height: 4px; border-radius: 0 0 4px 4px; background: var(--accent); }
.nav .badge { position: absolute; top: 8px; left: calc(50% + 6px); }
.fab { align-self: start; justify-self: center; margin-top: -18px; width: 60px; height: 60px; border-radius: 50%; border: 4px solid var(--surface); background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(18, 28, 43, .22); }
.fab svg { width: 28px; height: 28px; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--late); color: #fff; font: 700 11px/18px var(--body); text-align: center; }
.badge.review { background: var(--review); }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; font-weight: 600; font-size: 15.5px; text-decoration: none; white-space: nowrap; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.danger { background: transparent; color: var(--late); border-color: color-mix(in srgb, var(--late) 40%, transparent); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: 12px; color: var(--ink-2); }
.icon-btn:hover { background: var(--wash); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.link { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.field { display: block; margin-bottom: 16px; }
.field > span, .label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field small, .hint { display: block; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.input, .field input:not([type=checkbox]):not([type=color]), .field select, .field textarea { width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); outline: 0; }
.field textarea { min-height: 84px; resize: vertical; line-height: 1.4; }
.field textarea.title-input { font-size: 19px; font-weight: 600; min-height: 76px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--surface); font-size: 14.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--ink-3)); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 12px; background: #DDE2E9; }
.seg button { min-height: 42px; border: 0; border-radius: 9px; background: none; font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(18, 28, 43, .16); }
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; cursor: pointer; }
.switch input { appearance: none; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; transition: background .15s; margin: 0; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(18px); }
.switch b { display: block; font-weight: 600; font-size: 15px; }
.switch small { display: block; color: var(--ink-2); font-size: 13.5px; }

/* ---------- талон задачи ---------- */
.group { margin-bottom: 26px; }
.group-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.group-h h2 { font: 700 23px/1.1 var(--display); }
.group-h .n { font: 600 15px/1 var(--display); color: var(--ink-3); }
.group-h .more { margin-left: auto; font-size: 13.5px; }
.group.late .group-h h2 { color: var(--late); }
.group.review .group-h h2 { color: var(--review); }
.tickets { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.tickets > li { filter: drop-shadow(0 1px 1.5px rgba(18, 28, 43, .16)); }
.ticket { --seam: 74px; display: grid; grid-template-columns: var(--seam) minmax(0, 1fr) auto; min-height: 70px; background: var(--surface); border-radius: var(--r); overflow: hidden; cursor: pointer;
  -webkit-mask: radial-gradient(circle 7px at var(--seam) 0, #0000 97%, #000) top / 100% 51% no-repeat, radial-gradient(circle 7px at var(--seam) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle 7px at var(--seam) 0, #0000 97%, #000) top / 100% 51% no-repeat, radial-gradient(circle 7px at var(--seam) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat; }
.stub { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 8px 2px; text-align: center; background: var(--wash); color: var(--ink); border-right: 2px dashed color-mix(in srgb, var(--ink) 18%, transparent); }
.stub b { font: 800 26px/1 var(--display); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.stub b.time { font-size: 21px; letter-spacing: 0; }
.stub span { font-size: 11.5px; font-weight: 500; line-height: 1.15; }
.stub.today { background: var(--accent); color: var(--on-accent); }
.stub.late { background: var(--late); color: #fff; border-right-color: rgba(255, 255, 255, .5); }
.stub.none { color: var(--ink-3); }
.stub.none b { font-size: 20px; }
.stub.done { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }
.stub.done svg { width: 26px; height: 26px; }
.stub.review { background: color-mix(in srgb, var(--review) 13%, var(--surface)); color: var(--review); }
.t-body { padding: 11px 6px 11px 13px; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.t-title { font-size: 15.5px; font-weight: 600; line-height: 1.28; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.t-title .hot { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 5px; background: var(--late); color: #fff; font: 700 12px/18px var(--body); vertical-align: 2px; }
.ticket.closed .t-title { color: var(--ink-2); font-weight: 500; }
.t-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--ink-2); }
.t-meta > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.t-meta svg { width: 15px; height: 15px; }
.t-meta .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-3)); }
.t-meta .state { font-weight: 600; color: var(--ink); }
.t-meta .state.review { color: var(--review); }
.t-meta .free { font-weight: 600; color: var(--ink); background: var(--paper); padding: 1px 8px; border-radius: 10px; }
.t-go { display: grid; place-items: center; padding: 0 12px 0 6px; }
.t-go button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: var(--ink-3); display: grid; place-items: center; }
.t-go button:hover { border-color: var(--ok); color: var(--ok); }
.t-go button svg { width: 22px; height: 22px; }
.t-go button.take { border-color: var(--ink); color: var(--ink); width: auto; padding: 0 14px; border-radius: 22px; font-size: 13.5px; font-weight: 600; }
.empty { padding: 28px 20px; border: 1.5px dashed var(--line); border-radius: var(--r); text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font: 700 22px/1.2 var(--display); margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* ---------- люди ---------- */
.ava { --s: 36px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; display: inline-grid; place-items: center; background: var(--c, var(--ink-2)); color: #fff; font: 700 calc(var(--s) * .4)/1 var(--body); letter-spacing: .01em; }
.ava.s { --s: 22px; }
.ava.l { --s: 52px; }
.people { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 9px; }
.person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; width: 100%; padding: 14px; border: 0; border-radius: var(--r); background: var(--surface); text-align: left; box-shadow: 0 1px 1.5px rgba(18, 28, 43, .16); }
.person .ava { grid-row: span 2; }
.person.off { opacity: .55; }
.p-name { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-role { font-size: 13px; color: var(--ink-2); }
.p-load { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--ink-2); }
.p-load b { color: var(--ink); font-weight: 600; }
.p-load .late b, .p-load .late { color: var(--late); }
.p-load .review b, .p-load .review { color: var(--review); }
.p-done { text-align: right; }
.p-done b { display: block; font: 800 26px/1 var(--display); }
.p-done span { font-size: 11.5px; color: var(--ink-2); }

/* ---------- доска ---------- */
.filters { display: flex; gap: 8px; margin: 0 -16px 12px; padding: 2px 16px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters select, .filters input { min-height: 40px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 20px; background: var(--surface); font-size: 14.5px; flex: none; }
.filters input { width: 150px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: min(86vw, 340px); gap: 12px; margin: 0 -16px; padding: 0 16px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; }
.col { scroll-snap-align: start; min-width: 0; }
.col-h { display: flex; align-items: baseline; gap: 8px; padding: 6px 2px 10px; }
.col-h h2 { font: 700 22px/1 var(--display); }
.col-h .n { font: 600 15px/1 var(--display); color: var(--ink-3); }
.col[data-status="review"] .col-h h2 { color: var(--review); }
.col .tickets { min-height: 96px; align-content: start; border-radius: var(--r); padding-bottom: 28px; }
.col.over .tickets { outline: 2px dashed var(--ink); outline-offset: 4px; }
.col .empty { padding: 18px 12px; font-size: 14px; }
.tickets > li.drag { opacity: .4; }

/* ---------- шторка ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(18, 28, 43, .5); animation: fade .16s ease-out; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 94dvh; height: 94dvh; display: flex; flex-direction: column; background: var(--paper); border-radius: 20px 20px 0 0; animation: rise .22s cubic-bezier(.2, .8, .2, 1); overflow: hidden; }
.sheet.fit { height: auto; }
.sheet.still, .scrim.still { animation: none; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-h { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px 16px; }
.sheet-h h2 { flex: 1; min-width: 0; font: 700 22px/1.1 var(--display); }
.sheet-b { flex: 1; overflow-y: auto; padding: 6px 16px 20px; overscroll-behavior: contain; }
.sheet-f { display: flex; gap: 10px; padding: 12px 16px calc(12px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); }
.sheet-f .btn { flex: 1; }
.sheet-f .btn.narrow { flex: 0 0 auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 14px; background: var(--surface); font-size: 13px; font-weight: 600; }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.pill.doing::before { background: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 30%, transparent); }
.pill.review { color: var(--review); } .pill.review::before { background: var(--review); }
.pill.done { color: var(--ok); } .pill.done::before { background: var(--ok); }
.pill.late { color: var(--late); } .pill.late::before { background: var(--late); }

.task-title { font: 800 30px/1.08 var(--display); letter-spacing: -.003em; margin: 4px 0 14px; overflow-wrap: anywhere; position: relative; }
.stamp { float: right; margin: 2px 0 6px 12px; padding: 4px 10px 3px; border: 2.5px solid currentColor; border-radius: 7px; color: var(--ok); font: 800 17px/1 var(--display); letter-spacing: .09em; text-transform: uppercase; transform: rotate(-6deg); opacity: .9; }
.stamp.canceled { color: var(--ink-3); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 18px; }
.facts > div { background: var(--surface); padding: 10px 13px; min-width: 0; }
.facts dt { font-size: 12.5px; color: var(--ink-2); margin-bottom: 2px; }
.facts dd { margin: 0; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts dd.late { color: var(--late); }
.facts .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--ink-3)); flex: none; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 20px; font-size: 15.5px; }
.block { margin-bottom: 22px; }
.block-h { display: flex; align-items: baseline; gap: 8px; font: 700 19px/1.1 var(--display); margin-bottom: 9px; }
.block-h .n { font-size: 14px; color: var(--ink-3); }
.checks { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r); overflow: hidden; }
.checks li { display: flex; align-items: flex-start; gap: 2px; border-bottom: 1px solid var(--paper); }
.checks label { flex: 1; display: flex; align-items: flex-start; gap: 12px; padding: 12px 13px; cursor: pointer; min-width: 0; }
.checks input[type=checkbox] { appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 2px solid var(--ink-3); border-radius: 7px; display: grid; place-items: center; cursor: pointer; }
.checks input[type=checkbox]:checked { background: var(--ok); border-color: var(--ok); }
.checks input[type=checkbox]:checked::after { content: ''; width: 11px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); }
.checks input:checked + span { color: var(--ink-3); text-decoration: line-through; }
.checks span { overflow-wrap: anywhere; padding-top: 1px; }
.checks input:disabled { opacity: .5; cursor: default; }
.add-line { display: flex; gap: 8px; margin-top: 8px; }
.add-line input { flex: 1; min-width: 0; min-height: 44px; padding: 0 13px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.file { position: relative; width: 78px; height: 78px; border-radius: 12px; overflow: hidden; background: var(--surface); display: grid; place-items: center; text-decoration: none; font-size: 11px; font-weight: 600; color: var(--ink-2); text-align: center; padding: 4px; }
.file img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.file-add { border: 1.5px dashed var(--ink-3); background: none; color: var(--ink-2); flex-direction: column; gap: 2px; cursor: pointer; }
.file-add svg { width: 24px; height: 24px; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feed .ev { font-size: 13px; color: var(--ink-2); padding-left: 2px; }
.feed .ev time { color: var(--ink-3); }
.feed .msg { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; }
.feed .msg .ava { grid-row: span 2; }
.feed .msg header { font-size: 13px; color: var(--ink-2); }
.feed .msg header b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.feed .msg p { background: var(--surface); padding: 9px 12px; border-radius: 4px 14px 14px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; justify-self: start; }
.feed .via { font-size: 11.5px; padding: 0 6px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); margin-left: 4px; }
.wait-note { flex: 1; align-self: center; font-size: 14.5px; color: var(--ink-2); }
.menu { position: absolute; z-index: 50; right: 8px; top: 52px; min-width: 220px; padding: 6px; background: var(--surface); border-radius: 14px; box-shadow: 0 12px 34px rgba(18, 28, 43, .28); display: grid; }
.menu button { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px; border: 0; background: none; border-radius: 9px; text-align: left; font-size: 15px; font-weight: 500; }
.menu button:hover { background: var(--wash); }
.menu button.danger { color: var(--late); }
.menu svg { width: 20px; height: 20px; }

/* ---------- списки настроек ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 1.5px rgba(18, 28, 43, .12); }
.card > h2 { font: 700 21px/1.1 var(--display); margin-bottom: 4px; }
.card > p { color: var(--ink-2); font-size: 14.5px; margin-bottom: 14px; max-width: 60ch; }
.rows { list-style: none; margin: 0 0 12px; padding: 0; }
.rows li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--paper); min-height: 52px; }
.rows li > .grow { flex: 1; min-width: 0; }
.rows li b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows li small { color: var(--ink-2); font-size: 13px; display: block; }
.rows .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.rows li.off b { color: var(--ink-3); text-decoration: line-through; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1.5px var(--line); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink); }
.secret { margin: 12px 0; padding: 12px; border-radius: 12px; background: var(--paper); font: 500 13.5px/1.45 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.note { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 26%, var(--surface)); font-size: 14.5px; margin-bottom: 14px; }
.note.quiet { background: var(--paper); color: var(--ink-2); }
.note.bad { background: color-mix(in srgb, var(--late) 12%, var(--surface)); }
.facts.one { grid-template-columns: 1fr; }
.facts.one dd { white-space: normal; overflow-wrap: anywhere; }
.facts dd a { color: inherit; }
.t-meta .fv { max-width: 26ch; overflow: hidden; text-overflow: ellipsis; display: inline-block; color: var(--ink); }
.add-line select { flex: 0 1 auto; min-width: 0; min-height: 44px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
.icon-btn[aria-pressed="true"] { color: var(--ink); background: color-mix(in srgb, var(--accent) 45%, transparent); }
@media (max-width: 699px) { .add-line.wrap { flex-wrap: wrap; } .add-line.wrap input { flex: 1 1 100%; } .add-line.wrap select { flex: 1; } }
.pairs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.dlg-root { position: fixed; inset: 0; z-index: 58; display: grid; place-items: center; padding: 16px; }
.dlg-scrim { position: absolute; inset: 0; background: rgba(18, 28, 43, .5); animation: fade .16s ease-out; }
.dlg { position: relative; width: min(420px, 100%); background: var(--surface); border-radius: 18px; padding: 20px; box-shadow: 0 18px 50px rgba(18, 28, 43, .35); }
.dlg h2 { font: 700 22px/1.15 var(--display); margin: 0 0 8px; }
.dlg p { color: var(--ink-2); font-size: 15px; margin: 0 0 16px; }
.dlg .input { margin-bottom: 16px; }
.btn.danger-fill { background: var(--late); border-color: var(--late); color: #fff; }
.sched { font-size: 13.5px; color: var(--ink-2); }

/* ---------- вход ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 20px; background: var(--rail); }
.gate-card { width: 100%; max-width: 400px; }
.gate-mark { display: flex; align-items: center; gap: 12px; color: #fff; margin-bottom: 22px; }
.gate-mark svg { width: 46px; height: 46px; }
.gate-mark b { font: 800 34px/1 var(--display); }
.gate form { background: var(--paper); border-radius: 20px; padding: 22px 20px 20px; }
.gate h1 { font: 700 24px/1.1 var(--display); margin-bottom: 6px; }
.gate form > p { color: var(--ink-2); font-size: 14.5px; margin-bottom: 18px; }
.err { color: var(--late); font-size: 14px; font-weight: 500; min-height: 20px; margin: -4px 0 10px; }

#toasts { position: fixed; z-index: 60; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { max-width: 420px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14.5px; font-weight: 500; box-shadow: 0 10px 28px rgba(18, 28, 43, .35); animation: rise .2s ease-out; }
.toast.bad { background: var(--late); }

/* ---------- компьютер ---------- */
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); padding-bottom: 0; }
  .nav { display: none; }
  .rail { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; padding: 22px 14px 16px; background: var(--rail); color: #fff; }
  .rail-mark { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
  .rail-mark svg { width: 34px; height: 34px; flex: none; }
  .rail-mark b { font: 800 24px/1.05 var(--display); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
  .rail a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 11px; color: rgba(255, 255, 255, .72); text-decoration: none; font-weight: 500; font-size: 15.5px; position: relative; }
  .rail a svg { width: 22px; height: 22px; }
  .rail a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
  .rail a[aria-current="page"] { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
  .rail a[aria-current="page"]::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 5px; border-radius: 0 4px 4px 0; background: var(--accent); }
  .rail a .badge { margin-left: auto; }
  .rail .btn { margin: 14px 0 10px; }
  .rail-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid rgba(255, 255, 255, .14); color: #fff; text-decoration: none; }
  .rail-me div { min-width: 0; }
  .rail-me b { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail-me span { font-size: 12.5px; color: rgba(255, 255, 255, .62); }
  .main { min-width: 0; padding: 12px 32px 48px; }
  .top { padding: 22px 0 12px; }
  .top h1 { font-size: 42px; }
  .me-btn { display: none; }
  .announce { margin: 4px 0 14px; }
  .view { padding: 0; }
  .view.narrow { max-width: 760px; }
  .filters { margin: 0 0 14px; padding: 2px 0; }
  .board { grid-auto-flow: initial; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; overflow: visible; }
  .board .ticket { --seam: 62px; }
  .board .stub b { font-size: 22px; }
  .board .stub b.time { font-size: 17px; }
  .board .stub span { font-size: 11px; }
  .board .t-title { font-size: 14.5px; -webkit-line-clamp: 3; }
  .board .t-body { padding: 10px 4px 10px 11px; }
  .board .t-go { padding: 0 9px 0 4px; }
  .board .t-go button { width: 36px; height: 36px; }
  .board .t-go button svg { width: 18px; height: 18px; }
  .view > .group { max-width: 760px; }
  .sheet { left: auto; top: 0; bottom: 0; width: 540px; max-height: none; height: auto; border-radius: 0; animation-name: slide; }
  .sheet.fit { top: 0; }
  .sheet-h { padding: 16px 12px 8px 24px; }
  .sheet-b { padding: 6px 24px 24px; }
  .sheet-f { padding: 14px 24px; }
  #toasts { bottom: 24px; }
  .people { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
  .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .two .card { margin-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.row.wrap-gap { flex-wrap: wrap; gap: 8px; }
.row.wrap-gap .btn { flex: 0 0 auto; }

/* ---------- склад ---------- */
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 9px 0; border-bottom: 1px solid var(--paper); vertical-align: top; }
.tbl th { text-align: left; font-weight: 500; padding-right: 10px; }
.tbl td { text-align: right; white-space: nowrap; padding-left: 12px; }
.tbl small { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 400; }
.tbl tr:last-child th, .tbl tr:last-child td { border-bottom: 0; }
.tbl td.q { font-weight: 600; }
.tbl tr.neg td.q { color: var(--late); }
.tbl td.days { color: var(--ink-2); width: 1%; }
.tbl .late, .late { color: var(--late); }
.tbl .ok, .ok { color: var(--ok); }
.tbl td.warn { background: color-mix(in srgb, #F59E0B 16%, transparent); }
.tbl td.b { font-weight: 700; }
.tbl .z { color: var(--ink-3); }
.tbl thead td, .tbl thead th { font-size: 12.5px; color: var(--ink-2); font-weight: 500; white-space: normal; }
.tbl tfoot th, .tbl tfoot td { border-top: 1.5px solid var(--ink); border-bottom: 0; font-weight: 600; }
.tbl.inv td { width: 40%; }
.scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.rep-t { min-width: 760px; }
.ord tr.need th { font-weight: 600; }
.qty { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.qty input { width: 110px; min-height: 42px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 10px; text-align: right; background: var(--surface); font-variant-numeric: tabular-nums; }
.qty span { color: var(--ink-2); width: 22px; text-align: left; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: 0 1px 1.5px rgba(18, 28, 43, .12); text-decoration: none; color: inherit; border-left: 5px solid var(--line); }
.kpi span { font-size: 13px; color: var(--ink-2); line-height: 1.25; }
.kpi b { font: 800 28px/1 var(--display); font-variant-numeric: tabular-nums; }
.kpi.bad { border-left-color: var(--late); } .kpi.bad b { color: var(--late); }
.kpi.warn { border-left-color: var(--accent); }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.quick .btn { min-height: 64px; white-space: normal; text-align: left; justify-content: flex-start; line-height: 1.2; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.sheet-f .actions { margin: 0; width: 100%; }
.sub { padding: 6px 0 4px; }
.sub h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin: 4px 0 2px; }
.sec { font: 700 24px/1.1 var(--display); margin: 22px 0 10px; }
.hint { color: var(--ink-2); font-size: 14px; margin: 0 0 12px; }
.total { margin-top: 10px; }
.seg.wide { margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.place-h { display: flex; flex-direction: column; margin-bottom: 6px; }
.place-h h2 { font: 700 21px/1.1 var(--display); }
.place-h h2 a { text-decoration: none; }
.place-h small { color: var(--ink-2); font-size: 13px; }
.place .card, .grid .card { margin-bottom: 0; }

.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li a { display: block; padding: 10px 0; border-bottom: 1px solid var(--paper); text-decoration: none; }
.alerts li:last-child a { border-bottom: 0; }
.alerts b { display: block; font-weight: 600; }
.alerts span { display: block; font-size: 14px; color: var(--ink-2); }
.alerts span.late { color: var(--late); font-weight: 600; }

.docs { list-style: none; margin: 0; padding: 0; }
.doc { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px 12px 16px; margin-bottom: 8px; background: var(--surface); border-radius: 12px; text-decoration: none; box-shadow: 0 1px 1.5px rgba(18, 28, 43, .1); border-left: 4px solid var(--kc, var(--line)); }
.doc.off { opacity: .55; }
.doc-k { font-weight: 600; font-size: 14.5px; }
.doc-m { grid-column: 2; grid-row: 1; font-size: 13px; color: var(--ink-2); text-align: right; }
.doc-r { grid-column: 1 / -1; font-size: 14px; }
.doc-s { grid-column: 1 / -1; font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc:has(.k-receipt) { --kc: #2F6FDE; } .doc:has(.k-issue) { --kc: #8B4FD9; } .doc:has(.k-deliver) { --kc: var(--accent); }
.doc:has(.k-return) { --kc: #0E9F8A; } .doc:has(.k-sale) { --kc: var(--ink-3); } .doc:has(.k-writeoff) { --kc: var(--late); }
.doc:has(.k-inventory) { --kc: #A16207; } .doc:has(.k-order) { --kc: #3D5A80; } .doc:has(.k-transfer) { --kc: #55637A; }

.lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto 40px; gap: 6px; align-items: center; }
.line:has(input[data-key="price"]) { grid-template-columns: minmax(0, 1fr) 84px auto 84px 40px; }
.line select, .line input { min-height: 46px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
.line input { text-align: right; font-variant-numeric: tabular-nums; }
.line .u { color: var(--ink-2); }
@media (max-width: 520px) {
  .line, .line:has(input[data-key="price"]) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
  .line select[data-key="ingredient_id"] { grid-column: 1 / 3; }
  .line .icon-btn { grid-row: 1; grid-column: 3; }
}
.chooser { list-style: none; margin: 0; padding: 0; }
.chooser a { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--paper); text-decoration: none; }
.chooser .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--paper); display: grid; place-items: center; flex: none; }
.chooser .ico svg { width: 22px; height: 22px; }
.chooser b { display: block; font-weight: 600; }
.chooser small { color: var(--ink-2); font-size: 13.5px; }

.rep { padding: 0; overflow: hidden; }
.rep-h { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; border: 0; background: none; text-align: left; flex-wrap: wrap; }
.rep-h b { font-weight: 600; font-size: 16px; }
.rep-h .grow { flex: 1; }
.rep-h small { color: var(--ink-2); font-size: 13.5px; }
.rep > .scroll { margin: 0; padding: 0 16px 6px; }
.rep > .hint { padding: 0 16px; }
.pill.ok { color: var(--ok); } .pill.ok::before { background: var(--ok); }
.chart { width: 100%; height: auto; display: block; margin: 6px 0; }
.chart rect.a { fill: var(--ink); } .chart rect.a.we { fill: #3D4B60; }
.chart rect.t { fill: var(--accent); }
.chart rect.f { fill: color-mix(in srgb, var(--accent) 38%, var(--surface)); }
.chart .now { stroke: var(--ink-2); stroke-dasharray: 3 3; }
.chart .lbl { font-size: 11px; fill: var(--ink-2); }
.fc td { white-space: nowrap; }
.link-row { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.link-row svg { width: 22px; height: 22px; color: var(--ink-2); flex: none; }
.person-row { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.rows a.grow { text-decoration: none; }
.rows.log li { min-height: 0; }
.rows.log small { white-space: normal; overflow-wrap: anywhere; }
.wrap-gap { flex-wrap: wrap; gap: 8px; }
.wrap-gap .btn { flex: 0 0 auto; }
.desc { white-space: pre-wrap; margin: 12px 0; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  .scroll { margin: 0; padding: 0; }
}

.nav .fab, .nav .fab:hover { color: var(--on-accent); }

/* ---------- главная: 5 плиток, маржа: 6 ---------- */
.kpis.k5 > .kpi:first-child { grid-column: span 2; }
@media (min-width: 700px) {
  .kpis.k5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kpis.k5 > .kpi { grid-column: span 2; }
  .kpis.k5 > .kpi:nth-child(-n+2) { grid-column: span 3; }
  .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .kpis.k5 > .kpi, .kpis.k5 > .kpi:nth-child(-n+2) { grid-column: auto; }
  .kpis.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.kpi b { white-space: nowrap; font-size: clamp(20px, 2.4vw, 28px); }

/* ---------- расходы ---------- */
.page-act { display: flex; margin-bottom: 12px; }
.page-act .btn { flex: 1; }
@media (min-width: 700px) { .page-act .btn { flex: 0 0 auto; } }
.filters > * { flex: none; }
@media (min-width: 900px) { .filters.wrap { flex-wrap: wrap; overflow: visible; } }
.dot-c { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; vertical-align: -1px; }
.dot-c.no { background: var(--late); box-shadow: 0 0 0 3px color-mix(in srgb, var(--late) 18%, transparent); }
.dot-c.yes { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.exps li { padding: 0; }
.exp { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 11px 0; text-decoration: none; }
.exp .dot-c { margin-top: 6px; }
.exp small svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.exp-c { display: block; font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-sum { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.exp-state { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 14px; }
.exp-cat-in { margin-top: 10px; }
.file a { position: absolute; inset: 0; }
.file-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(18, 28, 43, .7); color: #fff; display: grid; place-items: center; padding: 0; }
.file-x svg { width: 14px; height: 14px; }
.kpi b.ok { color: var(--ok); }

/* ---------- задачи ---------- */
.todos { list-style: none; margin: 0; padding: 0; }
.todo { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; }
.todo .grow { flex: 1; min-width: 0; }
.todo b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.todo small { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.todo-n { display: block; font-size: 13.5px; color: var(--ink-2); margin-top: 4px; white-space: pre-wrap; }
.todo-ck { flex: none; width: 28px; height: 28px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--ink-3); background: var(--surface); color: #fff; display: grid; place-items: center; padding: 0; transition: background-color .15s ease, border-color .15s ease, transform .12s var(--ease); }
.todo-ck:hover { border-color: var(--ok); }
.todo-ck:active { transform: scale(.9); }
.todo-ck svg { width: 16px; height: 16px; }
.todo.done .todo-ck { background: var(--ok); border-color: var(--ok); }
.todo.done b { color: var(--ink-3); text-decoration: line-through; }
.todo.late .todo-ck { border-color: var(--late); }
.card.todo-late > h2 { color: var(--late); }
.card > h2 .n { font-size: 15px; color: var(--ink-3); font-weight: 600; }

/* ---------- продажи ---------- */
.kpi small { font-size: 12.5px; color: var(--ink-2); }
.kpi small.ok { color: var(--ok); } .kpi small.late { color: var(--late); }
.sales-t th { width: 55%; }
.sales-t th .link { font-weight: 600; text-decoration: none; text-align: left; }
.sbar { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--wash); overflow: hidden; }
.sbar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

/* ---------- фотоотчёты ---------- */
.pday-strip { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px; scrollbar-width: none; }
.pday-strip::-webkit-scrollbar { display: none; }
.pday { flex: none; width: 58px; padding: 8px 0; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); }
.pday span { font-size: 12px; color: var(--ink-2); }
.pday b { font: 700 18px/1 var(--display); }
.pday em { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 8px; }
.pday em.bad { background: color-mix(in srgb, var(--late) 14%, transparent); color: var(--late); }
.pday em.okk { color: var(--ok); }
.pday.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.pgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pgrid .card { margin: 0; }
.pcard.miss { border-color: color-mix(in srgb, var(--late) 45%, transparent); background: color-mix(in srgb, var(--late) 5%, var(--surface)); }
.pcard.off { opacity: .6; }
.pcard-h b { display: block; font-weight: 700; }
.pcard-h small { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.pthumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.pthumbs a { position: relative; display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--wash); }
.pthumbs img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s var(--ease); }
.pthumbs a:hover img { transform: scale(1.05); }
.pthumbs i { position: absolute; left: 4px; bottom: 4px; font-style: normal; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; }
@media (min-width: 900px) { .pday-strip { margin: 0 0 14px; padding: 2px 0; } }

/* ---------- инструкции ---------- */
.help summary { cursor: pointer; font: 700 19px/1.2 var(--display); letter-spacing: -.02em; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.help summary::-webkit-details-marker { display: none; }
.help summary::after { content: '›'; font-size: 24px; color: var(--ink-3); transition: transform .25s var(--ease); }
.help[open] summary::after { transform: rotate(90deg); }
.help-b { margin-top: 12px; font-size: 15px; line-height: 1.55; }
.help-b ol, .help-b ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.help[open] .help-b { animation: up .3s var(--ease) both; }

/* ---------- накладные ---------- */
.inv-up { margin-bottom: 14px; padding: 14px; border-radius: 14px; border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.inv-up .btn { white-space: normal; }
.inv-up small { margin: 8px 0 0; }
.inv-t { font: 700 17px/1.2 var(--display); margin: 16px 0 8px; }
.inv-ls { display: grid; gap: 8px; }
.inv-l { padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.inv-l.off { opacity: .6; }
.inv-n b { display: block; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.inv-n small { display: block; color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.inv-e { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; align-items: end; }
.inv-e select { grid-column: 1 / -1; min-height: 44px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.inv-f { display: block; position: relative; }
.inv-f span { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-f input { width: 100%; min-height: 42px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.inv-f em { position: absolute; right: 8px; bottom: 11px; font-style: normal; font-size: 12px; color: var(--ink-3); pointer-events: none; }
.inv-f:has(em:not(:empty)) input { padding-right: 34px; }
.inv-skip { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.inv-h { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); }
.inv-done { margin-top: 6px; font-size: 13.5px; color: var(--ok); font-weight: 600; }
.inv-sum { margin: 12px 0; font-size: 15px; }
.inv-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 10px; }
.inv-bar i { display: block; height: 100%; width: 35%; border-radius: 2px; background: var(--accent); animation: invbar 1.4s ease-in-out infinite; }
@keyframes invbar { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.files .file:not(.file-add) { box-shadow: 0 0 0 1px var(--line); }
.sheet-f:has([data-act="inv-post"]) { flex-wrap: wrap; }
.sheet-f [data-act="inv-post"] { flex: 1 1 100%; order: -1; }
@media (min-width: 900px) { .sheet-f [data-act="inv-post"] { flex: 1 1 auto; order: 0; } }

/* ---------- маржинальность ---------- */
.mg { padding: 6px 16px; }
.mg-t { min-width: 720px; }
.mg-t th { white-space: nowrap; }
.mg-t th.n, .mg-t td.n { text-align: right; }
.mg-t td:first-child { text-align: left; white-space: normal; padding-left: 0; min-width: 200px; }
.mg-t tr.off td { color: var(--ink-3); }
.mg-name { border: 0; background: none; padding: 0; font-weight: 600; text-align: left; color: var(--ink); }
.mg-name::after { content: ' ▾'; color: var(--ink-3); font-size: 12px; }
.mg-name[aria-expanded="true"]::after { content: ' ▴'; }
.mg-parts { list-style: none; margin: 6px 0 2px; padding: 6px 10px; border-radius: 10px; background: var(--wash); font-size: 13.5px; }
.mg-parts li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.mg-parts li b { font-weight: 600; }
.mg-pct { display: inline-block; min-width: 54px; padding: 2px 8px; border-radius: 8px; font-weight: 700; }
.mg-pct.good { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.mg-pct.warn { background: color-mix(in srgb, #F59E0B 20%, transparent); color: #A16207; }
.mg-pct.bad { background: color-mix(in srgb, var(--late) 14%, transparent); color: var(--late); }

/* ---------- оборудование ---------- */
.eq { margin-bottom: 8px; }
.eq .rep-h { align-items: center; flex-wrap: nowrap; }
.eq .rep-h .grow { min-width: 0; }
.eq .rep-h b { display: block; }
.eq .rep-h small { display: block; }
.eq .pill { flex: none; background: var(--paper); }
.eq-body { padding: 0 16px 14px; }
.eq-dev { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.eq-dev li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--wash); font-size: 14px; }
.eq-dev li span { color: var(--ink-2); }
.eq-dev li b { font-weight: 600; text-align: right; }
.eq-dev li.bad { background: color-mix(in srgb, var(--late) 12%, var(--surface)); }
.eq-dev li.bad b { color: var(--late); }
.eq-ev { list-style: none; margin: 0 0 10px; padding: 0; font-size: 14px; }
.eq-ev li { padding: 6px 0; border-bottom: 1px solid var(--paper); overflow-wrap: anywhere; }
.eq-ev time { color: var(--ink-3); font-variant-numeric: tabular-nums; margin-right: 4px; }
.eq-raw summary { cursor: pointer; font-size: 14px; color: var(--ink-2); padding: 6px 0; }
.eq-raw dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 6px 0 0; font-size: 13.5px; }
.eq-raw dt { color: var(--ink-2); }
.eq-raw dd { margin: 0; overflow-wrap: anywhere; }

/* ================= оформление: шрифты, светлая и тёмная тема, анимации ================= */
:root {
  --paper: #F4F6F8;
  --surface: #FFFFFF;
  --ink: #15171C;
  --ink-2: #5E6673;
  --ink-3: #98A0AC;
  --line: #E3E7EC;
  --wash: #F2F4F7;
  --seg: #E9ECF0;
  --tile: #F5F7FA;
  --on-ink: #FFFFFF;
  --rail: #FFFFFF;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-up: 0 2px 4px rgba(16, 24, 40, .06), 0 14px 32px rgba(16, 24, 40, .12);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: 'Manrope', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 18px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0F1115;
  --surface: #181B21;
  --ink: #ECEFF3;
  --ink-2: #A3ABB8;
  --ink-3: #6E7683;
  --line: #2A2F38;
  --wash: #20242B;
  --seg: #23272F;
  --tile: #1E2228;
  --on-ink: #0F1115;
  --rail: #14171C;
  --late: #FF6B5A;
  --ok: #34C77B;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-up: 0 10px 28px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
body { font-family: var(--body); letter-spacing: -.006em; transition: background-color .25s ease, color .25s ease; }
.top h1, .card > h2, .sec, .sheet-h h2, .dlg h2, .gate h1, .place-h h2, .kpi b, .empty b, .block-h, .group-h h2, .col-h h2, .p-done b, .stub b { font-family: var(--display); letter-spacing: -.02em; }
.top h1 { font-weight: 800; }
.card > h2 { font-size: 19px; font-weight: 700; }
.kpi b { font-weight: 800; }

/* кнопки, поля, переключатели */
.btn { color: var(--on-ink); border-radius: 14px; transition: transform .15s var(--ease), box-shadow .2s ease, background-color .2s ease, opacity .2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16, 24, 40, .14); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
.btn.ghost { color: var(--ink); background: var(--surface); }
.btn.accent { box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.chip { transition: background-color .15s ease, border-color .15s ease, transform .12s var(--ease); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { color: var(--on-ink); }
.seg { background: var(--seg); border-radius: 14px; }
.seg button { border-radius: 11px; transition: background-color .2s ease, color .2s ease; }
.seg button[aria-pressed="true"] { box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.input, .field input:not([type=checkbox]):not([type=color]), .field select, .field textarea, .filters select, .filters input, .line select, .line input, .qty input, .add-line input, .add-line select { background: var(--surface); border-color: var(--line); color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.toast { color: var(--on-ink); border-radius: 14px; }

/* карточки и плитки — светлые, с мягкой тенью, приподнимаются под курсором */
.card { border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.kpi { border-left: 0; border-radius: var(--r); background: var(--tile); box-shadow: none; border: 1px solid transparent; transition: transform .2s var(--ease), box-shadow .2s ease, background-color .2s ease; }
a.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); background: var(--surface); }
.kpi.bad { background: color-mix(in srgb, var(--late) 10%, var(--tile)); }
.kpi.warn { background: color-mix(in srgb, var(--accent) 16%, var(--tile)); }
.doc { border-radius: 14px; box-shadow: var(--shadow); transition: transform .18s var(--ease), box-shadow .18s ease; }
.doc:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); }
.note { border-radius: 14px; }
.empty { border-radius: 14px; }
.rows li, .alerts li a, .tbl th, .tbl td, .eq-ev li, .chooser a, .checks li { border-color: var(--line); }
.sheet { background: var(--paper); }
.sheet-f { background: var(--surface); border-color: var(--line); }
.dlg { background: var(--surface); }
.nav { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-color: var(--line); }
.fab { border-color: var(--paper); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .2s var(--ease); }
.fab:active { transform: scale(.94); }
.pill { background: var(--wash); }
.mg-parts, .eq-dev li { background: var(--wash); }

/* меню слева — светлое, как на profi.ru */
@media (min-width: 900px) {
  .rail { background: var(--rail); color: var(--ink); border-right: 1px solid var(--line); gap: 2px; }
  .rail a { color: var(--ink-2); border-radius: 12px; transition: background-color .15s ease, color .15s ease; }
  .rail a:hover { background: var(--wash); color: var(--ink); }
  .rail a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
  .rail a[aria-current="page"] svg { color: var(--accent); }
  .rail a[aria-current="page"]::before { left: -14px; }
  .rail .btn.accent { color: var(--on-accent); }
  .rail-me { border-top-color: var(--line); color: var(--ink); }
  .rail-me span { color: var(--ink-2); }
  .rail-mark .logo { width: 38px; height: 38px; }
  .rail-mark b { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
}
.theme-btn { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; margin-top: 6px; border: 0; border-radius: 12px; background: var(--wash); color: var(--ink-2); font-size: 14px; font-weight: 500; text-align: left; }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn b { margin-left: auto; color: var(--ink); font-weight: 600; }
.theme-btn:hover { color: var(--ink); }
@media (max-width: 899px) { .theme-btn { display: none; } }

/* вход */
.gate { background: radial-gradient(1200px 600px at 10% -10%, #1C9E5E 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #0E7444 0%, transparent 55%), #0E1512; }
.gate-mark .logo { width: 52px; height: 52px; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .3)); }
.gate-mark b { font-family: var(--display); letter-spacing: -.02em; }
.gate form { background: var(--surface); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: rise .5s var(--ease) both; }

/* логотип: пар над стаканом */
.logo-steam { animation: steam 3.2s ease-in-out infinite; transform-origin: 25px 9px; }
@keyframes steam { 0%, 100% { opacity: .45; transform: translateY(1px); } 50% { opacity: 1; transform: translateY(-1.2px); } }

/* аватар владельца — зелёный с короной */
.ava { position: relative; }
.ava.owner { background: #16A05D; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px #16A05D; }
.ava .crown { position: absolute; left: 50%; top: calc(var(--s) * -.42); width: calc(var(--s) * .62); height: calc(var(--s) * .42); transform: translateX(-50%) rotate(-8deg); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.rail-me { padding-top: 16px; }

/* сворачиваемые карточки на главной */
.fold-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; user-select: none; margin: -4px -6px 4px; padding: 4px 42px 4px 6px; border-radius: 10px; position: relative; transition: background-color .15s ease; }
.fold-h:hover { background: var(--wash); }
.fold-ic { position: absolute; right: 6px; top: 50%; width: 30px; height: 30px; margin-top: -15px; border-radius: 50%; background: var(--wash); display: grid; place-items: center; color: var(--ink-2); transition: transform .3s var(--ease); }
.fold-ic svg { width: 18px; height: 18px; }
.card.folded .fold-ic { transform: rotate(-90deg); }
.card.folded > :not(h2) { display: none !important; }
.card.folded > h2 { margin-bottom: -4px; }
.card.unfold > :not(h2) { animation: up .35s var(--ease) both; }
.fold-h .pill { height: 24px; font-size: 12px; }

/* появление экрана: карточки по очереди поднимаются */
@keyframes up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.shell.enter #view .kpi, .shell.enter #view .card, .shell.enter #view .note, .shell.enter #view .doc, .shell.enter #view .quick .btn { animation: up .5s var(--ease) both; }
.shell.enter #view .kpi:nth-child(2), .shell.enter #view .two > :nth-child(2) { animation-delay: .04s; }
.shell.enter #view .kpi:nth-child(3), .shell.enter #view .two > :nth-child(3) { animation-delay: .08s; }
.shell.enter #view .kpi:nth-child(4), .shell.enter #view .two > :nth-child(4) { animation-delay: .12s; }
.shell.enter #view .kpi:nth-child(5), .shell.enter #view .two > :nth-child(5) { animation-delay: .16s; }
.shell.enter #view .kpi:nth-child(6), .shell.enter #view .two > :nth-child(6) { animation-delay: .2s; }
.shell.enter #view .two > :nth-child(n+7) { animation-delay: .24s; }
.shell.enter .top h1 { animation: up .45s var(--ease) both; }

/* тёмная тема: точечные исправления */
:root[data-theme="dark"] .chart rect.a { fill: #C9CED6; }
:root[data-theme="dark"] .chart rect.a.we { fill: #8C939E; }
:root[data-theme="dark"] .scrim, :root[data-theme="dark"] .dlg-scrim { background: rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .file-add { border-color: var(--ink-3); }
:root[data-theme="dark"] .mg-pct.warn { color: #F5B84B; }
:root[data-theme="dark"] img { opacity: .94; }

/* календарь смен */
.sh-top .dcal-nav { margin-bottom: 10px; }
.sh-modes { margin: 4px 0 6px; }
.sh-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sh-h .grow { display: flex; flex-direction: column; min-width: 0; }
.sh-h b { font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.sh-h small { color: var(--ink-2); font-size: 13px; }
.sh-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.sh-stats span { padding: 4px 10px; border-radius: 999px; background: var(--wash); font-size: 13px; color: var(--ink-2); }
.sh-stats b { color: var(--ink); font-weight: 700; }
.sh-stats .bad { background: color-mix(in srgb, var(--late, #D93A2B) 12%, var(--surface)); color: var(--late, #D93A2B); }
.sh-stats .bad b { color: var(--late, #D93A2B); }
.sh-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sh-w { text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 2px; }
.sh-d { position: relative; aspect-ratio: 1 / 1; min-height: 40px; border: 0; border-radius: 12px; background: var(--wash); color: var(--ink); font: 600 15px/1 var(--body); display: grid; place-items: center; cursor: pointer; transition: transform .12s var(--ease), background-color .15s ease, box-shadow .15s ease; -webkit-tap-highlight-color: transparent; }
.sh-d:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.sh-d:active { transform: scale(.94); }
.sh-d.we:not(.plan):not(.done):not(.miss):not(.extra) { color: var(--ink-3); }
.sh-d.past:not(.plan):not(.done):not(.miss):not(.extra) { opacity: .55; }
.sh-d.plan { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); color: var(--ink); }
.sh-d.done { background: var(--ok, #2F8F6B); color: #fff; }
.sh-d.extra { background: var(--ok, #2F8F6B); color: #fff; box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 2px var(--ok, #2F8F6B); }
.sh-d.miss { background: color-mix(in srgb, var(--late, #D93A2B) 14%, var(--surface)); color: var(--late, #D93A2B); }
.sh-d.today { box-shadow: 0 0 0 2px var(--ink); }
.sh-d i { position: absolute; right: 5px; top: 3px; font-style: normal; font-size: 11px; font-weight: 800; opacity: .9; }
.sh-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.sh-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sh-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sh-legend i.done { background: var(--ok, #2F8F6B); }
.sh-legend i.plan { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.sh-legend i.miss { background: color-mix(in srgb, var(--late, #D93A2B) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--late, #D93A2B) 40%, transparent); }
.sh-legend i.extra { background: var(--ok, #2F8F6B); box-shadow: inset 0 0 0 2px var(--surface); outline: 2px solid var(--ok, #2F8F6B); outline-offset: -1px; }
@media (max-width: 420px) { .sh-g { gap: 4px; } .sh-d { border-radius: 10px; font-size: 14px; } }

/* главная техника — спокойное оформление: белые блоки, один акцент */
.t-home { display: flex; flex-direction: column; gap: 12px; }
.t-home > .card { margin: 0; }
.t-hello { padding: 4px 4px 2px; }
.t-hello small { display: block; font-size: 13px; color: var(--ink-2); }
.t-hello h2 { margin: 4px 0 0; font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.025em; color: var(--ink); }
.t-prog { background: var(--surface); border-radius: 18px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.t-prog > div:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.t-prog span { font-size: 14px; color: var(--ink-2); }
.t-prog b { font-size: 16px; font-weight: 700; color: var(--ink); }
.t-prog b i { font-style: normal; font-weight: 500; color: var(--ink-3); }
.t-bar { height: 6px; border-radius: 4px; background: var(--wash); margin-top: 10px; overflow: hidden; }
.t-bar span { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .5s var(--ease); }
.t-cta { width: 100%; min-height: 56px; border: 0; border-radius: 16px; background: var(--accent); color: var(--on-accent, #fff); font: 600 17px/1.2 var(--body); display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; transition: transform .15s var(--ease), filter .15s ease; }
.t-cta svg { width: 22px; height: 22px; }
.t-cta:hover { filter: brightness(1.05); }
.t-cta:active { transform: scale(.98); }
.t-list { background: var(--surface); border-radius: 18px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.t-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--ink); text-decoration: none; font-size: 16px; border-bottom: 1px solid var(--line); transition: background-color .15s ease; }
.t-item:last-child { border-bottom: 0; }
.t-item:hover, .t-item:active { background: var(--wash); }
.t-item > svg:first-child { width: 21px; height: 21px; color: var(--ink-2); }
.t-item span { flex: 1; }
.t-item > svg:last-child { width: 18px; height: 18px; color: var(--ink-3); transform: rotate(-90deg); }

/* маршрут на сегодня (выбор точки) */
.rt-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px; }
.rt-h h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.rt-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--wash); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.rt-x svg { width: 18px; height: 18px; }
.rt-hint { margin: 6px 4px 12px; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.rt-sec { margin: 18px 4px 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rt-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 18px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.card .rt-list { border-color: var(--line); }
.rt-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.rt-row:last-child { border-bottom: 0; }
.rt-row.next { box-shadow: inset 3px 0 0 var(--accent); }
.rt-n { flex: none; width: 26px; text-align: center; font-size: 15px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rt-row.next .rt-n { color: var(--accent); }
.rt-n.ok { color: var(--ok, #16A05D); display: grid; place-items: center; }
.rt-n.ok svg { width: 20px; height: 20px; }
.rt-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rt-m b { font-size: 16px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.rt-m small { font-size: 13px; color: var(--ink-2); }
.rt-row.done .rt-m b { color: var(--ink-2); font-weight: 500; }
.rt-row.done .rt-m small { color: var(--ink-3); }
.rt-next { color: var(--accent); font-weight: 600; }
.rt-cl { color: #B45309; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.rt-cl svg { width: 14px; height: 14px; }
:root[data-theme="dark"] .rt-cl { color: #F5B84B; }
.rt-ok { color: var(--ok, #16A05D); font-weight: 600; }
.rt-btn { flex: none; min-height: 36px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 14px/1 var(--body); cursor: pointer; transition: transform .12s var(--ease), background-color .15s ease; }
.rt-btn:active { transform: scale(.96); }
.rt-btn.main { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.rt-row.done .rt-btn { color: var(--ink-3); border-color: transparent; background: var(--wash); }
.rt-closed { margin-top: 14px; }
.rt-closed summary { cursor: pointer; padding: 6px 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rt-closed .rt-list { margin-top: 6px; opacity: .75; }

/* меню слева: своя прокрутка, если пункты не влезают по высоте; на невысоких экранах — компактнее */
@media (min-width: 900px) {
  .rail { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .rail > * { flex-shrink: 0; }
  .rail::-webkit-scrollbar { width: 6px; }
  .rail::-webkit-scrollbar-track { background: transparent; }
  .rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
  .rail:hover::-webkit-scrollbar-thumb { background: var(--ink-3); }
}
/* ---------- настройки: разделы слева, одна аккуратная колонка карточек справа ---------- */
.set-wrap { display: grid; gap: 16px; align-items: start; }
.set-nav { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.set-nav::-webkit-scrollbar { display: none; }
.set-nav button { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink-2); text-align: left; transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, border-color .15s ease; }
.set-nav button:hover { color: var(--ink); background: var(--wash); }
.set-nav button[aria-pressed="true"] { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.set-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--wash); color: var(--ink-2); transition: background-color .15s ease, color .15s ease; }
.set-ic svg { width: 18px; height: 18px; }
.set-nav button[aria-pressed="true"] .set-ic { background: var(--accent); color: var(--on-accent, #fff); }
.set-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.set-tx b { font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.set-tx small { display: none; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-body { min-width: 0; }
.set-sec:not([hidden]) { animation: up .3s var(--ease) both; }
.set-sec-h { margin: 2px 2px 16px; }
.set-sec-h h2 { font: 800 26px/1.1 var(--display); letter-spacing: -.02em; }
.set-sec-h p { margin-top: 6px; color: var(--ink-2); font-size: 14.5px; max-width: 60ch; }
.set-sec .card { padding: 20px 22px; margin-bottom: 14px; }
.set-sec .card > h2 { font-size: 18px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.set-sec .card > p { font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
.set-sec .card .note { font-size: 14px; }
.set-sec .block-h { font-size: 16px; margin: 18px 0 6px; padding-top: 16px; border-top: 1px dashed var(--line); }
.set-sec .card .hint { font-size: 13.5px; line-height: 1.5; }
.set-sec .card p > .btn, .set-sec .card .actions { margin-top: 2px; }
.set-sec .card .actions { margin-bottom: 4px; }
.set-sec .field { margin-bottom: 14px; }
.set-sec .row.wrap-gap { margin-top: 6px; }
.set-sec .rows { margin-bottom: 14px; }
.set-sec .rows li { padding: 12px 0; }
.set-sec .rows li:last-child { border-bottom: 0; }
@media (min-width: 900px) {
  .set-wrap { grid-template-columns: 250px minmax(0, 780px); gap: 28px; }
  .set-nav { flex-direction: column; gap: 4px; margin: 0; padding: 8px; overflow: visible; position: sticky; top: 16px; background: var(--surface); border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); box-shadow: var(--shadow); }
  .set-nav button { width: 100%; padding: 8px 10px; border: 0; background: transparent; border-radius: 12px; }
  .set-nav button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .set-tx small { display: block; }
  .set-sec-h { margin-top: 6px; }
}

@media (min-width: 900px) and (max-height: 900px) {
  .rail { padding: 14px 14px 12px; }
  .rail-mark { padding-bottom: 10px; }
  .rail-mark .logo, .rail-mark svg { width: 32px; height: 32px; }
  .rail-mark b { font-size: 19px; }
  .rail a { min-height: 38px; font-size: 14.5px; }
  .rail a svg { width: 20px; height: 20px; }
  .rail a[aria-current="page"]::before { top: 7px; bottom: 7px; }
  .rail .btn { margin: 8px 0 6px; min-height: 42px; }
  .theme-btn { min-height: 36px; margin-top: 4px; }
  .rail-me { padding-top: 10px; }
}
