/* Squaddies: ops-board look. Every colour is a token so light and dark both work. */
:root {
  --bg:#ECEEE8; --surface:#FBFCF9; --surface2:#F1F3EE; --ink:#1A1E1B; --muted:#5B635C; --line:#D3D8CF;
  --accent:#E0A02E; --accent-ink:#1F1400; --accent-text:#875800;
  --ok:#2F7A3D; --ok-bg:#E1F0E2; --warn:#A85A12; --warn-bg:#F8EAD9; --bad:#B3372E; --bad-bg:#F6E0DD;
  --pip:#2B332D; --pip-ink:#F1F3EE;
  --f-display:"Chakra Petch", "Rajdhani", system-ui, sans-serif;
  --f-body:"IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono:"IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r:6px;
}
@media (prefers-color-scheme: dark) { :root {
  --bg:#121614; --surface:#1A1F1C; --surface2:#222824; --ink:#E6EAE3; --muted:#929B93; --line:#2F3631;
  --accent:#E8AA3C; --accent-ink:#1A1100; --accent-text:#F0B955;
  --ok:#74C783; --ok-bg:#1D3022; --warn:#EDA060; --warn-bg:#3A2A1A; --bad:#EC7568; --bad-bg:#3A1F1C;
  --pip:#DCE2D9; --pip-ink:#151916; color-scheme:dark; } }

* { box-sizing:border-box; }
html, body { margin:0; }
body { background:var(--bg); color:var(--ink); font:15px/1.5 var(--f-body); }
button, input, select, textarea { font:inherit; color:inherit; }
a { color:inherit; }
.wrap { max-width:1140px; margin:0 auto; padding-inline:16px; }
h1, h2, h3 { font-family:var(--f-display); font-weight:700; text-wrap:balance; margin:0; letter-spacing:.01em; }
h1 { font-size:1.9rem; line-height:1.1; }
h2 { font-size:1.05rem; text-transform:uppercase; letter-spacing:.06em; }
h3 { font-size:1.2rem; line-height:1.2; }
h3 a { text-decoration:none; }
h3 a:hover { text-decoration:underline; text-decoration-color:var(--accent); }
p { margin:0; }
.mono { font-family:var(--f-mono); font-variant-numeric:tabular-nums; }
.muted { color:var(--muted); }
.small { font-size:.85rem; }
.label { font-family:var(--f-mono); font-size:.72rem; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.stack { display:flex; flex-direction:column; gap:12px; }
.row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.inline { display:inline; margin:0; }

/* top bar */
.top { background:var(--surface); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:5; }
.top-in { display:flex; flex-wrap:wrap; align-items:center; gap:10px 20px; padding-block:10px; }
.brand { display:flex; align-items:center; gap:10px; font-family:var(--f-display); font-weight:700; font-size:1.2rem; letter-spacing:.12em; text-decoration:none; color:var(--ink); }
.logo-mark { width:34px; height:auto; flex:none; color:var(--ink); }
.hero-mark .logo-mark { width:76px; }
.tabs { display:flex; gap:4px; flex-wrap:wrap; }
.tab { padding:7px 12px; border-radius:var(--r); font-weight:500; color:var(--muted); text-decoration:none; }
.tab:hover { color:var(--ink); background:var(--surface2); }
.tab.on { color:var(--ink); background:var(--surface2); box-shadow:inset 0 -2px 0 var(--accent); }
.who { margin-left:auto; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.count { font-family:var(--f-mono); font-size:.75rem; color:var(--muted); }
.count.hot { background:var(--accent); color:var(--accent-ink); border-radius:99px; padding:0 6px; }

main { padding-block:24px 56px; }

/* messages */
.flash { padding:10px 14px; border-radius:var(--r); margin-bottom:16px; background:var(--ok-bg); color:var(--ok); }
.flash.error { background:var(--bad-bg); color:var(--bad); }
.flash.warning { background:var(--warn-bg); color:var(--warn); }

/* buttons */
.btn { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); background:var(--surface); border-radius:var(--r); padding:7px 13px; cursor:pointer; font-weight:500; font-size:.9rem; white-space:nowrap; text-decoration:none; }
.btn:hover { border-color:var(--muted); }
.btn.primary { background:var(--accent); border-color:var(--accent); color:var(--accent-ink); font-weight:600; }
.btn.primary:hover { filter:brightness(1.06); }
.btn.ghost { background:transparent; }
.btn.danger { color:var(--bad); }
.btn.sm { padding:4px 9px; font-size:.8rem; }
.btn.on { background:var(--ink); color:var(--bg); border-color:var(--ink); }
.linkbtn { background:none; border:0; padding:0; cursor:pointer; color:var(--muted); font-size:.88rem; }
.linkbtn:hover { color:var(--ink); }

/* chips, tiers, ranks */
.chip { display:inline-flex; align-items:center; gap:5px; font-size:.75rem; font-weight:500; padding:2px 8px; border-radius:99px; background:var(--surface2); border:1px solid var(--line); white-space:nowrap; }
.chip.ok { background:var(--ok-bg); color:var(--ok); border-color:transparent; }
.chip.warn { background:var(--warn-bg); color:var(--warn); border-color:transparent; }
.chip.bad { background:var(--bad-bg); color:var(--bad); border-color:transparent; }
.chip.acc { background:transparent; color:var(--accent-text); border-color:var(--accent); }
.tier { font-family:var(--f-mono); font-size:.68rem; text-transform:uppercase; letter-spacing:.08em; padding:2px 7px; border-radius:3px; border:1px solid var(--line); color:var(--muted); white-space:nowrap; }
.tier.leader { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.tier.fulltime { color:var(--ink); border-color:var(--ink); }
.tier.probation { border-style:dashed; color:var(--warn); border-color:var(--warn); }
.rank { font-family:var(--f-mono); font-size:.68rem; font-weight:500; letter-spacing:.06em; padding:1px 5px; border-radius:3px; background:var(--pip); color:var(--pip-ink); white-space:nowrap; }
.rank.spec { background:transparent; color:var(--accent-text); border:1px solid var(--accent); }

/* role pips */
.pip { display:inline-grid; place-items:center; width:30px; height:30px; border-radius:4px; background:var(--pip); color:var(--pip-ink); font-family:var(--f-mono); font-size:.72rem; font-weight:500; flex:none; }
.pip.open { background:transparent; color:var(--accent-text); border:1.5px dashed var(--accent); }
.pip.out { background:transparent; color:var(--muted); border:1.5px solid var(--line); text-decoration:line-through; }
.pips { display:flex; gap:5px; flex-wrap:wrap; }

/* page heads, filters, grids */
.head { display:flex; flex-wrap:wrap; align-items:end; justify-content:space-between; gap:12px; margin-bottom:18px; }
.filters { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:22px; }
.filters input[type=search] { flex:1 1 200px; max-width:320px; }
.sec-title { display:flex; flex-wrap:wrap; align-items:baseline; gap:10px; margin:0 0 10px; }
.temps { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:10px; margin-bottom:28px; }
.temp { background:var(--surface); border:1px solid var(--accent); border-radius:var(--r); padding:12px 14px; display:flex; gap:12px; align-items:center; }
.temp > div { min-width:0; flex:1; }
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px; }
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:16px; display:flex; flex-direction:column; gap:10px; }
.card:hover { border-color:var(--muted); }
.card .desc { color:var(--muted); font-size:.9rem; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.card .foot { display:flex; flex-wrap:wrap; gap:6px; margin-top:auto; }
.empty { padding:28px; text-align:center; color:var(--muted); border:1px dashed var(--line); border-radius:var(--r); }

/* forms */
input[type=text], input[type=search], input[type=email], input[type=password], input[type=time], input[type=number], select, textarea {
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:7px 9px; min-width:0; max-width:100%;
}
textarea { width:100%; resize:vertical; }
.form { display:grid; gap:16px; max-width:720px; }
.form .field { display:flex; flex-direction:column; gap:5px; }
.form .field label { font-weight:600; font-size:.88rem; }
.form .field input, .form .field select, .form .field textarea { width:100%; }
.form .help { color:var(--muted); font-size:.82rem; }
.form .errs { color:var(--bad); font-size:.85rem; }
.two { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; }

/* panels */
.panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); }
.panel + .panel { margin-top:18px; }
.panel-h { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--line); }
.panel-b { padding:14px 16px; }
.panel-f { display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:12px 16px; border-top:1px solid var(--line); background:var(--surface2); border-radius:0 0 var(--r) var(--r); }

