:root {
  --bg: #f3f1ec;
  --surface: #ffffff;
  --surface-2: #f8f7f3;
  --line: #dcd8cd;
  --text: #1d1f1c;
  --muted: #676a62;
  --accent: #9e1b32;          /* 82nd red */
  --accent-2: #1f3a68;        /* 82nd blue */
  --tag-bg: #1f3a68;
  --tag-fg: #ffffff;
  --good: #2e7d4f;
  --warn: #a8670f;
  --bad: #a83232;
  --radius: 6px;
  --sans: "IBM Plex Sans Condensed", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121411;
    --surface: #1b1e1a;
    --surface-2: #20241f;
    --line: #2f342d;
    --text: #e7e6df;
    --muted: #9a9d93;
    --accent: #e0566d;
    --accent-2: #8fb0e8;
    --tag-bg: #2c4a7e;
    --good: #5fbf86;
    --warn: #e0a548;
    --bad: #e06a6a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
}
a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: .92em; }
main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 48px; }

/* top bar: brand | grouped menu | account, lined up with the page content */
.topbar { background: var(--surface); border-bottom: 3px solid var(--accent); }
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 10px 16px;
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav account";
  align-items: center; gap: 12px 20px;
}
.brand { grid-area: brand; display: flex; gap: 12px; align-items: center; text-decoration: none; }
/* the unit's Discord server icon (public/brand.webp) */
.brand-mark { display: block; width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover; }
.brand strong { display: block; font-size: 17px; letter-spacing: .02em; text-transform: uppercase; line-height: 1.15; white-space: nowrap; }
.brand small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }

.mainnav { grid-area: nav; display: flex; justify-content: center; align-items: center; min-width: 0; overflow: hidden; }
.nav-group { display: flex; gap: 2px; flex: none; }
.nav-group + .nav-group { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--line); }
.mainnav a {
  display: block; padding: 7px 9px; border-radius: var(--radius); white-space: nowrap;
  text-decoration: none; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.mainnav a:hover { color: var(--text); background: var(--surface-2); }
.mainnav a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.mainnav a[aria-current="page"] {
  color: var(--text); background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.account { grid-area: account; display: flex; justify-content: flex-end; }
.userbar { display: flex; gap: 12px; align-items: center; margin: 0; }
.who { display: flex; gap: 8px; align-items: center; min-width: 0; }
.who-mark {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--accent-2); color: var(--surface); font: 700 12px var(--sans); letter-spacing: .02em;
}
.who-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.who-text b { font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text small { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.signout {
  font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .06em; cursor: pointer;
  padding: 6px 10px; border-radius: var(--radius); border: 1px solid var(--line); background: none; color: var(--muted);
}
.signout:hover { color: var(--text); border-color: var(--muted); }
.signin.btn { min-height: 36px; padding: 6px 14px; text-decoration: none; }

/* Not enough room for one line (the page script adds .stacked, or a narrow screen):
   brand + account on top, the menu as its own full-width row. */
.topbar.stacked .topbar-inner { grid-template-columns: 1fr auto; grid-template-areas: "brand account" "nav nav"; padding-bottom: 0; }
.topbar.stacked .mainnav {
  justify-content: flex-start; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 6px 16px 8px; border-top: 1px solid var(--line);
}
@media (max-width: 760px) {
  .topbar-inner { grid-template-columns: 1fr auto; grid-template-areas: "brand account" "nav nav"; padding-bottom: 0; }
  .mainnav {
    justify-content: flex-start; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin: 0 -16px; padding: 6px 16px 8px; border-top: 1px solid var(--line);
  }
  .mainnav::-webkit-scrollbar { display: none; }
}
@media (max-width: 600px) {
  .brand small, .who-text { display: none; }
  .brand strong { font-size: 15px; }
  .nav-group + .nav-group { margin-left: 6px; padding-left: 6px; }
  .mainnav a { padding: 7px 8px; }
}


/* headings */
.eyebrow { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 600; }
h1 { margin: 2px 0 0; font-size: 30px; line-height: 1.15; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 10px; }
.count { color: var(--muted); font-weight: 500; font-family: var(--mono); font-size: 13px; margin-left: 4px; }

.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px; min-width: 84px; }
.stat b { display: block; font: 600 20px var(--mono); }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-muted b { color: var(--muted); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }

.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input, .filters select {
  font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 10px; min-height: 40px;
}
.filters input { flex: 1 1 240px; }
.filters select { flex: 0 1 260px; min-width: 0; }

/* roster table */
.unit { margin-bottom: 22px; }
.unit h2 { border-left: 4px solid var(--accent-2); padding-left: 8px; }
.former summary { cursor: pointer; list-style: none; }
.former summary::-webkit-details-marker { display: none; }
.former summary h2 { display: inline-block; border-left-color: var(--muted); color: var(--muted); }
.former summary h2::after { content: " ▸"; }
.former[open] summary h2::after { content: " ▾"; }

/* Wide tables scroll sideways inside their box instead of being cut off (phones). */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.roster { width: 100%; border-collapse: collapse; }
.roster th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-weight: 600;
}
.roster td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.roster tbody tr:last-child td { border-bottom: 0; }
.roster tbody tr { cursor: pointer; }
.roster tbody tr:hover { background: var(--surface-2); }
.roster td.rank { width: 64px; }
.who { display: flex; align-items: center; gap: 10px; }
.who a { font-weight: 600; text-decoration: none; }
.who a:hover { text-decoration: underline; }

.rank-tag {
  display: inline-block; min-width: 44px; text-align: center; padding: 2px 6px; border-radius: 3px;
  background: var(--tag-bg); color: var(--tag-fg); font: 600 12px var(--mono); letter-spacing: .03em;
}
.rank-tag.big { font-size: 20px; padding: 2px 10px; vertical-align: 3px; }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600;
  border: 1px solid currentColor; white-space: nowrap; color: var(--muted);
}
.pill-active { color: var(--good); }
.pill-loa, .pill-reserve { color: var(--warn); }
.pill-awol, .pill-discharged { color: var(--bad); }
.flag { font-size: 11px; color: var(--bad); border: 1px solid; border-radius: 3px; padding: 0 4px; text-transform: uppercase; }

