:root{
  --bg: #0b0d0f;
  --panel: #14171a;
  --panel-raised: #191d20;
  --hair: #292e33;
  --hair-soft: #21252a;
  --ink: #e9e6df;
  --ink-dim: #9aa0a6;
  --ink-faint: #676d73;
  --accent: #35659e;
  --accent-2: #c9a227;
  --accent-soft: rgba(53,101,158,0.12);
  --radius: 3px;
  --hover-bg: #1e2226;
}

:root[data-theme="light"]{
  --bg: #f4f2ec;
  --panel: #ffffff;
  --panel-raised: #f1efe8;
  --hair: #dcd7cc;
  --hair-soft: #e7e3d9;
  --ink: #1b1d1f;
  --ink-dim: #4c5157;
  --ink-faint: #767b81;
  --accent: #2b5480;
  --accent-2: #8a6a15;
  --accent-soft: rgba(43,84,128,0.1);
  --hover-bg: #e9e4d6;
}
:root[data-theme="light"] ::-webkit-scrollbar-track{ background:var(--hair-soft); }
:root[data-theme="light"] .grain{ opacity:0.02; }
*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:'Inter',sans-serif;
  min-height:100vh;
  line-height:1.5;
}
::selection{ background:var(--accent); color:#fff; }

.grain{
  position:fixed; inset:0; pointer-events:none; z-index:1; opacity:0.035; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,h2,h3,h4,.disp{ font-family:'Oswald',sans-serif; text-transform:uppercase; letter-spacing:0.02em; }
.mono{ font-family:'IBM Plex Mono',monospace; }

.shell{ display:flex; min-height:100vh; }

.sidebar{
  width:380px; flex-shrink:0; background:var(--panel);
  border-right:1px solid var(--hair);
  position:sticky; top:0; height:100vh; overflow-y:auto;
  display:flex; flex-direction:column;
  z-index:5;
}
.brand{ padding:28px 24px 22px; border-bottom:1px solid var(--hair); }
.brand .eyebrow{ font-family:'IBM Plex Mono',monospace; font-size:10px; letter-spacing:0.18em; color:var(--ink-faint); text-transform:uppercase; margin-bottom:6px;}
.brand h1{ font-size:22px; font-weight:700; line-height:1.05; color:var(--ink); }
.brand h1 span{ display:block; font-size:12px; font-weight:500; letter-spacing:0.14em; color:var(--accent-2); margin-top:6px; text-transform:uppercase; font-family:'IBM Plex Mono',monospace;}

.patrol-list{ padding:16px; display:flex; flex-direction:column; gap:10px; flex:1;}
.patrol-btn{
  display:flex; align-items:center; gap:12px;
  background:var(--panel-raised); border:1px solid var(--hair);
  border-left:3px solid var(--patrol-color, var(--hair));
  padding:12px 14px; border-radius:2px; cursor:pointer; text-align:left;
  transition:background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  width:100%;
}
.patrol-btn:hover{ background:var(--hover-bg); transform:translateX(2px); }
.patrol-btn.active{ background:linear-gradient(90deg, var(--patrol-color-soft) 0%, var(--panel-raised) 60%); border-color:var(--patrol-color); }
.patrol-btn .sigil{
  width:34px; height:34px; border-radius:2px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:#CCCCCC; color:#0b0d0f; font-family:'Oswald',sans-serif; font-weight:700; font-size:15px;
  overflow:hidden; border:1px solid var(--patrol-color, var(--hair));
}
.patrol-btn .sigil img{ width:22px; height:22px; object-fit:contain; }
.hero-sigil{
  width:52px; height:52px; border-radius:3px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:#CCCCCC; margin-bottom:14px; border:1px solid var(--patrol-color, var(--hair));
  color:#0b0d0f; font-family:'Oswald',sans-serif; font-weight:700; font-size:22px;
}
.hero-sigil img{ width:32px; height:32px; object-fit:contain; }
.patrol-btn .meta{ flex:1; min-width:0; }
.patrol-btn .faction{ font-size:10.5px; font-weight:700; letter-spacing:0.1em; color:var(--ink); text-transform:uppercase; font-family:'IBM Plex Mono',monospace; }
.patrol-btn .name{ font-family:'Oswald',sans-serif; font-size:15px; font-weight:600; color:var(--ink); text-transform:uppercase; letter-spacing:0.01em; }

.filter-bar{ padding:14px 16px 0; display:flex; flex-direction:column; gap:6px; }
.filter-row{ display:flex; gap:6px; flex-wrap:wrap; }
.search-row{ display:flex; gap:6px; margin-bottom:10px; }
.search-input{ flex:1; min-width:180px; padding:8px 12px; background:var(--panel); border:1px solid var(--hair); border-radius:3px; font-family:'Inter',sans-serif; font-size:13px; color:var(--ink); }
.search-input::placeholder{ color:var(--ink-faint); }
.search-input:focus{ outline:none; border-color:var(--patrol-color); box-shadow:0 0 0 2px var(--patrol-color-soft); }
.sort-select{ padding:8px 10px; background:var(--panel); border:1px solid var(--hair); border-radius:3px; font-family:'Inter',sans-serif; font-size:13px; color:var(--ink); cursor:pointer; }
.sort-select:focus{ outline:none; border-color:var(--patrol-color); }
.filter-spacer { height: 8px; }
.filter-chip{
  font-family:'IBM Plex Mono',monospace; font-size:10px; letter-spacing:0.05em; text-transform:uppercase;
  background:var(--panel-raised); border:1px solid var(--hair); color:var(--ink-dim);
  padding:5px 10px; border-radius:2px; cursor:pointer; transition:background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.filter-chip:hover{ border-color:var(--accent-2); color:var(--ink); }
.filter-chip.active{ background:var(--accent-2); color:#0b0d0f; border-color:var(--accent-2); font-weight:700; box-shadow:0 0 0 2px rgba(201,162,39,0.3); }
.filter-chip.status-chip.green:hover{ border-color:#7fd858; }
.filter-chip.status-chip.yellow:hover{ border-color:#e8c250; }
.filter-chip.status-chip.red:hover{ border-color:#e06a6a; }
.filter-chip.status-chip.green.active{ background:#7fd858; border-color:#7fd858; color:#0b0d0f; font-weight:700; box-shadow:0 0 0 2px rgba(127,216,88,0.3); }
.filter-chip.status-chip.yellow.active{ background:#e8c250; border-color:#e8c250; color:#0b0d0f; font-weight:700; box-shadow:0 0 0 2px rgba(232,194,80,0.3); }
.filter-chip.status-chip.red.active{ background:#e06a6a; border-color:#e06a6a; color:#0b0d0f; font-weight:700; box-shadow:0 0 0 2px rgba(224,106,106,0.3); }

.ed-badge{
  display:inline-flex; align-items:center; gap:5px; font-family:'IBM Plex Mono',monospace;
  font-size:9px; letter-spacing:0.05em; text-transform:uppercase; padding:3px 7px; border-radius:2px;
  border:1px solid; flex-shrink:0;
}
.ed-badge .dot{ width:7px; height:7px; border-radius:50%; flex-shrink:0; background:#0b0d0f; }
.ed-badge.green{ color:#0b0d0f; border-color:#7fd858; background:#7fd858; font-weight:700; }
.ed-badge.yellow{ color:#0b0d0f; border-color:#e8c250; background:#e8c250; font-weight:700; }
.ed-badge.red{ color:#0b0d0f; border-color:#e06a6a; background:#e06a6a; font-weight:700; }
.patrol-btn .meta-row{ display:flex; align-items:center; gap:8px; margin-top:4px; }
.sidebar-foot{ padding:18px 24px; border-top:1px solid var(--hair); font-size:11px; color:var(--ink-faint); line-height:1.6; }

.global-nav{ padding:16px 16px 0; }
.global-nav-btn{
  display:flex; align-items:center; gap:12px; width:100%;
  background:var(--panel-raised); border:1px solid var(--hair); border-left:3px solid var(--accent-2);
  padding:12px 14px; border-radius:2px; cursor:pointer; text-align:left;
  transition:background 0.15s ease, transform 0.1s ease;
}
.global-nav-btn:hover{ background:var(--hover-bg); transform:translateX(2px); }
.global-nav-btn.active{ background:linear-gradient(90deg, rgba(201,162,39,0.14) 0%, var(--panel-raised) 60%); }
.global-nav-btn .sigil{
  width:34px; height:34px; border-radius:2px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:var(--accent-2); color:#0b0d0f; font-family:'Oswald',sans-serif; font-weight:700; font-size:15px;
}
.global-nav-btn .name{ font-family:'Oswald',sans-serif; font-size:14px; font-weight:600; color:var(--ink); text-transform:uppercase; letter-spacing:0.01em; }
.global-nav-btn .sub{ font-size:9px; letter-spacing:0.1em; color:var(--ink-faint); text-transform:uppercase; font-family:'IBM Plex Mono',monospace; }
.nav-divider{ margin:14px 14px 0; border-top:1px solid var(--hair); padding-top:2px; }

/* Give the optional project-support link a little extra warmth and presence. */
.global-nav-btn.donate-btn{
  background:linear-gradient(105deg, rgba(176,112,48,0.2), var(--panel-raised) 72%);
  border-color:rgba(206,145,70,0.55);
  border-left-color:#d08a3d;
  box-shadow:0 0 0 1px rgba(208,138,61,0.08), 0 5px 18px rgba(0,0,0,0.16);
  text-decoration:none;
}
.global-nav-btn.donate-btn .sigil{
  background:#d08a3d;
  box-shadow:0 0 0 3px rgba(208,138,61,0.16);
}
.global-nav-btn.donate-btn .name{ color:#f0c27d; }
.global-nav-btn.donate-btn .sub{ color:#c9955b; }
.global-nav-btn.donate-btn:hover{
  background:linear-gradient(105deg, rgba(208,138,61,0.3), var(--hover-bg) 72%);
  border-color:#d08a3d;
  box-shadow:0 0 0 1px rgba(208,138,61,0.2), 0 7px 22px rgba(0,0,0,0.24);
}

.step-code{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--accent-2); letter-spacing:0.06em; }
.rule-card ul{ margin:4px 0 4px 18px; padding:0; }
.rule-card li{ font-size:14px; color:var(--ink-dim); line-height:1.7; margin-bottom:4px; }
.rule-card .note{ font-size:13px; color:var(--ink-faint); font-style:italic; margin-top:10px; line-height:1.65; }

.deploy-table{ width:100%; border-collapse:collapse; margin:14px 0 22px; max-width:360px; }
.manoeuvre-table{ width:100%; border-collapse:collapse; margin-top:14px; }
.manoeuvre-table th{ font-family:'IBM Plex Mono',monospace; font-size:9.5px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:0.06em; text-align:left; padding:0 12px 8px 0; border-bottom:1px solid var(--hair); }
.manoeuvre-table td{ font-size:12.5px; color:var(--ink-dim); line-height:1.55; padding:10px 12px 10px 0; border-bottom:1px solid var(--hair-soft); vertical-align:top; }
.manoeuvre-table td.mv-name{ color:var(--ink); font-weight:600; font-size:13px; white-space:nowrap; }
.manoeuvre-table tr:last-child td{ border-bottom:none; }
@media(max-width:700px){
  .manoeuvre-table, .manoeuvre-table thead, .manoeuvre-table tbody, .manoeuvre-table th, .manoeuvre-table td, .manoeuvre-table tr{ display:block; }
  .manoeuvre-table thead{ display:none; }
  .manoeuvre-table tr{ border-bottom:1px solid var(--hair); padding-bottom:10px; margin-bottom:10px; }
  .manoeuvre-table td{ border-bottom:none; padding:2px 0; }
  .manoeuvre-table td.mv-name{ font-size:14px; margin-bottom:4px; }
  .manoeuvre-table td:not(.mv-name)::before{ content:attr(data-label); display:block; font-family:'IBM Plex Mono',monospace; font-size:9px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:0.06em; margin-bottom:2px; }
}
.deploy-table th{ font-family:'IBM Plex Mono',monospace; font-size:10px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:0.06em; text-align:left; padding:6px 10px; border-bottom:1px solid var(--hair); }
.deploy-table td{ font-size:13.5px; color:var(--ink); padding:8px 10px; border-bottom:1px solid var(--hair-soft); }

.layout-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:8px; }
@media(max-width:900px){ .layout-grid{ grid-template-columns:1fr; } }
.layout-card{ background:var(--panel); border:1px solid var(--hair); border-radius:3px; padding:14px; }
.layout-card h5{ font-family:'Oswald',sans-serif; font-size:14px; color:var(--ink); text-transform:uppercase; margin-bottom:10px; letter-spacing:0.02em; }
.layout-card svg{ width:100%; height:auto; display:block; border-radius:2px; }
.layout-legend{ display:flex; gap:10px; margin-top:8px; font-size:10.5px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace; }
.layout-legend span{ display:flex; align-items:center; gap:5px; }
.swatch{ width:10px; height:10px; border-radius:1px; display:inline-block; }

.main{ flex:1; min-width:0; position:relative; }

.hero{
  position:relative; padding:64px 56px 46px; overflow:hidden;
  border-bottom:1px solid var(--hair);
  background:
    radial-gradient(ellipse 900px 400px at 15% -10%, var(--patrol-color-soft), transparent 60%),
    var(--bg);
}
.hero::before{
  content:''; position:absolute; right:-60px; top:-40px; width:420px; height:420px;
  border:1px solid var(--patrol-color); opacity:0.14; border-radius:2px; transform:rotate(8deg);
  pointer-events:none;
}
.hero::after{
  content:''; position:absolute; right:20px; top:40px; width:260px; height:260px;
  border:1px solid var(--patrol-color); opacity:0.1; border-radius:2px; transform:rotate(-6deg);
  pointer-events:none;
}
.hero .top-row{ display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; flex-wrap:wrap; }
.hero .eyebrow{
  font-family:'IBM Plex Mono',monospace; font-size:12px; font-weight:700; letter-spacing:0.2em; text-transform:uppercase;
  color:var(--patrol-color); display:flex; align-items:center; gap:10px; margin:0;
}
.hero .eyebrow b{ color:var(--ink); font-weight:700; }
.hero .eyebrow::before{ content:''; width:22px; height:1px; background:var(--patrol-color); }
.updated-pill{
  display:inline-flex; align-items:center; gap:6px;
  font-family:'IBM Plex Mono',monospace; font-size:10px; font-weight:600;
  letter-spacing:0.06em; text-transform:uppercase;
  color:var(--accent-2); border:1px solid rgba(201,162,39,0.45);
  background:rgba(201,162,39,0.1);
  padding:5px 10px 5px 8px; border-radius:20px; flex-shrink:0; white-space:nowrap;
}
.updated-pill .dot{
  width:6px; height:6px; border-radius:50%; background:var(--accent-2); flex-shrink:0;
  box-shadow:0 0 5px rgba(201,162,39,0.7);
}
.updated-pill .label{ color:var(--ink-dim); font-weight:500; }
.updated-pill .date{ color:var(--accent-2); }
.hero h2{ font-size:clamp(34px,5vw,58px); font-weight:700; color:var(--ink); line-height:0.98; max-width:800px; }
.hero .blurb{ margin-top:18px; max-width:640px; color:var(--ink-dim); font-size:15px; line-height:1.7; font-family:'Inter',sans-serif; text-transform:none; letter-spacing:0; }
.hero .tags{ margin-top:22px; display:flex; gap:8px; flex-wrap:wrap; }
.hero .tag{
  font-family:'IBM Plex Mono',monospace; font-size:10.5px; letter-spacing:0.06em; text-transform:uppercase;
  border:1px solid var(--hair); color:var(--ink-dim); padding:5px 10px; border-radius:2px;
}

/* Patrol-level 11E/10E edition switch (hero header). Colors deliberately
   reuse the site's existing green="11E ready"/red="Legends (10E)" language
   (see .ed-badge) so the selected edition reads instantly, and the whole
   control gets a matching tinted background - not just the small knob -
   so the state is obvious at a glance. */
.edition-toggle-container{
  display:inline-flex; flex-direction:column; align-items:center; gap:4px;
}

.edition-toggle-header{
  font-family:'IBM Plex Mono',monospace; font-size:9.5px; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--ink-faint);
}

.edition-toggle{
  display:inline-flex; align-items:center; position:relative; cursor:pointer;
  user-select:none; gap:9px; padding:5px 10px 5px 5px; border-radius:14px;
  background:rgba(127,216,88,0.1); border:1px solid #3a5f2a; transition:background 0.25s ease, border-color 0.25s ease;
}

.edition-toggle:has(input:checked){
  background:rgba(224,106,106,0.12); border-color:#6b2a2a;
}

.edition-toggle input[type="checkbox"]{
  display:none;
}

.toggle-slider{
  width:38px; height:22px; background:#7fd858; border:1px solid #3a5f2a;
  border-radius:11px; position:relative; transition:background 0.25s ease, border-color 0.25s ease;
  flex-shrink:0; box-shadow:inset 0 1px 2px rgba(0,0,0,0.2);
}

.toggle-slider::after{
  content:''; position:absolute; width:16px; height:16px; background:#0b0d0f;
  border-radius:50%; top:2px; left:2px; transition:left 0.25s ease;
  box-shadow:0 1px 2px rgba(0,0,0,0.4);
}

.edition-toggle input[type="checkbox"]:checked ~ .toggle-slider{
  background:#e06a6a; border-color:#6b2a2a;
}

.edition-toggle input[type="checkbox"]:checked ~ .toggle-slider::after{
  left:18px;
}

.toggle-label{
  font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:0.06em; text-transform:uppercase;
  font-weight:700; min-width:22px; transition:color 0.25s ease;
  color:#8a8f94;
}

/* Inactive label is grey; the active label switches to its bold neon
   edition colour - 11E green, 10E red - so the active choice reads instantly.
   Markup order is slider, then the two labels, all <span> - nth-of-type counts
   the slider as span 1, so the labels are span 2 (11E) and span 3 (10E). */
.edition-toggle input[type="checkbox"]:not(:checked) ~ .toggle-label:nth-of-type(2){
  color:#39ff14;
}
.edition-toggle input[type="checkbox"]:checked ~ .toggle-label:nth-of-type(3){
  color:#ff2626;
}

.content{ padding:8px 56px 90px; max-width:1180px; }

.section{ padding-top:46px; }
.section-head{ display:flex; align-items:center; gap:14px; margin-bottom:18px; cursor:pointer; user-select:none; transition:opacity 0.2s ease; }
.section-head:hover{ opacity:0.8; }
.section-head::before{ content:'▼'; font-size:12px; color:var(--patrol-color); width:16px; text-align:center; display:inline-block; transition:transform 0.3s ease; }
.section.open .section-head::before{ transform:rotate(0deg); }
.section:not(.open) .section-head::before{ transform:rotate(-90deg); }
.section-head .num{ font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--ink-faint); font-weight:700; }
.section-head h3{ font-size:22px; font-weight:600; color:var(--ink); }
.section-head .line{ flex:1; height:1px; background:var(--hair); }
/* Collapse via grid-template-rows rather than a max-height cap: the Datasheets
   section is taller than any fixed cap (all datasheets are open by default), and
   a cap plus overflow:hidden silently cut the bottom off with no way to scroll. */
.section-body{
  display:grid; grid-template-rows:1fr; opacity:1; overflow:hidden;
  transition:grid-template-rows 0.4s ease, opacity 0.3s ease;
}
.section-body > .section-body-inner{ min-height:0; }
.section:not(.open) .section-body{
  grid-template-rows:0fr; opacity:0; pointer-events:none;
  transition:grid-template-rows 0.4s ease, opacity 0.3s ease 0.1s;
}
.section-sub{ font-size:13px; color:var(--ink-dim); margin:8px 0 16px; line-height:1.65; max-width:760px; }

.rule-card{
  background:var(--panel); border:1px solid var(--hair); border-radius:3px;
  padding:20px 22px; margin-bottom:12px;
}
.rule-card h4{ font-size:14.5px; color:var(--ink); margin-bottom:8px; font-weight:600; letter-spacing:0.03em;}
.rule-card p{ color:var(--ink-dim); font-size:14px; line-height:1.7; font-family:'Inter',sans-serif; }
.rule-card p + p{ margin-top:8px; }
.rule-card .rule-list{ margin:8px 0 10px 18px; padding-left:16px; }
.rule-card .rule-list li{ color:var(--ink-dim); font-size:14px; line-height:1.65; margin-bottom:6px; padding-left:3px; }
.rule-card .rule-list li:last-child{ margin-bottom:0; }
.rule-card strong, .rule-card b{ color:var(--ink); font-weight:700; }
.rule-card em, .rule-card i{ color:var(--ink-faint); }
.rule-card .rule-subhead{ margin:16px 0 6px; color:var(--accent-2); font-size:12px; text-transform:uppercase; letter-spacing:.06em; }
.rule-card .dp-badge{
  display:inline-block; font-family:'IBM Plex Mono',monospace; font-size:10.5px; color:var(--accent-2);
  border:1px solid var(--hair); padding:3px 8px; border-radius:2px; margin-bottom:10px; letter-spacing:0.04em;
}

/* Detachment rule lists (e.g., Strategic Reserves) */
.rule-card .rule-list-item{
  display:grid; grid-template-columns:1fr auto; gap:16px; align-items:baseline;
  padding:10px 0; border-bottom:1px solid var(--hair-soft);
}
.rule-card .rule-list-item:last-of-type{ border-bottom:none; }
.rule-card .rule-list-item strong{ color:var(--ink); font-weight:600; }
/* The detail column holds free text, so it must wrap - nowrap here overflowed
   the card horizontally as soon as a rule had a long detail. */
.rule-card .rule-list-item span{ color:var(--ink-dim); font-size:13.5px; }

.changelog-entry{ padding:18px 0; border-bottom:1px solid var(--hair); }
.changelog-entry:last-child{ border-bottom:none; }
.changelog-date{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--patrol-color); letter-spacing:0.05em; margin-bottom:6px; }
.changelog-summary{ font-size:15px; font-weight:600; color:var(--ink); margin-bottom:10px; }
.changelog-list{ list-style:none; padding:0; margin:0; }
.changelog-list li{ font-size:13.5px; color:var(--ink-dim); line-height:1.6; padding:4px 0 4px 20px; position:relative; }
.changelog-list li:before{ content:"•"; position:absolute; left:4px; }


.disp-row{ display:flex; gap:8px; flex-wrap:wrap; }
.disp-chip{
  font-family:'IBM Plex Mono',monospace; font-size:11.5px; letter-spacing:0.05em;
  background:var(--accent-soft); border:1px solid var(--patrol-color); color:var(--ink);
  padding:7px 12px; border-radius:2px;
}

.composition-section{ background:var(--panel); border:1px solid var(--hair); border-radius:3px; padding:18px 22px; }
.composition-list{ margin-bottom:14px; }
.composition-item{ display:flex; align-items:center; gap:10px; margin-bottom:8px; font-size:14px; color:var(--ink-dim); }
.comp-bullet{ color:var(--ink-dim); font-weight:600; }
.comp-datasheet{ flex:1; color:var(--ink); font-weight:500; }
.comp-count{ font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--ink-faint); }
.composition-total{ font-size:13.5px; color:var(--ink); font-weight:600; border-top:1px solid var(--hair); padding-top:10px; }

.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
@media(max-width:900px){ .grid-2,.grid-3{ grid-template-columns:1fr; } }

.strat-card{
  background:var(--panel); border:1px solid var(--hair); border-radius:3px; padding:16px 18px;
  border-top:2px solid var(--patrol-color);
}
.strat-card .top{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:10px;}
.strat-card h4{ font-size:14px; color:var(--ink); font-weight:600; letter-spacing:0.02em; }
.strat-card .cp{
  font-family:'IBM Plex Mono',monospace; font-size:11px; color:#0b0d0f; background:var(--accent-2);
  padding:3px 7px; border-radius:2px; flex-shrink:0; font-weight:600;
}
.strat-card .cat{ font-family:'IBM Plex Mono',monospace; font-size:9.5px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:0.1em; margin-bottom:10px; }
.strat-card .row{ font-size:12.5px; color:var(--ink-dim); margin-bottom:4px; }
.strat-card .row b{ color:var(--ink-faint); font-weight:600; font-family:'IBM Plex Mono',monospace; font-size:10px; text-transform:uppercase; letter-spacing:0.06em; margin-right:6px; }

.enh-card{
  background:var(--panel); border:1px solid var(--hair); border-radius:3px; padding:18px 20px;
  border-left:2px solid var(--accent-2);
}
.enh-card h4{ font-size:14.5px; color:var(--ink); font-weight:600; display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.enh-card .restrict{ font-family:'IBM Plex Mono',monospace; font-size:10px; color:var(--accent-2); text-transform:uppercase; letter-spacing:0.05em; margin:6px 0 10px; }
.enh-card p{ font-size:13.5px; color:var(--ink-dim); line-height:1.65; }

.mission-card{ background:var(--panel); border:1px solid var(--hair); border-radius:3px; padding:20px 22px; }
.mission-card h4{ font-size:15px; color:var(--ink); margin-bottom:16px; font-weight:600; }
.mission-condition{ margin-bottom:18px; padding-bottom:18px; border-bottom:1px solid var(--hair); }
.mission-condition:last-of-type{ border-bottom:none; margin-bottom:0; padding-bottom:0; }
.cond-label{ font-family:'IBM Plex Mono',monospace; font-size:10.5px; color:var(--accent-2); text-transform:uppercase; letter-spacing:0.04em; font-weight:600; margin-bottom:10px; }
.cond-when{ font-size:13px; color:var(--ink-dim); line-height:1.6; margin-bottom:12px; }
.cond-when b{ color:var(--ink); }
.cond-rule{ display:flex; justify-content:space-between; align-items:baseline; gap:20px; margin-bottom:8px; font-size:13px; }
.rule-text{ color:var(--ink-dim); flex:1; line-height:1.6; }
.rule-vp{ font-family:'IBM Plex Mono',monospace; font-size:12px; font-weight:600; color:var(--accent-2); white-space:nowrap; }
.mission-lore{ margin-top:18px; padding-top:18px; border-top:1px solid var(--hair); }
.lore-label{ font-family:'IBM Plex Mono',monospace; font-size:10.5px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:0.04em; margin-bottom:8px; }
.mission-lore p{ font-size:13px; color:var(--ink-dim); line-height:1.7; font-style:italic; }


.datasheet{
  background:var(--panel); border:1px solid var(--hair); border-radius:4px; overflow:hidden; margin-bottom:22px;
}
.datasheet.collapsible .ds-head {
  cursor:pointer; user-select:none; position:relative; padding-left:44px;
}
.datasheet.collapsible .ds-head::before {
  content:'▼'; font-size:10px; color:#CCCCCC; position:absolute; left:8px; top:50%; transform:translateY(-50%);
  transition:transform 0.3s ease; background:#0b0d0f; width:28px; height:28px; display:flex; align-items:center;
  justify-content:center; border-radius:50%; font-weight:700;
}
.datasheet:not(.open) .ds-head::before {
  transform:translateY(-50%) rotate(-90deg);
}
.datasheet .ds-body {
  max-height:10000px; opacity:1; transition:max-height 0.4s ease, opacity 0.3s ease; overflow:hidden;
}
.datasheet:not(.open) .ds-body {
  max-height:0; opacity:0; pointer-events:none; transition:max-height 0.4s ease, opacity 0.3s ease 0.1s;
}
.ds-head{
  padding:16px 20px; background:#CCCCCC; border-bottom:3px solid var(--patrol-color);
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px;
}
.ds-head h4{ color:#14171a; font-size:18px; font-weight:700; letter-spacing:0.01em; }
.ds-head-title{ display:flex; flex-direction:column; gap:4px; flex:1; }
.ds-subtitle{ font-family:'IBM Plex Mono',monospace; font-size:10px; color:rgba(11,13,15,0.6); text-transform:uppercase; letter-spacing:0.05em; font-weight:500; }
.ds-head .leader-badge{
  font-family:'IBM Plex Mono',monospace; font-size:9.5px; color:#14171a; background:rgba(11,13,15,0.1);
  padding:4px 9px; border-radius:2px; text-transform:uppercase; letter-spacing:0.06em; font-weight:600;
  border:1px solid rgba(11,13,15,0.18);
}
.ds-head .warlord-badge{
  font-family:'IBM Plex Mono',monospace; font-size:9.5px; color:#fff; background:#c9a227;
  padding:4px 9px; border-radius:2px; text-transform:uppercase; letter-spacing:0.06em; font-weight:700;
  border:1px solid #a5811d;
}

.version-toggle{
  display:inline-flex; border:1px solid rgba(11,13,15,0.25); border-radius:20px; padding:2px;
  background:rgba(11,13,15,0.06); flex-shrink:0;
}
.version-toggle button{
  appearance:none; border:none; background:transparent; color:rgba(11,13,15,0.55);
  font-family:'IBM Plex Mono',monospace; font-size:10.5px; font-weight:700; letter-spacing:0.06em;
  text-transform:uppercase; padding:6px 14px; border-radius:16px; cursor:pointer;
  transition:background 0.15s ease, color 0.15s ease;
}
.version-toggle button.active{ background:var(--accent-2); color:#14171a; }
.version-toggle button:not(.active):hover{ color:#14171a; }
.version-toggle button:focus-visible{ outline:2px solid var(--accent-2); outline-offset:1px; }

.ds-body{ padding:18px 20px 22px; }

.correction-banner{
  display:flex; align-items:center; gap:8px; font-family:'IBM Plex Mono',monospace; font-size:11px;
  letter-spacing:0.04em; border-radius:3px; padding:9px 12px; margin-top:18px; line-height:1.5;
}
.correction-banner .dot{ width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.correction-banner.current{ color:#0b0d0f; background:rgba(201,162,39,0.12); border:1px solid rgba(201,162,39,0.35); }
.correction-banner.current .dot{ background:var(--accent-2); }
.correction-banner.original{ color:#0b0d0f; background:rgba(194,69,69,0.12); border:1px solid rgba(194,69,69,0.4); }
.correction-banner.original .dot{ background:#c24545; }

.statline{ width:100%; border-collapse:collapse; margin-bottom:16px; }
.statline th{
  font-family:'IBM Plex Mono',monospace; font-size:11px; color:#0b0d0f; background:#CCCCCC; text-transform:uppercase;
  letter-spacing:0.08em; text-align:center; padding:6px 8px; border-bottom:1px solid var(--hair); font-weight:700; border-radius:2px;
}
.statline td{
  font-family:'IBM Plex Mono',monospace; font-size:14.5px; color:var(--ink); padding:9px 10px; text-align:center;
  border-bottom:1px solid var(--hair-soft);
}
.statline td.mname{ font-family:'Inter',sans-serif; font-size:13px; color:var(--ink-dim); font-weight:500; }
.statline tr:last-child td{ border-bottom:none; }

.wep-group-label{
  font-family:'IBM Plex Mono',monospace; font-size:10px; color:var(--accent-2);
  text-transform:uppercase; letter-spacing:0.1em; font-weight:600; margin:14px 0 8px;
}
.wep-block{ margin-bottom:10px; }
.wep-block .wname{
  background:var(--panel-raised); border:1px solid var(--hair); border-bottom:none;
  font-size:13.5px; font-weight:600; color:var(--ink); padding:8px 12px; border-radius:3px 3px 0 0;
}
.wep-stats{ display:grid; grid-template-columns:repeat(6,1fr); border:1px solid var(--hair); border-top:none; }
.wep-stats .cell{ padding:9px 6px 6px; text-align:center; border-right:1px solid var(--hair-soft); }
.wep-stats .cell:last-child{ border-right:none; }
.wep-stats .cell .lbl{ display:block; font-family:'IBM Plex Mono',monospace; font-size:10px; color:var(--accent-2); background:var(--panel-raised); text-transform:uppercase; letter-spacing:0.06em; margin-bottom:4px; font-weight:700; padding:3px 6px; border-radius:2px; border:1px solid var(--hair); }
.wep-stats .cell .val{ display:block; font-family:'IBM Plex Mono',monospace; font-size:13.5px; color:var(--ink); }
.wep-tags{ display:flex; gap:6px; flex-wrap:wrap; padding:8px 12px 2px; border:1px solid var(--hair); border-top:none; border-radius:0 0 3px 3px; background:var(--panel); }
.wep-tags:empty{ display:none; padding:0; border:none; }
.wtag{
  font-family:'IBM Plex Mono',monospace; font-size:10px; letter-spacing:0.04em; color:#0b0d0f;
  background:#CCCCCC; border:1px solid #e0e0e0; padding:3px 8px; border-radius:2px; margin-bottom:6px; text-transform:uppercase; font-weight:600;
}
button.wtag-link{
  background:#CCCCCC; cursor:pointer; color:#0b0d0f; border-color:#e0e0e0;
  font-weight:600;
}
.gloss-item.flash{ animation:glossFlash 1.6s ease; border-radius:3px; }
@keyframes glossFlash{
  0%{ background:var(--patrol-color-soft, rgba(255,255,255,0.08)); }
  100%{ background:transparent; }
}
.wep-select-note{ font-size:11.5px; color:var(--ink-faint); font-style:italic; line-height:1.6; margin:6px 0 14px; }

.abilities{ margin-bottom:6px; margin-top:16px; }
.ability{ margin-bottom:11px; }
.ability .aname{ font-size:13px; font-weight:600; color:var(--ink); margin-bottom:3px; display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.ability .aname .tag{ font-family:'IBM Plex Mono',monospace; font-size:9.5px; color:var(--accent-2); font-weight:600; margin-left:6px; }
.ability-tags{ display:flex; gap:6px; flex-wrap:wrap; }
.ability-tags .wtag{ font-family:'IBM Plex Mono',monospace; font-size:9px; letter-spacing:0.04em; color:#0b0d0f; background:#CCCCCC; border:1px solid #e0e0e0; padding:3px 6px; border-radius:2px; margin:0; text-transform:uppercase; font-weight:600; }
.ability-tags button.wtag-link{ background:#CCCCCC; cursor:pointer; color:#0b0d0f; border-color:#e0e0e0; font-weight:600; }
.ability p{ font-size:12.5px; color:var(--ink-dim); line-height:1.65; }

.potential-error{ font-size:12.5px; color:#ff6b6b; font-style:italic; line-height:1.65; margin-top:10px; }
.potential-error strong{ font-weight:700; }
.army-rules-warning{
  color:#ff6b6b;
  border:1px solid rgba(255,107,107,.55);
  background:rgba(255,107,107,.08);
  padding:12px 14px;
  margin-bottom:14px;
  font-size:13px;
  font-weight:700;
  line-height:1.55;
}

.ds-footer{ margin-top:16px; padding-top:14px; border-top:1px solid var(--hair); }
.ds-footer .comp-label{ font-family:'IBM Plex Mono',monospace; font-size:10px; color:var(--accent-2); text-transform:uppercase; letter-spacing:0.08em; font-weight:600; margin-bottom:8px; }
.comp-list{ list-style:none; margin:0 0 10px; padding:0; }
.comp-list li{ font-size:13px; color:var(--ink); line-height:1.6; padding-left:14px; position:relative; margin-bottom:3px; }
.comp-list li::before{ content:'-'; position:absolute; left:0; color:var(--patrol-color); }
.ds-footer .comp-equip{ font-size:12.5px; color:var(--ink-dim); line-height:1.7; margin-bottom:12px; }
.equip-group{ margin-bottom:8px; }
.equip-label{ font-size:11.5px; color:var(--ink-dim); font-weight:600; margin-bottom:3px; }
.faq-status-list{ margin-top:10px; display:flex; flex-direction:column; gap:10px; }
.faq-status-row{ display:flex; align-items:flex-start; gap:10px; }
.faq-status-row .ed-badge{ flex-shrink:0; margin-top:2px; }
.faq-status-row p{ font-size:13.5px; color:var(--ink-dim); line-height:1.65; margin:0; }
.commentary-list{ display:flex; flex-direction:column; gap:12px; }
.commentary-card{ background:var(--panel); border:1px solid var(--hair); border-left:2px solid var(--patrol-color); border-radius:3px; padding:16px 20px; }
.commentary-card h4{ font-size:14.5px; color:var(--ink); margin-bottom:6px; font-weight:600; }
.commentary-card p{ font-size:13.5px; color:var(--ink-dim); line-height:1.7; }
.kw-row{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:5px; }
.kw{ font-family:'IBM Plex Mono',monospace; font-size:9.5px; letter-spacing:0.04em; color:var(--ink-faint); border:1px solid var(--hair); padding:3px 7px; border-radius:2px; text-transform:uppercase;}
.kw.faction{ color:var(--patrol-color); background:#CCCCCC; border-color:var(--patrol-color); font-weight:600; }
#content[data-faction="T'au Empire"] .kw.faction{ color:#FFD700; background:#0b0d0f; border-color:#FFD700; }

.glossary{ display:grid; grid-template-columns:1fr 1fr; gap:10px 20px; }
@media(max-width:900px){ .glossary{ grid-template-columns:1fr; } }
.gloss-item{ padding:12px 0; border-bottom:1px solid var(--hair-soft); grid-column: 1 / -1; }
.gloss-item dt{ font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--accent-2); padding:4px 0; text-transform:uppercase; letter-spacing:0.04em; font-weight:700; margin-bottom:4px; }
.gloss-item dd{ font-size:12.5px; color:var(--ink-dim); line-height:1.65; }
.gloss-note{ font-size:11.5px; color:var(--ink-faint); margin-bottom:16px; line-height:1.6; }
.edition-glossary{ margin-bottom:12px; }
.edition-glossary > .collapsible-header{ color:var(--accent-2); }
.edition-glossary > .collapsible-body{ padding-top:8px; }

.tag-popover{
  position:absolute; z-index:50; max-width:240px; background:var(--panel-raised);
  border:1px solid var(--accent-2); border-radius:4px; padding:10px 12px;
  box-shadow:0 8px 24px rgba(0,0,0,0.5);
}
.tag-popover .tp-title{ font-family:'IBM Plex Mono',monospace; font-size:10.5px; color:var(--accent-2); text-transform:uppercase; letter-spacing:0.05em; font-weight:600; margin-bottom:5px; }
.tag-popover .tp-body{ font-size:12.5px; color:var(--ink); line-height:1.55; }

.foot{ padding:30px 56px 60px; color:var(--ink-faint); font-size:11.5px; border-top:1px solid var(--hair); max-width:1180px; }

::-webkit-scrollbar{ width:9px; }
::-webkit-scrollbar-track{ background:var(--bg); }
::-webkit-scrollbar-thumb{ background:#2a2e33; border-radius:5px; }

@media(max-width:1200px){
  .content{ padding:8px 32px 90px; }
  .hero{ padding:48px 32px 38px; }
}

@media(max-width:820px){
  .shell{ flex-direction:column; }
  .sidebar{ width:100%; height:auto; position:relative; }
  .hero{ padding:38px 24px 30px; }
  .content{ padding:8px 24px 60px; }
  .grid-2,.grid-3{ grid-template-columns:1fr; }
  .wep-stats{ grid-template-columns:repeat(3,1fr); }
}

a:focus-visible, button:focus-visible{ outline:2px solid var(--accent-2); outline-offset:2px; }
@media (prefers-reduced-motion: reduce){ *{ transition:none !important; scroll-behavior:auto !important; } }

/* ===== Fix global nav icons ===== */
.global-nav-btn .sigil {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-2);
    border-radius: 2px;
    overflow: hidden;
}

.global-nav-btn .sigil img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Forces white */
}

/* Match faction icon sizing */
.patrol-btn .sigil {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #CCCCCC;
    border-radius: 2px;
    border: 1px solid var(--patrol-color, var(--hair));
    overflow: hidden;
}

.patrol-btn .sigil img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}
/* Legends warning banner */
.legends-warning {
    background: rgba(224, 106, 106, 0.15);
    border: 2px solid #e06a6a;
    color: #e06a6a;
    padding: 12px 18px;
    border-radius: 3px;
    margin-bottom: 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
}

/* Checklist styling */
.checklist-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: 3px;
  padding: 16px;
  text-align: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 600;
  color: var(--patrol-color);
  font-family: 'IBM Plex Mono', monospace;
}

.stat-label {
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: 3px;
  transition: background-color 0.2s;
}

.checklist-item.done {
  opacity: 0.7;
}

.checkbox {
  flex-shrink: 0;
  width: 20px;
  margin-top: 2px;
  text-align: center;
  font-weight: 600;
  color: var(--ink-dim);
}

.checkbox.done {
  color: #4caf50;
  font-size: 16px;
}

.checklist-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.faction-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1.2;
}

.patrol-name {
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.2;
}

.checklist-item.done .patrol-name {
  color: var(--ink-dim);
  text-decoration: line-through;
  opacity: 0.6;
}

.patrol-source {
  font-size: 10px;
  color: var(--ink-dim);
  opacity: 0.7;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.03em;
}

/* ===== GLOSSARY PAGE STYLING ===== */
.collapsible {
  margin-bottom: 10px;
}

.collapsible-header {
  background: var(--panel-raised);
  border: 1px solid var(--hair);
  border-radius: 3px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
  font-weight: 600;
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.collapsible-header:hover {
  background: var(--panel);
  border-color: var(--patrol-color);
}

.collapsible-header::before {
  content: '▶';
  font-size: 10px;
  color: var(--patrol-color);
  width: 12px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.collapsible.open .collapsible-header::before {
  transform: rotate(90deg);
}

.collapsible-body {
  max-height: 10000px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  border: 1px solid var(--hair);
  border-top: none;
  border-radius: 0 0 3px 3px;
  background: var(--panel);
  padding: 14px 16px;
}

.collapsible:not(.open) .collapsible-body {
  max-height: 0;
  opacity: 0;
  padding: 0;
  border: none;
}

/* Mission details */
.mission-detail {
  font-size: 12.5px;
  color: var(--ink-dim);
  line-height: 1.6;
}

.mission-detail b {
  color: var(--ink);
  font-weight: 600;
}

.mission-detail-title {
  font-weight: 600;
  color: var(--patrol-color);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mission-vp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: var(--panel);
  border-radius: 2px;
}

.mission-vp-row .vp-value {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  color: var(--patrol-color);
  white-space: nowrap;
}

/* Glossary mission section styling */
.mission-setup {
  margin-bottom: 12px;
}

.mission-setup-label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.mission-setup-text {
  font-size: 12.5px;
  color: var(--ink-dim);
  line-height: 1.65;
}

.mission-action {
  margin: 12px 0;
}

.mission-action-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.mission-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 12px;
}

@media(max-width:900px) {
  .mission-action-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.mission-action-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  align-items: start;
}

.mission-action-row strong {
  color: var(--ink);
}

.mission-action-row span {
  color: var(--ink-dim);
}

.mission-conditions {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.mission-condition-block {
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: 2px;
}

.mission-condition-timing {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.mission-condition-when {
  font-size: 12px;
  margin: 4px 0 8px 0;
}

.mission-condition-when strong {
  color: var(--ink);
}

.mission-condition-text {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
}

.mission-condition-text div:first-child {
  flex: 1;
  color: var(--ink-dim);
}

.mission-condition-text .vp-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  color: var(--accent-2);
  white-space: nowrap;
}

/* Faction core rule blocks */
.faction-rule-block {
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: 3px;
  background: var(--panel-raised);
  margin-bottom: 10px;
}

.faction-rule-block:last-child {
  margin-bottom: 0;
}

.faction-rule-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--patrol-color);
  margin-bottom: 6px;
}

.faction-rule-text {
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.6;
  margin: 0;
}

.faction-rule-restrict {
  font-size: 12px;
  color: var(--ink-faint);
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hair);
  font-style: italic;
}

.faction-subrule {
  padding-left: 12px;
  border-left: 2px solid var(--ink-faint);
  margin-top: 8px;
}

.faction-subrule-title {
  font-weight: 500;
  font-size: 12px;
  color: var(--ink);
  margin-bottom: 4px;
}

.faction-subrule-text {
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.5;
}

/* Mobile Patrols toggle */
/* Site-wide light/dark theme toggle (sidebar brand area) */
.theme-toggle{
  display:inline-flex; align-items:center; gap:8px; margin-top:14px;
  cursor:pointer; user-select:none; padding:5px 10px 5px 5px; border-radius:14px;
  background:var(--panel-raised); border:1px solid var(--hair);
}
.theme-toggle input[type="checkbox"]{ display:none; }
.theme-toggle .toggle-slider{
  width:38px; height:22px; background:var(--hair); border:1px solid var(--ink-faint);
  border-radius:11px; position:relative; flex-shrink:0;
  box-shadow:inset 0 1px 2px rgba(0,0,0,0.2); transition:background 0.25s ease;
}
.theme-toggle .toggle-slider::after{
  content:''; position:absolute; width:16px; height:16px; background:var(--accent-2);
  border-radius:50%; top:2px; left:2px; transition:left 0.25s ease;
  box-shadow:0 1px 2px rgba(0,0,0,0.4);
}
.theme-toggle input[type="checkbox"]:checked ~ .toggle-slider::after{ left:18px; }
.theme-toggle .toggle-label{
  font-family:'IBM Plex Mono',monospace; font-size:10.5px; letter-spacing:0.06em; text-transform:uppercase;
  font-weight:700; color:var(--ink-dim);
}

.mobile-patrols-btn {
  display: none;
}

@media(max-width:820px) {
  .mobile-patrols-btn {
    display: flex;
  }

  .filter-bar {
    display: none;
  }

  .filter-bar.mobile-visible {
    display: flex;
    flex-direction: column;
  }

  .patrol-list {
    display: none;
    max-height: 400px;
    overflow-y: auto;
  }

  .patrol-list.mobile-visible {
    display: flex;
  }
}