/* squad page */
.back { color:var(--muted); font-size:.88rem; text-decoration:none; display:inline-block; margin-bottom:12px; }
.back:hover { color:var(--ink); }
.sq-head { display:flex; flex-wrap:wrap; gap:14px; justify-content:space-between; align-items:start; margin-bottom:20px; }
.sq-head > div:first-child { min-width:0; flex:1 1 380px; display:flex; flex-direction:column; gap:6px; }
.sq-head .desc { max-width:62ch; color:var(--muted); }
.cols { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:18px; align-items:start; }
@media (max-width:880px) { .cols { grid-template-columns:minmax(0,1fr); } }
.when { font-family:var(--f-display); font-size:1.3rem; font-weight:600; line-height:1.2; }
.session.off .lineup { opacity:.55; }
.lineup { display:flex; flex-direction:column; gap:8px; }
.lslot { display:grid; grid-template-columns:30px minmax(0,1fr) auto; gap:6px 12px; align-items:center; padding:9px 11px; border-radius:var(--r); background:var(--surface2); border:1px solid transparent; }
.lslot.gap { border:1px dashed var(--warn); background:transparent; }
.lslot.covered { border-style:solid; border-color:var(--line); }
.lslot .who-cell { min-width:0; }
.lslot .who-cell b { font-weight:600; }
.lslot .sub { font-size:.8rem; color:var(--muted); }
.fix { grid-column:2 / -1; display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.fix form { margin:0; }
@media (max-width:520px) { .lslot { grid-template-columns:30px minmax(0,1fr); } .lslot > .state { grid-column:2; } }
.notice { padding:10px 12px; border-radius:var(--r); background:var(--warn-bg); color:var(--warn); font-size:.9rem; }
.notice.ok { background:var(--ok-bg); color:var(--ok); }
.people { list-style:none; margin:0; padding:0; }
.people li { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; padding:10px 16px; border-top:1px solid var(--line); }
.people li:first-child { border-top:0; }
.people .nm { display:flex; align-items:center; gap:10px; min-width:0; flex:1 1 200px; }
.people .nm > div { min-width:0; }
.people .acts { display:flex; flex-wrap:wrap; gap:6px; }
.people .acts form { margin:0; display:flex; gap:6px; }
.bar { height:4px; background:var(--line); border-radius:2px; width:70px; overflow:hidden; display:inline-block; vertical-align:middle; }
.bar i { display:block; height:100%; background:var(--warn); }
.bar.done i { background:var(--ok); }
.note { font-size:.85rem; color:var(--muted); flex-basis:100%; margin-left:40px; }
details.more summary { cursor:pointer; color:var(--muted); font-size:.85rem; }

/* chat */
.chat { display:flex; flex-direction:column; height:560px; position:sticky; top:76px; }
@media (max-width:880px) { .chat { position:static; height:460px; } }
.msgs { flex:1; overflow-y:auto; padding:12px 16px; display:flex; flex-direction:column; gap:10px; }
.msg .meta { font-size:.75rem; color:var(--muted); }
.msg .meta b { color:var(--ink); font-weight:600; }
.msg p { margin:1px 0 0; overflow-wrap:anywhere; white-space:pre-line; }
.msg.sys { font-family:var(--f-mono); font-size:.76rem; color:var(--muted); border-left:2px solid var(--accent); padding-left:8px; }
.chat form { display:flex; gap:6px; padding:10px; border-top:1px solid var(--line); }
.chat form input { flex:1; }

/* my squads */
.mrow { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:14px 16px; display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) auto; gap:10px 18px; align-items:center; }
.mrow form { margin:0; }
@media (max-width:760px) { .mrow { grid-template-columns:minmax(0,1fr); } }