.avatar { border-radius: 50%; flex: none; object-fit: cover; background: var(--surface-2); }
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 88px; height: 88px; border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.avatar-blank { display: inline-grid; place-items: center; font: 600 11px var(--mono); color: var(--muted); border: 1px solid var(--line); }
.avatar-lg.avatar-blank { font-size: 26px; }

/* activity */
.activity { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; position: sticky; top: 16px; }
.activity h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.activity ul { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.activity li:first-child { border-top: 0; }
.activity li a { text-decoration: none; }
.activity li span { display: block; color: var(--text); overflow-wrap: anywhere; }
.activity time { display: block; color: var(--muted); font-size: 12px; font-family: var(--mono); }

/* SRB page */
.back { display: inline-block; margin-bottom: 14px; text-decoration: none; color: var(--muted); font-weight: 600; }
.srb { max-width: 980px; }
.srb-head { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; }
.srb-id h1 { font-size: 32px; overflow-wrap: anywhere; }
.sub { margin: 6px 0 0; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.fields {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.field { padding: 12px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.field:nth-child(3n) { border-right: 0; }
.field:nth-last-child(-n + 3) { border-bottom: 0; }
.field dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.field dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.field small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { padding: 8px 0; border-top: 1px solid var(--line); }
.items li:first-child { border-top: 0; padding-top: 0; }
.items b { display: block; }
.items span { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.items blockquote { margin: 6px 0 0; padding-left: 10px; border-left: 2px solid var(--accent); font-style: italic; color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline .ev { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline .ev:first-child { border-top: 0; padding-top: 0; }
.timeline time { font: 12px var(--mono); color: var(--muted); padding-top: 2px; }
.timeline b { display: inline-block; padding-left: 10px; border-left: 3px solid var(--muted); }
.timeline .ev-promoted b, .timeline .ev-enlisted b, .timeline .ev-qualified b, .timeline .ev-awarded b { border-color: var(--good); }
.timeline .ev-demoted b, .timeline .ev-award b, .timeline .ev-qualification b { border-color: var(--warn); }
.timeline .ev-record b, .timeline .ev-left b { border-color: var(--bad); }
.timeline .ev-transferred b, .timeline .ev-status b, .timeline .ev-billet b { border-color: var(--accent-2); }
.timeline p { margin: 2px 0 0 13px; overflow-wrap: anywhere; }
.timeline small { display: block; margin-left: 13px; color: var(--muted); }

.meta { color: var(--muted); font-size: 12px; }
.empty-state { text-align: center; padding: 48px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 0 16px 32px; }


/* roster extras */
.unit > h2 { margin-bottom: 12px; }
.platoon { margin: 0 0 14px 12px; }
.platoon h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.num { text-align: right; }
.roster th.num { text-align: right; }
.roster tr.late td { background: color-mix(in srgb, var(--bad) 8%, transparent); }
.roster small { color: var(--muted); }
.stat b.bad { color: var(--bad); }
.stat b.warn { color: var(--warn); }
.stats-inline { margin-bottom: 10px; }
.filters button {
  font: inherit; font-weight: 600; padding: 8px 16px; min-height: 40px; border-radius: var(--radius);
  border: 1px solid var(--accent-2); background: var(--accent-2); color: #fff; cursor: pointer;
}
.pager { display: flex; justify-content: space-between; align-items: center; margin: 16px 0; color: var(--muted); }
.pager a { font-weight: 600; text-decoration: none; color: var(--accent-2); }

/* pills */
.pill-reserve, .pill-contact-poor { color: var(--warn); }
.pill-contact-good { color: var(--good); }
.pill-vet { color: var(--accent-2); }
.pill-d-honorable, .pill-d-retired { color: var(--good); }
.pill-d-general, .pill-d-administrative { color: var(--muted); }
.pill-d-oth { color: var(--warn); }
.pill-d-dishonorable { color: var(--bad); }

/* SRB extras */
.banner { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.banner-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.banner-bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
.qual-cat { margin-bottom: 12px; }
.qual-cat:last-child { margin-bottom: 0; }
.qual-cat h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 3px 10px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.timeline .ev-discharged b, .timeline .ev-left b { border-color: var(--bad); }
.timeline .ev-moved b, .timeline .ev-reserve b { border-color: var(--warn); }
.timeline .ev-returned b, .timeline .ev-re-enlisted b, .timeline .ev-jumps b { border-color: var(--good); }
.timeline .ev-imported b, .timeline .ev-discord b, .timeline .ev-joined b { border-color: var(--line); }

/* text-style buttons */
.linkbtn {
  font: inherit; font-size: 13px; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px;
}
.linkbtn.danger { color: var(--bad); }

/* messages */
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; line-height: 1.45; }
.flash small { display: block; margin-top: 4px; color: var(--muted); }
.flash-ok { color: var(--good); background: color-mix(in srgb, var(--good) 8%, var(--surface)); }
.flash-err { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 14px; min-height: 40px; padding: 8px 16px;
  border-radius: var(--radius); border: 1px solid var(--accent-2); background: var(--accent-2); color: #fff;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.1); }
.btn.secondary { background: transparent; color: var(--accent-2); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.discord { background: #5865f2; border-color: #5865f2; width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row form { margin: 0; }
.filters .btn { margin-left: auto; }

/* forms */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; margin-bottom: 14px; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; border: 0; padding: 0; }
.fld > span, .fld legend { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 0; }
.fld small { color: var(--muted); font-size: 12px; }
.fld input, .fld select, .fld textarea, .aar-review input[type=text], .aar-review select {
  font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 10px; min-height: 40px; width: 100%;
}
.fld textarea { resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .aar-review input:focus, .aar-review select:focus { outline: 2px solid var(--accent-2); outline-offset: 0; border-color: var(--accent-2); }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; min-height: 32px; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent-2); }
.chk-row { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.qual-set { border: 0; padding: 0; margin: 0 0 14px; }
.qual-set legend { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 16px; }
.inline-form { display: inline; margin: 0; }
.item-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.form-card { max-width: 860px; }
.form-card.narrow { max-width: 420px; margin: 32px auto; }
.form-card h1 { margin-bottom: 16px; }
.form-card form .btn { margin-top: 4px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 16px 0; font-size: 12px; text-transform: uppercase; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
ul.plain { padding-left: 18px; }

/* S1 actions panel */
.admin { border: 1px solid var(--accent-2); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; background: var(--surface); }
.admin > h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; color: var(--accent-2); }
.admin > h2 small { font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
details.act { border-top: 1px solid var(--line); }
details.act summary {
  cursor: pointer; list-style: none; padding: 10px 0; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
details.act summary::-webkit-details-marker { display: none; }
details.act summary::after { content: "+"; font: 600 18px var(--mono); color: var(--muted); }
details.act[open] summary::after { content: "−"; }
details.act.danger summary { color: var(--bad); }
.act-body { padding: 4px 0 16px; }
.act-body p { margin: 0 0 10px; }

/* in-place editing */
.srb-head { flex-wrap: wrap; }
.edit-toolbar { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.edit-help { font-size: 13px; color: var(--muted); }
.srb:not(.editing) .edit-only { display: none !important; }
.srb.editing .editable {
  cursor: pointer; border-radius: 4px;
  outline: 1px dashed color-mix(in srgb, var(--accent-2) 70%, transparent); outline-offset: 2px;
  transition: background-color .12s;
}
.srb.editing .editable:hover, .srb.editing .editable:focus-visible, .srb.editing .editable.is-open {
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  outline-style: solid; outline-color: var(--accent-2);
}
.srb.editing .field.editable { outline-offset: -3px; }
.srb.editing .field.editable dt::after { content: " ✎"; color: var(--accent-2); }
.srb.editing .rank-tag.editable { outline-offset: 3px; }
.srb.editing h2.editable { padding: 2px 4px; margin-left: -4px; }
.srb.editing .banner.editable { outline-offset: -2px; }
.add-hint { margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--accent-2); }
.card h2 { display: flex; align-items: baseline; gap: 6px; }
.x-btn {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--bad);
  font: 600 14px/1 var(--sans); cursor: pointer; vertical-align: middle;
}
.x-btn:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.chips li { display: inline-flex; align-items: center; }

.pop {
  position: absolute; z-index: 50; width: min(360px, calc(100vw - 16px));
  background: var(--surface); color: var(--text); border: 1px solid var(--accent-2); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35); padding: 14px;
}
.pop.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; border-radius: 12px 12px 0 0; max-height: 80vh; overflow: auto; }
.pop-title { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; margin-bottom: 8px; }
.pop-note { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.pop-form { display: flex; flex-direction: column; gap: 10px; }
.pop-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.pop-actions .linkbtn { margin-left: auto; }
.pop-menu { display: flex; flex-direction: column; gap: 8px; }
.pop-menu .btn { justify-content: flex-start; }
.pop-error { margin: 0; color: var(--bad); font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }

/* reports */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.report-card {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: start; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent-2); border-radius: var(--radius);
  text-decoration: none; color: inherit;
}
.report-card:hover { border-color: var(--accent-2); }
.report-count { grid-row: span 3; font: 600 26px/1.1 var(--mono); min-width: 2ch; }
.report-name { font-weight: 700; }
.report-desc { color: var(--muted); font-size: 13px; }
.report-filters { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.report .page-head { align-items: flex-start; }
.report-head .report-desc { margin: 4px 0 0; font-size: 14px; }
.signature { margin-top: 32px; white-space: normal; line-height: 1.6; }
.builder select[multiple] { min-height: 180px; }
.builder-actions { margin: 4px 0 20px; }
.delete-report { margin-top: 12px; }
.print-only { display: none; }

/* quick add */
.quick-add { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.quick-add textarea {
  font: 14px/1.5 var(--mono); color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 10px; resize: vertical; width: 100%;
}
.qa-preview { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qa-summary { width: 100%; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.qa-chip { font-size: 13px; padding: 2px 8px; border-radius: 99px; border: 1px solid; }
.qa-chip.ok { color: var(--good); }
.qa-chip.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); cursor: help; }
.qa-chip.dup { color: var(--muted); text-decoration: line-through; }

/* schools */
.days { margin-bottom: 14px; }
.day-row { display: grid; grid-template-columns: 56px 170px 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.day-row input { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; min-height: 38px; }
.day-no { font: 600 12px var(--mono); color: var(--muted); }
.class-actions { margin: 0 0 16px; align-items: center; }
.class-actions .linkbtn { margin-left: auto; }
.att-table th, .att-table td { text-align: center; }
.att-table th:first-child, .att-table td.cadet { text-align: left; }
.att-table td.cadet { white-space: nowrap; }
.att-table .who { gap: 8px; }
.att-table td.att input { width: 20px; height: 20px; accent-color: var(--good); cursor: pointer; }
.att-table td.att input:disabled { cursor: default; }
.day-col { min-width: 92px; vertical-align: bottom; }
.day-col.held { background: color-mix(in srgb, var(--good) 10%, var(--surface-2)); }
.day-head { display: flex; flex-direction: column; gap: 1px; text-transform: none; letter-spacing: 0; }
.day-head b { color: var(--text); }
.day-head small { font-weight: 400; }
.held-chk { font-size: 11px; min-height: 22px; justify-content: center; text-transform: none; letter-spacing: 0; }
.day-tools { display: flex; gap: 6px; justify-content: center; font-size: 11px; }
.day-tools .linkbtn { font-size: 11px; }
.att-table tr.dropped td { opacity: .55; }
.result-sel { font: inherit; font-size: 13px; padding: 4px 6px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.result-sel.result-pass, .pill-result-pass { color: var(--good); border-color: var(--good); }
.result-sel.result-fail, .pill-result-fail { color: var(--bad); border-color: var(--bad); }
.result-sel.result-dropped, .pill-result-dropped { color: var(--muted); }
.pill-result-pending { color: var(--accent-2); }
.pill-class-open { color: var(--good); }
.pill-class-graduated { color: var(--accent-2); }
.pill-class-cancelled { color: var(--muted); }
.saved { animation: saved 0.9s ease-out; }
@keyframes saved { from { box-shadow: inset 0 0 0 2px var(--good); } to { box-shadow: inset 0 0 0 2px transparent; } }
.add-cadets { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; background: var(--surface); }
.stats .btn { align-self: center; }

/* LOA */
.pill-loa, .pill-loa-requested { color: var(--warn); }
.pill-loa-approved { color: var(--good); }
.pill-loa-denied { color: var(--bad); }
.pill-loa-cancelled { color: var(--muted); }
.flag-loa { color: var(--warn); }
.loa-tools { margin-top: 6px; gap: 14px; }
.btn-row.nowrap { flex-wrap: nowrap; gap: 6px; }
.btn-row.nowrap .btn { min-height: 32px; padding: 4px 12px; font-size: 13px; }
span.bad, td.bad { color: var(--bad); font-weight: 600; }
span.warn { color: var(--warn); font-weight: 600; }

/* report builder: show only the sections for the chosen kind */
.kind-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-bottom: 14px; }
.kind-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: var(--surface-2); }
.kind-opt:has(input:checked) { border-color: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent-2); }
.kind-opt input { margin-top: 4px; accent-color: var(--accent-2); }
.kind-opt small { display: block; color: var(--muted); font-size: 12px; }
.builder[data-kind="list"] .only-count, .builder[data-kind="list"] .only-retention,
.builder[data-kind="count"] .only-list, .builder[data-kind="count"] .only-retention,
.builder[data-kind="retention"] .only-list, .builder[data-kind="retention"] .only-count,
.builder[data-kind="retention"] .not-retention { display: none; }
.report-group th {
  text-align: left; background: var(--surface-2); border-top: 2px solid var(--accent-2);
  font-size: 13px; text-transform: uppercase; letter-spacing: .04em; padding-top: 10px;
}
.report-group .count { font: 600 12px var(--mono); color: var(--muted); margin-left: 6px; }
@media print { .report-group th { break-after: avoid; } }
.count-table tfoot td { border-top: 2px solid var(--line); background: var(--surface-2); }

/* retention order */
.ro-summary { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; }
.ro-line { margin: 2px 0; font-size: 16px; }
.ro-tiles { margin-bottom: 20px; }
.ro-tile { flex: 1 1 130px; }
.ro-section { margin-bottom: 18px; }
.ro-section h2 { display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.ro-count { font: 600 14px var(--mono); color: var(--muted); }
.ro-list { list-style: none; margin: 0; padding: 0; columns: 2 240px; column-gap: 24px; }
.ro-list li { padding: 3px 0; break-inside: avoid; }
.ro-list a { text-decoration: none; }
.ro-list small { color: var(--muted); }
.ro-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }

/* ORBAT */
.orbat-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.orbat-tabs a {
  flex: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none;
  font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface);
}
.orbat-tabs a[aria-current="page"] { color: #fff; background: var(--accent-2); border-color: var(--accent-2); }
#orbat-q { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; min-height: 40px; min-width: 200px; }
.orbat-band {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-bottom: 14px; align-items: start;
}
.orbat-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.orbat-head {
  display: grid; grid-template-columns: 1fr auto; gap: 0 8px; align-items: baseline;
  padding: 8px 12px; background: var(--surface-2); border-bottom: 2px solid var(--accent-2);
}
.orbat-head .caption { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 600; }
.block-title { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; line-height: 1.3; }
.block-fill { font: 600 12px var(--mono); color: var(--warn); }
.block-fill.full { color: var(--good); }
.slots { list-style: none; margin: 0; padding: 4px 0; }
.slot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto; gap: 8px; align-items: center; padding: 4px 12px; font-size: 13px; }
.slot.team-start { border-top: 1px dashed var(--line); margin-top: 3px; padding-top: 6px; }
.slot-pos { display: flex; flex-direction: column; min-width: 0; }
.callsign { font: 600 11px var(--mono); color: var(--accent-2); letter-spacing: .02em; }
.slot-title { color: var(--muted); overflow-wrap: anywhere; }
.slot-who { min-width: 0; overflow-wrap: anywhere; }
.slot-who .holder { text-decoration: none; font-weight: 600; }
.slot-who .holder .rank-tag { min-width: 36px; font-size: 11px; padding: 1px 4px; }
.holder.unlinked { font-style: italic; color: var(--muted); }
.vacant { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bad); border: 1px dashed currentColor; border-radius: 3px; padding: 0 6px; opacity: .8; }
.slot.dim { opacity: .25; }
.slot.hit { background: color-mix(in srgb, var(--accent-2) 14%, transparent); }
.slot-edit { border: 0; background: none; color: var(--accent-2); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.orbat:not(.editing) .edit-only { display: none !important; }
.orbat.editing .slot, .orbat.editing .orbat-head.editable { cursor: pointer; }
.orbat.editing .slot:hover, .orbat.editing .orbat-head.editable:hover, .orbat .is-open { background: color-mix(in srgb, var(--accent-2) 12%, transparent); }
.add-slot { margin: 2px 12px 8px; font-size: 12px; }
.add-block { border: 1px dashed var(--line); border-radius: var(--radius); background: none; color: var(--accent-2); font: inherit; font-weight: 600; min-height: 60px; cursor: pointer; }
.orbat-page-tools { display: flex; gap: 16px; align-items: center; margin-top: 8px; }

/* platoon picker + one row per platoon */
.platoon-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; min-height: 36px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.chip small { font: 500 11px var(--mono); color: var(--muted); margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.chip[aria-pressed="true"] small { color: rgba(255, 255, 255, .8); }
.orbat-hq { margin-bottom: 8px; }
.orbat-group { margin-bottom: 22px; }
.group-head { display: flex; align-items: baseline; gap: 10px; padding: 4px 0 8px; border-bottom: 2px solid var(--accent); margin-bottom: 10px; }
.group-head h2 { margin: 0; font-size: 18px; }
.orbat.editing .group-head.editable { cursor: pointer; }
.orbat.editing .group-head.editable:hover { background: color-mix(in srgb, var(--accent-2) 12%, transparent); }
/* A platoon's HQ and squads sit side by side, wrapping onto more lines when they don't fit
   (no sideways scrolling). Every section is shown at full height. */
.group-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; align-items: start;
}
.group-row .add-block { min-width: 120px; }
@media (max-width: 700px) {
  .group-row { grid-auto-flow: row; grid-template-columns: 1fr; overflow-x: visible; }
}
body:has(#orbat.editing) .editable-title { cursor: pointer; outline: 1px dashed var(--accent-2); outline-offset: 4px; border-radius: 4px; }
.report-count small { font-size: 14px; }
.fill-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 6px; }
.fill-bar span { display: block; height: 100%; background: var(--good); }

@media print {
  .orbat-band { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .group-row { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; gap: 6px; }
  .orbat-group { break-inside: avoid-page; }
  .orbat-block { break-inside: avoid; border-color: #999; }
  .slot { padding: 1px 6px; font-size: 9pt; }
  .slot.dim { opacity: 1; }
  #orbat-q, label.chk, #orbat-edit { display: none; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --muted: #333; --line: #999; --tag-bg: #fff; --tag-fg: #000; }
  body { background: #fff; font-size: 11pt; }
  .topbar, .foot, .no-print, .back, .flash, .filters, .pager { display: none !important; }
  main { padding: 0; max-width: none; }
  .print-only { display: block; }
  .report-letterhead { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .06em; }
  .table-wrap { border: 0; }
  .roster th, .roster td { padding: 4px 6px; border-bottom: 1px solid #bbb; }
  .roster tbody tr:hover { background: none; }
  .rank-tag { border: 1px solid #000; }
  a { text-decoration: none; color: #000; }
  tr { break-inside: avoid; }
  .signature { break-inside: avoid; }
}

@media (max-width: 1100px) {
  .hide-md { display: none; }
}
@media (max-width: 900px) {
  .ro-cols { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .activity { position: static; }
  .cols { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr 1fr; }
  .field:nth-child(3n) { border-right: 1px solid var(--line); }
  .field:nth-child(2n) { border-right: 0; }
  .field:nth-last-child(-n + 3) { border-bottom: 1px solid var(--line); }
  .field:nth-last-child(-n + 2) { border-bottom: 0; }
}
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .page-head .stats { width: 100%; }
  .stat { flex: 1 1 90px; min-width: 0; }
  .ro-list { columns: 1; }
  .kind-row { grid-template-columns: 1fr; }
  .att-table td.att input { width: 24px; height: 24px; }
  .platoon { margin-left: 0; }
  .filters .btn { margin-left: 0; width: 100%; }
  .day-row { grid-template-columns: 48px 1fr auto; }
  .day-row input[type=text] { grid-column: 2 / 4; }
  h1 { font-size: 24px; }
  .srb-head { flex-direction: column; align-items: flex-start; }
  .srb-id h1 { font-size: 24px; }
  .fields { grid-template-columns: 1fr; }
  .field { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .field:last-child { border-bottom: 0 !important; }
  .timeline .ev { grid-template-columns: 1fr; gap: 2px; }
  .roster td, .roster th { padding: 8px; }
}

/* access: roles × permissions grid */
.access-grid { border-collapse: collapse; width: 100%; font-size: 13px; }
.access-grid th, .access-grid td { padding: 6px 10px; border-bottom: 1px solid var(--line); }
.access-grid thead th { position: sticky; top: 0; background: var(--surface-2); text-align: left; vertical-align: bottom; }
.access-grid .role-col { text-align: center; min-width: 84px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.access-grid tbody th { text-align: left; font-weight: 400; min-width: 220px; }
.access-grid tbody th small { display: block; color: var(--muted); font-size: 12px; }
.access-grid td { text-align: center; }
.access-grid td input { width: 18px; height: 18px; accent-color: var(--accent-2); cursor: pointer; }
.access-grid tbody tr:not(.perm-group):hover { background: color-mix(in srgb, var(--accent-2) 7%, transparent); }
.access-grid .perm-group th {
  background: var(--surface-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent);
  border-top: 2px solid var(--line);
}
.access-grid tbody th:first-child, .access-grid thead th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.access-grid thead th:first-child, .access-grid .perm-group th { background: var(--surface-2); }
.section-title { margin: 22px 0 10px; font-size: 18px; }
.role-card h3 { margin: 0 0 6px; }
.role-card select[multiple] { min-height: 120px; }
.role-card .chk-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 12px; }
.danger-text { color: var(--bad); }
.check-result { margin-top: 10px; }

/* report builder: old units nobody serves in any more */
.former-units { margin-top: 8px; }
.former-units summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; }
.former-units .chk-grid { opacity: .75; }

/* AARs */
.aar-paste { font: 14px/1.5 var(--mono); }
.aar-review td { vertical-align: top; }
.aar-review select, .aar-review input[type=text] { width: 100%; min-width: 140px; }
.aar-review td:nth-child(3) { min-width: 240px; }
.aar-review tr.is-unsure td { background: color-mix(in srgb, var(--warn) 9%, transparent); }
.aar-review tr.aar-extra td { opacity: .85; }
.aar-hint { display: block; margin-top: 4px; color: var(--muted); }
.aar-group + .aar-group { margin-top: 12px; }
.aar-group h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.aar-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.aar-people a { text-decoration: none; font-weight: 600; }
.aar-people small { color: var(--muted); font-weight: 400; }
.aar-people .unmatched { color: var(--muted); font-style: italic; }
.aar-debrief dt { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 10px; }
.aar-debrief dt:first-child { margin-top: 0; }
.aar-debrief dd { margin: 2px 0 0; }
.aar-raw { white-space: pre-wrap; font: 13px/1.5 var(--mono); margin: 0; }

/* AAR form: people pickers */
.aar-sec { padding: 10px 0; border-top: 1px solid var(--line); }
.aar-sec:first-of-type { border-top: 0; padding-top: 0; }
.aar-sec-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.aar-sec-label small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.pchips { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pchips:empty { display: none; }
.pchip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; font-weight: 600; }
.pchip.is-unsure { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.pchip.is-text { border-style: dashed; color: var(--muted); font-weight: 400; }
.pchip small { color: var(--muted); font-weight: 400; }
.pchip select { font: inherit; font-weight: 600; background: transparent; color: var(--text); border: 0; padding: 2px; max-width: 260px; }
.pchip .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 99px; }
.pchip .x:hover { color: var(--bad); background: var(--surface); }
.aar-add-row { display: flex; gap: 8px; }
.aar-add-row .aar-add { flex: 1; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; min-height: 40px; min-width: 0; }
.aar-add-row .aar-add:focus { outline: 2px solid var(--accent-2); outline-offset: 0; }
.aar-sec.busy .aar-add { opacity: .6; }

/* enlist: "already in the SRB" warning */
.dupes { margin: 4px 0 12px; padding: 10px 14px; border: 1px solid var(--warn); border-radius: var(--radius); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.dupes ul { margin: 6px 0; padding-left: 18px; }
.dupes small { color: var(--muted); }
.force-row { margin: 0 0 8px; }

/* promotions */
.promo-step + .promo-step { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.req-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 14px; }
.req-list small { color: var(--muted); }
.req-mark { display: inline-block; width: 18px; text-align: center; font-weight: 700; }
.req-mark.ok { color: var(--good); }
.req-mark.no { color: var(--bad); }
.req-mark.confirm { color: var(--muted); }
.req-list .is-confirm { color: var(--muted); }
.promo-table small { color: var(--muted); }

/* promotion requests */
.req-facts { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 6px 16px; margin: 0 0 12px; }
.req-facts dt { color: var(--muted); font-size: 13px; }
.req-facts dd { margin: 0; font-weight: 600; }
.req-facts small { color: var(--muted); font-weight: 400; }
.req-why { white-space: normal; line-height: 1.55; }
.sub-h { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.levels .level-row small { display: block; color: var(--muted); margin-top: 2px; }
.levels blockquote { margin: 4px 0 0; }
.decide-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.decide-row input[type=text] { flex: 1 1 200px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; min-height: 36px; }
.promote-card .chk-col { display: grid; gap: 4px; margin: 8px 0 12px; }
.promo-req-line { margin: 0 0 10px; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.awaiting { border-color: var(--warn); }

.platoon h3 small { font-weight: 400; text-transform: none; letter-spacing: 0; }

/* audit log */
.audit-filters { flex-wrap: wrap; }
.audit-filters input[type=search] { flex: 1 1 280px; }
.fld-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.fld-inline input { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; min-height: 40px; }
.audit-table td { vertical-align: top; font-size: 13px; }
.audit-table td small { display: block; color: var(--muted); }
.audit-table .audit-when { white-space: nowrap; }
.audit-detail { color: var(--muted); max-width: 420px; overflow-wrap: anywhere; }
.audit-filter { text-decoration: none; color: var(--muted); margin-left: 2px; }
.audit-denied td { background: color-mix(in srgb, var(--bad) 7%, transparent); }
.audit-failed td { background: color-mix(in srgb, var(--warn) 6%, transparent); }
.muted { color: var(--muted); }

/* schools: jumps + credited days */
.att .jump-box { width: 44px; margin-left: 6px; font: 13px var(--mono); padding: 2px 4px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; }
.att.credited { background: color-mix(in srgb, var(--good) 10%, transparent); }
.att.credited small, .credited-key { color: var(--good); font-size: 11px; margin-left: 4px; }
.day-head + .held-chk + .day-tools + .jumps-all, .jumps-all { display: block; margin-top: 2px; font-size: 12px; }

.jump-parts { display: inline-flex; gap: 4px; margin-left: 4px; vertical-align: middle; }
.jump-part { display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); }
.jump-part .jump-box { margin-left: 0; }
/* no spinner arrows: they ate the whole box. Type the number (or use ↑/↓ keys). */
.att .jump-box { width: 36px; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.att .jump-box::-webkit-outer-spin-button, .att .jump-box::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.result-sel.result-incomplete, .pill-result-incomplete { color: var(--warn); border-color: var(--warn); }

.att .tried { display: block; color: var(--warn); font-size: 11px; }
.att.credited small { display: block; }


/* a platoon's command section: its own row, centered over the squads */
.group-cmd { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.group-cmd .orbat-block { flex: 0 1 380px; min-width: 250px; border-color: var(--accent-2); }
@media (max-width: 700px) { .group-cmd .orbat-block { flex-basis: 100%; } }
@media print { .group-cmd { margin-bottom: 6px; } .group-cmd .orbat-block { flex-basis: 30%; } }

.school-tabs { margin-bottom: 16px; flex-wrap: wrap; overflow: visible; padding-bottom: 0; } /* every tab visible, no sideways scrolling */
.school-tabs small { font: 500 11px var(--mono); opacity: .75; margin-left: 2px; }
tr[data-href] { cursor: pointer; }

/* roster picker: who meets the school's requirements */
.qa-elig { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin: 6px 0 10px; background: var(--surface-2); }
.qa-elig-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.qa-elig-head small { color: var(--muted); }
.qa-elig-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; max-height: 180px; overflow-y: auto; }
.qa-elig-list button { font: inherit; font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.qa-elig-list button:hover { border-color: var(--accent-2); }
.qa-chip.warn { border-color: var(--warn); color: var(--warn); }
/* placement */
.place-card h2 small { font-weight: 500; font-size: 12px; margin-left: 6px; }
.place-table select, .place-table input { font: inherit; font-size: 13px; padding: 4px 6px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 180px; }
.place-table tr.placed { opacity: .6; }
.place-msg { font-size: 12px; margin-left: 6px; }
.place-msg.good { color: var(--good); } .place-msg.bad { color: var(--bad); }

/* AAR: suggested people per section (by billet) */
.aar-suggest { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0 6px; }
.aar-suggest small { color: var(--muted); margin-right: 2px; }
.aar-suggest button { font: inherit; font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px dashed var(--line); background: none; color: var(--muted); cursor: pointer; }
.aar-suggest button:hover { color: var(--text); border-color: var(--accent-2); border-style: solid; }
.aar-suggest button.all { color: var(--accent-2); border-color: var(--accent-2); }

/* class cadre */
.cadre-head th { text-align: left; padding-top: 14px; border-top: 2px solid var(--accent-2); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.cadre-head small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); margin-left: 8px; }
.cadre-row { background: color-mix(in srgb, var(--accent-2) 6%, transparent); }
.pill-cadre-cadre { color: var(--accent-2); border-color: var(--accent-2); }
.pill-cadre-trainee { color: var(--warn); border-color: var(--warn); }
.cadre-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cadre-form select { font: inherit; padding: 6px 8px; min-width: 260px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.suggest-note { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; max-width: 260px; }
.suggest-note.good { color: var(--good); }

/* cadre picker: tick several */
.cadre-form { display: block; }
.cadre-form-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.cadre-filter { font: inherit; padding: 6px 8px; min-width: 220px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cadre-lists { display: grid; gap: 12px; }
.cadre-list { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px 10px; margin: 0; }
.cadre-list legend { font-size: 12px; font-weight: 600; padding: 0 4px; }
.cadre-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 10px; } /* every name shown in columns, no inner scroll box */
.cadre-pick { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 4px; border-radius: 4px; cursor: pointer; }
.cadre-pick:hover { background: var(--surface-2); }
.cadre-pick[hidden] { display: none; }

/* Schools → Cadre */
.cadre-page { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.cadre-trainees { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 10px; }
.cadre-trainees small { color: var(--muted); width: 100%; }
.chip-btn { font: inherit; font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px dashed var(--line); background: none; color: var(--text); cursor: pointer; }
.chip-btn:hover { border-color: var(--accent-2); }
.chip-btn:disabled { opacity: .4; cursor: default; }

/* Take roll: unit checklist */
.roll-list { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px 12px; margin: 12px 0; }
.roll-list legend { font-weight: 600; padding: 0 4px; }
.roll-tools { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-bottom: 8px; }
.roll-picks { display: grid; grid-template-columns: minmax(0, 520px); gap: 1px; } /* one per line, in platoon order */
.roll-pick { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 4px; border-radius: 4px; cursor: pointer; }
.roll-pick:hover { background: var(--surface-2); }
.roll-pick small { color: var(--muted); }
.roll-pick.on-loa { opacity: .7; }
.roll-pick input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; min-width: 0; flex: none; margin: 0; padding: 0; }
.roll-pick small { white-space: nowrap; margin-left: auto; padding-left: 6px; }
.roll-group { margin: 12px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.roll-group:first-child { margin-top: 0; }
.roll-team { margin: 6px 0 0 4px; font-size: 11px; font-weight: 600; color: var(--muted); }

/* announcements */
.announce-pick { align-items: end; grid-template-columns: 1fr auto 1fr; }
.announce-or { align-self: center; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; padding: 0 4px; }
@media (max-width: 700px) { .announce-pick { grid-template-columns: 1fr; } .announce-or { text-align: center; } }
.pill-good { color: var(--good); border-color: var(--good); text-decoration: none; }
.pill-bad { color: var(--bad); border-color: var(--bad); }

/* announcements bell (top right) */
.bell { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--muted); text-decoration: none; flex: none; }
.bell:hover { color: var(--text); background: var(--surface-2); }
.bell-count {
  position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: #d93025; color: #fff; font: 700 10.5px/17px var(--sans); text-align: center; box-shadow: 0 0 0 2px var(--surface);
}

/* announcement pictures */
.pic-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pic { position: relative; margin: 0; width: 110px; height: 80px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic .x-btn { position: absolute; top: 2px; right: 2px; background: rgb(0 0 0 / .6); color: #fff; border-radius: 50%; width: 22px; height: 22px; }
.pic-add { align-self: flex-start; cursor: pointer; }
.pic-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.pic-gallery img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); display: block; }

.flash-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }

/* announcement page: the post itself */
.announce-post { max-width: 760px; margin: 8px 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.announce-cover img { display: block; width: 100%; max-height: 360px; object-fit: cover; }
.announce-body { padding: 18px 22px 16px; }
.announce-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.announce-kind { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); border-color: var(--accent); }
.announce-body h1 { margin: 10px 0 12px; font-size: 30px; line-height: 1.15; }
.announce-facts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.announce-facts li { display: flex; gap: 8px; align-items: baseline; }
.announce-text { white-space: pre-wrap; font-size: 15px; line-height: 1.6; padding-top: 12px; border-top: 1px solid var(--line); }
.announce-by { margin: 14px 0 0; }
.announce-admin { max-width: 760px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 16px; }
.announce-admin summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.announce-admin[open] summary { margin-bottom: 8px; }
.announce-admin form { display: inline-block; margin: 8px 12px 0 0; }

.announce-class { display: inline-flex; margin: 0 0 14px; font-size: 15px; padding: 10px 16px; text-decoration: none; }

/* Activity: FTX eligibility */
.ftx-panel { margin-bottom: 20px; }
.ftx-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.ftx-head h2 { margin: 2px 0 4px; }
.ftx-nav { display: flex; gap: 6px; }
.ftx-stats { margin: 10px 0 14px; align-items: center; }
.ftx-units { display: grid; gap: 14px; }
.ftx-unit-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.ftx-bar { flex: 0 1 160px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--bad) 35%, transparent); overflow: hidden; }
.ftx-bar span { display: block; height: 100%; background: var(--good); }
.ftx-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ftx-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; padding: 3px 8px 3px 6px; border-radius: 99px; border: 1px solid; text-decoration: none; color: var(--text); }
.ftx-chip .rank-tag { font-size: 10px; padding: 0 4px; }
.ftx-chip.is-yes { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.ftx-chip.is-no { border-color: color-mix(in srgb, var(--bad) 70%, transparent); color: var(--muted); }
.ftx-chip.is-loa { border-color: var(--line); color: var(--muted); border-style: dashed; }
.ftx-units.only-no .ftx-chip.is-yes, .ftx-units.only-no .ftx-chip.is-loa { display: none; }
/* last-8-weeks strip */
.wk-strip { display: inline-flex; gap: 3px; vertical-align: middle; }
.wk { display: inline-block; width: 11px; height: 11px; border-radius: 2px; background: var(--line); }
.wk-yes { background: var(--good); }
.wk-loa { background: var(--accent-2); }
.wk-no { background: color-mix(in srgb, var(--bad) 55%, transparent); }
.wk-open { background: transparent; border: 1px dashed var(--line); }
.wk-none { background: transparent; border: 1px solid var(--line); opacity: .4; }

/* jump manifest: editable counts (no spinner arrows, like AIC) */
.mf-count { width: 56px; text-align: center; font: 13px var(--mono); padding: 4px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; -moz-appearance: textfield; appearance: textfield; }
.mf-count::-webkit-outer-spin-button, .mf-count::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mf-tools { justify-content: space-between; align-items: center; margin-bottom: 8px; }
#mf-table td.saved { animation: saved-flash 1s ease-out; }
@keyframes saved-flash { from { background: color-mix(in srgb, var(--good) 30%, transparent); } to { background: transparent; } }

.jump-fix { margin: -4px 0 8px; }

/* Discord roles preview */
.pill-warn { color: var(--warn); border-color: var(--warn); }
.discord-roles td:first-child { min-width: 160px; }
.discord-roles .role-name { font-weight: 600; display: block; }
.discord-roles .role-group { display: block; font-size: 11px; }
.discord-roles .role-rule { font-size: 13px; }
.discord-roles .role-who summary { cursor: pointer; font-size: 12px; color: var(--accent-2); margin-top: 4px; }
.discord-roles .role-who p { font-size: 13px; margin: 4px 0 0; line-height: 1.6; }
.discord-roles tr[data-kind~="diff"] td:nth-child(3) b { color: var(--warn); }
.discord-roles tr[data-kind="discord"] { opacity: .7; }
