/* Pilot 10: AI-app rescue demo. Mobile first; tokens on :root, dark below. */
:root {
  --bg: #f5f4f0; --surface: #ffffff; --ink: #16202a; --muted: #4e5a65;
  --brand: #2f4b8a; --brand-ink: #ffffff; --accent: #8a4b0a; --accent-soft: #fbeedd;
  --line: #d8d4ca; --ok: #1d6b3a; --err: #a4231b; --focus: #8a4b0a;
  --critical: #a4231b; --high: #b5520b; --medium: #7a6408; --low: #4e5a65;
  --radius: 14px; --gutter: 16px; --field: #807a70; /* field and chip edges: 4.2:1 on white, 3.9:1 on the page (needs 3) */ color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10161d; --surface: #18222c; --ink: #eef2f5; --muted: #a8b5c0;
    --brand: #8fb0ff; --brand-ink: #0d1626; --accent: #f0b35a; --accent-soft: #3a2a14;
    --line: #2d3b47; --ok: #6fd08f; --err: #ff8a80; --focus: #f0b35a;
    --critical: #ff8a80; --high: #ffb169; --medium: #e6cf6a; --low: #a8b5c0; --field: #7f8a94; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10161d; --surface: #18222c; --ink: #eef2f5; --muted: #a8b5c0;
  --brand: #8fb0ff; --brand-ink: #0d1626; --accent: #f0b35a; --accent-soft: #3a2a14;
  --line: #2d3b47; --ok: #6fd08f; --err: #ff8a80; --focus: #f0b35a;
  --critical: #ff8a80; --high: #ffb169; --medium: #e6cf6a; --low: #a8b5c0; --field: #7f8a94; color-scheme: dark;
}
* { box-sizing: border-box; }
p, ul, ol, dl { margin: 0 0 16px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 9; }
.skip:focus { left: 8px; }
.demo-bar { margin: 0; padding: 8px var(--gutter); background: var(--accent-soft); font-size: 16px; text-align: center; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px var(--gutter); max-width: 960px; margin: 0 auto; }
.brand { display: flex; gap: 12px; align-items: center; min-height: 44px; min-width: 44px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.logo-bg { fill: var(--brand); } .logo-mark { stroke: var(--brand-ink); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tools { display: flex; gap: 8px; }
.chip { min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }
main { max-width: 960px; margin: 0 auto; padding: 0 var(--gutter); }
section { padding: 24px 0; }
h1 { font-size: clamp(30px, 7vw, 46px); line-height: 1.12; margin: 8px 0 16px; }
h2 { font-size: clamp(22px, 5vw, 30px); margin: 0 0 12px; }
h3 { margin: 0 0 8px; font-size: 18px; }
.kicker { color: var(--accent); font-weight: 700; margin: 0; }
.lead { font-size: 19px; color: var(--muted); max-width: 40em; }
.price { font-size: 22px; font-weight: 800; margin: 12px 0; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--muted); }
.facts li::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.grid { display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card p { margin: 0; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px var(--gutter); margin: 12px 0; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, textarea, select { width: 100%; min-height: 48px; padding: 12px 12px; border: 1px solid var(--field); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
input[disabled] { opacity: .55; }
textarea { min-height: 120px; }
/* one height for every single-line field, so neighbours share a centre line; tick boxes keep their own size */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select { height: 48px; padding-top: 8px; padding-bottom: 8px; }
input[type="checkbox"], input[type="radio"] { margin: 0; padding: 0; }
input[type=file] { padding: 12px; }
.hint { color: var(--muted); font-size: 16px; margin: 8px 0 0; max-width: 68ch; }
label.check { display: flex; align-items: center; gap: 12px; font-weight: 400; margin-top: 16px; min-height: 44px; }
label.check input { width: 24px; min-height: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--brand); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 2px solid var(--brand); background: var(--surface); color: var(--brand); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.wide { width: 100%; margin-top: 16px; }
.btn[disabled] { opacity: .6; cursor: wait; }
.msg { min-height: 1.5em; font-weight: 600; margin: 12px 0 0; }
.msg.ok { color: var(--ok); } .msg.err { color: var(--err); }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 22px; letter-spacing: 2px; font-weight: 700; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 14px; overflow-wrap: anywhere; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps li { padding-left: 32px; position: relative; color: var(--muted); }
.steps li::before { content: "○"; position: absolute; left: 6px; }
.steps li.done { color: var(--ink); } .steps li.done::before { content: "●"; color: var(--ok); }
.clock { font-size: 20px; font-weight: 700; margin: 4px 0; }
.clock.late { color: var(--err); } .clock.paused { color: var(--accent); }
.sev { display: inline-block; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 6px; border: 2px solid; }
.sev-critical { color: var(--critical); } .sev-high { color: var(--high); } .sev-medium { color: var(--medium); } .sev-low { color: var(--low); }
.finding { border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 10px; padding: 12px; margin: 0 0 12px; background: var(--surface); }
.finding.critical { border-left-color: var(--critical); } .finding.high { border-left-color: var(--high); }
.finding.medium { border-left-color: var(--medium); } .finding.low { border-left-color: var(--low); }
.finding h3 { font-size: 17px; margin: 8px 0; }
.finding p { margin: 4px 0; } .finding .k { font-weight: 700; }
.finding.dropped { opacity: .55; }
ol.first { padding-left: 24px; } ol.first li { margin: 4px 0; font-weight: 600; }
.summary p { margin: 4px 0; }
.choice { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.choice label { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0; min-height: 44px; }
.choice input { width: 22px; min-height: 22px; height: 22px; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th, table.list td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }
pre.file { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; font-size: 14px; line-height: 1.45; }
.hidden { display: none !important; }
.foot { max-width: 960px; margin: 0 auto; padding: 24px var(--gutter) 40px; color: var(--muted); font-size: 16px; }
.foot p { margin: 0 0 4px; } .sig { font-style: italic; }
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .facts { grid-template-columns: repeat(3, auto); justify-content: start; gap: 24px; }
  .panel { padding: 28px; }
  .two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; align-items: end; }
}
/* Pilot 04: quotes */
.stats { margin: 8px 0 16px; grid-template-columns: 1fr 1fr; }
.kpi-label { color: var(--muted); font-weight: 600; font-size: 15px; margin: 0; }
.kpi-val { font-size: 24px; font-weight: 800; margin: 2px 0 0; color: var(--ink) !important; font-variant-numeric: tabular-nums; }
table.totals { max-width: 420px; margin: 12px 0 0 auto; }
table.totals th { font-weight: 500; } table.totals td { text-align: right; font-variant-numeric: tabular-nums; }
table.totals tr.grand th, table.totals tr.grand td { font-weight: 800; font-size: 19px; border-top: 2px solid var(--ink); }
table.list td { font-variant-numeric: tabular-nums; }
.qline { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; background: var(--bg); }
.qline label { margin: 8px 0 0; font-size: 14px; } .qline label:first-child { grid-column: 1 / -1; }
.qline .qtot { margin: 8px 0 0; font-weight: 700; align-self: center; font-variant-numeric: tabular-nums; }
.row-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.linkbtn { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font: inherit; font-size: 15px; padding: 8px 12px; min-height: 44px; cursor: pointer; text-align: left; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .qline { grid-template-columns: 3fr 1.3fr 0.8fr 0.9fr 1fr 1fr auto; align-items: end; }
  .qline label:first-child { grid-column: auto; }
}
@media print { .demo-bar, .top, #answer, .foot { display: none; } }
#q-lines td:nth-child(n+2), #q-lines th:nth-child(n+2) { white-space: nowrap; text-align: right; }
/* pilot-05: requests, badges, progress, chat */
.req { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 0 0 12px; }
.req h3 { margin: 0 0 4px; font-size: 18px; } .req h4 { margin: 12px 0 2px; font-size: 15px; color: var(--muted); }
.req.st-approved { border-left-color: var(--ok); } .req.st-submitted { border-left-color: var(--brand); } .req.st-returned, .req.late { border-left-color: var(--err); }
.badge { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--bg); border: 1px solid var(--line); }
.badge.st-approved { color: var(--ok); } .badge.st-returned { color: var(--err); } .badge.st-submitted { color: var(--brand); }
.late-t { color: var(--err); font-weight: 700; }
.note { background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 12px 0 0; } .bar span { display: block; height: 100%; background: var(--ok); }
ul.plain { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 8px; overflow-wrap: anywhere; }
ul.chat { list-style: none; padding: 0; display: grid; gap: 8px; } ul.chat li { padding: 12px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; } ul.chat li.firm { margin-right: 15%; } ul.chat li.client { margin-left: 15%; background: var(--accent-soft); }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
label.btn { margin: 0; }
.review { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
/* ---- Upgrade 2026-11-12: shared helpers, back office ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.inline { display: flex; gap: 8px; align-items: flex-end; } .inline > input { flex: 1; } .inline.wrap { flex-wrap: wrap; } .inline .grow { flex: 1 1 220px; }
.inline label { margin-top: 8px; }
.narrow { max-width: 460px; }
.mt { margin-top: 20px; } .end { display: flex; align-items: flex-end; } .end .btn { width: 100%; margin-top: 8px; }
.empty { color: var(--muted); font-style: italic; }
.badge { display: inline-block; font-size: 14px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); white-space: nowrap; }
.s-accepted { border-color: var(--ok); color: var(--ok); } .s-declined, .s-cancelled, .s-expired { border-color: var(--err); color: var(--err); } .s-changes { border-color: var(--accent); color: var(--accent); }
tr.muted td { color: var(--muted); }
.adm-nav { max-width: 960px; margin: 0 auto; padding: 0 var(--gutter); }
.adm-nav ul { list-style: none; margin: 0; padding: 0 0 4px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.adm-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.adm-nav a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.adm main h1 { font-size: clamp(26px, 6vw, 36px); }
.filters .cols { display: grid; gap: 0 16px; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 720px) { .filters .cols { grid-template-columns: repeat(4, 1fr); } .filters .span2 { grid-column: span 2; } }
.pager { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 12px 0; }
.kpis { margin: 8px 0 16px; }
.kpis .kpi-val { font-size: 28px; }
.att { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; } .att li { padding: 8px 0; border-bottom: 1px solid var(--line); }
details { margin-top: 16px; } summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
details.danger summary, .danger-zone h2 { color: var(--err); }
.btn.danger { border-color: var(--err); color: var(--err); } .btn.danger:not([disabled]):hover { background: var(--err); color: var(--surface); }
ul.diff { padding-left: 20px; } ul.diff.add li::marker { content: "+ "; color: var(--ok); } ul.diff.del li { text-decoration: line-through; } ul.diff.del li::marker { content: "− "; color: var(--err); }
ul.diff.chg li::marker { content: "~ "; color: var(--accent); }
.grand-delta { font-size: 18px; }
dl.hours { display: grid; grid-template-columns: max-content 1fr; gap: 2px 16px; margin: 0; } dl.hours dt { font-weight: 600; } dl.hours dd { margin: 0; }
.hours-edit .hrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours-edit .hday { font-weight: 700; } .hours-edit label.check { margin: 0; }
@media (min-width: 720px) { .hours-edit .hrow { grid-template-columns: 1.2fr 1fr 1fr 1fr; } }
fieldset.panel legend { padding: 0; float: left; width: 100%; } fieldset.panel legend + * { clear: both; }
ul.er { padding-left: 20px; }
@media (max-width: 380px) { .top { flex-wrap: wrap; } .brand { font-size: 16px; } .chip { padding: 0 8px; } table.list { font-size: 14px; } }
/* pilot-05 upgrade: named document slots */
ul.slots { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
li.slot { border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px; background: var(--bg); }
li.slot.miss { border-left: 5px solid var(--err); }
.slot-h { margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge.req { color: var(--err); border-color: var(--err); }
.ok-t { color: var(--ok); font-weight: 700; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 15px; margin-top: 8px; }
label:has(+ input.sr:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.slot-edit { display: grid; grid-template-columns: 1fr; gap: 0 12px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; background: var(--bg); }
.slot-edit label { margin: 8px 0 2px; font-size: 14px; }
.slot-edit .row-btns { margin-top: 8px; }
@media (min-width: 720px) { .slot-edit { grid-template-columns: 2fr 3fr auto; align-items: end; } }
.tpl { border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px; margin: 12px 0; }
/* ---- round 2 (12.11.2026): no jumps, small screens ---- */
/* the menu is drawn by the shell script: its line is kept from the start, and everything under the page heading is held
   in place, invisible, until the first data is drawn (public/admin/shell.js) */
.adm-nav { min-height: 52px; }
html.adm-loading main > :not(h1) { visibility: hidden; }
/* client page: while the portal is still loading (no code form, no portal yet) the footer waits, so it does not jump */
main:has(#code-form.hidden):has(#portal.hidden) ~ .foot { visibility: hidden; }
/* a button never touches the field above it */
textarea + .btn, select + .btn, input + .btn { margin-top: 12px; }
/* export buttons are equal, so they share edges when the row wraps */
.row-btns:has(> [data-export]) { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 224px), 1fr)); }
/* pager on a phone: the count on its own line, Previous and Next side by side under it (they used to fall onto three lines) */
@media (max-width: 480px) { .pager { display: grid; grid-template-columns: 1fr 1fr; } .pager > :not(button) { grid-column: 1 / -1; grid-row: 1; text-align: center; } .pager .btn { padding: 0 12px; } }
/* desktop: the back office is wide enough for the whole menu on one line (at 960 px the last entry was cut off) */
@media (min-width: 1024px) { .adm .top, .adm .adm-nav, .adm main, .adm .foot { max-width: 1120px; } }
