:root {
  --ink: #17202c; --muted: #647082; --line: #dde3ea; --bg: #f4f6f9; --card: #fff;
  --brand: #0f6fde; --brand-ink: #0a56ad; --navy: #0b2a4a;
  --ok: #17794a; --ok-bg: #e4f5ec; --warn: #8a5a00; --warn-bg: #fff3d9; --err: #b3261e; --err-bg: #fde9e7; --info-bg: #e6f0fd;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 16px; line-height: 1.2; }
h2 { font-size: 16px; margin: 18px 0 8px; }
.card > h2:first-child { margin-top: 0; }
p { margin: 0 0 10px; }
.muted, small { color: var(--muted); font-size: 13px; }

.top { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; background: var(--navy); color: #fff; }
.brand { color: #fff; font-weight: 700; font-size: 17px; }
.brand span { font-weight: 400; opacity: .7; }
.brand:hover { text-decoration: none; }
.top nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.top nav a { color: #c9d6e6; padding: 6px 12px; border-radius: 6px; white-space: nowrap; }
.top nav a:hover { background: rgba(255, 255, 255, .1); text-decoration: none; }
.top nav a.on { background: rgba(255, 255, 255, .16); color: #fff; }
.who { display: flex; gap: 12px; align-items: center; font-size: 13px; color: #c9d6e6; margin: 0; white-space: nowrap; }
.who a { color: #c9d6e6; text-decoration: underline; }
button.link { background: none; border: 0; color: #fff; cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }

main { max-width: 1080px; margin: 0 auto; padding: 28px 24px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.narrow { max-width: 440px; margin: 40px auto; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.head h1 { margin: 0; }

.stack { display: grid; gap: 14px; }
.stack.tight { gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.inline { display: inline-block; margin: 0 6px 4px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
label { display: grid; gap: 5px; font-weight: 600; font-size: 14px; }
label small, label .muted { font-weight: 400; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
input, select { font: inherit; padding: 9px 11px; border: 1px solid #c3ccd8; border-radius: 7px; background: #fff; color: var(--ink); width: 100%; min-width: 0; }
input[type="checkbox"] { width: auto; }
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input.qty { width: 90px; }
.row input { width: auto; flex: 1; min-width: 180px; max-width: 320px; }

.btn { display: inline-block; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 7px; border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--brand-ink); border-color: var(--brand-ink); text-decoration: none; }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.ghost { background: #fff; color: var(--ink); border-color: #c3ccd8; }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: #fff; color: var(--err); border-color: #e3b1ad; }
.btn.danger:hover { background: var(--err-bg); }
.stack > .btn { justify-self: start; }

.notice { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid transparent; }
.notice.ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe5d0; }
.notice.warn { background: var(--warn-bg); color: var(--warn); border-color: #f1dca6; }
.notice.err { background: var(--err-bg); color: var(--err); border-color: #f3c5c1; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--err-bg); color: var(--err); }
.pill.info { background: var(--info-bg); color: var(--brand-ink); }
.pill.mute { background: #e9edf2; color: var(--muted); }

.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; }
.card .tablewrap { border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.empty { background: var(--card); border: 1px dashed #c3ccd8; border-radius: 10px; padding: 28px; text-align: center; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats a { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; color: var(--ink); display: grid; gap: 2px; }
.stats a:hover { border-color: var(--brand); text-decoration: none; }
.stats b { font-size: 28px; line-height: 1.1; }
.stats span { color: var(--muted); font-size: 13px; }

.facts { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

.quote { border: 1px dashed #c3ccd8; border-radius: 8px; padding: 14px; color: var(--muted); display: grid; gap: 4px; }
.quote.has { border-style: solid; border-color: #b9d4f7; background: var(--info-bg); color: var(--ink); }
.quote.has b { font-size: 22px; }
.quote.bad { border-color: #f3c5c1; background: var(--err-bg); color: var(--err); }
.quote .tip { color: var(--brand-ink); font-weight: 600; }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 6px 12px; border-radius: 999px; color: var(--muted); white-space: nowrap; font-size: 14px; }
.tabs a.on { background: var(--navy); color: #fff; }
.actions .row:last-child { margin-bottom: 0; }

@media (max-width: 640px) {
  .top { padding: 0 16px; gap: 12px; }
  .who a { display: none; }
  main { padding: 20px 16px 48px; }
  .grid2, .grid3, .facts { grid-template-columns: 1fr; }
  .facts dt { margin-top: 6px; }
}

pre { background: #0f1b2b; color: #dbe6f3; padding: 14px 16px; border-radius: 8px; overflow-x: auto; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 8px 0 14px; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #eef1f5; padding: 1px 5px; border-radius: 4px; }
code.key { display: block; margin-top: 8px; padding: 10px 12px; background: #fff; border: 1px solid #bfe5d0; word-break: break-all; font-size: 14px; user-select: all; }
.skurow { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); align-items: end; }
.skurow label { flex: 1; min-width: 220px; max-width: 340px; }
.skurow label input { width: 100%; max-width: none; }
