[hidden] { display: none !important; }
:root {
  --bg: #f6f6f4; --panel: #fff; --text: #1d1f23; --muted: #6b6f76; --line: #e2e2de;
  --link: #2a64b0; --link-h: #1b4580; --h1: #8a1f1f; --top: #1c1d20; --top-text: #e9e6df; --accent: #8a1f1f;
  --good: #2f7d32; --bad: #b3261e; --chip: #efeee9; --row-h: #fafaf7;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #131416; --panel: #1b1c1f; --text: #e6e4df; --muted: #9a9ca1; --line: #2c2e33;
    --link: #6ea8fe; --link-h: #a9c9ff; --h1: #e0827a; --top: #0c0d0e; --top-text: #e9e6df; --accent: #c0392b;
    --good: #6cc070; --bad: #ef6b63; --chip: #26282c; --row-h: #202125;
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #131416; --panel: #1b1c1f; --text: #e6e4df; --muted: #9a9ca1; --line: #2c2e33;
  --link: #6ea8fe; --link-h: #a9c9ff; --h1: #e0827a; --top: #0c0d0e; --top-text: #e9e6df; --accent: #c0392b;
  --good: #6cc070; --bad: #ef6b63; --chip: #26282c; --row-h: #202125;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.43 'Helvetica Neue', Helvetica, Arial, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-h); text-decoration: underline; }
h1 { font-size: 36px; font-weight: 500; margin: 20px 0 14px; line-height: 1.1; color: var(--h1); }
h2 { font-size: 24px; font-weight: 500; margin: 1.6rem 0 .6rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
.wrap { width: min(1080px, 100% - 1.5rem); margin: 0 auto; }
main { min-height: 70vh; padding-bottom: 2rem; }
.muted { color: var(--muted); }
.good { color: var(--good); font-weight: 600; }
.inline { display: inline; }
code, .mono { font-family: ui-monospace, Consolas, 'Cascadia Mono', monospace; font-size: .9em; }

/* Top bar */
.top { background: var(--top); color: var(--top-text); border-bottom: 3px solid var(--accent); }
.top-in { display: flex; align-items: center; gap: 1.5rem; min-height: 52px; flex-wrap: wrap; }
.top a { color: var(--top-text); }
.logo { font-weight: 700; font-size: 1.1rem; letter-spacing: .02em; }
.main-nav, .acct { display: flex; gap: 1rem; align-items: center; }
.main-nav a.on { text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.acct { margin-left: auto; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn.danger { color: var(--bad); }

/* Buttons and fields */
.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 4px; padding: .5rem 1rem; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.1); color: #fff; text-decoration: none; }
.btn.small { padding: .3rem .7rem; font-size: .85rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: .45rem .55rem; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { display: block; font-weight: 600; font-size: .9rem; margin: .9rem 0 .3rem; }
label input, label select, label textarea { display: block; width: 100%; margin-top: .3rem; font-weight: 400; }
.hint { color: var(--muted); font-size: .85rem; margin: .2rem 0 .5rem; }
.err { background: color-mix(in srgb, var(--bad) 12%, transparent); border-left: 3px solid var(--bad); padding: .6rem .8rem; }

/* Tabs and filters */
.tabs { list-style: none; display: flex; flex-wrap: wrap; gap: .2rem; padding: 0; margin: 0 0 .8rem; border-bottom: 1px solid var(--line); }
.tabs a { display: flex; align-items: center; gap: .4rem; padding: .5rem .8rem; color: var(--text); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { border-bottom-color: var(--accent); font-weight: 600; }
.tabs a:hover { text-decoration: none; background: var(--row-h); }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.filters input[type=search] { flex: 1 1 180px; }

/* Icons */
.ic { width: 1em; height: 1em; fill: currentColor; vertical-align: -0.15em; }
.fm { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 4px; background: var(--fc, #777); color: #fff; font-size: 22px; flex: none; }
.tabs .fm { width: 22px; height: 22px; font-size: 16px; }
.ui { display: inline-grid; place-items: center; color: var(--muted); }
.c-fm { width: 46px; text-align: center; }
.c-fm .ui { display: block; font-size: 26px; margin-top: 4px; color: var(--text); }
.steps .ui { font-size: 18px; margin-right: .45rem; vertical-align: middle; }
.steps tr.k-commander .ui { color: #b8892e; } .steps tr.k-unit .ui { color: #3d8bd1; }
.details .fm { width: 20px; height: 20px; font-size: 14px; vertical-align: middle; }

/* Build list */
.blist { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); }
.blist td { padding: .65rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.blist tr:hover td { background: var(--row-h); }
.bt { font-weight: 600; font-size: 1.02rem; }
.by { color: var(--muted); font-size: .85rem; }
.by a { color: var(--muted); }
.c-mu, .c-type { white-space: nowrap; font-size: .9rem; }
.c-stats { white-space: nowrap; font-size: .85rem; text-align: right; }
.empty { background: var(--panel); border: 1px solid var(--line); padding: 1.5rem; text-align: center; }
.pager { display: flex; justify-content: space-between; margin-top: 1rem; }
@media (max-width: 700px) {
  .blist tr { display: grid; grid-template-columns: 3.6rem 1fr; }
  .blist td { border: 0; padding: .35rem .5rem; }
  .blist .c-fm { grid-row: span 3; padding-top: .7rem; }
  .blist .c-mu, .blist .c-type, .blist .c-stats { text-align: left; display: flex; gap: .5rem; }
  .blist .c-mu div, .blist .c-type div, .blist .c-stats div { display: inline; }
  .blist tr { border-bottom: 1px solid var(--line); padding: .3rem 0; }
  .acct { margin-left: 0; }
}

/* Build page */
.h-sub { color: var(--muted); font-weight: 400; }
.meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; color: var(--muted); font-size: .9rem; }
.vote { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin: 1rem 0; }
.vbtn { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 4px; padding: .3rem .7rem; font: inherit; cursor: pointer; }
.vbtn.on { border-color: var(--good); color: var(--good); font-weight: 600; }
.vbtn.on.down { border-color: var(--bad); color: var(--bad); }
.owner { margin-left: auto; display: flex; gap: .8rem; }
.desc p, .desc ul { margin: 0 0 .7rem; }
.vod { position: relative; aspect-ratio: 16/9; max-width: 720px; }
.vod iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.steps { border-collapse: collapse; width: 100%; background: var(--panel); border: 1px solid var(--line); }
.steps th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .45rem .6rem; border-bottom: 1px solid var(--line); }
.steps td { padding: .4rem .6rem; border-bottom: 1px solid var(--line); }
.steps td.num { font-family: ui-monospace, Consolas, monospace; white-space: nowrap; width: 1%; color: var(--muted); }
.comments { list-style: none; padding: 0; }
.comments li { border-bottom: 1px solid var(--line); padding: .6rem 0; }
.cform { display: grid; gap: .5rem; justify-items: start; }

/* Forms */
.bform { max-width: 820px; }
.bform .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 .8rem; }
.unitbar { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .5rem; }
.unitbar > div { display: contents; }
.unitbar > div[hidden] { display: none; }
.chip { background: var(--chip); border: 1px solid var(--line); color: var(--text); border-radius: 3px; padding: .2rem .5rem; font: inherit; font-size: .8rem; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.preview { margin-top: .5rem; font-size: .85rem; color: var(--muted); }
.preview table { width: 100%; border-collapse: collapse; }
.preview td { padding: .2rem .4rem; border-bottom: 1px dashed var(--line); color: var(--text); }
.auth { max-width: 380px; }
.prose { max-width: 720px; }

.foot { border-top: 1px solid var(--line); margin-top: 2rem; padding: 1rem 0 2rem; font-size: .85rem; }
.foot p { margin: .3rem 0; }

/* Parity additions */
.btn.ghost { background: transparent; color: var(--link); border: 1px solid var(--line); }
.btn.ghost:hover { color: var(--link-h); border-color: var(--accent); }
.btn.block { display: block; width: 100%; text-align: center; }
.cta { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); border: 1px solid var(--line); padding: .6rem .9rem; border-radius: 4px; }
.mu-links { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: -.3rem 0 1rem; }
.mu-links a { display: block; padding: .2rem .6rem; border: 1px solid var(--line); border-radius: 3px; color: var(--text); font-size: .85rem; background: var(--panel); }
.mu-links a.on { border-color: var(--accent); color: var(--link); font-weight: 600; }
.listing { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 1.5rem; align-items: start; }
.side { font-size: .9rem; }
.side h2.sh { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.1rem 0 .3rem; }
.side label { font-weight: 400; color: var(--muted); font-size: .85rem; margin: .5rem 0 .2rem; }
.side-search input { width: 100%; }
.opts { list-style: none; padding: 0; margin: 0; }
.opts li { padding: .15rem 0; }
.opts a { color: var(--text); }
.opts a.on { color: var(--link); font-weight: 600; }
.opts a.on::before { content: '› '; }
.check a { display: flex; align-items: center; gap: .5rem; color: var(--text); font-size: .9rem; text-decoration: none; }
.check .cb { flex: none; width: 16px; height: 16px; border: 1px solid var(--muted); border-radius: 3px; background: var(--panel); display: grid; place-items: center; font-size: 12px; line-height: 1; color: #fff; }
.check .cb.on { background: var(--link); border-color: var(--link); }
.small-help { font-size: .85rem; }
.listing .side > .check, .listing .side > .small-help { grid-column: 1 / -1; }
.pager { align-items: center; }
.build-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.8rem; align-items: start; }
.build-side { position: sticky; top: 1rem; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: .8rem; display: grid; gap: .6rem; }
.box .vote { margin: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.details { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.toggles { display: grid; gap: .1rem; }
.tg { font-weight: 400; margin: 0; display: flex; align-items: center; gap: .4rem; font-size: .88rem; }
.tg input { width: auto; margin: 0; }
.kd { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; }
.kd.k-commander { background: #c9a24a; } .kd.k-unit { background: #3d8bd1; } .kd.k-other { background: #8a8d93; }
.steps-tools { display: flex; gap: .5rem; margin-bottom: .6rem; flex-wrap: wrap; }
.steps.color tr.k-commander td.act { border-left: 4px solid #c9a24a; }
.steps.color tr.k-unit td.act { border-left: 4px solid #3d8bd1; }
.steps.color tr.k-other td.act { border-left: 4px solid #8a8d93; }
.steps.hide-time .tcol { display: none; }
.steps tr.cur td { background: color-mix(in srgb, var(--good) 18%, var(--panel)); }
.steps tr.done td { opacity: .45; }
.player { position: sticky; bottom: 0; background: var(--panel); border: 1px solid var(--accent); border-radius: 4px; padding: .8rem 1rem; margin: .8rem 0; display: grid; gap: .3rem; box-shadow: 0 -4px 16px rgba(0,0,0,.25); }
.p-clock { font: 700 1.8rem ui-monospace, Consolas, monospace; }
.p-now { font-size: 1.15rem; font-weight: 600; }
.p-ctl { display: flex; gap: .5rem; }
@media (max-width: 860px) {
  .listing, .build-grid { grid-template-columns: 1fr; }
  .listing .side { order: -1; }
  .listing .side { display: block; border-bottom: 1px solid var(--line); padding-bottom: .8rem; }
  .listing .side .opts { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
  .listing .side h2.sh { margin-top: .7rem; }
  .build-side { position: static; }
}

.lead { color: var(--muted); margin: -.4rem 0 1rem; }
