/* Контроль запусков. Палитра взята из ресторана: льняная скатерть, фарфор, бутылочное стекло;
   статусы — шафран, баклажан, морская вода, базилик, томат. */

@font-face { font-family: "Onest"; src: url("fonts/onest-cyrillic-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; src: url("fonts/onest-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Forum"; src: url("fonts/forum-cyrillic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Forum"; src: url("fonts/forum-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --linen: #F1F3F2; --porcelain: #FFFFFF; --ink: #16212B; --steel: #5F6C78; --line: #D6DCDA; --line-soft: #E8ECEA;
  --bottle: #1D4A3C; --bottle-deep: #133428; --bottle-wash: #E3EDE8;
  --ash: #9AA4AC; --saffron: #B97A12; --aubergine: #6B3E72; --sea: #2A6A8C; --basil: #2E7D4E; --tomato: #BF3B2C;
  --saffron-wash: #F7ECD8; --aubergine-wash: #F0E6F2; --tomato-wash: #F9E5E1;
  --text: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Forum", "Times New Roman", Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--linen); color: var(--ink); font: 400 15px/1.45 var(--text); font-variant-numeric: tabular-nums; }
body.locked { overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--bottle); }
h1, h2, h3, p { margin: 0; }
h1 { font: 400 38px/1.1 var(--display); letter-spacing: 0.005em; }
h2 { font: 400 24px/1.2 var(--display); }
h3 { font: 600 14px/1.3 var(--text); }
small { font-size: 13px; color: var(--steel); }
code { font: inherit; font-weight: 600; background: var(--porcelain); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; border-radius: 4px; }

.boot { padding: 48px 24px; color: var(--steel); }
.empty { color: var(--steel); padding: 14px 0; }
.hint { color: var(--steel); font-size: 14px; max-width: 76ch; margin: 4px 0 12px; }
.err { color: var(--tomato); font-size: 14px; min-height: 0; }
.err:empty { display: none; }
.late { color: var(--tomato); }
.warn { color: var(--saffron); }

/* статусы: один цвет на статус во всех местах */
.st-not_started { --c: var(--ash); } .st-in_progress { --c: var(--saffron); } .st-on_approval { --c: var(--aubergine); }
.st-approved { --c: var(--sea); } .st-done { --c: var(--basil); } .st-not_required { --c: #C9CFD3; } .st-empty { --c: var(--line); }

/* кнопки и поля */
.btn { font: 500 14px/1 var(--text); padding: 10px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--porcelain); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; }
.btn:hover { border-color: var(--steel); }
.btn.primary { background: var(--bottle); border-color: var(--bottle); color: #fff; }
.btn.primary:hover { background: var(--bottle-deep); }
.btn.quiet { border-color: transparent; background: none; color: var(--steel); }
.btn.quiet:hover { color: var(--ink); text-decoration: underline; }
.btn:disabled { opacity: .5; cursor: default; }
.link { font: inherit; font-size: 14px; background: none; border: 0; padding: 0; color: var(--bottle); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--bottle) 35%, transparent); }
.link:hover { text-decoration-color: currentColor; }
.link.danger { color: var(--tomato); text-decoration-color: color-mix(in srgb, var(--tomato) 35%, transparent); }
input[type=text], input[type=password], input[type=date], input[type=search], input:not([type]), select, textarea {
  font: 400 15px/1.3 var(--text); color: var(--ink); background: var(--porcelain); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; width: 100%; min-width: 0; }
textarea { resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--linen); color: var(--ink); opacity: 1; -webkit-text-fill-color: var(--ink); border-color: var(--line-soft); }
input.missing, select.missing, textarea.missing { border-color: var(--tomato); background: var(--tomato-wash); }
.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.fld > span, .fld-title { font-size: 13px; font-weight: 500; color: var(--steel); }
.fld-title { margin: 6px 0 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; margin: 2px 0 10px; }
.check input { width: 17px; height: 17px; accent-color: var(--bottle); margin: 0; flex: none; }
.badge { display: inline-block; min-width: 20px; padding: 2px 6px; margin-left: 6px; border-radius: 10px; background: var(--aubergine); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.3; text-align: center; }
.count { font: 400 14px var(--text); color: var(--steel); margin-left: 10px; }

