:root { --bg: #f4f5f7; --fg: #15171a; --muted: #5f6670; --card: #fff; --line: #dfe3e8; --blue: #1f6feb; --red: #d1242f; --green: #1a7f37; --warn: #9a6700; --accent: #1f2937; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--blue); }
h1 { font-size: 22px; margin: 8px 0 12px; } h2 { font-size: 18px; margin: 18px 0 8px; } h3 { font-size: 16px; margin: 12px 0 6px; }
.wrap { max-width: 720px; margin: 0 auto; padding: 12px 16px 40px; }
.wide { max-width: 1200px; }
.center { text-align: center; padding-top: 18vh; }
.lead { font-size: 18px; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.btn, button { display: inline-block; border: 0; border-radius: 10px; padding: 12px 16px; font: inherit; font-weight: 600; background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; text-align: center; }
.btn.block, button.block { display: block; width: 100%; margin: 8px 0; }
button.ghost, .btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
button.blue { background: var(--blue); } button.red { background: var(--red); } button.green { background: var(--green); } button.warn { background: #d4a72c; color: #111; }
button:disabled { opacity: .45; cursor: default; }
button.small, .btn.small { padding: 6px 10px; font-size: 14px; border-radius: 8px; }
input, select, textarea { font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 8px; width: 100%; background: #fff; color: var(--fg); }
textarea { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
label { display: block; margin: 8px 0 4px; font-size: 14px; color: var(--muted); }
table { border-collapse: collapse; width: 100%; } th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; font-size: 14px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef1f4; color: var(--fg); }
.pill.wait { background: #fff1c2; color: #6b4e00; } .pill.blue { background: #dbe9ff; color: #0b4bb3; } .pill.red { background: #ffd8db; color: #9b1620; }
.pill.dispute { background: #f0dcff; color: #5b1a8b; } .pill.after { background: #e7e7e7; color: #444; }
.party { display: inline-block; padding: 2px 10px; border-radius: 6px; color: #fff; font-weight: 700; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.status { font-weight: 700; font-size: 18px; margin: 6px 0; }
.route li { padding: 8px 0; border-bottom: 1px solid var(--line); list-style: none; display: flex; justify-content: space-between; }
.route { padding: 0; margin: 0; } .route li.now { font-weight: 800; } .route li.done { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #111; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 99; max-width: 90vw; }
.toast.bad { background: var(--red); }
.tabs { display: flex; gap: 6px; margin: 8px 0; position: sticky; top: 0; background: var(--bg); padding: 6px 0; z-index: 5; }
.tabs button { flex: 1; background: #e6e9ee; color: var(--fg); padding: 10px 6px; font-size: 15px; }
.tabs button.on { background: var(--accent); color: #fff; }
.code { font-size: 44px; font-weight: 900; text-align: center; letter-spacing: .04em; font-family: ui-monospace, Menlo, monospace; margin: 12px 0; }
.code.small { font-size: 22px; }
.steps li { margin: 6px 0; }
.props { background: #fff1c2; border-radius: 10px; padding: 10px; font-weight: 700; }
.green-box { background: #e3f6e8; border-left: 4px solid var(--green); padding: 8px 10px; border-radius: 6px; margin: 6px 0; }
.red-box { background: #fde7e9; border-left: 4px solid var(--red); padding: 8px 10px; border-radius: 6px; margin: 6px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.q-item { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.q-item.wait { background: #fffaf0; } .q-item:hover { background: #f3f6fa; }
/* режим показа документа комиссии */
.showmode { position: fixed; inset: 0; background: #fff; z-index: 50; overflow: auto; padding: 10px 10px 80px; touch-action: pinch-zoom; }
.showmode .hint { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.showmode .close { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); background: #444; user-select: none; -webkit-user-select: none; }
.showmode .close.pressing { background: var(--red); transition: background 1s; }
.showmode .dtabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; }
.showmode .dtabs button { background: #e6e9ee; color: #111; padding: 8px 12px; font-size: 14px; }
.showmode .dtabs button.on { background: #111; color: #fff; }
.showmode.zoom .doc { transform: scale(1.35); transform-origin: top center; margin-bottom: 40%; }
.scanner { position: fixed; inset: 0; background: #000; z-index: 60; display: flex; flex-direction: column; }
.scanner video { flex: 1; object-fit: cover; width: 100%; }
.scanner .bar { padding: 12px; display: flex; justify-content: space-between; align-items: center; color: #fff; }
.chief section { margin-bottom: 18px; }
.chief .rounds td { white-space: nowrap; }
.cell-bad { color: var(--red); font-weight: 700; }
details summary { cursor: pointer; font-weight: 600; }
/* админ */
.adm .tabs { flex-wrap: wrap; }
.adm .savebar { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0; }
.adm .big-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.adm .rtable td { font-size: 13px; } .adm tr.r-open { background: #fff7e0; }
.pl-layout { display: grid; grid-template-columns: 240px 1fr; gap: 12px; align-items: start; }
.pl-list { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; padding: 8px; }
.pl-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; text-decoration: none; color: inherit; font-size: 14px; }
.pl-item .small { margin-left: auto; } .pl-item:hover { background: #f1f3f6; } .pl-item.on { background: var(--accent); color: #fff; } .pl-item.on .muted { color: #cfd5dd; }
.pdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pc-list { display: grid; gap: 10px; margin-top: 10px; }
.pc { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; position: relative; }
.pc.done { opacity: .72; } .pc.now { border: 3px solid #e5534b; box-shadow: 0 0 0 4px #ffe1de; } .pc.next { border: 2px dashed var(--green); }
.pc-flag { position: absolute; top: -11px; left: 12px; background: #e5534b; color: #fff; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 6px; letter-spacing: .03em; }
.pc-flag.next { background: var(--green); }
.pc-h { margin-bottom: 6px; } .pc-t { font-weight: 700; }
.pc-body { display: grid; grid-template-columns: 1fr 340px; gap: 12px; }
.pc-docv .doc { font-size: 13px; margin-bottom: 8px; } .pc-docv .doc .f .v { font-size: 14px; } .pc-docv .doc .f.big .v { font-size: 15px; }
.mono { font-family: ui-monospace, Menlo, monospace; } .c-blue { color: var(--blue); } .c-red { color: var(--red); }
.now-box { background: #ffe9e7; border-left: 4px solid #e5534b; padding: 8px 10px; border-radius: 6px; font-weight: 700; }
.pill.void { background: #eee; }
@media (max-width: 860px) { .pl-layout, .pc-body { grid-template-columns: 1fr; } .pl-list { position: static; max-height: 240px; } .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .grid3, .grid2 { grid-template-columns: 1fr; } }

/* ---------- движок v1 ---------- */
.c-green { color: var(--green); }
.center-card { text-align: center; padding: 24px 16px; }
button.big, .btn.big { font-size: 20px; padding: 16px; }
.role-badge { display: inline-block; background: var(--accent); color: #fff; font-weight: 800; border-radius: 8px; padding: 4px 10px; font-size: 14px; letter-spacing: .02em; margin-bottom: 6px; }
.vh { font-size: 24px; margin: 6px 0 2px; }
.steps .cond { font-weight: 700; color: var(--warn); }
.brief { background: #eef4ff; border-left: 4px solid var(--blue); padding: 8px 10px; border-radius: 6px; }
.fin { margin: 8px 0 12px; }
.net { text-align: center; color: var(--red); }
.row-input { display: flex; gap: 8px; align-items: center; } .row-input input { flex: 1; font-size: 20px; letter-spacing: .1em; }
.kh { margin: 0 0 6px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.docres { border-radius: 8px; padding: 10px 12px; margin: 6px 0; } .docres.ok { background: #e3f6e8; border-left: 4px solid var(--green); } .docres.no { background: #fde7e9; border-left: 4px solid var(--red); }
.decide { border: 2px solid var(--blue); }
tr.r-open { background: #fff7e0; }
.small-tabs { position: static; } .small-tabs button { padding: 6px; font-size: 13px; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.pv-grid pre { white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }
.pairs { display: flex; flex-wrap: wrap; gap: 6px; }
/* кнопки баллов */
.points-sticky { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 8px 16px 6px; border-bottom: 1px solid var(--line); }
.pbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 720px; margin: 0 auto; }
.pbtn { font-size: 22px; font-weight: 900; padding: 18px 8px; border-radius: 14px; letter-spacing: .01em; }
.pbtn.red { background: var(--red); } .pbtn.blue { background: var(--blue); }
.pbtn:active { transform: scale(.98); filter: brightness(.9); }
.pinfo { display: flex; justify-content: space-between; align-items: center; gap: 8px; max-width: 720px; margin: 6px auto 0; font-size: 14px; }
.pscore { display: flex; gap: 14px; } .pscore .rd { color: var(--red); } .pscore .bl { color: var(--blue); }
.pnet.on { color: var(--green); } .pnet.off { color: var(--red); font-weight: 700; }
.plast, .ppend { max-width: 720px; margin: 4px auto 0; font-size: 14px; border-radius: 8px; padding: 6px 10px; }
.plast.ok { background: #e3f6e8; } .plast.bad { background: #fde7e9; } .plast.wait, .ppend { background: #fff1c2; }
#pts .pbar, #pts .pinfo, #pts .plast, #pts .ppend { margin-left: 0; }
/* экран кода ситуации и режим показа */
.showmode .sm-bar { position: fixed; bottom: 14px; left: 0; right: 0; display: flex; gap: 8px; justify-content: center; }
.showmode .sm-bar .close { position: static; transform: none; }
.codebox { text-align: center; } .codebox .qr { width: min(80vw, 360px); height: auto; margin-top: 16px; image-rendering: pixelated; }
.codebox .code { font-size: 54px; }
/* табло */
body.board { --bg: #0e1116; --fg: #e8ecf1; --muted: #9aa4b2; background: var(--bg); color: var(--fg); }
.bwrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 16px; }
.btitle { text-align: center; font-size: clamp(22px, 4vw, 48px); font-weight: 800; margin-bottom: 3vh; }
.bscore { display: grid; grid-template-columns: 1fr 1fr; gap: 3vw; }
.bside { text-align: center; border-radius: 24px; padding: 3vh 2vw; }
.bside.red { background: #3a1316; color: #ff8a80; } .bside.blue { background: #10233f; color: #79b8ff; }
.bname { font-size: clamp(24px, 5vw, 64px); font-weight: 800; letter-spacing: .03em; }
.bnum { font-size: clamp(80px, 20vw, 300px); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.bnet { text-align: center; margin-top: 3vh; font-size: clamp(14px, 2vw, 24px); min-height: 1.4em; }
.bnet.off { color: #ffb4a9; font-weight: 700; }
.askbox { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ask-card { background: #fff; color: #111; border-radius: 14px; padding: 18px; max-width: 420px; width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.ask-card p { font-size: 17px; margin: 0 0 14px; }
.ask-btns { display: flex; gap: 8px; justify-content: flex-end; }