/* forum */
.board-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 16px; padding:14px 16px; border-top:1px solid var(--line); text-decoration:none; }
.board-row:first-child { border-top:0; }
a.board-row:hover { background:var(--surface2); }
.board-row.locked { color:var(--muted); }
.post { display:grid; grid-template-columns:170px minmax(0,1fr); gap:16px; padding:16px; border-top:1px solid var(--line); }
.post:first-child { border-top:0; }
.post.hidden-post { opacity:.5; }
.post .body { white-space:pre-line; overflow-wrap:anywhere; }
@media (max-width:640px) { .post { grid-template-columns:minmax(0,1fr); gap:6px; } }

/* profile */
.stat-row { display:flex; flex-wrap:wrap; gap:28px; }
.stat b { display:block; font-family:var(--f-display); font-size:1.6rem; line-height:1.1; }
.progress { height:8px; background:var(--line); border-radius:4px; overflow:hidden; max-width:360px; }
.progress i { display:block; height:100%; background:var(--accent); }

.foot-bar { border-top:1px solid var(--line); padding-block:16px; color:var(--muted); font-size:.8rem; }
@media (prefers-reduced-motion:no-preference) { .card, .btn, .tab { transition:border-color .15s, background .15s; } }

/* news + about */
.news-list { display:flex; flex-direction:column; gap:12px; }
.news-item { display:flex; flex-direction:column; gap:8px; padding:20px 22px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r); text-decoration:none; color:var(--ink); }
.news-item:hover { border-color:var(--muted); }
.news-item:hover h3 { text-decoration:underline; text-decoration-color:var(--accent); }
.news-item h3 { margin-top:2px; }
.news-item p { margin:0; line-height:1.55; }
.news-item .row { gap:10px; }
.news-item.pinned { border-color:var(--accent); box-shadow:inset 3px 0 0 var(--accent); }
.banner-msg { color:var(--muted); max-width:62ch; }
.banner-msg a { color:var(--accent-text); font-weight:500; }
.cat { font-family:var(--f-mono); font-size:.68rem; text-transform:uppercase; letter-spacing:.08em; padding:2px 7px; border-radius:3px; background:var(--surface2); border:1px solid var(--line); }
.cat-site { background:var(--ink); color:var(--bg); border-color:var(--ink); }
.cat-org { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.cat-ranks { background:var(--ok-bg); color:var(--ok); border-color:transparent; }
.cat-hails { background:var(--warn-bg); color:var(--warn); border-color:transparent; }
.cat-squads { color:var(--accent-text); border-color:var(--accent); background:transparent; }
.article { max-width:760px; display:flex; flex-direction:column; gap:12px; }
.article h1 { font-size:2.1rem; }
.lede { font-size:1.1rem; color:var(--muted); }
.prose { display:flex; flex-direction:column; gap:12px; max-width:65ch; line-height:1.65; }
.prose p { margin:0; }
.bulletin { margin-top:22px; display:flex; flex-direction:column; gap:10px; }
.bulletin .people { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); }
.names { line-height:1.8; }
.defs { margin:0; display:grid; gap:10px; }
.defs > div { display:grid; grid-template-columns:120px minmax(0,1fr); gap:12px; }
.defs dt { font-family:var(--f-display); font-weight:700; }
.defs dd { margin:0; color:var(--muted); }
@media (max-width:560px) { .defs > div { grid-template-columns:minmax(0,1fr); gap:2px; } }
.table-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:var(--r); background:var(--surface); }
.ladder { width:100%; border-collapse:collapse; font-size:.9rem; }
.ladder th, .ladder td { text-align:left; padding:9px 12px; border-top:1px solid var(--line); vertical-align:top; }
.ladder thead th { border-top:0; font-family:var(--f-mono); font-size:.7rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:500; }
.ladder td:first-child { white-space:nowrap; }
