/* =====================================================================
   THE SHADOWS — ONIDB theme layer (loaded after styles.css)
   Black/charcoal + off-white, blood red from the emblem, muted gold only
   for ranks and key figures. styles.css routes its old gold through the
   tokens below (--hl*, --line*, --accent-fill*, --tint).
   ===================================================================== */
:root {
  --bg: #0a0a0b;
  --bg-elev: #131314;
  --bg-elev-2: #1b1a1b;
  --bg-sunk: #0e0e0f;
  --border: #262324;
  --border-strong: #353031;
  --text: #ece6dd;
  --text-dim: #aaa399;
  --text-faint: #9a938a;

  --blood: #7d1015;
  --blood-bright: #d22a2f;
  --blood-ink: #f07a7a;          /* red text that stays readable on black */
  --blood-soft: rgba(210, 42, 47, 0.12);

  --gold: #bea06a;               /* muted — ranks, key figures */
  --gold-bright: #d6bb84;
  --gold-dim: #7f6c49;
  --ok: #6cc795;
  --ooc: #8fa9c4;                /* OOC zone accent (steel) */

  /* tokens styles.css now uses where it used to hard-code gold */
  --tint: 214, 204, 190;
  --hl: #ddd3c4;
  --hl-strong: #f2ece3;
  --hl-dim: #8f877c;
  --line: #3a3434;
  --line-accent: #5e1c1f;
  --accent-fill: #b3222a;
  --accent-fill-dim: #7d1015;

  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --font-num: "Bebas Neue", "Inter", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 3px;
}

/* ---------- Base ---------- */
html, body { font-family: var(--font-ui); font-weight: 400; font-size: 15px; line-height: 1.5; }
body {
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(125, 16, 21, 0.16), transparent 60%),
    linear-gradient(180deg, #0c0b0c 0%, #080808 100%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
/* Restraint: no neon glow, no scanlines, no perpetual glitch/pulse */
body *:not(.keep-shadow) { text-shadow: none !important; }
.scanlines, .site-header::before, .cmd-deck-grid-bg, .cmd-deck-glyph, .comms-glyph, .comms-strip { display: none !important; }
.logo, .logo::before, .logo::after { animation: none !important; }
.comms-strip-bar, .cmd-deck-cursor { animation: none !important; }
/* Worn grain: present, never in the way */
.bg-grain { opacity: 0.16; mix-blend-mode: soft-light; z-index: 1; }

::selection { background: rgba(210, 42, 47, 0.45); color: #fff; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

/* Corner-bracket ornaments were on every box — keep them only on the hero */
.form::before, .table-wrap::before, .table-wrap::after,
.home-block::before, .home-block::after, .roster-section::before, .roster-section::after,
.roster-summary-cell::before, .comms-console::before, .comms-console::after,
.allies-tier::before, .allies-tier::after, .hud::before, .hud::after,
.stat-card::before, .stat-card::after, .home-action::before { display: none !important; }

/* ---------- Header ---------- */
.site-header {
  padding: 14px 32px;
  background: linear-gradient(180deg, #0f0d0e 0%, #0a0a0b 100%);
  border-bottom: 1px solid var(--border);
}
.site-header::after { background: linear-gradient(90deg, transparent, var(--blood) 25%, var(--blood-bright) 50%, var(--blood) 75%, transparent); opacity: 0.55; }
.header-inner { max-width: 1280px; }
.brand { gap: 16px; }
.brand::before { display: none; }
.brand-logo { width: 80px; height: 80px; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.7)); }
.brand-text { gap: 4px; }
.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hl-strong);
}
.brand-sys {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-sys-name {
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--blood-ink);
  border: 1px solid rgba(210, 42, 47, 0.45);
  border-radius: var(--radius);
  padding: 1px 6px;
  font-size: 0.84rem;
}

/* HUD -> compact account chip */
.hud {
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.hud-line {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  letter-spacing: 0;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  white-space: nowrap;
}
.hud-line .cursor { display: none; }
.hud-val.hud-granted { color: var(--text); font-weight: 600; }
.hud-val.hud-locked { color: var(--text-dim); }
.hud-rank { color: var(--gold); font-size: 0.84rem; font-weight: 500; }
.hud-btn.btn { width: auto; }

/* ---------- Primary navigation ---------- */
.primary-tabs { margin: 0 auto; padding: 0 32px; gap: 2px; border-bottom: 1px solid var(--border); max-width: 1344px; }
.primary-tabs::before, .primary-tabs .tab::before { display: none !important; }
.primary-tabs .tab {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-dim);
  padding: 14px 16px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  box-shadow: none;
  gap: 8px;
}
.primary-tabs .tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); border-color: transparent; border-bottom-color: var(--border-strong); }
.primary-tabs .tab.active { color: var(--hl-strong); background: transparent; border: 0; border-bottom: 2px solid var(--blood-bright); box-shadow: none; }
.primary-tabs .tab.active::after { display: none; }
.tab-zone {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: var(--radius);
  border: 1px solid currentColor;
}
.tab-ic .tab-zone { color: var(--blood-ink); }
.tab-ooc .tab-zone { color: var(--ooc); }
.primary-tabs .tab.tab-ooc.active { border-bottom-color: var(--ooc); }

