:root {
  --bg: #F4F5F7; --card: #FFFFFF; --ink: #111827; --muted: #4B5563; --line: #E5E7EB; --field: #D1D5DB;
  --accent: #1D4ED8; --accent-ink: #1E3A8A; --accent-soft: #DBEAFE;
  --ok: #065F46; --ok-soft: #D1FAE5; --warn: #92400E; --warn-soft: #FEF3C7; --bad: #B91C1C; --bad-soft: #FEE2E2;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
#app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 24px; margin: 0; } h2 { font-size: 17px; margin: 0; }
.top { display: flex; align-items: center; gap: 8px; padding: 20px 0 12px; }
.top h1 { flex: 1; font-size: 21px; } .top .sub { font-size: 13px; color: var(--muted); }
.back { width: 44px; height: 44px; margin-left: -12px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.back svg, .tabs svg, .icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.section { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 8px 4px 0; }
.card { background: var(--card); border-radius: 14px; padding: 14px; display: block; color: var(--ink); }
a.card:active { background: #EEF2FF; }
.card .title { font-size: 15px; font-weight: 600; }
.card .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.list { background: var(--card); border-radius: 14px; overflow: hidden; }
.list > * { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.list > *:last-child { border-bottom: 0; }
.list .t { font-size: 14px; font-weight: 500; } .list .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.chip { font-size: 12px; font-weight: 600; border-radius: 10px; padding: 3px 8px; white-space: nowrap; background: #E5E7EB; color: #374151; }
.chip.blue { background: var(--accent-soft); color: #1E40AF; } .chip.green { background: var(--ok-soft); color: var(--ok); }
.chip.orange { background: var(--warn-soft); color: var(--warn); } .chip.red { background: var(--bad-soft); color: var(--bad); }
.hero { background: var(--accent); color: #fff; border-radius: 16px; padding: 16px; display: block; }
.hero .k { font-size: 13px; opacity: .9; } .hero .v { font-size: 36px; font-weight: 700; letter-spacing: 1px; }
.hero.big { text-align: center; padding: 24px 16px; } .hero.big .v { font-size: 56px; line-height: 1.1; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; text-align: right; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--field); background: #fff; color: var(--ink); font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; width: 100%; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); } .btn.light { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; }
.btn.white { background: #fff; border-color: #fff; color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btns { display: grid; gap: 10px; } .btns.two { grid-template-columns: 1fr 1fr; }
.sticky { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); background: var(--bg); margin: 0 -16px; padding: 10px 16px; box-shadow: 0 -10px 14px -12px rgba(17,24,39,.25); z-index: 2; }
form.stack label, .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea { font-size: 16px; font-family: inherit; color: var(--ink); background: #fff; border: 1px solid var(--field);
  border-radius: 10px; padding: 0 12px; min-height: 46px; width: 100%; }
textarea { padding: 10px 12px; resize: vertical; min-height: 84px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check { flex-direction: row !important; align-items: center; gap: 10px !important; font-size: 14px !important; color: var(--ink) !important; }
.check input { width: 22px; min-height: 22px; height: 22px; accent-color: var(--accent); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; color: var(--ink); }
.muted { color: var(--muted); font-size: 13px; } .center { text-align: center; }
.banner { border-radius: 14px; padding: 14px; font-size: 14px; }
.banner.blue { background: var(--accent-soft); color: var(--accent-ink); } .banner.orange { background: var(--warn-soft); color: var(--warn); }
.banner.green { background: var(--ok-soft); color: var(--ok); } .banner.red { background: var(--bad-soft); color: var(--bad); }
.compare { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.compare > div { flex: 1; background: #fff; border-radius: 12px; padding: 10px; text-align: center; color: var(--ink); }
.compare b { display: block; font-size: 26px; } .compare .old b { color: var(--muted); text-decoration: line-through; }
.timeline > div { display: flex; gap: 12px; padding-bottom: 12px; position: relative; }
.timeline > div::before { content: ""; width: 10px; height: 10px; border-radius: 5px; background: #6B7280; margin-top: 5px; flex-shrink: 0; }
.timeline > div:last-child::before { background: var(--accent); }
.tabset { display: flex; gap: 8px; flex-wrap: wrap; }
.tabset button { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--field); background: #fff; font-size: 13px; font-weight: 500; font-family: inherit; color: var(--ink); }
.tabset button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; font-size: 14px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff;
  border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; font-size: 11px; color: var(--muted); }
.tabs a.on { color: var(--accent); font-weight: 600; }
.tabs .plus span { width: 48px; height: 48px; border-radius: 24px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.tabs .plus svg { width: 24px; height: 24px; stroke-width: 2.5; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(88px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: 90vw; z-index: 10; }
.login { min-height: 100vh; display: flex; flex-direction: column; padding: 64px 8px 32px; }
.logo { width: 56px; height: 56px; border-radius: 16px; }
.err { color: var(--bad); font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (min-width: 600px) { #app { padding-top: 8px; } }
[hidden] { display: none !important; }

/* Рабочее место подрядчика: шире, таблицы, вкладки разделов */
body.wide #app { max-width: 1200px; padding-bottom: 32px; }
.chead { border-bottom: 1px solid var(--line); }
.cnav { display: flex; gap: 4px; overflow-x: auto; margin: 0 -4px; padding-bottom: 2px; }
.cnav a { padding: 10px 12px; border-radius: 10px; color: var(--ink); font-size: 14px; white-space: nowrap; }
.cnav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.tblwrap { overflow-x: auto; background: var(--card); border-radius: 14px; border: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; padding: 10px 12px; white-space: nowrap; }
.tbl td { padding: 12px; border-top: 1px solid var(--line); vertical-align: top; }
.grid5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 12px; align-items: start; }
details > summary { list-style: none; } details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "+ "; color: var(--accent); }
details[open] > summary::before { content: "− "; }
/* метка с флажком в строку */
label.check { display: flex; flex-direction: row; align-items: center; gap: 10px; font-weight: 400; color: inherit; }
label.check input { width: 20px; height: 20px; min-height: 0; margin: 0; flex: none; }
.btns.three { grid-template-columns: 1fr 1fr 1fr; } @media (max-width: 420px) { .btns.three { grid-template-columns: 1fr 1fr; } .btns.three > :first-child { grid-column: 1 / -1; } }