/* вход */
.auth { max-width: 440px; margin: 0 auto; padding: 9vh 24px 48px; }
.auth .brand { font: 400 46px/1.05 var(--display); color: var(--bottle); }
.auth .lead { color: var(--steel); margin: 12px 0 28px; }
.auth form { background: var(--porcelain); border: 1px solid var(--line); border-radius: 10px; padding: 22px 22px 24px; }
.auth form .btn { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.demo { margin-top: 28px; }
.demo p { font-size: 14px; color: var(--steel); margin-bottom: 10px; }
.demo-user { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; font: inherit; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 2px; cursor: pointer; color: var(--ink); }
.demo-user:hover b { color: var(--bottle); text-decoration: underline; }
.demo-user span { color: var(--steel); font-size: 13px; text-align: right; }

/* шапка */
.top { background: var(--porcelain); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 28px; padding: 0 24px; min-height: 58px; position: sticky; top: 0; z-index: 5; }
.top .brand { font: 400 25px/1 var(--display); color: var(--bottle); text-decoration: none; white-space: nowrap; }
.top nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.top nav a { padding: 19px 10px 17px; color: var(--steel); text-decoration: none; font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.top nav a:hover { color: var(--ink); }
.top nav a.on { color: var(--ink); border-bottom-color: var(--bottle); }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; font-weight: 500; font-size: 14px; padding: 8px 0; white-space: nowrap; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary::after { content: ""; display: inline-block; width: 7px; height: 7px; border-right: 1.5px solid var(--steel); border-bottom: 1.5px solid var(--steel); transform: rotate(45deg); margin: 0 2px 3px 9px; }
.menu { position: absolute; right: 0; top: 100%; background: var(--porcelain); border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-width: 210px; box-shadow: 0 12px 32px rgba(22, 33, 43, .14); display: flex; flex-direction: column; }
.menu p { font-size: 13px; color: var(--steel); padding: 6px 10px 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu a, .menu button { font: inherit; font-size: 14px; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 5px; color: var(--ink); text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--linen); }

/* страница */
.page { max-width: 1480px; margin: 0 auto; padding: 30px 24px 80px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 18px; }
.toolbar input[type=search] { width: 260px; }
.toolbar select { width: auto; max-width: 240px; }
.toolbar .check { margin: 0; }
.group { margin: 0 0 34px; }
.group > h2 { margin-bottom: 4px; }
.group > h3 { margin: 22px 0 10px; }

/* кнопки статусов: число и название, нажатие фильтрует чек-лист */
.statbtns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 20px 0 8px; }
.statbtn { font: inherit; text-align: left; background: var(--porcelain); border: 1px solid var(--line); border-bottom: 3px solid var(--c); border-radius: 8px; padding: 12px 14px 11px; cursor: pointer; color: var(--ink); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.statbtn b { font: 400 34px/1 var(--display); }
.statbtn span { font-size: 13px; color: var(--steel); display: flex; align-items: center; gap: 7px; }
.statbtn:hover { border-color: var(--steel); border-bottom-color: var(--c); }
.statbtn.on { background: var(--ink); border-color: var(--ink); border-bottom-color: var(--c); color: #fff; }
.statbtn.on span { color: #D5DBDF; }
.statbtn i, .stmark i, .path i, .statline i { width: 9px; height: 9px; border-radius: 2px; background: var(--c); flex: none; display: inline-block; }
.statline { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.statline span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.stmark { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; white-space: nowrap; }

/* проекты */
.proj { background: var(--porcelain); border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px 10px; margin-bottom: 18px; }
.proj.off { opacity: .7; }
.proj-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 12px; }
.proj-head h2 { font-size: 30px; }
.proj-head p { color: var(--steel); flex: 1; }
.blockline { display: grid; grid-template-columns: 150px minmax(120px, 1fr) 230px auto; align-items: center; gap: 6px 20px; padding: 14px 0; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.blockline:hover b { color: var(--bottle); text-decoration: underline; }
.bl-ready { color: var(--steel); font-size: 14px; }
.bl-open { justify-self: end; }
.ver { color: var(--ash); font-size: 12px; text-align: center; padding: 18px 0 26px; margin: 0; }
.bl-flags { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.bl-flags:empty { display: none; }
.flag.late { color: var(--tomato); font-weight: 500; } .flag.wait { color: var(--aubergine); font-weight: 500; }
.archive { margin-top: 26px; } .archive summary { cursor: pointer; color: var(--steel); margin-bottom: 12px; }

/* шапка блока */
.blockhead { margin-bottom: 8px; }
.crumb { font-size: 14px; color: var(--steel); }
.blockhead h1 { margin: 6px 0 4px; }
.opening { color: var(--steel); }
.switch { display: inline-flex; margin-top: 16px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--porcelain); }
.switch a { padding: 9px 18px; text-decoration: none; color: var(--steel); font-weight: 500; font-size: 14px; }
.switch a + a { border-left: 1px solid var(--line); }
.switch a.on { background: var(--bottle); color: #fff; }
.oneblock { margin-top: 12px; font-weight: 600; }
.readyline { color: var(--steel); font-size: 14px; }
.stick { position: sticky; top: var(--top-h, 58px); z-index: 4; background: var(--linen); margin: 14px -24px 20px; padding: 0 24px; box-shadow: 0 1px 0 var(--line); }
.stick-filters:empty { display: none; }
.stick-filters .toolbar { margin: 0; padding: 10px 0; }
.resetbox:empty { display: none; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0; overflow-x: auto; scrollbar-width: none; }
.stick-filters:empty + .nothing, .stick .tabs:last-child { border-bottom: 0; }
.tabs a { padding: 11px 13px; text-decoration: none; color: var(--steel); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--bottle); }

/* списки задач */
.tlist { background: var(--porcelain); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tlist .empty { padding: 14px 16px; }
.trow { display: grid; grid-template-columns: minmax(0, 1fr) 165px 150px 200px; gap: 4px 18px; align-items: baseline; padding: 11px 16px; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.trow:first-child, .sub + .trow { border-top: 0; }
.trow:hover { background: #F7F9F8; }
.trow.off { color: var(--ash); } .trow.off .trow-title { text-decoration: line-through; }
.trow-title { font-weight: 500; overflow-wrap: anywhere; }
.trow-title small { display: block; font-weight: 400; }
.trow-title small.warn { color: var(--saffron); }
.trow-who { font-size: 14px; color: var(--steel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-who.none { color: var(--tomato); }
.crit { font-size: 11px; font-weight: 600; color: var(--tomato); border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; margin-right: 8px; vertical-align: 1px; }
.due { font-size: 14px; color: var(--steel); }
.due b { font-weight: 500; color: var(--ink); }
.due.late, .due.late b { color: var(--tomato); }
.due.ok { color: var(--basil); } .due.none { color: var(--ash); }
.due em { font-style: normal; font-size: 12px; color: var(--saffron); margin-left: 8px; white-space: nowrap; }
.sub { font: 500 13px/1.3 var(--text); color: var(--steel); background: var(--linen); padding: 8px 16px; border-top: 1px solid var(--line-soft); }
.sub:first-child { border-top: 0; }
.sec { margin-bottom: 22px; }
.sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; }
.sec-title { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; display: flex; align-items: baseline; color: var(--ink); text-align: left; flex: 1; min-width: 200px; }
.sec-title h2::before { content: ""; display: inline-block; width: 8px; height: 8px; border-right: 1.5px solid var(--steel); border-bottom: 1.5px solid var(--steel); transform: rotate(45deg); margin: 0 12px 5px 2px; transition: transform .15s; }
.sec.closed .sec-title h2::before { transform: rotate(-45deg); margin-bottom: 3px; }
.sec.tpl .sec-head h2 { flex: none; }
.sec.tpl .sec-head .count { flex: 1; }

/* чек-лист: разделы слева, как листы в Excel, и таблица */
.clayout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 26px; align-items: start; }
.sheets { position: sticky; top: calc(var(--top-h, 58px) + var(--stick-h, 100px) + 14px); max-height: calc(100vh - var(--top-h, 58px) - var(--stick-h, 100px) - 28px); overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding-bottom: 6px; }
.sheet { font: 500 14px/1.25 var(--text); background: none; color: var(--ink); border: 0; border-left: 3px solid transparent; border-radius: 0 7px 7px 0; padding: 9px 10px 9px 12px; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; text-align: left; width: 100%; }
.sheet span { font-weight: 400; font-size: 12px; color: var(--steel); white-space: nowrap; }
.sheet:hover { background: var(--porcelain); }
.sheet.on { background: var(--porcelain); border-left-color: var(--bottle); box-shadow: 0 0 0 1px var(--line); font-weight: 600; }
.sheet.all { margin-bottom: 6px; }
.addsec { margin: 10px 0 0 15px; align-self: flex-start; }
.ctable .chead, .crow { grid-template-columns: 30px minmax(0, 1fr) 140px 150px 96px 118px 100px 96px; gap: 4px 14px; }
@media (max-width: 1420px) {
  .ctable .chead, .crow { grid-template-columns: 30px minmax(0, 1fr) 140px 150px 96px 118px; }
  .chead span:nth-child(n+7), .crow .c-money, .crow .c-pay { display: none; }
}
.chead { display: grid; padding: 9px 16px; font-size: 12.5px; font-weight: 500; color: var(--steel); background: var(--linen); border-bottom: 1px solid var(--line); line-height: 1.25; align-items: end; }
.chead + .trow, .chead + .sub { border-top: 0; }
.c-num { color: var(--ash); font-size: 13px; }
.c-date { font-size: 14px; white-space: nowrap; }
.c-date i { font-style: normal; color: var(--ash); font-size: 13px; } .c-date i.ok { color: var(--basil); }
.c-date em { font-style: normal; font-size: 12px; color: var(--saffron); margin-left: 6px; }
.c-money { font-size: 14px; text-align: right; white-space: nowrap; }
.c-pay { font-size: 13px; color: var(--steel); }
.c-mobile { display: none; }
.sec-head > h2 { flex: none; } .sec-head > .count { flex: 1; }

/* согласования и журнал */
.arow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; background: var(--porcelain); border: 1px solid var(--line); border-left: 3px solid var(--aubergine); border-radius: 0 8px 8px 0; padding: 13px 16px; margin-top: 8px; }
.arow-main { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); min-width: 220px; flex: 1; }
a.arow-main:hover b { text-decoration: underline; color: var(--bottle); }
.arow-act { display: flex; flex-wrap: wrap; gap: 8px; }
.jlist { background: var(--porcelain); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.jlist .empty { padding: 14px 16px; }
.jrow { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 18px; padding: 10px 16px; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); font-size: 14px; }
.jrow:first-child { border-top: 0; }
a.jrow:hover { background: #F7F9F8; }
.jrow-when { color: var(--steel); font-size: 13px; display: flex; flex-direction: column; }
.jrow-when b { color: var(--ink); font-weight: 500; font-size: 14px; }
.jrow-what { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.jrow-what em { font-style: normal; font-weight: 600; }
.reason { color: var(--steel); border-left: 2px solid var(--line); padding-left: 10px; }
.reason:empty { display: none; }

/* сводка, люди, шаблоны */
.tablewrap { overflow-x: auto; background: var(--porcelain); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
thead th { border-top: 0; font-weight: 500; font-size: 13px; color: var(--steel); white-space: nowrap; }
tbody th { font-weight: 500; }
tfoot th, tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
td.zero { color: #C3CACF; }
td.pct { font-weight: 500; }
tbody th, tfoot th { white-space: nowrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 10px 0 0; }
.facts div { background: var(--porcelain); padding: 12px 16px; }
.facts dt { font-size: 13px; color: var(--steel); } .facts dd { margin: 2px 0 0; font: 400 26px/1.1 var(--display); }
.people { background: var(--porcelain); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 10px 0 6px; }
.person { display: grid; grid-template-columns: minmax(0, 1fr) 220px auto; gap: 6px 18px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--line-soft); }
.person:first-child { border-top: 0; }
.person.off { color: var(--ash); }
.person > span:first-child { display: flex; flex-direction: column; }
.tpltable td { padding: 5px 6px; vertical-align: top; }
.tpltable th { padding: 9px 8px; }
.tpltable input[type=text], .tpltable select { padding: 6px 8px; font-size: 14px; border-color: transparent; background: transparent; }
.tpltable input[type=text]:hover, .tpltable select:hover, .tpltable input[type=text]:focus, .tpltable select:focus { border-color: var(--line); background: var(--porcelain); }
.tpltable td:nth-child(1) { width: 19%; } .tpltable td:nth-child(2) { min-width: 300px; } .tpltable td:nth-child(3) { width: 150px; }
.tpltable .num { width: 62px; text-align: right; }
.tpltable .strong { font-weight: 500; } .tpltable .faint { color: var(--steel); font-size: 13px; }
.tpltable input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--bottle); margin: 8px 0 0 12px; }

/* окна */
.backdrop { position: fixed; inset: 0; background: rgba(22, 33, 43, .42); z-index: 20; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 24px; overflow-y: auto; }
.backdrop.side { padding: 0; justify-content: flex-end; align-items: stretch; z-index: 10; }
.modal { background: var(--porcelain); border-radius: 12px; padding: 24px 26px 22px; width: 100%; max-width: 480px; box-shadow: 0 24px 60px rgba(22, 33, 43, .25); }
.modal h2 { margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.modal-actions .quiet { margin-right: auto; }

/* карточка задачи */
.drawer { background: var(--porcelain); width: min(620px, 100vw); height: 100%; overflow-y: auto; padding: 22px 30px 60px; box-shadow: -16px 0 48px rgba(22, 33, 43, .16); animation: slide .18s ease-out; overscroll-behavior: contain; }
@keyframes slide { from { transform: translateX(28px); opacity: .4; } }
.d-close { float: right; font: inherit; font-size: 14px; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; cursor: pointer; color: var(--steel); margin-left: 12px; }
.d-close:hover { color: var(--ink); border-color: var(--steel); }
.d-path { font-size: 13px; color: var(--steel); margin-bottom: 8px; padding-top: 4px; }
.d-head h2 { font-size: 30px; line-height: 1.12; margin-bottom: 4px; overflow-wrap: anywhere; }
.d-expl { color: var(--steel); margin-top: 8px; max-width: 62ch; }
.d-status { margin: 20px -30px; padding: 18px 30px 20px; background: var(--linen); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.path { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 4px; padding: 0; margin: 0 0 12px; font-size: 13px; color: var(--steel); }
.path li { display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 5px; }
.path li i { opacity: .45; }
.path li.past { color: var(--ink); } .path li.past i { opacity: 1; }
.path li.on { background: var(--porcelain); color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--c), 0 0 0 1px var(--line); }
.path li.on i { opacity: 1; }
.note { font-size: 14px; margin: 8px 0; max-width: 64ch; }
.note.warn { color: #8A5A08; background: var(--saffron-wash); padding: 9px 12px; border-radius: 6px; }
.note.late { color: var(--tomato); font-weight: 500; }
.needs { background: var(--porcelain); border: 1px solid var(--line); border-left: 3px solid var(--saffron); border-radius: 0 6px 6px 0; padding: 10px 14px; margin: 10px 0; font-size: 14px; }
.needs ul { margin: 6px 0 0; padding-left: 20px; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.d-actions:empty { display: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.two.wide-first { grid-template-columns: minmax(0, 1fr) 170px; }
.three { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 0 16px; }
.evidence { border: 1px solid var(--line-soft); border-radius: 8px; padding: 14px 14px 12px; margin-bottom: 14px; }
.evidence .fld { margin-bottom: 8px; }
.evidence .open { display: inline-block; margin: 0 14px 8px 0; font-size: 14px; font-weight: 500; }
.files { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.files:empty { display: none; }
.file { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14px; }
.upload { font-size: 13px; padding: 8px 12px; }
.duenote.late { color: var(--saffron); }
.d-tpl { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 6px 0 22px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.d-tpl:empty { display: none; }
.drawer > h3 { margin: 0 0 10px; }
.drawer .jrow { grid-template-columns: 130px minmax(0, 1fr); padding: 9px 12px; }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 40; max-width: min(92vw, 560px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--tomato); }

@media (max-width: 860px) {
  h1 { font-size: 30px; }
  .top { flex-wrap: wrap; gap: 0 16px; padding: 8px 16px 0; }
  .top .brand { flex: 1; font-size: 22px; }
  .top nav { order: 3; flex-basis: 100%; margin: 0 -6px; }
  .top nav a { padding: 12px 8px 10px; }
  .page { padding: 20px 16px 70px; }
  .statbtns { gap: 5px; }
  .statbtn { padding: 8px 7px; } .statbtn b { font-size: 24px; } .statbtn span { font-size: 10.5px; line-height: 1.2; gap: 4px; align-items: flex-start; flex-direction: column; overflow-wrap: anywhere; }
  .stick { position: static; margin: 12px -16px 16px; padding: 0 16px; }
  .clayout { grid-template-columns: 1fr; gap: 14px; }
  .sheets { position: static; max-height: none; flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .sheet { width: auto; flex: none; border: 1px solid var(--line); border-radius: 7px; background: var(--porcelain); padding: 8px 10px; font-size: 13px; }
  .sheet.on { background: var(--bottle); border-color: var(--bottle); color: #fff; box-shadow: none; } .sheet.on span { color: #C9DDD4; }
  .sheet.all { margin-bottom: 0; } .addsec { margin: 0; align-self: center; white-space: nowrap; }
  .blockline { grid-template-columns: 1fr; gap: 6px; }
  .bl-open { justify-self: start; }
  .bl-flags { grid-column: 1; }
  .trow, .crow { grid-template-columns: 1fr auto; padding: 11px 14px; }
  .chead, .crow .c-num, .crow .c-date, .crow .c-money, .crow .c-pay { display: none; }
  .crow .c-mobile { display: block; }

  .trow-title { grid-column: 1 / -1; }
  .trow-who { grid-column: 1 / -1; }
  .due { text-align: right; }
  .jrow, .drawer .jrow { grid-template-columns: 1fr; }
  .jrow-when { flex-direction: row; gap: 10px; }
  .person { grid-template-columns: 1fr; }
  .toolbar input[type=search] { width: 100%; } .toolbar select { max-width: none; flex: 1; }
  .drawer { padding: 18px 18px 60px; }
  .d-status { margin: 18px -18px; padding: 16px 18px 18px; }
  .d-head h2 { font-size: 26px; }
  .two, .two.wide-first, .three { grid-template-columns: 1fr; }
  .arow-act { width: 100%; } .arow-act .btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .top, .tabs, .toolbar, #toast { display: none; } body { background: #fff; } }