/* Zone banners at the top of the IC / OOC areas */
.zone-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-left-width: 3px;
  background: var(--bg-elev);
}
.zone-tag { font-weight: 700; letter-spacing: 0.08em; font-size: 0.84rem; padding: 1px 7px; border-radius: var(--radius); }
.zone-ic { border-left-color: var(--blood-bright); }
.zone-ic .zone-tag { color: #fff; background: var(--blood); }
.zone-ooc { border-left-color: var(--ooc); background: #111417; }
.zone-ooc .zone-tag { color: #0b0e12; background: var(--ooc); }

/* Sub-tabs */
.sub-tabs { border-bottom: 1px solid var(--border); margin-bottom: 26px; gap: 4px; flex-wrap: wrap; }
.sub-tabs::before { display: none; }
.subtab {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  text-transform: none;
  padding: 10px 14px;
  color: var(--text-dim);
}
.subtab:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.subtab.active { color: var(--hl-strong); border-bottom-color: var(--blood-bright); }
#ooc .subtab.active { border-bottom-color: var(--ooc); }

main { padding: 28px 32px 40px; }

/* ---------- Headings ---------- */
.section-head { margin-bottom: 18px; }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hl-strong);
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-head h2::before {
  content: "";
  width: 4px;
  height: 1.05em;
  background: var(--blood-bright);
  border-radius: 1px;
}
#ooc .section-head h2::before { background: var(--ooc); }
.ooc-badge { font-family: var(--font-ui); font-weight: 700; letter-spacing: 0.08em; font-size: 0.84rem; color: var(--ooc); border-color: rgba(143, 169, 196, 0.5); background: rgba(143, 169, 196, 0.08); border-radius: var(--radius); }

/* ---------- Buttons: primary / secondary / destructive ---------- */
.btn {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  text-transform: none;
  padding: 8px 16px;
  min-height: 36px;
  border-radius: var(--radius);
  clip-path: none;
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid #45403f;
  box-shadow: none;
}
.btn:hover { background: #242223; color: #fff; border-color: #5a5352; }
.btn.primary {
  background: var(--blood-bright);
  border-color: var(--blood-bright);
  color: #fff;
  box-shadow: none;
}
.btn.primary:hover { background: #e3383d; border-color: #e3383d; color: #fff; }
.btn.ghost { background: transparent; border-color: #3d3837; color: var(--text); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.05); color: #fff; border-color: #5a5352; }
.btn.danger-ghost {
  background: transparent;
  border: 1px dashed rgba(240, 122, 122, 0.45);
  color: var(--blood-ink);
  letter-spacing: 0.01em;
  padding: 8px 14px;
}
.btn.danger-ghost:hover { background: rgba(125, 16, 21, 0.35); border-style: solid; border-color: var(--blood-bright); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blood-bright);
  border-radius: var(--radius);
  padding: 18px;
}
.form input, .form select, .form textarea,
input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="datetime-local"], select, textarea {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text);
  background: var(--bg-sunk);
  border: 1px solid #3a3536;
  border-radius: var(--radius);
}
.form input, .form select { padding: 9px 12px; }
input::placeholder, textarea::placeholder { color: var(--text-faint) !important; letter-spacing: 0 !important; text-transform: none !important; }
.form input:focus, .form select:focus, .form textarea:focus,
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dim); }
.check-label { border: 1px solid #3a3536; background: var(--bg-sunk); border-radius: var(--radius); font-size: 0.9rem; }
.check-label input[type="checkbox"] { accent-color: var(--blood-bright); }
.modal-hint, .note { font-size: 0.86rem; color: var(--text-dim); }

/* ---------- Tables ---------- */
.table-wrap { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { font-size: 0.9rem; }
.data-table th {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: #0f0f10;
  border-bottom: 1px solid var(--border-strong);
}
.data-table td { font-weight: 400; border-bottom-color: var(--border); }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

/* Status pills */
.status-pill { font-family: var(--font-ui); font-weight: 600; font-size: 0.84rem; letter-spacing: 0.04em; padding: 2px 8px; border-radius: var(--radius); }
.status-On\.Leave, .status-Pending { color: var(--gold-bright); border-color: var(--gold-dim); background: rgba(190, 160, 106, 0.1); }
.status-KIA, .status-Lost, .status-Confiscated { color: var(--blood-ink); }

/* ---------- Empty states: compact and deliberate ---------- */
.empty {
  font-style: normal;
  text-align: left;
  font-size: 0.88rem;
  color: var(--text-dim);
  padding: 12px 14px;
  margin: 0;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  align-items: center;
  gap: 10px;
}
.empty::before { content: ""; width: 6px; height: 6px; background: var(--blood-bright); transform: rotate(45deg); flex: none; opacity: 0.8; }

/* ---------- Rank pills: keep each rank distinct, drop the glow ---------- */
.rank-pill {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  padding: 2px 9px;
  border-radius: var(--radius);
  text-transform: none;
}

/* ---------- Home: identity banner ---------- */
.cmd-deck {
  display: block;
  padding: 0;
  margin-bottom: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background:
    radial-gradient(ellipse 60% 120% at 12% 60%, rgba(125, 16, 21, 0.32), transparent 70%),
    linear-gradient(180deg, #121112 0%, #0b0b0c 100%);
  overflow: hidden;
  position: relative;
}
.cmd-deck::before, .cmd-deck::after { width: 18px; height: 18px; z-index: 3; }
.cmd-deck::before { border-top: 2px solid var(--blood-bright); border-left: 2px solid var(--blood-bright); }
.cmd-deck::after { border-bottom: 2px solid var(--blood-bright); border-right: 2px solid var(--blood-bright); }
.deck-emblem-bg {
  position: absolute;
  right: -6%;
  top: 50%;
  width: 560px;
  height: 560px;
  transform: translateY(-50%);
  background: url("assets/logo.png") center / contain no-repeat;
  opacity: 0.07;
  filter: grayscale(0.6) contrast(1.2);
  pointer-events: none;
  z-index: 0;
}
.deck-util {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.84rem;
  color: var(--text-dim);
}
.deck-util-sep { width: 1px; height: 14px; background: var(--border-strong); }
.cmd-deck-online { background: transparent; border: 0; padding: 0; font-size: 0.84rem; letter-spacing: 0.02em; gap: 6px; color: var(--ok); font-weight: 500; }
.cmd-deck-led { width: 7px; height: 7px; animation: none; box-shadow: 0 0 0 2px rgba(108, 199, 149, 0.18); }
.deck-clock { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; }
.deck-clock .cmd-deck-tz { background: none; border: 0; padding: 0; color: var(--text-dim); font-size: 0.84rem; font-weight: 600; letter-spacing: 0.04em; }
.deck-date { color: var(--text-dim); margin-left: 4px; text-transform: none; }
.cmd-deck-threat {
  width: auto;
  background: none;
  border: 0;
  padding: 0;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.cmd-deck-threat-label { font-size: 0.84rem; letter-spacing: 0.02em; color: var(--text-dim); }
.cmd-deck-threat-bar { width: 64px; height: 5px; border-radius: 3px; display: inline-block; }
.cmd-deck-threat-value { font-family: var(--font-ui); font-weight: 700; font-size: 0.84rem; letter-spacing: 0.06em; }

.deck-main {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 26px 34px 30px;
}
.deck-emblem {
  width: 200px;
  height: 200px;
  flex: none;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.8));
}
.deck-id { min-width: 0; }
.deck-kicker {
  margin: 0 0 6px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--blood-ink);
  text-transform: uppercase;
}
.deck-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--hl-strong);
}
.deck-motto {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--blood-ink);
}
.deck-member {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.cmd-deck-greet { display: inline; margin: 0; font-family: var(--font-ui); font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--text-dim); font-weight: 400; }
.cmd-deck-user { font-family: var(--font-ui); font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: 0; }
.cmd-deck-rank.rank-pill { font-size: 0.84rem; padding: 3px 10px; }
.cmd-deck-strikes { margin: 0; border-radius: var(--radius); font-size: 0.84rem; letter-spacing: 0.02em; text-transform: none; padding: 3px 9px; }
.cmd-deck-strikes-text { font-family: var(--font-ui); font-weight: 700; }

