:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2330; --muted: #6a7384; --line: #e3e6ec;
  --brand: #1f4fd8; --brand-d: #173ca3; --ok: #15803d; --warn: #b45309; --bad: #b91c1c; --info: #1d4ed8;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171f; --card: #1c212c; --text: #e8ebf2; --muted: #98a1b3; --line: #2c3342; --brand: #5b8cff; --brand-d: #7aa1ff; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 64px; }
h1 { font-size: 24px; margin: 0 0 12px; } h2 { font-size: 18px; margin: 20px 0 10px; } h3 { font-size: 15px; margin: 16px 0 8px; }
.card h2:first-child { margin-top: 0; }

.top { background: var(--card); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav a { padding: 6px 12px; border-radius: 6px; color: var(--text); } nav a:hover { background: var(--bg); text-decoration: none; } nav a.on { background: var(--bg); font-weight: 600; }
.who { display: flex; align-items: center; gap: 12px; } .who form { margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.card.flush { padding: 0; overflow-x: auto; } .card.narrow { max-width: 420px; margin: 40px auto; }
.pad { padding: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: flex-end; } .wrap-row { flex-wrap: wrap; } .row form { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; } .grow { flex: 1; min-width: 180px; }
.crumbs { color: var(--muted); margin: 0 0 8px; }
.muted { color: var(--muted); } .pre { white-space: pre-line; } .plain { list-style: none; padding: 0; margin: 0 0 14px; } .plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.error-text, .danger-text { color: var(--bad); }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.qty { width: 80px; }

.btn { display: inline-block; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; text-align: center; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-d); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; } button.link:hover { text-decoration: underline; }
button.link.danger-text { color: var(--bad); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tfoot td { border-bottom: 0; } tr:last-child td { border-bottom: 0; }
.r { text-align: right; } tr.dim { color: var(--muted); }
.lines td { padding: 6px 8px; } .lines td:first-child { min-width: 240px; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--bg); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.badge.warn { background: #fef3c7; color: #92400e; } .badge.info { background: #dbeafe; color: #1e40af; }
.badge.progress { background: #ede9fe; color: #5b21b6; } .badge.ok { background: #dcfce7; color: #166534; } .badge.bad { background: #fee2e2; color: #991b1b; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--card); }
.flash.ok { background: #dcfce7; color: #14532d; border-color: #86efac; } .flash.error { background: #fee2e2; color: #7f1d1d; border-color: #fca5a5; } .flash.warn { background: #fef3c7; color: #78350f; border-color: #fcd34d; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chips a { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 13px; }
.chips a.on { background: var(--brand); border-color: var(--brand); color: #fff; } .chips .n { opacity: .7; margin-left: 4px; }

.sum { text-align: right; line-height: 1.8; }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { padding: 10px 0 10px 16px; border-left: 2px solid var(--line); }
code { font-size: 13px; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }
