:root {
  --ink: #16202e; --muted: #5f6b7a; --line: #dde3ea; --bg: #f4f6f9; --card: #ffffff;
  --accent: #1f3a5f; --accent-soft: #e8eef7; --ok: #1b7a4b; --warn: #a15c00; --money: #8a1c3a;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
.topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 20px; background: var(--accent); color: #fff; }
.topbar a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 17px; }
nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
nav a { opacity: .8; padding-bottom: 2px; }
nav a.on, nav a:hover { opacity: 1; border-bottom: 2px solid #fff; }
nav form { margin: 0; }
main { max-width: 1100px; margin: 0 auto; padding: 16px 16px 110px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 14px; }
.card.narrow { max-width: 380px; margin: 60px auto; }
h1 { font-size: 22px; margin: 0 0 8px; } h2 { font-size: 18px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 14px 0; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]), select { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; background: #fff; }
input:focus, select:focus, button:focus-visible, summary:focus-visible { outline: 2px solid #5b8def; outline-offset: 1px; }
fieldset.doctype { border: 0; padding: 0; margin: 6px 0 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
fieldset legend { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 400; color: var(--ink); font-size: 14px; }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check { font-weight: 400; color: var(--ink); font-size: 14px; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 8px 12px; }
button.primary, a.button { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; padding: 10px 18px; border-radius: 7px; text-decoration: none; display: inline-block; }
button.link { border: 0; background: none; padding: 0; color: inherit; text-decoration: underline; }
.card button.link { color: var(--accent); }
.alert { background: #fdecea; color: #8a1c1c; padding: 10px 12px; border-radius: 7px; }
.toolbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar input[type=search] { flex: 1 1 260px; margin: 0; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
details.category > summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; cursor: pointer; font-size: 17px; font-weight: 700; list-style: none; }
details.category > summary::-webkit-details-marker { display: none; }
details.category > summary::before { content: "▸"; color: var(--muted); margin-right: 8px; }
details.category[open] > summary::before { content: "▾"; }
.cat-name { flex: 1; }
.count { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cat-actions { font-size: 13px; margin: 8px 0; }
ul.items { list-style: none; margin: 0; padding: 0; }
.item { border-top: 1px solid var(--line); padding: 12px 0; }
.item-head { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink); cursor: pointer; }
.item-head input { width: 19px; height: 19px; margin-top: 2px; flex: none; }
.item-name { flex: 1; font-weight: 600; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge.cost { background: #e6f4ec; color: var(--ok); } .badge.money { background: #fbe9ee; color: var(--money); } .badge.special { background: #fff1dc; color: var(--warn); }
.summary { margin: 4px 0 6px 29px; color: var(--muted); font-size: 14px; }
.spec { margin: 0 0 6px 29px; display: none; }
.item:has(.item-head input:checked) { background: linear-gradient(90deg, var(--accent-soft), transparent 60%); }
.item:has(.item-head input:checked) .spec { display: block; }
details.where { margin-left: 29px; font-size: 13px; color: var(--muted); }
details.where summary { cursor: pointer; }
details.where q { font-style: italic; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 20px; display: flex; justify-content: center; align-items: center; gap: 20px; box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
.scroll { overflow-x: auto; }
table.matrix { border-collapse: collapse; font-size: 13px; min-width: 100%; }
table.matrix th, table.matrix td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; text-align: left; min-width: 150px; }
table.matrix thead th { background: var(--accent-soft); position: sticky; top: 0; }
table.matrix th[scope=row] { min-width: 240px; font-weight: 600; } table.matrix th small { font-weight: 400; color: var(--muted); }
td.yes { background: #f1f9f4; } td.no { background: #fafbfc; }
ol.sections li { margin-bottom: 10px; }
.hidden { display: none !important; }
details.where li.notin { color: var(--warn); }