/* Alerts keep their weight */
.war-alert, .strike-banner { border-radius: var(--radius); font-family: var(--font-ui); }
.war-alert-tag, .strike-banner-tag { letter-spacing: 0.06em; }

/* ---------- Home: content order ---------- */
.home-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  grid-auto-rows: auto;
  gap: 16px;
  margin-top: 0;
  align-items: start;
}
.home-block-announce { grid-column: 1; grid-row: 1; }
.home-block-actions { grid-column: 2; grid-row: 1 / 3; }
.home-block-situation { grid-column: 1; grid-row: 2; }
.home-block {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px 18px;
  gap: 12px;
}
.home-block-head { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.home-block-head h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--hl-strong);
}
.home-block-head h3::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  background: var(--blood-bright);
  transform: rotate(45deg) translateY(-2px);
}
.home-link { font-family: var(--font-ui); font-size: 0.84rem; letter-spacing: 0; color: var(--text-dim); border-radius: var(--radius); }
.home-link:hover { color: var(--text); border-color: var(--border-strong); }

/* Quick actions: a compact command list */
.home-actions-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
.home-action {
  flex-direction: row;
  justify-content: flex-start;
  min-height: 0;
  padding: 11px 12px;
  gap: 10px;
  text-align: left;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0;
  color: var(--text);
  background: var(--bg-sunk);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.home-action:hover { transform: none; border-color: var(--blood-bright); background: rgba(125, 16, 21, 0.18); box-shadow: none; }
.home-action-icon { font-family: var(--font-ui); font-size: 1rem; width: 22px; height: 22px; display: inline-grid; place-items: center; color: var(--blood-ink); flex: none; }
.home-action-label { white-space: normal; }

/* Ally situation tiles */
.status-tile { border-radius: var(--radius); background: var(--bg-sunk); }
.status-tile-label { font-family: var(--font-ui); font-weight: 700; font-size: 0.84rem; letter-spacing: 0.06em; }
.status-tile-count { font-family: var(--font-num); font-weight: 400; }
.home-block .status-tile-count { font-size: 1.7rem; }

/* Support row: stats + leave */
.home-support {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}
.home-stats-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 0; }
.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 14px;
  font-family: var(--font-ui);
}
.stat-card:hover { transform: none; border-color: var(--border-strong); background: var(--bg-elev-2); }
.stat-value { font-family: var(--font-num); font-size: 1.9rem; letter-spacing: 0.02em; color: var(--gold-bright); margin-bottom: 2px; }
.stat-label { font-family: var(--font-ui); font-weight: 600; font-size: 0.84rem; letter-spacing: 0; color: var(--text); }
.stat-sub { font-size: 0.84rem; letter-spacing: 0; color: var(--text-dim); }

