/* Склад. Общая основа с задачником (шрифты, каркас), своё — таблицы-накладные с цифрами по правому краю. */
: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; }
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); }

/* ---------- оборудование ---------- */
.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; }
