:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --faint: #9aa1ad;
  --line: #e5e7eb;
  --line-soft: #f0f1f4;
  --accent: #ffa100;
  --banner: #242424;
  --good: #047857;
  --bad: #dc2626;
  --group-bg: #eef1f5;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; }

/* header */
.top {
  position: sticky; top: 0; z-index: 30; background: var(--card); border-bottom: 1px solid var(--line);
}
.top-inner { max-width: 1400px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 16px; }
.logo { font-weight: 800; letter-spacing: .02em; font-size: 16px; text-decoration: none; }
.logo b { color: var(--accent); }
.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tabs a {
  text-decoration: none; padding: 6px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 13px;
}
.tabs a.on { background: var(--ink); color: #fff; }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.who form { margin: 0; }
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px;
  padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover { border-color: #c9ced6; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }

main { max-width: 1400px; margin: 0 auto; padding: 20px 24px 48px; display: flex; flex-direction: column; gap: 20px; }

/* period selector */
.selector { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  text-decoration: none; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font-size: 13px; color: var(--ink);
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.year { font-weight: 700; }
.chip .draft { font-size: 11px; color: var(--accent); margin-left: 4px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 18px 20px; }
.h-cap { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.h-cap.accent { color: var(--accent); }
.section-title { display: flex; align-items: center; gap: 10px; }
.section-title h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sub { font-size: 12px; color: var(--muted); margin-top: -12px; }

/* banner */
.banner { background: var(--banner); color: #fff; border-radius: var(--radius); padding: 22px 24px; }
.banner .kicker { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.banner h2 { font-size: 22px; margin-top: 4px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.badge { background: rgba(255,255,255,.12); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.draft-flag { display: inline-block; margin-left: 10px; font-size: 11px; font-weight: 700; color: var(--banner); background: var(--accent); border-radius: 4px; padding: 1px 6px; vertical-align: middle; }

/* summary row */
.summary { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }
.summary.narrow { grid-template-columns: minmax(0, 520px); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.rich p { margin: 0 0 6px; }
.rich ul, .rich ol { margin: 0 0 6px; padding-left: 20px; }
.rich.plain p.hd { font-weight: 600; margin-top: 8px; }
.rich.plain p.li { padding-left: 14px; position: relative; color: var(--muted); }
.rich.plain p.li::before { content: "●"; color: var(--accent); font-size: 7px; position: absolute; left: 0; top: 6px; }
.note { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.note .lbl { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }

table { border-collapse: collapse; width: 100%; }
.totals td { padding: 7px 4px; border-bottom: 1px solid var(--line-soft); }
.totals tr:last-child td { border-bottom: 0; }
.totals th { font-size: 11px; color: var(--faint); font-weight: 500; text-align: right; padding: 0 4px 6px; border-bottom: 1px solid var(--line); }
.totals th:first-child { text-align: left; }
.totals td.v { text-align: right; font-weight: 600; white-space: nowrap; }
.totals td.c { text-align: right; width: 56px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.totals td.l { color: var(--muted); }
.totals tr.hl td { background: #f7f8fa; }
.totals tr.hl td.l { color: var(--ink); font-weight: 600; }

.pos { color: var(--good); }
.neg { color: var(--bad); }
.chg-good { color: var(--good); }
.chg-bad { color: var(--bad); }
.chg-muted { color: var(--faint); }

/* KPI cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { padding: 12px; }
.kpi .t { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 18px; font-weight: 700; margin-top: 2px; white-space: nowrap; }
.kpi .p { font-size: 11px; color: var(--muted); margin-top: 6px; }
.kpi .ch { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: #f3f4f6; }
.kpi .ch.chg-good { background: #ecfdf5; }
.kpi .ch.chg-bad { background: #fef2f2; }

/* project table */
.scroll { overflow-x: auto; }
.ptable { font-size: 12.5px; min-width: 900px; }
.ptable th { font-weight: 600; color: var(--muted); padding: 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ptable th.g { text-align: center; border-left: 1px solid var(--line); }
.ptable th.first { text-align: left; min-width: 200px; }
.ptable thead tr:nth-child(2) th { background: #fafbfc; font-size: 11px; font-weight: 500; }
.ptable td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.ptable td.prev { color: var(--muted); border-left: 1px solid var(--line-soft); }
.ptable td.chg { text-align: center; font-weight: 600; font-size: 11.5px; }
.ptable td.name { text-align: left; white-space: normal; }
.ptable tr.group td { background: var(--group-bg); }
.ptable tr.group td.name { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 11.5px; border-left: 3px solid #475569; }
.ptable tr.group td.name a { text-decoration: none; }
.ptable tr.project td.name { padding-left: 24px; font-weight: 500; }
.ptable tr.total td { font-weight: 700; border-top: 2px solid var(--line); background: #f7f8fa; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.hi { font-weight: 700; font-size: 11px; margin-left: 6px; white-space: nowrap; }

/* group detail */
.gbanner { display: flex; align-items: center; gap: 12px; padding: 16px 20px; flex-wrap: wrap; }
.gbanner h3 { font-size: 18px; }
.gbanner .s { font-size: 12px; color: var(--muted); }
.gbanner .prods { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pbadge { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #f1f2f4; color: var(--muted); }
.pbadge.on { background: var(--ink); color: #fff; }
.nav { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--muted); }
.hicards { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.hicard { display: flex; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.hicard .txt { font-size: 12px; color: var(--muted); flex: 1; min-width: 0; }
.hicard .pn { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.hicard .rec { border-left: 2px solid var(--accent); padding-left: 10px; margin-top: 6px; color: var(--ink); }
.hicard .rec .lbl { color: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.gtabs { display: flex; flex-wrap: wrap; gap: 6px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 16px; }
.pcard { padding: 16px; }
.pcard .hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pcard .hd h4 { font-size: 15px; }
.pnl { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; background: #f3f4f6; }
.pnl.pos { background: #ecfdf5; }
.pnl.neg { background: #fef2f2; }
.goal { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; color: #1a5276; font-size: 13px; }
.goal .bar { height: 8px; background: #eef0f3; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.goal .bar span { display: block; height: 100%; border-radius: 999px; }
.dtable td, .dtable th { padding: 6px 6px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.dtable th { font-weight: 600; color: var(--muted); text-align: right; font-size: 11.5px; }
.dtable th:first-child, .dtable td:first-child { text-align: left; color: var(--muted); }
.dtable td { text-align: right; white-space: nowrap; }
.dtable td.prev { color: var(--muted); }
.dtable td.chg { text-align: center; font-weight: 600; font-size: 11.5px; }
.dtable tr.kpihead td { padding-top: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.events h4 { font-size: 13px; margin: 10px 0 4px; }
.empty { padding: 32px; text-align: center; color: var(--muted); }

/* metrics */
.mhead { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.hcard { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 10px 14px; }
.hcard .t { font-size: 12px; font-weight: 600; }
.hcard .row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.hcard .gp { font-size: 18px; font-weight: 700; }
.hcard .lbl { font-size: 11px; color: var(--muted); }
.hcard .why { font-size: 11px; margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.toolbar h3 { font-size: 15px; margin-right: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg a { padding: 5px 10px; font-size: 12.5px; text-decoration: none; color: var(--muted); }
.seg a.on { background: var(--ink); color: #fff; }
.toolbar select, .toolbar input { font: inherit; font-size: 12.5px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: var(--card); }
.mtable { font-size: 13px; min-width: 960px; }
.mtable th { text-align: right; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.mtable th:first-child { text-align: left; }
.mtable td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.mtable td:first-child { text-align: left; white-space: normal; }
.mtable tr.ptotal td { font-weight: 700; background: #f7f8fa; border-top: 2px solid var(--line); }
.mtable tr.phead td { background: #f1f3f6; font-weight: 600; }
.mtable tr.sub td:first-child { padding-left: 28px; color: var(--muted); }
.na { color: var(--faint); }
.partial { display: inline-block; font-size: 10px; color: var(--faint); margin-left: 6px; font-weight: 400; }
details.contrib summary { cursor: pointer; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 2px; }
details.contrib table { margin: 6px 0 2px; font-size: 12px; }
details.contrib td { border: 0; padding: 2px 8px 2px 0; text-align: right; }
details.contrib td:first-child { text-align: left; }

/* auth */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth .card { width: 100%; max-width: 380px; padding: 28px; }
.auth h1 { font-size: 20px; margin-bottom: 4px; }
.auth p { color: var(--muted); margin: 0 0 18px; }
.auth label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.auth input { width: 100%; font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; }
.auth .btn { width: 100%; margin-top: 18px; padding: 10px; }
.auth .auth-hint { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.err { color: var(--bad); font-size: 13px; margin-top: 10px; }

.htmx-request main { opacity: .6; transition: opacity .15s; }

/* таблицы-списки прокручиваются внутри карточки, страница не шире экрана */
.card:has(> table) { overflow-x: auto; }
table.list td.r, table.list th.r, .num { text-align: right; }

@media (max-width: 900px) {
  .summary { grid-template-columns: 1fr; }
  .mhead { grid-template-columns: 1fr; }
  .pcards { grid-template-columns: 1fr; }
  .top-inner, main { padding-left: 16px; padding-right: 16px; }
  .who .name { display: none; }
}

/* правка на месте */
.edit-toggle { position: absolute; top: 18px; right: 20px; margin: 0; }
.banner { position: relative; }
.badges-edit { margin-top: 8px; font-size: 12px; }
.edit-hint { background: #fff7e6; border: 1px solid #ffd591; border-radius: var(--radius); padding: 8px 12px; font-size: 13px; }
.ed { cursor: pointer; border-bottom: 1px dashed var(--accent); }
div.ed { display: block; border: 1px dashed transparent; border-bottom-color: var(--accent); padding: 2px 4px; margin: 2px -4px; border-radius: 4px; }
.ed:hover { background: #fff7e6; }
.ed-empty { color: var(--faint); font-style: italic; }
div.ed ul, div.ed ol { padding-left: 20px; margin: 4px 0; }
.ed-active { background: #fff1d6; border-bottom-style: solid; }
/* окно правки поверх страницы: значение и соседние ячейки остаются на месте */
.ed-pop { position: absolute; z-index: 40; display: none; }
.ed-pop.open { display: block; }
.ed-form { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 20, 30, .18), 0 2px 6px rgba(15, 20, 30, .08);
  width: 320px; text-align: left; font-size: 13px; color: var(--ink); }
.ed-form.ed-rich, .ed-form.ed-lines { width: min(640px, calc(100vw - 32px)); }
.ed-form.ed-bool, .ed-form.ed-select { width: 260px; }
.ed-form input, .ed-form select, .ed-form textarea { font: inherit; font-size: 15px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; width: 100%; }
.ed-form input:focus, .ed-form select:focus, .ed-form textarea:focus, .ed-rich:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.ed-form input.num { text-align: right; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.ed-head { display: flex; align-items: flex-start; gap: 8px; }
.ed-label { font-weight: 600; font-size: 12px; color: var(--muted); flex: 1; }
.ed-x { border: 0; background: none; font-size: 18px; line-height: 1; color: var(--faint); cursor: pointer; padding: 0 2px; }
.ed-x:hover { color: var(--ink); }
.ed-hint { font-size: 12px; color: var(--muted); }
.ed-actions { display: flex; gap: 6px; align-items: center; }
.ed-keys { font-size: 11px; color: var(--faint); margin-left: auto; }
.ed-choices { display: flex; gap: 6px; }
.ed-choices .btn { flex: 1; padding: 8px; }
.ed-toolbar { display: flex; gap: 4px; }
.ed-toolbar .btn { padding: 2px 8px; }
/* переключатель да/нет */
.ed-switch { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 0; font: inherit; color: var(--ink); cursor: pointer; }
.ed-switch .knob { width: 30px; height: 18px; border-radius: 999px; background: #d4d8de; position: relative; transition: background .15s; flex: none; }
.ed-switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.ed-switch.on .knob { background: var(--good); }
.ed-switch.on .knob::after { transform: translateX(12px); }
.ed-switch.off { color: var(--muted); }
.ed-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ed-rich { min-height: 120px; border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: #fff; }
.err { color: var(--bad); }
.ok { color: var(--good); }
.hi-edit { font-size: 12px; text-align: center; }

/* журнал */
.jrow { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.jhead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.jtime { color: var(--muted); font-variant-numeric: tabular-nums; }
.jtitle { flex: 1; }
.jrevert { margin: 0; }
.jchanges { margin-top: 6px; font-size: 13px; border-collapse: collapse; width: auto; max-width: 100%; }
.jchanges td { padding: 2px 10px 2px 0; vertical-align: top; }
.jchanges td.l { color: var(--muted); padding-right: 16px; }
.jchanges td.prev { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(107,114,128,.4); }
.jchanges td.arr { color: var(--faint); }
.jchanges td.prev, .jchanges td.new { overflow-wrap: break-word; }
.badge.muted { background: var(--line-soft); color: var(--muted); }

/* управление */
.admin-nav { margin-bottom: 4px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.admin-grid a { text-decoration: none; }
.admin-grid h3 { margin-bottom: 6px; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.form-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form-row select, .form-row input[type=text], .form-row input[type=password], .form-row input:not([type]),
.link-form select, .link-form input[type=password], .link-form input:not([type]) { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }
.form-row label.check { flex-direction: row; align-items: center; color: var(--ink); font-size: 13px; }
.form-row .sub, .form-row .err { flex-basis: 100%; }
.form-row label.wide { flex: 1 1 320px; }
.form-row label.wide input { width: 100%; }
.project-note { margin-top: 10px; padding-top: 8px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 8px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; }
table.list td.r { text-align: right; white-space: nowrap; }
.draft { color: var(--accent); }
.wiz-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.steps .chip { font-weight: 600; }
.ptable.grid td { white-space: nowrap; }
.ptable.grid th { white-space: nowrap; font-size: 12px; }
.ptable.grid .gsub { font-size: 11px; color: var(--muted); }
/* название проекта остаётся на месте при прокрутке широкой таблицы */
.ptable.grid td.name, .ptable.grid th.first { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: 1px 0 0 var(--line-soft); }
.import { margin-top: 12px; }
.import-hint { font-size: 12px; color: var(--muted); }
.src-next { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.import ul { margin: 4px 0 8px 18px; padding: 0; }
.card-pad > h3 { margin-bottom: 8px; }
.card-pad > p.sub, .card-pad > .sub { margin: 0 0 10px; }
.ghead { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.ghead .sub { margin: 0; }
form.inline { display: inline; margin: 0; }
.hi-admin td { vertical-align: top; }
.hi-admin td:nth-child(3), .hi-admin td:nth-child(4) { min-width: 280px; }
.badge.warn { background: #fff4e0; color: #9a5b00; }
.badge.ok { background: #e7f6ec; color: var(--good); }
.badge.bad { background: #fde8e8; color: var(--bad); }
.run-warnings { margin-top: 4px; font-size: 12px; color: #9a5b00; }
.run-warnings ul { margin: 4px 0 0; padding-left: 16px; }
.run-error { margin-top: 4px; font-size: 12px; color: var(--bad); overflow-wrap: anywhere; }
.issued { border-left: 3px solid var(--good); }
.issued code { font-size: 16px; padding: 2px 8px; background: var(--line-soft); border-radius: 6px; user-select: all; }
code.addr { font-size: 12px; word-break: break-all; }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.presets .sub { flex-basis: 100%; margin: 0; }
.link-form { display: grid; gap: 14px; }
.link-form > label, .link-form fieldset > label:not(.check) { display: grid; gap: 4px; max-width: 520px; font-size: 12px; color: var(--muted); }
.link-form fieldset .sub { display: block; margin: 6px 0 0; }
.link-form fieldset { min-width: 0; border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 14px; }
.link-form legend { font-weight: 600; padding: 0 6px; }
.addr-input { display: flex; align-items: center; gap: 4px; }
.addr-input .sub { margin: 0; white-space: nowrap; }
label.check { display: inline-flex; align-items: center; gap: 6px; margin: 3px 14px 3px 0; }
.pick-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 8px; }
.pick-group { display: flex; flex-direction: column; }
.sub-check { margin-left: 22px; font-size: 13px; }
.pick-periods { display: flex; flex-wrap: wrap; margin: 6px 0 10px; }

input[type=file] { font: inherit; font-size: 13px; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-size: 13px; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 12px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: #c9ced6; }

@media (max-width: 640px) {
  /* iOS увеличивает страницу при фокусе на поле со шрифтом меньше 16px */
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; }
  .section-title h3 { white-space: normal; }
  .jchanges tr { display: flex; flex-wrap: wrap; column-gap: 8px; margin-top: 4px; }
  .jchanges td { padding: 0; }
  .jchanges td.l { flex-basis: 100%; }
  .admin-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav .chip { white-space: nowrap; }
  .pcard { overflow-x: auto; }
  .addr-input { flex-wrap: wrap; }
  .addr-input .sub { white-space: normal; word-break: break-all; }
  .top-inner { flex-wrap: wrap; row-gap: 8px; }
  .tabs { order: 3; flex-basis: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; }
  .ed-pop { position: fixed; left: 0 !important; right: 0; bottom: 0; top: auto !important; }
  .ed-form, .ed-form.ed-rich, .ed-form.ed-lines, .ed-form.ed-bool, .ed-form.ed-select { width: 100%; border-radius: 14px 14px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 80vh; overflow-y: auto; }
  .ed-keys { display: none; }
}

.export-links { margin-top: 10px; font-size: 12px; opacity: .85; }
.export-links a { color: inherit; text-decoration: underline; }
.toolbar .export-links { margin: 0 0 0 auto; color: var(--muted); }

/* версии отчёта и уточнения после публикации */
.version-note, .refined { margin-top: 12px; font-size: 13px; }
.version-note.old { background: #fff7e6; border-color: #ffd591; }
.refined summary, .version-note summary { cursor: pointer; }
.refined details[open] summary { margin-bottom: 8px; }
.version-list { margin: 6px 0 0; padding-left: 18px; }
.field-changes td, .field-changes th { white-space: nowrap; }
.warn-list { color: #9a5b00; font-size: 13px; margin-top: 10px; }
.carried-flag { color: #9a5b00; font-size: 12px; margin-top: 4px; }
.carry-form { margin-top: 4px; }
.carry-form .btn { font-size: 12px; padding: 2px 8px; }
.presence:empty { display: none; }
.presence-flag { display: inline-block; margin: 6px 0; padding: 4px 10px; border-radius: 6px; background: #fff4e0; color: #9a5b00; font-size: 13px; }