@media (max-width: 980px) {
  .home-grid, .home-support { grid-template-columns: 1fr; }
  .home-block-announce, .home-block-actions, .home-block-situation { grid-column: 1; grid-row: auto; }
  .deck-main { gap: 18px; padding: 20px; }
  .deck-emblem { width: 120px; height: 120px; }
  .deck-emblem-bg { width: 380px; height: 380px; right: -30%; }
}
@media (max-width: 600px) {
  .site-header { padding: 10px 16px; }
  .brand-logo { width: 56px; height: 56px; }
  .brand-name { font-size: 1.35rem; }
  .hud { width: 100%; justify-content: space-between; }
  .hud-line { align-items: flex-start; }
  .primary-tabs { padding: 0 8px; overflow-x: auto; flex-wrap: nowrap; }
  .primary-tabs .tab { padding: 12px 10px 10px; font-size: 0.86rem; white-space: nowrap; }
  main { padding: 18px 16px 32px; }
  .deck-main { flex-direction: column; align-items: flex-start; text-align: left; }
  .deck-emblem { width: 96px; height: 96px; }
  .deck-util { justify-content: flex-start; padding: 8px 14px; gap: 8px; }
  .deck-date { display: none; }
  .home-actions-grid { grid-template-columns: 1fr 1fr; }
  .zone-banner { font-size: 0.84rem; }
}

/* ---------- Announcements ---------- */
.announce-card { border-radius: 4px; background: var(--bg-elev); border-color: var(--border); }
.announce-title { font-family: var(--font-ui) !important; font-weight: 700; font-size: 1.05rem; letter-spacing: 0; color: var(--text); text-transform: none; }
.announce-meta { font-size: 0.84rem; letter-spacing: 0; color: var(--text-dim); }
.announce-body { font-size: 0.95rem; line-height: 1.6; color: var(--text); }
.tier-badge { font-family: var(--font-ui); font-weight: 700; letter-spacing: 0.06em; border-radius: var(--radius); }
.tier-badge-ic { color: var(--blood-ink); border-color: rgba(210, 42, 47, 0.5); background: var(--blood-soft); }
.tier-badge-ic::before { content: none !important; }
.tier-badge-ooc { color: var(--ooc); border-color: rgba(143, 169, 196, 0.5); background: rgba(143, 169, 196, 0.08); }

/* ---------- Roster ---------- */
.roster-wrap { gap: 16px; }
.roster-summary { gap: 8px; }
.roster-summary-cell { border-radius: 4px; padding: 10px 16px; min-width: 96px; background: var(--bg-elev); }
.roster-summary-num { font-family: var(--font-num); font-size: 1.6rem; color: var(--gold-bright); }
.roster-summary-lbl { font-size: 0.84rem; letter-spacing: 0.02em; text-transform: none; }
.roster-summary-search input { color: var(--text); font-family: var(--font-ui); letter-spacing: 0; border-radius: var(--radius); }

.roster-tiers { gap: 16px; }
.roster-section { border-radius: 4px; background: var(--bg-elev); border-color: var(--border); }
.roster-section-head { padding: 12px 18px; background: #0f0f10; border-bottom: 1px solid var(--border); }
.roster-section-label { font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: 0.08em; }
.roster-section-sub { font-size: 0.84rem; letter-spacing: 0.02em; color: var(--text-dim); }
.roster-section-count { font-family: var(--font-num); font-size: 1.15rem; border-radius: var(--radius); padding: 1px 10px; color: var(--text); background: rgba(255,255,255,0.04); border-color: var(--border-strong); }
.roster-section.tier-high { border-color: rgba(210, 42, 47, 0.38); }
.roster-section.tier-high .roster-section-label { color: var(--blood-ink); }
.roster-section.tier-high .roster-section-count { color: var(--blood-ink); border-color: rgba(210, 42, 47, 0.4); background: var(--blood-soft); }
.roster-section.tier-low .roster-section-label { color: var(--gold-bright); }
.roster-section.tier-low { border-color: rgba(190, 160, 106, 0.3); }

.roster-card {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 12px 18px 12px 20px;
  border-bottom: 1px solid var(--border);
}
.roster-card:hover { background: rgba(255, 255, 255, 0.025); }
.roster-card-pos { font-family: var(--font-ui); font-weight: 600; font-size: 0.86rem; letter-spacing: 0; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.roster-card-top { gap: 8px 10px; }
.roster-card-name { font-family: var(--font-ui); font-weight: 650; font-size: 1.04rem; letter-spacing: 0; color: var(--text); }
.roster-card-meta { gap: 8px 12px; margin-top: 6px; font-size: 0.84rem; }
.roster-card-phone { font-family: var(--font-ui); font-weight: 500; letter-spacing: 0.02em; font-size: 0.88rem; font-variant-numeric: tabular-nums; color: var(--text); }
.roster-card-phone::before { color: var(--text-faint); }
.roster-card-flag {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.84rem;
  letter-spacing: 0;
  text-transform: none;
  border-radius: var(--radius);
  padding: 1px 8px;
  border-color: var(--border-strong);
  color: var(--text-faint);
  background: transparent;
  min-height: 24px;
}
.roster-card-flag.is-yes { color: var(--text); border-color: #4a4443; background: rgba(255, 255, 255, 0.03); }
.roster-card-flag.is-branded { color: var(--gold-bright); border-color: rgba(190, 160, 106, 0.45); background: rgba(190, 160, 106, 0.08); padding-left: 3px; }
.flag-emblem { width: 18px; height: 18px; object-fit: contain; flex: none; }
.roster-card-notes { border-left-color: var(--blood-bright); border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.92rem; }
.roster-card.has-notes .roster-card-name::after { color: var(--text-faint); }
.roster-card.is-expanded .roster-card-name::after { color: var(--blood-ink); }
.roster-card-actions .btn { min-height: 30px; padding: 4px 12px; font-size: 0.84rem; }
.roster-strikes-label { font-size: 0.84rem; letter-spacing: 0; text-transform: none; }
.roster-flag { font-family: var(--font-ui); font-weight: 700; letter-spacing: 0.04em; border-radius: var(--radius); }

/* ---------- Radio frequencies (click-to-copy preserved) ---------- */
.comms-console { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 4px; }
.comms-tag { font-size: 0.84rem; letter-spacing: 0.08em; color: var(--blood-ink); }
.comms-title { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.06em; color: var(--hl-strong); }
.comms-status { border-radius: var(--radius); background: var(--bg-sunk); }
.comms-note { font-size: 0.84rem; letter-spacing: 0; color: var(--text-dim); }
.freq-tile { border-radius: 4px; background: var(--bg-sunk); border-color: var(--border-strong); }
.freq-tile:hover { border-color: var(--gold); }
.freq-tile .num { font-family: var(--font-num); color: var(--gold-bright); letter-spacing: 0.06em; }
.freq-tile .idx, .freq-tile .channel-line { font-size: 0.84rem; letter-spacing: 0.06em; color: var(--text-dim); }
.freq-tile.is-copied { border-color: var(--ok); }

/* ---------- Allies / LOA / accounts / drops: shared surface ---------- */
.allies-tier, .loa-tile, .loa-card, .acct-card, .intruder-mgr, .cover-codes-mgr, .watch-list, .drop-items-block, .drop-price-block {
  border-radius: 4px;
}
.loa-section-title, .cc-title, .watch-list-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--hl-strong);
}
.watch-list-title { color: var(--blood-ink); }

/* ---------- Modals ---------- */
.modal-card { border-radius: 6px; border-color: var(--border-strong); background: #111011; }
.modal-title { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.06em; color: var(--hl-strong); }
.terminal { border-radius: var(--radius); font-family: var(--font-mono); font-size: 0.84rem; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 22px 16px;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 0.84rem;
  letter-spacing: 0;
  color: var(--text-dim);
  text-transform: none;
}
.foot-emblem { width: 28px; height: 28px; object-fit: contain; opacity: 0.9; }
.foot-name { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.foot-motto { font-family: var(--font-display); color: var(--blood-ink); letter-spacing: 0.04em; }
.foot-sys { font-size: 0.84rem; font-weight: 700; letter-spacing: 0.14em; color: var(--text-faint); }

/* ---------- Toast ---------- */
.toast { font-family: var(--font-ui); letter-spacing: 0; border-radius: var(--radius); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Fixes after first visual pass ---------- */
/* Header, nav and page content share one left edge */
.header-inner { max-width: 1216px; }
.primary-tabs { max-width: 1280px; padding: 0 32px; border-bottom: 0; }
nav.primary-tabs { box-shadow: inset 0 -1px 0 var(--border); }
/* Old grid pins from the previous home layout */
.home-support .home-block-loa { grid-column: auto; grid-row: auto; }
/* Data names (people, gangs, places) use the reading face */
.ally-name, .ally-card-name, .acct-card-name, .watch-card-name, .loa-user, .loa-tile-user,
.rank-meta-val, .dropmap-point-label, .dropmap-popup-title {
  font-family: var(--font-ui) !important;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.allies-tier-label, .loa-section-title { font-family: var(--font-display); }

/* Lock + boot screens: real emblem instead of a font glyph, no line texture */
.lock-screen::before, .lock-screen::after, .boot-screen::before, .boot-screen::after { display: none !important; }
.lock-glyph, .boot-glyph {
  font-size: 0 !important;
  color: transparent !important;
  width: min(70vh, 80vw);
  height: min(70vh, 80vw);
  background: url("assets/logo.png") center / contain no-repeat;
  opacity: 0.08;
  filter: grayscale(0.5);
}
.lock-status { font-family: var(--font-display); letter-spacing: 0.08em; }
.remember-text { font-family: var(--font-ui); letter-spacing: 0; }

/* Phones: compact zone tabs, quieter background emblem */
@media (max-width: 600px) {
  .tab-text { display: none; }
  .tab-zone { font-size: 0.84rem; padding: 2px 8px; }
  .deck-emblem-bg { opacity: 0.045; }
}

/* ---------- Polish pass 2: identity on internal pages, readability ---------- */
/* Page heading band with the emblem beside the title (never over text, forms or the map) */
.subpanel > .section-head, #admin > .section-head {
  position: relative;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background:
    radial-gradient(ellipse 45% 160% at 0% 50%, rgba(125, 16, 21, 0.30), transparent 72%),
    linear-gradient(180deg, #151415 0%, #0f0e0f 100%);
}
#ooc .subpanel > .section-head {
  background:
    radial-gradient(ellipse 45% 160% at 0% 50%, rgba(143, 169, 196, 0.12), transparent 72%),
    linear-gradient(180deg, #141516 0%, #0e0f10 100%);
}
.subpanel > .section-head h2::before, #admin > .section-head h2::before,
#ooc .subpanel > .section-head h2::before {
  content: "";
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 0;
  background: url("assets/logo-160.png") center / contain no-repeat;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

/* Faded states keep their cue without fading the words */
.acct-card.is-locked { opacity: 1; border-style: dashed; }
.acct-card.is-locked .acct-card-actions, .acct-card.is-locked .acct-recruit input { opacity: 0.6; }
.intruder-row.status-revoked, .intruder-row.status-locked, .intruder-row.status-expired { opacity: 1; }
.intruder-row.status-revoked .intruder-token, .intruder-row.status-expired .intruder-token { text-decoration: line-through; text-decoration-color: var(--text-dim); }
.loa-card.loa-status-denied { opacity: 0.85; }
.announce-sep { opacity: 0.8; }

/* Secondary text: one readable step below body text */
.empty, .modal-hint, .note, .comms-note, .stat-sub, .roster-section-sub, .ally-card-meta,
.announce-meta, .acct-card-meta, .cc-sub, .deck-date, .home-link { color: var(--text-dim); }
.data-table th { color: #c3bcb2; }
.subtab, .primary-tabs .tab { color: #bdb6ac; }

@media (max-width: 600px) {
  .subpanel > .section-head, #admin > .section-head { padding: 10px 12px; }
  .subpanel > .section-head h2::before, #admin > .section-head h2::before { width: 32px; height: 32px; }
  .section-head h2 { font-size: 1.25rem; }
}

/* Comfortable sizes at 100% zoom */
.btn { font-size: 0.9rem; }
.roster-card-actions .btn, .mm-section-actions .btn { font-size: 0.86rem; min-height: 32px; }
@media (max-width: 600px) {
  html { font-size: 16px; }
  html, body { font-size: 16px; }
}
@media (max-width: 720px) {
  .roster-card { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 12px 14px 12px 14px; }
  .roster-card-pos { font-size: 0.84rem; text-align: left; align-self: start; padding-top: 3px; }
  .roster-card-actions { grid-column: 2; padding-left: 0; flex-wrap: wrap; }
}

/* =====================================================================
   Private-network pass: operational terminal feel on the same foundation.
   Mono for headings, timestamps and system labels; Inter stays for names,
   notes and forms. Sharp corners, thin borders, brackets on key panels only.
   ===================================================================== */
:root {
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --radius: 0;
  --net-line: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><g stroke='%23b8343a' stroke-width='1' fill='none'><path d='M18 40 L108 72 L192 28 L252 92'/><path d='M108 72 L88 150 L172 172 L244 214' stroke-dasharray='6 5'/><path d='M88 150 L28 212 L122 246'/><path d='M172 172 L192 28' stroke-dasharray='2 7'/><path d='M244 214 L252 92'/></g><g fill='%23d0484d'><circle cx='18' cy='40' r='2.5'/><circle cx='108' cy='72' r='3'/><circle cx='192' cy='28' r='2.5'/><circle cx='252' cy='92' r='2'/><circle cx='88' cy='150' r='3'/><circle cx='172' cy='172' r='2.5'/><circle cx='244' cy='214' r='2'/><circle cx='28' cy='212' r='2'/><circle cx='122' cy='246' r='2.5'/></g></svg>");
}

/* Network lines: outer margins only (never behind the content column) */
.net-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--net-line);
  background-size: 260px 260px;
  opacity: 0.2;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(50% - 680px), transparent calc(50% - 620px), transparent calc(50% + 620px), #000 calc(50% + 680px), #000 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(50% - 680px), transparent calc(50% - 620px), transparent calc(50% + 620px), #000 calc(50% + 680px), #000 100%);
}
/* …and in the banner, only over the watermark side, below the status line */
.deck-net {
  position: absolute;
  top: 44px; bottom: 0; left: 70%; right: 0;
  z-index: 1;
  pointer-events: none;
  background-image: var(--net-line);
  background-size: 220px 220px;
  opacity: 0.32;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 45%);
  mask-image: linear-gradient(90deg, transparent 0, #000 45%);
}
@media (max-width: 980px) { .deck-net { display: none; } }

/* Monospace headings (the Shadows title and motto keep their display face) */
.section-head h2, .home-block-head h3, .roster-section-label, .allies-tier-label, .loa-section-title,
.cc-title, .watch-list-title, .modal-title, .comms-title {
  font-family: var(--font-mono) !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.section-head h2 { font-size: 1.25rem; }
.home-block-head h3 { font-size: 0.95rem; color: var(--hl-strong); display: flex; align-items: center; }
.home-block-head h3::before { display: none; }
.roster-section-label, .allies-tier-label { font-size: 0.98rem; }
.modal-title { font-size: 0.98rem; }
.sec-id {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--blood-ink);
  border: 1px solid rgba(210, 42, 47, 0.5);
  padding: 1px 6px;
  margin-right: 10px;
  line-height: 1.4;
  text-transform: none;
}
/* Monospace for timestamps, small system labels and record references */
.deck-util, .deck-kicker, .brand-sys-name, .tab-zone, .zone-tag, .stat-sub, .announce-meta, .announce-date,
.roster-card-pos, .roster-section-sub, .loa-tile-end, .loa-countdown, .ally-card-meta, .acct-card-meta-key,
.comms-status, .comms-tag, .freq-tile .idx, .freq-tile .channel-line, .status-pill, .roster-summary-lbl,
.home-link, .cmd-deck-threat-value, .cmd-deck-threat-label, .foot-sys {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* Sharp corners everywhere except true circles (LEDs, strike pips) */
.cmd-deck, .home-block, .stat-card, .roster-section, .roster-summary-cell, .announce-card, .comms-console,
.freq-tile, .modal-card, .zone-banner, .subpanel > .section-head, #admin > .section-head, .btn, .form,
.empty, .rank-pill, .status-pill, .roster-card-flag, .home-action, .status-tile, .table-wrap, .allies-tier,
.loa-tile, .loa-card, .acct-card, .intruder-mgr, .cover-codes-mgr, .watch-list, input, select, textarea,
.check-label, .tab-zone, .zone-tag, .sec-id, .brand-sys-name, .home-link, .ooc-badge, .tier-badge { border-radius: 0 !important; }

/* Thin borders; brackets on the key panels only */
.home-block, .roster-section { border: 1px solid #2e2a2b; padding: 14px 16px; }
.home-block-head { padding-bottom: 8px; border-bottom: 1px dashed #3a3434; }
.home-block::before, .home-block::after, .roster-section::before, .roster-section::after,
.subpanel > .section-head::before, .subpanel > .section-head::after, #admin > .section-head::before, #admin > .section-head::after {
  display: block !important;
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
  z-index: 2;
}
.home-block::before, .roster-section::before, .subpanel > .section-head::before, #admin > .section-head::before {
  top: -1px; left: -1px; border-top: 1px solid var(--blood-bright); border-left: 1px solid var(--blood-bright);
}
.home-block::after, .roster-section::after, .subpanel > .section-head::after, #admin > .section-head::after {
  bottom: -1px; right: -1px; border-bottom: 1px solid var(--blood-bright); border-right: 1px solid var(--blood-bright);
}
.subpanel > .section-head, #admin > .section-head { border: 1px solid #2e2a2b; }

/* Navigation: restrained red for the selected item; clear hover and focus */
.primary-tabs .tab.active::before, .subtab.active::before {
  display: inline-block !important;
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 8px;
  background: var(--blood-bright);
  vertical-align: middle;
}
.primary-tabs .tab.tab-ooc.active::before, #ooc .subtab.active::before { background: var(--ooc); }
.primary-tabs .tab:hover, .subtab:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.primary-tabs .tab:focus-visible, .subtab:focus-visible, .home-action:focus-visible, .activity-row:focus-visible,
.stat-card:focus-visible, .home-link:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.home-action:hover { border-color: var(--blood-bright); }

/* Home layout: Operations + Activity on the right */
.home-block-actions { grid-column: 2; grid-row: 1; }
.home-block-activity { grid-column: 2; grid-row: 2; }
@media (max-width: 980px) { .home-block-actions, .home-block-activity { grid-column: 1; grid-row: auto; } }

/* Network Activity feed */
.activity-group + .activity-group { margin-top: 12px; }
.activity-zone { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
.zone-ic-chip { color: var(--blood-ink); }
.zone-ooc-chip { color: var(--ooc); }
.activity-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #2e2a2b; }
.activity-row {
  display: grid;
  grid-template-columns: 4.8rem 7.6rem minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  width: 100%;
  padding: 7px 4px;
  background: none;
  border: 0;
  border-bottom: 1px solid #2a2627;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}
.activity-row:hover { background: rgba(255, 255, 255, 0.035); }
.activity-time { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; }
.activity-kind { font-family: var(--font-mono); font-size: 0.8rem; color: var(--blood-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#activityOoc .activity-kind { color: var(--ooc); }
.activity-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-empty { font-family: var(--font-mono); font-size: 0.84rem; color: var(--text-dim); padding: 8px 4px; }
@media (max-width: 600px) { .activity-row { grid-template-columns: 4.4rem minmax(0, 1fr); } .activity-kind { grid-column: 2; } .activity-text { grid-column: 1 / -1; white-space: normal; } }

/* One-time entry: panels settle in, network lines fade up; nothing moves afterwards */
@keyframes netIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes netLines { from { opacity: 0; } to { opacity: 0.32; } }
body.net-enter .cmd-deck { animation: netIn 0.45s ease-out both; }
body.net-enter .home-grid > *, body.net-enter .home-support > * { animation: netIn 0.45s ease-out both; }
body.net-enter .home-grid > :nth-child(2) { animation-delay: 0.06s; }
body.net-enter .home-grid > :nth-child(3) { animation-delay: 0.12s; }
body.net-enter .home-grid > :nth-child(4) { animation-delay: 0.18s; }
body.net-enter .home-support > * { animation-delay: 0.22s; }
body.net-enter .deck-net { animation: netLines 1.1s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  body.net-enter .cmd-deck, body.net-enter .home-grid > *, body.net-enter .home-support > *, body.net-enter .deck-net { animation: none !important; }
}
.sec-id { white-space: nowrap; flex: none; }
.activity-row { grid-template-columns: 4.8rem max-content minmax(0, 1fr); }
@media (max-width: 600px) { .activity-row { grid-template-columns: 4.4rem minmax(0, 1fr); } }
/* keep the network labels at the readable floor (12.6px desktop / 13.4px phone) */
.sec-id, .activity-time, .activity-kind, .activity-zone { font-size: 0.84rem; }
/* Intrusion-token rows wrap on phones instead of running off-screen */
@media (max-width: 600px) {
  .intruder-row { display: flex; flex-wrap: wrap; gap: 8px 10px; }
  .intruder-row > div { flex: 1 1 100%; min-width: 0; }
  .intruder-row .intruder-token { word-break: break-all; }
}
