 :root {
      --bg: #0b0e14;
      --bg-elevated: #0b1016;
      --bg-panel: #111822;
      --border-soft: #222b38;
      --text-main: #e5ecf5;
      --text-muted: #9aa4b5;
      --accent: #4fd1ff;
      --accent-soft: rgba(79, 209, 255, 0.12);
      --danger: #ff4b6a;
      --success: #4fe39a;
      --warning: #ffc857;

      --verge: #4fd1ff;
      --force: #ff4b6a;
      --focus: #9f7aea;
      --bulwark: #4fe39a;
      --system: #ffc857;

      --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      --font-mono: "Consolas", "Fira Code", monospace;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      padding: 0;
      font-family: var(--font-main);
      background-color: var(--bg);
      background-image:
        radial-gradient(circle at 20% 15%, rgba(79, 209, 255, 0.08), transparent 42%),
        linear-gradient(rgba(79, 209, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 209, 255, 0.08) 1px, transparent 1px);
      background-size: auto, 32px 32px, 32px 32px;
      background-position: center, 0 0, 0 0;
      background-repeat: no-repeat, repeat, repeat;
      background-attachment: fixed;
      color: var(--text-main);
      display: flex;
      min-height: 100vh;
    }

    /* SIDEBAR NAV */

    .sidebar {
      width: 280px;
      background: linear-gradient(180deg, #05070a 0, #05070a 40%, #0b1016 100%);
      border-right: 1px solid var(--border-soft);
      padding: 1.5rem 1.25rem;
      position: sticky;
      top: 0;
      height: 100vh;
      overflow-y: auto;
    }

    .sidebar h1 {
      font-size: 1rem;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--accent);
      margin: 0 0 0.25rem;
    }

    .sidebar h2 {
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.16em;
      color: var(--text-muted);
      margin: 0 0 1.25rem;
    }

    .sidebar .badge-classified {
      display: inline-block;
      padding: 0.25rem 0.6rem;
      border-radius: 999px;
      border: 1px solid var(--danger);
      color: var(--danger);
      font-size: 0.7rem;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      margin-bottom: 1.5rem;
    }

    .nav-section-title {
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.16em;
      color: var(--text-muted);
      margin: 1.25rem 0 0.35rem;
    }

    .nav-list {
      list-style: none;
      padding: 0;
      margin: 0;
      font-size: 0.85rem;
    }

    .nav-list li {
      margin: 0.1rem 0;
    }

    .nav-list a {
      color: var(--text-main);
      text-decoration: none;
      display: block;
      padding: 0.2rem 0.4rem;
      border-radius: 4px;
      transition: background 0.15s, color 0.15s;
    }

    .nav-list a:hover {
      background: var(--accent-soft);
      color: var(--accent);
    }

    .nav-list a:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .nav-list a.is-active {
      background: var(--accent-soft);
      color: var(--accent);
      box-shadow: inset 2px 0 0 var(--accent);
    }

    .nav-list .nav-sub {
      font-size: 0.78rem;
      color: var(--text-muted);
      padding-left: 0.75rem;
    }

    .sidebar-content {
      display: block;
    }

    .sidebar-actions {
      margin-top: 0.85rem;
      padding-top: 0.85rem;
      border-top: 1px solid var(--border-soft);
      display: grid;
      gap: 0.55rem;
    }

    .sidebar-icons {
      padding: 0.45rem;
      border: 1px solid var(--border-soft);
      background: var(--bg-elevated);
      border-radius: 6px;
    }

    .sidebar-icons img {
      display: block;
      width: 100%;
      height: auto;
    }

    .sidebar-tools-title {
      margin: 0.35rem 0 0.1rem;
      padding-top: 0.55rem;
      border-top: 1px solid var(--border-soft);
      font-size: 0.72rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--text-muted);
    }

    .sidebar-action-link,
    .print-button {
      display: block;
      width: 100%;
      padding: 0.52rem 0.65rem;
      border-radius: 6px;
      border: 1px solid var(--border-soft);
      background: var(--bg-elevated);
      color: var(--text-main);
      text-decoration: none;
      text-align: center;
      font-size: 0.74rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-weight: 600;
      transition: border-color 0.15s, background 0.15s, color 0.15s;
    }

    .sidebar-action-link:hover,
    .print-button:hover {
      border-color: var(--accent);
      background: var(--accent-soft);
      color: var(--accent);
    }

    /* MAIN CONTENT */

    .main {
      flex: 1;
      padding: 1.75rem 2.25rem;
      max-width: 1200px;
      margin: 0 auto;
    }

    .doc-header {
      background-color: #111;        /* solid background */
      padding: 1.5rem 2rem;
      border-bottom: 2px solid #333;
      margin-bottom: 1.5rem;
      border-bottom: 1px solid var(--border-soft);
      padding-bottom: 1rem;
    }

    .doc-header h1 {
      background-color: #111;        /* solid background */
      padding: 1.5rem 2rem;
      border-bottom: 2px solid #333;  
      font-size: 1.6rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      margin: 0 0 0.35rem;
    }

    .doc-header p {
      background-color: #111;        /* solid background */
      padding: 1.5rem 2rem;
      border-bottom: 2px solid #333;
      margin: 0;
      font-size: 0.85rem;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      color: var(--danger);
    }

    .doc-subline {
      margin-top: 0.4rem;
      font-size: 0.85rem;
      color: var(--text-muted);
      max-width: 52rem;
    }

    /* SECTION HEADINGS */

    .section {
      margin: 2.5rem 0;
      padding: 1.5rem;
      background: var(--bg-elevated);
      border-radius: 8px;
      border: 1px solid var(--border-soft);
      box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.01);
    }

    .section-title {
      font-size: 1.75rem;
      text-transform: uppercase;
      letter-spacing: 0.18em;
      margin: 0 0 0.75rem;
      color: var(--accent);
    }

    .section-label {
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.16em;
      color: var(--text-muted);
      margin-bottom: 0.25rem;
    }

    .section-intro {
      font-size: 0.9rem;
      color: var(--text-main);
      margin-bottom: 1rem;
    }

    /* SECTION 0 - WORLD BRIEFING STORY LAYOUT */
    #section0 {
      background:
        linear-gradient(160deg, rgba(79, 209, 255, 0.08) 0%, rgba(79, 209, 255, 0) 42%),
        var(--bg-elevated);
    }

    #section0 .section-title {
      margin-bottom: 0.4rem;
    }

    #section0 .section-intro {
      max-width: 72ch;
      color: #d8e4f4;
      border-left: 3px solid var(--accent);
      padding-left: 0.85rem;
      margin-bottom: 1.1rem;
    }

    #section0 .world-brief-hero {
      display: grid;
      grid-template-columns: minmax(260px, 38%) 1fr;
      gap: 1.2rem;
      align-items: stretch;
    }

    #section0 .world-brief-image {
      margin: 0;
      border: 1px solid #3a4659;
      background: #0e141f;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    }

    #section0 .world-brief-image img {
      width: 100%;
      height: 100%;
      min-height: 280px;
      object-fit: cover;
      object-position: center;
      display: block;
    }

    #section0 .world-brief-lead {
      border: 1px solid #334055;
      padding: 0.95rem 1rem;
      background: rgba(9, 14, 22, 0.76);
    }

    #section0 .world-brief-lead h3 {
      margin-top: 0;
      margin-bottom: 0.5rem;
      color: #d9e7fb;
    }

    #section0 .world-brief-lead p:last-child {
      margin-bottom: 0;
    }

    #section0 .story-divider {
      border: 0;
      border-top: 1px solid #384458;
      margin: 1.2rem 0 1rem;
    }

    #section0 .world-story-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.9rem;
    }

    #section0 .story-block {
      border: 1px solid #2f3b4f;
      border-top: 3px solid #51627d;
      padding: 0.85rem 0.95rem 0.9rem;
      background: rgba(13, 19, 30, 0.74);
    }

    #section0 .story-block h3 {
      margin-top: 0;
      margin-bottom: 0.45rem;
      font-size: 0.95rem;
      color: #d7e3f5;
    }

    #section0 .story-block p:last-child {
      margin-bottom: 0;
    }

    /* SECTION 1 - SETUP BRIEFING LAYOUT */
    #section1 {
      background:
        linear-gradient(150deg, rgba(79, 227, 154, 0.07) 0%, rgba(79, 227, 154, 0) 42%),
        var(--bg-elevated);
    }

    #section1 .section-intro {
      max-width: 72ch;
      color: #d7e7df;
      border-left: 3px solid var(--success);
      padding-left: 0.85rem;
      margin-bottom: 1.05rem;
    }

    #section1 .setup-brief-hero {
      display: grid;
      grid-template-columns: minmax(260px, 38%) 1fr;
      gap: 1.2rem;
      align-items: stretch;
    }

    #section1 .setup-brief-image {
      margin: 0;
      border: 1px solid #2f4a3f;
      background: #0f1a16;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    }

    #section1 .setup-brief-image img {
      width: 100%;
      height: 100%;
      min-height: 260px;
      object-fit: cover;
      object-position: center;
      display: block;
    }

    #section1 .setup-brief-lead {
      border: 1px solid #315247;
      padding: 0.95rem 1rem;
      background: rgba(9, 19, 15, 0.72);
    }

    #section1 .setup-brief-lead h3 {
      margin-top: 0;
      margin-bottom: 0.5rem;
      color: #d9f4e8;
    }

    #section1 .setup-brief-lead p:last-child {
      margin-bottom: 0;
    }

    #section1 .setup-divider {
      border: 0;
      border-top: 1px solid #345447;
      margin: 1.15rem 0 0.95rem;
    }

    #section1 .two-column h3 {
      border-top: 1px solid #2c4a3d;
      padding-top: 0.7rem;
      margin-top: 1rem;
    }

    #section1 .two-column h3:first-child {
      border-top: none;
      padding-top: 0;
      margin-top: 0;
    }

    /* SECTION 2 - CORE CONCEPTS BRIEFING LAYOUT */
    #section2 {
      background:
        linear-gradient(150deg, rgba(255, 200, 87, 0.08) 0%, rgba(255, 200, 87, 0) 42%),
        var(--bg-elevated);
    }

    #section2 .section-intro {
      max-width: 72ch;
      color: #ece1c4;
      border-left: 3px solid var(--warning);
      padding-left: 0.85rem;
      margin-bottom: 1.05rem;
    }

    #section2 .concepts-brief-hero {
      display: grid;
      grid-template-columns: minmax(260px, 38%) 1fr;
      gap: 1.2rem;
      align-items: stretch;
    }

    #section2 .concepts-brief-image {
      border: 1px solid #5a4c2d;
      background: #1f1a10;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    }

    #section2 .concepts-brief-image img {
      width: 100%;
      height: 100%;
      min-height: 260px;
      object-fit: cover;
      object-position: center;
      display: block;
    }

    #section2 .concepts-brief-lead {
      border: 1px solid #6b5a33;
      padding: 0.95rem 1rem;
      background: rgba(24, 19, 10, 0.72);
    }

    #section2 .concepts-brief-lead h3 {
      margin-top: 0;
      margin-bottom: 0.5rem;
      color: #ffe8b2;
    }

    #section2 .concepts-brief-lead p:last-child {
      margin-bottom: 0;
    }

    #section2 .concepts-divider {
      border: 0;
      border-top: 1px solid #5e5030;
      margin: 1.15rem 0 0.95rem;
    }

    #section2 .two-column h3 {
      border-top: 1px solid #5e5030;
      padding-top: 0.7rem;
      margin-top: 1rem;
    }

    #section2 .two-column h3:first-child {
      border-top: none;
      padding-top: 0;
      margin-top: 0;
    }

    /* SECTION 3 - ROUND STRUCTURE BRIEFING LAYOUT */
    #section3 {
      background:
        linear-gradient(150deg, rgba(255, 75, 106, 0.08) 0%, rgba(255, 75, 106, 0) 42%),
        var(--bg-elevated);
    }

    #section3 .section-intro {
      max-width: 72ch;
      color: #eed6dc;
      border-left: 3px solid var(--danger);
      padding-left: 0.85rem;
      margin-bottom: 1.05rem;
    }

    #section3 .round-brief-hero {
      display: grid;
      grid-template-columns: minmax(260px, 38%) 1fr;
      gap: 1.2rem;
      align-items: stretch;
    }

    #section3 .round-brief-image {
      border: 1px solid #5a3540;
      background: #211217;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    }

    #section3 .round-brief-image img {
      width: 100%;
      height: 100%;
      min-height: 260px;
      object-fit: cover;
      object-position: center;
      display: block;
    }

    #section3 .round-brief-lead {
      border: 1px solid #6d3f4b;
      padding: 0.95rem 1rem;
      background: rgba(28, 13, 17, 0.72);
    }

    #section3 .round-brief-lead h3 {
      margin-top: 0;
      margin-bottom: 0.5rem;
      color: #ffd4dd;
    }

    #section3 .round-brief-lead p:last-child {
      margin-bottom: 0;
    }

    #section3 .round-divider {
      border: 0;
      border-top: 1px solid #5a3540;
      margin: 1.15rem 0 0.95rem;
    }

    #section3 .two-column h3 {
      border-top: 1px solid #5a3540;
      padding-top: 0.7rem;
      margin-top: 1rem;
    }

    #section3 .two-column h3:first-child {
      border-top: none;
      padding-top: 0;
      margin-top: 0;
    }

    /* SECTION 4 - COMBAT BRIEFING LAYOUT */
    #section4 {
      background:
        linear-gradient(150deg, rgba(79, 209, 255, 0.08) 0%, rgba(79, 209, 255, 0) 42%),
        var(--bg-elevated);
    }

    #section4 .section-intro {
      max-width: 72ch;
      color: #d3e8f7;
      border-left: 3px solid var(--accent);
      padding-left: 0.85rem;
      margin-bottom: 1.05rem;
    }

    #section4 .combat-brief-hero {
      display: grid;
      grid-template-columns: minmax(260px, 38%) 1fr;
      gap: 1.2rem;
      align-items: stretch;
    }

    #section4 .combat-brief-image {
      border: 1px solid #345169;
      background: #101a24;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    }

    #section4 .combat-brief-image img {
      width: 100%;
      height: 100%;
      min-height: 260px;
      object-fit: cover;
      object-position: center;
      display: block;
    }

    #section4 .combat-brief-lead {
      border: 1px solid #406482;
      padding: 0.95rem 1rem;
      background: rgba(11, 20, 30, 0.72);
    }

    #section4 .combat-brief-lead h3 {
      margin-top: 0;
      margin-bottom: 0.5rem;
      color: #d8efff;
    }

    #section4 .combat-brief-lead p:last-child {
      margin-bottom: 0;
    }

    #section4 .combat-divider {
      border: 0;
      border-top: 1px solid #345169;
      margin: 1.15rem 0 0.95rem;
    }

    #section4 .two-column h3 {
      border-top: 1px solid #345169;
      padding-top: 0.7rem;
      margin-top: 1rem;
    }

    #section4 .two-column h3:first-child {
      border-top: none;
      padding-top: 0;
      margin-top: 0;
    }

    /* SECTION 5 - WEAPONS BRIEFING LAYOUT */
    #section5 {
      background:
        linear-gradient(150deg, rgba(159, 122, 234, 0.09) 0%, rgba(159, 122, 234, 0) 42%),
        var(--bg-elevated);
    }

    #section5 .section-intro {
      max-width: 72ch;
      color: #e6dcf7;
      border-left: 3px solid var(--focus);
      padding-left: 0.85rem;
      margin-bottom: 1.05rem;
    }

    #section5 .weapons-brief-hero {
      display: grid;
      grid-template-columns: minmax(260px, 38%) 1fr;
      gap: 1.2rem;
      align-items: stretch;
    }

    #section5 .weapons-brief-image {
      border: 1px solid #5a4485;
      background: #1d172b;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    }


    #section5 .two-column img,
    #section5 img.img {
      border-radius: 8px;
    }


    #section5 .weapons-brief-image img {
      width: 100%;
      height: 100%;
      min-height: 260px;
      object-fit: cover;
      object-position: center;
      display: block;
    }

    #section5 .weapons-brief-lead {
      border: 1px solid #6d56a2;
      padding: 0.95rem 1rem;
      background: rgba(20, 14, 35, 0.72);
    }

    #section5 .weapons-brief-lead h3 {
      margin-top: 0;
      margin-bottom: 0.5rem;
      color: #e9dbff;
    }

    #section5 .weapons-brief-lead p:last-child {
      margin-bottom: 0;
    }

    #section5 .weapons-divider {
      border: 0;
      border-top: 1px solid #5a4485;
      margin: 1.15rem 0 0.95rem;
    }

    #section5 .two-column h3 {
      border-top: 1px solid #5a4485;
      padding-top: 0.7rem;
      margin-top: 1rem;
    }

    #section5 .two-column h3:first-child {
      border-top: none;
      padding-top: 0;
      margin-top: 0;
    }

    #section5 .weapon-rule-block {
      margin: 0.7rem 0 0.9rem;
      padding: 0.65rem 0.8rem;
      border: 1px solid #5a4485;
      border-left: 3px solid var(--focus);
      background: rgba(29, 23, 43, 0.72);
      break-inside: avoid;
    }

    #section5 .weapon-rule-block h4 {
      margin: 0 0 0.35rem;
      color: #e9dbff;
    }

    #section5 .weapon-rule-block p {
      margin: 0;
      line-height: 1.4;
    }

    /* SECTION 6 - ARMOR BRIEFING LAYOUT */
    #section6 {
      background:
        linear-gradient(150deg, rgba(79, 227, 154, 0.09) 0%, rgba(79, 227, 154, 0) 42%),
        var(--bg-elevated);
    }

    #section6 > p:first-of-type {
      max-width: 72ch;
      color: #d6eee1;
      border-left: 3px solid var(--success);
      padding-left: 0.85rem;
      margin-bottom: 1.05rem;
    }

    #section6 .armor-brief-hero {
      display: grid;
      grid-template-columns: minmax(260px, 38%) 1fr;
      gap: 1.2rem;
      align-items: stretch;
    }

    #section6 .armor-brief-image {
      border: 1px solid #35614e;
      background: #0f2119;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    }

    #section6 .armor-brief-image img {
      width: 100%;
      height: 100%;
      min-height: 260px;
      object-fit: cover;
      object-position: center;
      display: block;
    }

    #section6 .armor-brief-lead {
      border: 1px solid #42775f;
      padding: 0.95rem 1rem;
      background: rgba(10, 24, 17, 0.72);
    }

    #section6 .armor-brief-lead h3 {
      margin-top: 0;
      margin-bottom: 0.5rem;
      color: #d8f8e8;
    }

    #section6 .armor-brief-lead p:last-child {
      margin-bottom: 0;
    }

    #section6 .armor-divider {
      border: 0;
      border-top: 1px solid #35614e;
      margin: 1.15rem 0 0.95rem;
    }

    #section6 .two-column h3 {
      border-top: 1px solid #35614e;
      padding-top: 0.7rem;
      margin-top: 1rem;
    }

    #section6 .two-column h3:first-child {
      border-top: none;
      padding-top: 0;
      margin-top: 0;
    }

    /* SECTION 7 - TACTICS DECK BRIEFING LAYOUT */
    #section7 {
      background:
        linear-gradient(150deg, rgba(255, 200, 87, 0.09) 0%, rgba(255, 200, 87, 0) 42%),
        var(--bg-elevated);
    }

    #section7 .section-intro {
      max-width: 72ch;
      color: #efe4c7;
      border-left: 3px solid var(--warning);
      padding-left: 0.85rem;
      margin-bottom: 1.05rem;
    }

    #section7 .tactics-brief-hero {
      display: grid;
      grid-template-columns: minmax(260px, 38%) 1fr;
      gap: 1.2rem;
      align-items: stretch;
    }

    #section7 .tactics-brief-image {
      border: 1px solid #6a5532;
      background: #231c11;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    }

    #section7 .tactics-brief-image img {
      width: 100%;
      height: 100%;
      min-height: 260px;
      object-fit: cover;
      object-position: center;
      display: block;
    }

    #section7 .tactics-brief-lead {
      border: 1px solid #806742;
      padding: 0.95rem 1rem;
      background: rgba(30, 22, 10, 0.72);
    }

    #section7 .tactics-brief-lead h3 {
      margin-top: 0;
      margin-bottom: 0.5rem;
      color: #ffe6b0;
    }

    #section7 .tactics-brief-lead p:last-child {
      margin-bottom: 0;
    }

    #section7 .tactics-divider {
      border: 0;
      border-top: 1px solid #6a5532;
      margin: 1.15rem 0 0.95rem;
    }

    #section7 .two-column h3 {
      border-top: 1px solid #6a5532;
      padding-top: 0.7rem;
      margin-top: 1rem;
    }

    #section7 .two-column h3:first-child {
      border-top: none;
      padding-top: 0;
      margin-top: 0;
    }

    /* SECTION 8 - OPERATORS BRIEFING LAYOUT */
    #section8 {
      background:
        linear-gradient(150deg, rgba(255, 75, 106, 0.09) 0%, rgba(255, 75, 106, 0) 42%),
        var(--bg-elevated);
    }

    #section8 .section-intro {
      max-width: 72ch;
      color: #f1d8dd;
      border-left: 3px solid var(--danger);
      padding-left: 0.85rem;
      margin-bottom: 1.05rem;
    }

    #section8 .operators-brief-hero {
      display: grid;
      grid-template-columns: minmax(260px, 38%) 1fr;
      gap: 1.2rem;
      align-items: stretch;
    }

    #section8 .operators-brief-image {
      border: 1px solid #6a3a45;
      background: #231116;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    }

    #section8 .operators-brief-image img {
      width: 100%;
      height: 100%;
      min-height: 260px;
      object-fit: cover;
      object-position: center;
      display: block;
    }

    #section8 .operators-brief-lead {
      border: 1px solid #814854;
      padding: 0.95rem 1rem;
      background: rgba(29, 12, 17, 0.72);
    }

    #section8 .operators-brief-lead h3 {
      margin-top: 0;
      margin-bottom: 0.5rem;
      color: #ffd9e1;
    }

    #section8 .operators-brief-lead p:last-child {
      margin-bottom: 0;
    }

    #section8 .operators-divider {
      border: 0;
      border-top: 1px solid #6a3a45;
      margin: 1.15rem 0 0.95rem;
    }

    #section8 .two-column h3 {
      border-top: 1px solid #6a3a45;
      padding-top: 0.7rem;
      margin-top: 1rem;
    }

    #section8 .two-column h3:first-child {
      border-top: none;
      padding-top: 0;
      margin-top: 0;
    }

    /* Faction-tinted stat bar accents */
    #section8 .operator-block .operator-table:first-of-type,
    #appendixB .operator-block .operator-table:first-of-type {
      border-top: 2px solid rgba(var(--faction-rgb), 0.72);
      background: linear-gradient(180deg, rgba(var(--faction-rgb), 0.22), rgba(14, 19, 29, 0.94));
      box-shadow: inset 0 0 0 1px rgba(var(--faction-rgb), 0.22);
    }

    #section8 .operator-block .operator-table:first-of-type th,
    #appendixB .operator-block .operator-table:first-of-type th {
      background: rgba(var(--faction-rgb), 0.22);
      color: rgb(var(--faction-rgb));
      letter-spacing: 0.12em;
      border-right: 1px solid rgba(var(--faction-rgb), 0.2);
      border-bottom-color: rgba(var(--faction-rgb), 0.26);
    }

    #section8 .operator-block .operator-table:first-of-type td,
    #appendixB .operator-block .operator-table:first-of-type td {
      background: rgba(16, 24, 37, 0.95);
      color: #ffffff;
      font-size: 1rem;
      font-weight: 800;
      text-shadow: 0 0 8px rgba(var(--faction-rgb), 0.45);
      border-right: 1px solid rgba(var(--faction-rgb), 0.18);
      border-bottom-color: rgba(var(--faction-rgb), 0.24);
    }

    #section8 .operator-block .operator-table:first-of-type td:last-child,
    #section8 .operator-block .operator-table:first-of-type th:last-child,
    #appendixB .operator-block .operator-table:first-of-type td:last-child,
    #appendixB .operator-block .operator-table:first-of-type th:last-child {
      border-right: none;
    }

    /* SECTION 9 - MERCENARIES BRIEFING LAYOUT */
    #section9 {
      background:
        linear-gradient(150deg, rgba(79, 227, 154, 0.09) 0%, rgba(79, 227, 154, 0) 42%),
        var(--bg-elevated);
    }

    #section9 .section-intro {
      max-width: 72ch;
      color: #d9f0e5;
      border-left: 3px solid var(--success);
      padding-left: 0.85rem;
      margin-bottom: 1.05rem;
    }

    #section9 .mercs-brief-hero {
      display: grid;
      grid-template-columns: minmax(260px, 38%) 1fr;
      gap: 1.2rem;
      align-items: stretch;
    }

    #section9 .mercs-brief-image {
      border: 1px solid #37614f;
      background: #0f2119;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    }

    #section9 .mercs-brief-image img {
      width: 100%;
      height: 100%;
      min-height: 260px;
      object-fit: cover;
      object-position: center;
      display: block;
    }

    #section9 .mercs-brief-lead {
      border: 1px solid #427960;
      padding: 0.95rem 1rem;
      background: rgba(10, 24, 17, 0.72);
    }

    #section9 .mercs-brief-lead h3 {
      margin-top: 0;
      margin-bottom: 0.5rem;
      color: #ddf8eb;
    }

    #section9 .mercs-brief-lead p:last-child {
      margin-bottom: 0;
    }

    #section9 .mercs-divider {
      border: 0;
      border-top: 1px solid #37614f;
      margin: 1.15rem 0 0.95rem;
    }

    #section9 .two-column h3 {
      border-top: 1px solid #37614f;
      padding-top: 0.7rem;
      margin-top: 1rem;
    }

    #section9 .two-column h3:first-child {
      border-top: none;
      padding-top: 0;
      margin-top: 0;
    }
    /* Section 9.6 Mercenary examples - compact readable card layout */
    #section9 .two-column h4:has(.tag) {
      column-span: all;
      margin-top: 0.85rem;
    }

    #section9 .table-wrapper.compact-card {
      column-span: all;
      border: none;
      background: transparent;
      padding: 0;
      margin: 0.7rem 0 1.2rem;
      break-inside: avoid;
    }

    #section9 .table-wrapper.compact-card table {
      border: none;
      background: transparent;
      width: 100%;
    }

    #section9 .table-wrapper.compact-card thead {
      display: none;
    }

    #section9 .table-wrapper.compact-card tbody {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.7rem;
    }

    #section9 .table-wrapper.compact-card tr {
      display: flex;
      flex-direction: column;
      border: 1px solid #37614f;
      border-left: 4px solid var(--success);
      border-radius: 8px;
      overflow: hidden;
      background: linear-gradient(180deg, rgba(79, 227, 154, 0.12), rgba(10, 24, 17, 0.92));
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
      break-inside: avoid;
    }

    #section9 .table-wrapper.compact-card td {
      border: none;
      padding: 0.55rem 0.65rem;
      font-size: 0.78rem;
      line-height: 1.35;
      color: #d8f4e8;
    }

    #section9 .table-wrapper.compact-card td:first-child {
      background: rgba(8, 20, 15, 0.82);
      border-bottom: 1px solid rgba(79, 227, 154, 0.28);
      color: #ecfff6;
      font-size: 0.82rem;
      letter-spacing: 0.03em;
    }

    #section9 .table-wrapper.compact-card td:last-child > div {
      margin-bottom: 0.3rem;
    }

    #section9 .table-wrapper.compact-card td:last-child > div:last-child {
      margin-bottom: 0;
    }

    #section9 .table-wrapper.compact-card strong {
      color: #f2fff8;
    }
    #section9 h4:has(.tag-verge) + .table-wrapper.compact-card {
      --merc-faction-rgb: 79, 209, 255;
    }

    #section9 h4:has(.tag-force) + .table-wrapper.compact-card {
      --merc-faction-rgb: 255, 75, 106;
    }

    #section9 h4:has(.tag-focus) + .table-wrapper.compact-card {
      --merc-faction-rgb: 159, 122, 234;
    }

    #section9 h4:has(.tag-bulwark) + .table-wrapper.compact-card {
      --merc-faction-rgb: 79, 227, 154;
    }

    #section9 h4:has(.tag-system) + .table-wrapper.compact-card {
      --merc-faction-rgb: 255, 200, 87;
    }

    #section9 .table-wrapper.compact-card {
      --merc-faction-rgb: 79, 227, 154;
    }

    #section9 .table-wrapper.compact-card tr {
      border-color: rgba(var(--merc-faction-rgb), 0.42);
      border-left-color: rgba(var(--merc-faction-rgb), 0.82);
      background: linear-gradient(180deg, rgba(var(--merc-faction-rgb), 0.18), rgba(10, 24, 17, 0.92));
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(var(--merc-faction-rgb), 0.16);
    }

    #section9 .table-wrapper.compact-card td:first-child {
      border-bottom-color: rgba(var(--merc-faction-rgb), 0.34);
      color: rgb(var(--merc-faction-rgb));
      background: rgba(8, 20, 15, 0.86);
    }

    #section9 .table-wrapper.compact-card strong {
      color: rgba(255, 255, 255, 0.96);
    }

    @media (max-width: 980px) {
      #section9 .table-wrapper.compact-card tbody {
        grid-template-columns: 1fr;
      }
    }

    /* SECTION 10 - STATUS EFFECTS BRIEFING LAYOUT */
    #section10 {
      background:
        linear-gradient(150deg, rgba(255, 75, 106, 0.08) 0%, rgba(255, 75, 106, 0) 42%),
        var(--bg-elevated);
    }

    #section10 .section-intro {
      max-width: 72ch;
      color: #f2dde2;
      border-left: 3px solid var(--danger);
      padding-left: 0.85rem;
      margin-bottom: 1.05rem;
    }

    #section10 .status-brief-hero {
      display: grid;
      grid-template-columns: minmax(260px, 38%) 1fr;
      gap: 1.2rem;
      align-items: stretch;
    }

    #section10 .status-brief-image {
      border: 1px solid #6a3b46;
      background: #231217;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    }

    #section10 .status-brief-image img {
      width: 100%;
      height: 100%;
      min-height: 260px;
      object-fit: cover;
      object-position: center;
      display: block;
    }

    #section10 .status-brief-lead {
      border: 1px solid #804a56;
      padding: 0.95rem 1rem;
      background: rgba(29, 13, 18, 0.72);
    }

    #section10 .status-brief-lead h3 {
      margin-top: 0;
      margin-bottom: 0.5rem;
      color: #ffdce3;
    }

    #section10 .status-brief-lead p:last-child {
      margin-bottom: 0;
    }

    #section10 .status-divider {
      border: 0;
      border-top: 1px solid #6a3b46;
      margin: 1.15rem 0 0.95rem;
    }

    #section10 .two-column h3 {
      border-top: 1px solid #6a3b46;
      padding-top: 0.7rem;
      margin-top: 1rem;
    }

    #section10 .two-column h3:first-child {
      border-top: none;
      padding-top: 0;
      margin-top: 0;
    }

    #section10 .status-flow {
      column-count: 1;
      column-gap: 0;
    }

    #section10 .status-rule-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.55rem;
      margin: 0.65rem 0 0.95rem;
      break-inside: avoid;
    }

    #section10 .status-rule-item {
      margin: 0;
      padding: 0.62rem 0.72rem;
      border: 1px solid #52323a;
      border-left: 3px solid #d97893;
      background: rgba(14, 10, 12, 0.72);
      break-inside: avoid;
    }

    #section10 .status-rule-item h4 {
      margin: 0 0 0.4rem;
    }

    #section10 .status-rule-item p,
    #section10 .status-rule-item ul {
      margin: 0;
    }

    #section10 .status-rule-item ul {
      padding-left: 1rem;
    }

    #section10 .status-tracking-panel {
      margin: 0.75rem 0 1rem;
      padding: 0.8rem;
      border: 1px solid #6a3b46;
      background: rgba(29, 13, 18, 0.48);
      break-inside: avoid;
    }

    #section10 .status-tracking-panel h4 {
      margin-top: 0.25rem;
      margin-bottom: 0.45rem;
    }

    #section10 .token-types-list {
      list-style: none;
      margin: 0 0 0.8rem;
      padding: 0;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.45rem;
    }

    #section10 .token-types-list li {
      margin: 0;
      padding: 0.5rem 0.6rem;
      border: 1px solid #52323a;
      background: rgba(14, 10, 12, 0.7);
      line-height: 1.35;
      break-inside: avoid;
    }

    #section10 .token-placement-list {
      margin: 0 0 0.7rem 1rem;
      padding: 0;
    }

    #section10 .token-removal-note {
      margin: 0;
      padding: 0.55rem 0.65rem;
      border-left: 3px solid #d97893;
      background: rgba(217, 120, 147, 0.08);
    }

    #section10 .status-negative-grid,
    #section10 .status-positive-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.55rem;
      margin: 0.65rem 0 0.95rem;
      break-inside: avoid;
    }

    #section10 .status-effect-card {
      margin: 0;
      padding: 0.6rem 0.7rem;
      border: 1px solid #52323a;
      background: rgba(14, 10, 12, 0.72);
      break-inside: avoid;
    }

    #section10 .status-effect-card h4 {
      margin: 0 0 0.45rem;
    }

    #section10 .status-effect-card ul {
      margin: 0 0 0 1rem;
      padding: 0;
    }

    #section10 .status-effect-card ul li {
      margin: 0.14rem 0;
    }

    #section10 .status-effect-card p {
      margin: 0;
      line-height: 1.4;
    }

    #section10 .status-effect-card-negative {
      border-left: 3px solid #ff4b6a;
    }

    #section10 .status-effect-card-positive {
      border-left: 3px solid #4fd1ff;
    }

    #section10 .status-interactions-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.55rem;
      margin: 0.65rem 0 0.95rem;
      break-inside: avoid;
    }

    #section10 .status-interaction-item {
      margin: 0;
      padding: 0.62rem 0.72rem;
      border: 1px solid #52323a;
      border-left: 3px solid #4fd1ff;
      background: rgba(14, 10, 12, 0.72);
      break-inside: avoid;
    }

    #section10 .status-interaction-item h4 {
      margin: 0 0 0.4rem;
    }

    #section10 .status-interaction-item p {
      margin: 0;
    }

    /* SECTION 11 - TERRAIN BRIEFING LAYOUT */
    #section11 {
      background:
        linear-gradient(150deg, rgba(79, 209, 255, 0.08) 0%, rgba(79, 209, 255, 0) 42%),
        var(--bg-elevated);
    }

    #section11 .section-intro {
      max-width: 72ch;
      color: #d6eaf8;
      border-left: 3px solid var(--accent);
      padding-left: 0.85rem;
      margin-bottom: 1.05rem;
    }

    #section11 .terrain-brief-hero {
      display: grid;
      grid-template-columns: minmax(260px, 38%) 1fr;
      gap: 1.2rem;
      align-items: stretch;
    }

    #section11 .terrain-brief-image {
      border: 1px solid #355c77;
      background: #101c29;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    }

    #section11 .terrain-brief-image img {
      width: 100%;
      height: 100%;
      min-height: 260px;
      object-fit: cover;
      object-position: center;
      display: block;
    }

    #section11 .terrain-brief-lead {
      border: 1px solid #44718f;
      padding: 0.95rem 1rem;
      background: rgba(11, 21, 33, 0.72);
    }

    #section11 .terrain-brief-lead h3 {
      margin-top: 0;
      margin-bottom: 0.5rem;
      color: #d8efff;
    }

    #section11 .terrain-brief-lead p:last-child {
      margin-bottom: 0;
    }

    #section11 .terrain-divider {
      border: 0;
      border-top: 1px solid #355c77;
      margin: 1.15rem 0 0.95rem;
    }

    #section11 .two-column h3 {
      border-top: 1px solid #355c77;
      padding-top: 0.7rem;
      margin-top: 1rem;
    }

    #section11 .two-column h3:first-child {
      border-top: none;
      padding-top: 0;
      margin-top: 0;
    }

    /* TWO-COLUMN BODY */

    .two-column {
      column-count: 2;
      column-gap: 2rem;
      font-size: 0.9rem;
      line-height: 1.5;
    }

    .two-column h3,
    .two-column h4,
    .two-column h5 {
      break-inside: avoid;
    }

    .two-column p,
    .two-column ul,
    .two-column ol {
      break-inside: avoid;
    }

    h3 {
      font-size: 1.12rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      margin-top: 1.25rem;
      margin-bottom: 0.35rem;
      color: var(--accent);
    }

    h4 {
      font-size: 0.9rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin-top: 0.9rem;
      margin-bottom: 0.25rem;
      color: var(--text-main);
    }

    p {
      margin: 0 0 0.5rem;
    }

    ul {
      margin: 0 0 0.6rem 1.1rem;
      padding: 0;
    }

    li {
      margin: 0.15rem 0;
    }

    /* TABLES */

    .table-wrapper {
      margin: 1rem 0;
      overflow-x: auto;
      break-inside: avoid;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.85rem;
      background: var(--bg-panel);
      border-radius: 6px;
      overflow: hidden;
    }

    th,
    td {
      padding: 0.45rem 0.6rem;
      border-bottom: 1px solid var(--border-soft);
    }

    th {
      text-align: left;
      font-weight: 600;
      background: #151c28;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-size: 0.75rem;
    }

    tr:last-child td {
      border-bottom: none;
    }

    /* TAGS / LABELS */

    .tag {
      display: inline-block;
      padding: 0.1rem 0.45rem;
      border-radius: 999px;
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      border: 1px solid var(--border-soft);
      color: var(--text-muted);
      margin-right: 0.25rem;
    }

    .tag-verge { border-color: var(--verge); color: var(--verge); }
    .tag-force  { border-color: var(--force); color: var(--force); }
    .tag-focus { border-color: var(--focus); color: var(--focus); }
    .tag-bulwark { border-color: var(--bulwark); color: var(--bulwark); }
    .tag-system { border-color: var(--system); color: var(--system); }
 /* COLOR ICONS */  
   
.tag-force::before {
  content: "\1F480\FE0E ";
}
.tag-verge::before {
  content: "\2B4D ";
}
.tag-bulwark::before {
  content: "\26CA ";
}
.tag-system::before {
  content: "\2301 ";
}

.tag-focus::before {
  content: "\2295 ";
}
    

/* STATUS ICON TOKENS */
.status-icon {
  display: inline-flex;
  width: auto;
  height: auto;
  align-items: center;
  justify-content: center;
  margin-right: 0.35rem;
  line-height: 1;
  font-size: 1.24em;
  font-weight: 700;
  color: var(--text-main);
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Arial Unicode MS", sans-serif;
  vertical-align: text-bottom;
}

.status-icon::before {
  content: "\2753";
}

.status-suppressed,
.status-marked,
.status-disoriented,
.status-jammed,
.status-immobilized,
.status-revealed,
.status-burning,
.status-bleeding,
.status-guarded,
.status-overwatch,
.status-hidden,
.status-focused,
.status-shielded {
  color: var(--text-main);
  border-color: var(--border-soft);
}

.status-suppressed::before { content: "\1F507\FE0E"; }
.status-marked::before { content: "\1F3AF\FE0E"; }
.status-disoriented::before { content: "\1F300\FE0E"; }
.status-jammed::before { content: "\1F4F5\FE0E"; }
.status-immobilized::before { content: "\26D3\FE0E"; }
.status-revealed::before { content: "\1F441\FE0E"; }
.status-burning::before { content: "\1F525\FE0E"; }
.status-bleeding::before { content: "\1FA78\FE0E"; }
.status-guarded::before { content: "\1F6A7\FE0E"; }
.status-overwatch::before { content: "\0298"; }
.status-hidden::before { content: "\233D"; }
.status-focused::before { content: "\26AE"; }
.status-shielded::before { content: "\1F6E1\FE0E"; }

.status-icon.status-suppressed,
.status-icon.status-marked,
.status-icon.status-disoriented,
.status-icon.status-jammed,
.status-icon.status-immobilized,
.status-icon.status-revealed,
.status-icon.status-burning,
.status-icon.status-bleeding {
  color: #ff4b6a;
  border-color: #ff4b6a;
  background: rgba(255, 75, 106, 0.12);
}

.status-icon.status-guarded,
.status-icon.status-overwatch,
.status-icon.status-hidden,
.status-icon.status-focused,
.status-icon.status-shielded {
  color: #66e3ff;
  border-color: #66e3ff;
  background: rgba(102, 227, 255, 0.12);
}

/* Status polarity colors (icons stay neutral) */
.status-icon.status-guarded + .tag,
.status-icon.status-overwatch + .tag,
.status-icon.status-hidden + .tag,
.status-icon.status-focused + .tag,
.status-icon.status-shielded + .tag {
  color: #66e3ff;
  border-color: #66e3ff;
  background: rgba(102, 227, 255, 0.14);
}

.status-icon.status-suppressed + .tag,
.status-icon.status-marked + .tag,
.status-icon.status-disoriented + .tag,
.status-icon.status-jammed + .tag,
.status-icon.status-immobilized + .tag,
.status-icon.status-revealed + .tag,
.status-icon.status-burning + .tag,
.status-icon.status-bleeding + .tag {
  color: #ff4b6a;
  border-color: #ff4b6a;
  background: rgba(255, 75, 106, 0.14);
}

/* Appendix D status name coloring */
#appendixD tr:has(.status-icon.status-guarded) td:nth-child(2),
#appendixD tr:has(.status-icon.status-overwatch) td:nth-child(2),
#appendixD tr:has(.status-icon.status-hidden) td:nth-child(2),
#appendixD tr:has(.status-icon.status-focused) td:nth-child(2),
#appendixD tr:has(.status-icon.status-shielded) td:nth-child(2) {
  color: #4fd1ff;
  font-weight: 700;
}

#appendixD tr:has(.status-icon.status-suppressed) td:nth-child(2),
#appendixD tr:has(.status-icon.status-marked) td:nth-child(2),
#appendixD tr:has(.status-icon.status-disoriented) td:nth-child(2),
#appendixD tr:has(.status-icon.status-jammed) td:nth-child(2),
#appendixD tr:has(.status-icon.status-immobilized) td:nth-child(2),
#appendixD tr:has(.status-icon.status-revealed) td:nth-child(2),
#appendixD tr:has(.status-icon.status-burning) td:nth-child(2),
#appendixD tr:has(.status-icon.status-bleeding) td:nth-child(2) {
  color: #ff4fd1;
  font-weight: 700;
}

    /* APPENDIX (FULL WIDTH, NO COLUMNS) */

    .appendix {
      margin: 2.5rem 0;
      padding: 1.5rem;
      background: var(--bg-elevated);
      border-radius: 8px;
      border: 1px solid var(--border-soft);
    }

    .appendix-title {
      font-size: 1rem;
      text-transform: uppercase;
      letter-spacing: 0.16em;
      margin: 0 0 0.75rem;
      color: var(--accent);
    }

    .appendix-label {
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.16em;
      color: var(--text-muted);
      margin-bottom: 0.25rem;
    }
.appendix-b {
      margin: 2.5rem 0;
      padding: 1.5rem;
      background: var(--bg-elevated);
      column-count: 2;  
      border-radius: 8px;
      border: 1px solid var(--border-soft);
}  

/* ============================================================================
   APPENDIX E - GLOSSARY
   ============================================================================ */

#appendixE .section-intro {
  margin-bottom: 1rem;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1rem;
}

.glossary-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
}

.glossary-item h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.glossary-item h3 a {
  color: var(--accent);
  text-decoration: none;
}

.glossary-item h3 a:hover {
  text-decoration: underline;
}

.glossary-item p {
  margin: 0;
  color: var(--text-main);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* ============================================================================
   APPENDIX C - FACTION DOSSIERS
   ============================================================================ */

#appendixC.appendix-factions {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--bg-elevated);
  border: 1px solid #3a4352;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 18px 35px rgba(0, 0, 0, 0.38);
}

#appendixC .appendix-label {
  color: #b8c3d4;
  letter-spacing: 0.22em;
}

#appendixC .appendix-title {
  color: #d8e3f3;
  margin-bottom: 1.1rem;
  letter-spacing: 0.2em;
}

#appendixC .two-column {
  column-count: 1;
  column-gap: 0;
}

#appendixC .operator-block {
  max-width: none;
  margin: 1rem 0 1.3rem;
  border-radius: 0;
  border: 1px solid #445064;
  background:
    linear-gradient(0deg, rgba(8, 12, 17, 0.93), rgba(8, 12, 17, 0.93)),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 30px,
      rgba(255, 255, 255, 0.02) 30px,
      rgba(255, 255, 255, 0.02) 31px
    );
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

#appendixC .faction-lore {
  padding: 0.95rem 1.1rem 1.1rem;
  border-left: 4px solid #6f7e95;
}

#appendixC .faction-header {
  display: grid;
  grid-template-columns: 1fr minmax(264px, 41%);
  grid-template-areas:
    "name image"
    "tagline image";
  align-items: start;
  gap: 0.9rem 1.1rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #3d4655;
}

#appendixC .faction-header img {
  grid-area: image;
  width: 100%;
  height: 100%;
  min-height: 204px;
  object-fit: cover;
  border: 1px solid #5d6a7d;
  filter: none;
}

#appendixC .faction-name {
  grid-area: name;
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e4ecfa;
}

#appendixC .faction-tagline {
  grid-area: tagline;
  margin: 0.15rem 0 0;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #acb7c8;
}

#appendixC .faction-body {
  margin: 0.6rem 0 0;
  color: #d0dae9;
  font-size: 0.9rem;
  line-height: 1.58;
}

#appendixC .faction-verge { border-left-color: var(--verge); }
#appendixC .faction-force { border-left-color: var(--force); }
#appendixC .faction-focus { border-left-color: var(--focus); }
#appendixC .faction-bulwark { border-left-color: var(--bulwark); }
#appendixC .faction-system { border-left-color: var(--system); }

/* ============================================================================
   OPERATOR CARD - GAME CARD STYLE WITH FULL BACKGROUND PORTRAIT
   ============================================================================ */

.operator-block {
  position: relative;
  max-width: 400px;
  margin: 1.5rem auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  break-inside: avoid;
  background: var(--bg-panel);
  border: 2px solid var(--border-soft);
  padding-bottom: 0;
}

/* Full background portrait */
.operator-header {
  position: relative;
  height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  overflow: hidden;
}

/* Portrait as background using the image */
.operator-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  background-color: #222;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Dark gradient overlay for text readability */
.operator-header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(to top, 
    rgba(0, 0, 0, 0.95) 0%, 
    rgba(0, 0, 0, 0.7) 50%, 
    rgba(0, 0, 0, 0) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Text content on top of portrait */
.operator-header-left {
  position: relative;
  z-index: 3;
}

.operator-name {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
}

.operator-role {
  font-size: 1rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.9;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9);
}

/* Operator Stats Section */
.operator-table {
  width: 100%;
  background: var(--bg-elevated);
  border-collapse: collapse;
  margin: 0;
  line-height: 1.3;
}

.operator-block .operator-table:first-of-type {
  margin-top: 0;
}

.operator-block .operator-table:last-of-type {
  margin-bottom: 0;
}

.operator-table th {
  background: rgba(79, 209, 255, 0.1);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
  width: 25%;
  vertical-align: middle;
}

.operator-table td {
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-soft);
  width: 25%;
  vertical-align: middle;
}

/* For ability row (spans full width) */
.operator-table th[colspan],
.operator-table th:only-child {
  text-align: left;
  width: auto;
  white-space: normal;
}

.operator-table td:only-child,
.operator-table td[colspan] {
  text-align: left;
  width: auto;
  white-space: normal;
  line-height: 1.4;
}

.operator-table tr:last-child td,
.operator-table tr:last-child th {
  border-bottom: none;
}

/* Tag positioning on card */
.operator-block .tag {
  position: relative;
  z-index: 3;
  margin-bottom: 0.5rem;
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}
/* Faction tinting for operator cards (Section 8 + Appendix B) */
#section8 .operator-block,
#appendixB .operator-block {
  --faction-rgb: 79, 209, 255;
  background:
    linear-gradient(180deg, rgba(var(--faction-rgb), 0.16) 0%, rgba(17, 24, 34, 0.96) 32%, rgba(17, 24, 34, 1) 100%);
  border-color: rgba(var(--faction-rgb), 0.45);
}

#section8 .operator-block:has(.tag-force),
#appendixB .operator-block:has(.tag-force) { --faction-rgb: 255, 75, 106; }

#section8 .operator-block:has(.tag-focus),
#appendixB .operator-block:has(.tag-focus) { --faction-rgb: 159, 122, 234; }

#section8 .operator-block:has(.tag-system),
#appendixB .operator-block:has(.tag-system) { --faction-rgb: 255, 200, 87; }

#section8 .operator-block:has(.tag-verge),
#appendixB .operator-block:has(.tag-verge) { --faction-rgb: 79, 209, 255; }

#section8 .operator-block:has(.tag-bulwark),
#appendixB .operator-block:has(.tag-bulwark) { --faction-rgb: 79, 227, 154; }

#section8 .operator-block .operator-table th,
#appendixB .operator-block .operator-table th {
  background: rgba(var(--faction-rgb), 0.16);
  color: rgb(var(--faction-rgb));
}


/* Mobile optimization for operator cards */
@media (max-width: 980px) {
  .operator-block {
    max-width: 100%;
    margin: 1rem 0;
  }
  
  .operator-header {
    height: 240px;
    padding: 4.2rem 1rem 1rem;
  }
  
  .operator-name {
    font-size: 1.4rem;
  }
  
  .operator-role {
    font-size: 0.85rem;
  }
  
  .operator-table th {
    font-size: 0.65rem;
    padding: 0.4rem 0.3rem;
  }
  
  .operator-table td {
    font-size: 0.85rem;
    padding: 0.5rem 0.3rem;
  }
}

@media (max-width: 480px) {
  .operator-header {
    height: 200px;
  }
  
  .operator-name {
    font-size: 1.2rem;
  }
  
  .operator-table th {
    font-size: 0.6rem;
    padding: 0.3rem 0.2rem;
    letter-spacing: 0.05em;
  }
  
  .operator-table td {
    font-size: 0.8rem;
    padding: 0.4rem 0.2rem;
  }
}

.round-flow-vertical {
  width: min(100%, 360px);
  margin: 1.5rem auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 75, 106, 0.08), rgba(11, 16, 22, 0.95) 34%),
    var(--bg-panel);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.flow-box {
  width: 100%;
  padding: 0.68rem 0.85rem;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(79, 209, 255, 0.32);
  border-left-width: 4px;
  border-radius: 8px;
  color: var(--text-main);
  background: linear-gradient(180deg, rgba(79, 209, 255, 0.14), rgba(17, 24, 34, 0.94));
  text-shadow: 0 0 10px rgba(79, 209, 255, 0.2);
}

.round-flow-vertical .flow-box:nth-of-type(1) {
  border-left-color: var(--warning);
  background: linear-gradient(180deg, rgba(255, 200, 87, 0.2), rgba(17, 24, 34, 0.94));
}

.round-flow-vertical .flow-box:nth-of-type(2) {
  border-left-color: var(--focus);
  background: linear-gradient(180deg, rgba(159, 122, 234, 0.2), rgba(17, 24, 34, 0.94));
}

.round-flow-vertical .flow-box:nth-of-type(3),
.round-flow-vertical .flow-box:nth-of-type(4) {
  border-left-color: var(--accent);
  background: linear-gradient(180deg, rgba(79, 209, 255, 0.2), rgba(17, 24, 34, 0.94));
}

.round-flow-vertical .flow-box:nth-of-type(5) {
  border-left-color: var(--danger);
  background: linear-gradient(180deg, rgba(255, 75, 106, 0.22), rgba(17, 24, 34, 0.94));
}

.round-flow-vertical .flow-box:nth-of-type(6) {
  border-left-color: var(--success);
  background: linear-gradient(180deg, rgba(79, 227, 154, 0.22), rgba(17, 24, 34, 0.94));
}

.flow-connector {
  width: 2px;
  height: 24px;
  margin: 0.15rem 0;
  background: linear-gradient(180deg, rgba(79, 209, 255, 0.2), rgba(79, 209, 255, 0.75));
  position: relative;
}

.flow-connector::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--accent);
}

@media (max-width: 480px) {
  .round-flow-vertical {
    width: 100%;
    padding: 0.75rem;
  }

  .flow-box {
    font-size: 0.78rem;
    padding: 0.58rem 0.65rem;
    letter-spacing: 0.07em;
  }
}
/* BACK TO TOP BUTTON*/
.sidebar-backtotop {
  margin-top: 1rem;
  padding: 0.5rem;
  background-color: #111;
  border: 1px solid #333;
  text-align: center;
}

.sidebar-backtotop a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-backtotop a:hover {
  color: var(--accent-color, #b00020); /* optional hover color */
}

/* LINE OF SIGHT*/
.los-diagram {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #111;
  border: 1px solid #333;
  break-inside: avoid;
}

.los-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.los-box,
.los-obstacle {
  background: #111;
  border: 2px solid #333;
  padding: 0.5rem 1rem;
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0.5rem;
  min-width: 90px;
}

.los-obstacle {
  background: #222;
  border-color: #550000;
}

.los-arrow {
  width: 40px;
  height: 2px;
  background: #333;
  position: relative;
}

.los-arrow::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 6px solid #333;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.los-arrow.blocked {
  background: #550000;
}

.los-arrow.blocked::after {
  border-left-color: #550000;
}

.los-note {
  text-align: center;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: #ccc;
}

.los-divider {
  height: 1px;
  background: #333;
  margin: 1rem 0;
}

/* RANGE*/
.range-diagram.compact {
  margin: 1rem 0;
  padding: 0.75rem;
  background: #111;
  border: 1px solid #333;
  break-inside: avoid;
}

.range-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.range-box {
  background: #111;
  border: 2px solid #333;
  padding: 0.3rem 0.6rem;
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  min-width: 60px;
}

.range-band {
  height: 4px;
  width: 30px;
  border-radius: 2px;
  position: relative;
  font-size: 0.6rem;
  color: #ccc;
  text-align: center;
  line-height: 1;
}

.range-band.close { background: #4caf50; }
.range-band.medium { background: #ffc107; }
.range-band.long { background: #f44336; }

.range-note {
  text-align: left;
  font-size: 0.7rem;
  margin-top: 0.5rem;
  color: #aaa;
}
/* Hit Formula*/
.math-formula {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: #111;
  border: 1px solid #333;
  break-inside: avoid;
}

.math-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
  margin-bottom: 0.35rem;
}

.math-expression {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.4;
}

.math-term {
  padding: 0.1rem 0.35rem;
  background: #181818;
  border: 1px solid #333;
  border-radius: 2px;
}

.math-operator {
  padding: 0 0.2rem;
  color: #ccc;
  font-weight: 700;
}

.math-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.35rem;
  background: #181818;
  border: 1px solid #333;
  border-radius: 2px;
}
  
.math-note {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: #aaa;
}

.combat-example {
  margin: 1rem 0;
  padding: 1rem;
  background: #111;
  border: 1px solid #333;
  break-inside: avoid;
}

.combat-header {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  text-align: center;
  color: #ccc;
}

.combat-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.combat-box {
  background: #181818;
  border: 1px solid #333;
  padding: 0.5rem 1rem;
  min-width: 120px;
  text-align: center;
  font-size: 0.8rem;
}

.combat-step {
  margin-bottom: 0.75rem;
}

.combat-step-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #ccc;
}

.combat-step-body {
  background: #181818;
  border: 1px solid #333;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

.combat-note {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #aaa;
}

.cover-diagram {
  margin: 1rem 0;
  padding: 1rem;
  background: #111;
  border: 1px solid #333;
  break-inside: avoid;
}

.cover-header {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  color: #ccc;
  margin-bottom: 0.5rem;
}

.cover-summary {
  text-align: center;
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 0.75rem;
}

.cover-types {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.cover-type {
  display: flex;
  justify-content: space-between;
  background: #181818;
  border: 1px solid #333;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

.cover-label {
  font-weight: 600;
}

.cover-value {
  color: #ccc;
}

.cover-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
  margin: 0.75rem 0;
}

.cover-box,
.cover-block {
  width: 50px;
  height: 50px;
  background: #181818;
  border: 2px solid #333;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
}

.cover-block {
  background: #222;
  border-color: #550000;
}

.cover-box span,
.cover-block span {
  font-size: 0.6rem;
  font-weight: 400;
  color: #aaa;
  margin-top: 0.2rem;
}

.cover-note {
  text-align: center;
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 0.5rem;
}

/* Diagram Theme Pass (match manual + round flow visual language) */
.los-diagram,
.math-formula,
.combat-example,
.cover-diagram {
  margin: 1rem 0;
  padding: 0.95rem 1rem;
  background:
    linear-gradient(180deg, rgba(79, 209, 255, 0.08), rgba(11, 16, 22, 0.94) 36%),
    var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  break-inside: avoid;
}

.los-box,
.los-obstacle,
.combat-box,
.combat-step-body,
.math-term,
.math-group,
.cover-type,
.cover-box,
.cover-block,
.math-formula .ruler-label,
.math-formula .ruler-band {
  background: rgba(17, 24, 34, 0.92);
  border: 1px solid rgba(79, 209, 255, 0.22);
  border-radius: 6px;
}

.los-box,
.los-obstacle {
  border-left: 4px solid rgba(79, 209, 255, 0.38);
  color: var(--text-main);
}

.los-obstacle,
.cover-block {
  border-color: rgba(255, 75, 106, 0.42);
  border-left-color: rgba(255, 75, 106, 0.68);
}

.los-arrow {
  background: linear-gradient(90deg, rgba(79, 209, 255, 0.35), rgba(79, 209, 255, 0.9));
}

.los-arrow::after {
  border-left-color: var(--accent);
}

.los-arrow.blocked {
  background: linear-gradient(90deg, rgba(255, 75, 106, 0.4), rgba(255, 75, 106, 0.95));
}

.los-arrow.blocked::after {
  border-left-color: var(--danger);
}

.los-note,
.math-note,
.combat-note,
.cover-summary,
.cover-note {
  color: #c7d3e4;
}

.los-divider {
  background: linear-gradient(90deg, transparent, rgba(79, 209, 255, 0.5), transparent);
}

.math-label,
.combat-header,
.cover-header,
.combat-step-title {
  color: #d4ecff;
  letter-spacing: 0.1em;
}

.math-formula .ruler-label.shooter,
.cover-box.shooter {
  border-left: 4px solid rgba(79, 209, 255, 0.72);
  color: var(--accent);
}

.math-formula .ruler-label.target,
.cover-box.target {
  border-left: 4px solid rgba(255, 75, 106, 0.72);
  color: var(--danger);
}

.math-formula .ruler-band.close {
  background: linear-gradient(180deg, rgba(79, 227, 154, 0.24), rgba(17, 24, 34, 0.92));
  border-color: rgba(79, 227, 154, 0.45);
}

.math-formula .ruler-band.medium {
  background: linear-gradient(180deg, rgba(255, 200, 87, 0.24), rgba(17, 24, 34, 0.92));
  border-color: rgba(255, 200, 87, 0.45);
}

.math-formula .ruler-band.long {
  background: linear-gradient(180deg, rgba(255, 75, 106, 0.24), rgba(17, 24, 34, 0.92));
  border-color: rgba(255, 75, 106, 0.45);
}

.math-formula .formula-card {
  background: rgba(10, 14, 22, 0.92);
  border: 1px solid rgba(79, 209, 255, 0.28);
  border-radius: 8px;
}

.combat-row {
  gap: 0.7rem;
}

.combat-box {
  min-width: 132px;
}

.cover-type {
  border-left: 4px solid rgba(79, 209, 255, 0.44);
}

.cover-value {
  color: #d8ebff;
}


.cover-box span,
.cover-block span {
  color: #f2f7ff;
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  line-height: 1.1;
  background: rgba(6, 10, 16, 0.72);
  padding: 0.08rem 0.28rem;
  border-radius: 999px;
  margin-top: 0.24rem;
}


@media (max-width: 600px) {
  .los-diagram,
  .math-formula,
  .combat-example,
  .cover-diagram {
    padding: 0.75rem;
  }

  .los-box,
  .los-obstacle {
    min-width: 72px;
    padding: 0.45rem 0.55rem;
    margin: 0.2rem;
    font-size: 0.72rem;
  }

  .math-formula .range-ruler {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .math-formula .ruler-label,
  .math-formula .ruler-band {
    text-align: center;
  }

  .cover-visual {
    gap: 0.65rem;
  }
}
.print-button {
  cursor: pointer;
}

/* ============================================================================
   FLOATING SEARCH - FIXED CSS
   ============================================================================ */

.floating-search {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
}

.floating-search-input {
  width: 220px;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: border 0.15s, background 0.15s;
}

.floating-search-input:focus {
  border-color: var(--accent);
  background: var(--bg-panel);
}

/* ============================================================================
   SEARCH RESULTS PANEL
   ============================================================================ */

#searchResults {
  position: fixed;
  bottom: 4.5rem;
  right: 1rem;
  z-index: 9998;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  max-width: 300px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.floating-results-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: background 0.15s;
}

.floating-results-item:last-child {
  border-bottom: none;
}

.floating-results-item:hover {
  background: var(--bg-elevated);
}

@media (max-width: 980px) {
  .floating-search {
    left: 0.75rem;
    right: 0.75rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    padding: 0.6rem;
    border-radius: 10px;
  }

  .floating-search-input {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
  }

  #searchResults {
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(4.75rem + max(0.75rem, env(safe-area-inset-bottom)));
    width: auto;
    max-width: none;
    max-height: min(46vh, 22rem);
    border-radius: 10px;
  }

  .floating-results-item {
    font-size: 0.98rem;
    line-height: 1.35;
    padding: 0.85rem 0.95rem;
  }
}

/* ============================================================================
   SEARCH HIGHLIGHTING
   ============================================================================ */

mark.search-highlight {
  background: rgba(255, 235, 59, 0.4);
  color: inherit;
  padding: 0.1em 0.2em;
  border-radius: 2px;
  font-weight: 500;
}

/* Dark mode variant if needed */
@media (prefers-color-scheme: dark) {
  mark.search-highlight {
    background: rgba(255, 235, 59, 0.3);
  }
}

.print-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
@media print {
  .sidebar,
  .print-button,
  .video-background,
  .floating-search,
  #searchResults,
  .mobile-menu-toggle,
  .sidebar-overlay {
    display: none !important;
  }

  @page {
    margin: 0.5in;
  }

  * {
    color: #000 !important;
    background: transparent !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    display: block !important;
    font-size: 10pt;
    line-height: 1.3;
  }

  .main {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .doc-header {
    border: 1px solid #999 !important;
    margin-bottom: 0.7rem !important;
    padding: 0.65rem !important;
  }

  .doc-header h1,
  .doc-header p {
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    letter-spacing: 0.03em !important;
    text-transform: none !important;
  }

  .doc-header h1 {
    font-size: 18pt !important;
    margin-bottom: 0.35rem !important;
  }

  .doc-header p {
    font-size: 10pt !important;
    color: #333 !important;
  }

  .section {
    border: 1px solid #bbb !important;
    margin: 0 0 0.45rem !important;
    padding: 0.45rem !important;
    border-radius: 0 !important;
    page-break-inside: auto;
    break-inside: auto;
  }

  .section-title,
  .appendix-title {
    font-size: 15pt !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
    margin-bottom: 0.35rem !important;
  }

  .section-label,
  .appendix-label,
  .nav-section-title {
    font-size: 9pt !important;
    color: #333 !important;
    letter-spacing: 0.02em !important;
  }

  .two-column {
    column-count: 1 !important;
    column-gap: 0 !important;
  }

  h2,
  h3,
  h4 {
    page-break-after: avoid;
    break-after: avoid;
  }

  p,
  ul,
  ol,
  table,
  .table-wrapper,
  .operator-block,
  .faction-lore {
    page-break-inside: auto;
    break-inside: auto;
  }

  .collapsible-toggle {
    display: none !important;
  }

  .collapsible-content,
  .collapsible-wrapper.active .collapsible-content {
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
  }

  .collapsible-content-inner,
  .collapsible-wrapper {
    display: block !important;
    overflow: visible !important;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 10pt !important;
  }

  th,
  td {
    border: 1px solid #888 !important;
    padding: 0.3rem 0.4rem !important;
    background: #fff !important;
  }

  a {
    color: #000 !important;
    text-decoration: underline !important;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #444 !important;
  }

  img,
  figure,
  .img,
  [class*="portrait"],
  [class*="hero-image"],
  .operator-image,
  .world-brief-image,
  .setup-brief-image,
  .concepts-brief-image,
  .round-brief-image,
  .combat-brief-image,
  .weapons-brief-image,
  .armor-brief-image,
  .tactics-brief-image,
  .operators-brief-image,
  .mercs-brief-image,
  .status-brief-image,
  .terrain-brief-image {
    display: none !important;
  }
}

img {
  width: 100%;
  height: auto;
  display: block;
  align-items: center;
}

  /* ============================================================
 Gameboard
   ============================================================ */
 .board-wrapper {
  display: inline-block;
  padding: 0.5rem;
  background: var(--bg-panel, #111);
  color: var(--text-soft, #ccc);
  font-family: system-ui, sans-serif;
  font-size: 0.7rem;
}

.board-coords-top {
  display: grid;
  grid-template-columns: repeat(25, 1.5rem);
  margin-bottom: 0.25rem;
}

.board-coords-top span {
  text-align: center;
}

.board-main {
  display: flex;
}

.board-coords-left {
  display: grid;
  grid-template-rows: repeat(24, 1.5rem);
  margin-right: 0.25rem;
}

.board-coords-left span {
  display: flex;
  align-items: center;
  justify-content: center;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(24, 1.5rem);
  grid-template-rows: repeat(24, 1.5rem);
  border: 1px solid var(--border-soft, #444);
}

.cell {
  border: 1px solid #333;
  background: #181818;
  box-sizing: border-box;
}

/* range example styling */
/* Range highlight colors */
.range-close {
  background: rgba(0, 255, 0, 0.25); /* green tint */
}

.range-medium {
  background: rgba(255, 255, 0, 0.25); /* yellow tint */
}

.range-long {
  background: rgba(255, 0, 0, 0.25); /* red tint */
}

/* Shooter + Target markers */
.shooter {
  background: #4fd1ff !important;
  color: #000;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.target {
  background: #ff4b6a !important;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Wrapper to scale down the example */
/* Outer wrapper ensures the diagram never exceeds column width */
.range-example-wrapper {
  width: 100%;
  overflow: hidden;
  margin: 0.5rem 0 1rem;
}

/* Inner wrapper handles scaling */
.range-example-scale {
  transform-origin: top left;
  display: inline-block;
}

/* Force the mini-board to be 10×10 using your existing cell size */
.range-example-grid {
  grid-template-columns: repeat(10, 1.4rem);
  grid-template-rows: repeat(10, 1.4rem);
}

/* Auto-scale the board to fit the column */
@media (max-width: 900px) {
  .range-example-scale {
    transform: scale(0.85);
  }
}

@media (max-width: 700px) {
  .range-example-scale {
    transform: scale(0.7);
  }
}

@media (max-width: 550px) {
  .range-example-scale {
    transform: scale(0.55);
  }
}

@media (max-width: 450px) {
  .range-example-scale {
    transform: scale(0.45);
  }
}
/* Optional zone styling */
.cell.cover { background: #444; }
.cell.objective { background: #ffd54a; }
.cell.deploy-a { background: rgba(0, 120, 255, 0.25); }
.cell.deploy-b { background: rgba(255, 40, 40, 0.25); }

.board-responsive {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.board-wrapper {
  transform-origin: top left;
  display: inline-block;
}

/* Compact card mode base styling */
.table-wrapper.compact-card {
  border: 2px solid #333;
  border-radius: 6px;
  padding: 0.5rem;
  margin-bottom: 1rem;
  background: #111;
}

/* Faction-colored borders */
.tag-verge + .table-wrapper.compact-card {
  border-color: var(--verge);
}

.tag-force + .table-wrapper.compact-card {
  border-color: var(--force);
}

.tag-focus + .table-wrapper.compact-card {
  border-color: var(--focus);
}

.tag-bulwark + .table-wrapper.compact-card {
  border-color: var(--bulwark);
}

.tag-system + .table-wrapper.compact-card {
  border-color: var(--system);
}

/* placards inside compact card mode */
/* Wrapper scales nicely in two-column layouts */
.loadout-placard-wrapper {
  width: 100%;
  margin: 0.75rem 0 1.25rem;
}


/* 5×3 mini-grid using your existing board-grid class */
.loadout-placard-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* fills the column */
  grid-template-rows: repeat(3, auto);
  gap: 0.25rem; /* optional spacing */
}


/* Shared styling for placard slots */
.loadout-operator,
.loadout-weapon,
.loadout-armor,
.loadout-merc,
.loadout-tactics {
  aspect-ratio: 1 / 1; /* keeps them square */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  border: 2px solid #262a36;
  background: #0b0d13;
  color: #e5e9f0;
}


/* Color coding (subtle neon accents) */
.loadout-operator {
  background: rgba(79, 209, 255, 0.25); /* Verge cyan */
  border-color: #4fd1ff;
}

.loadout-weapon {
  background: rgba(255, 75, 106, 0.25);
  border-color: #ff4b6a;
}

.loadout-armor {
  background: rgba(255, 200, 55, 0.25);
  border-color: #ffc837;
}

.loadout-merc {
  background: rgba(79, 227, 154, 0.25);
  border-color: #4fe39a;
}

.loadout-tactics {
  background: rgba(159, 122, 234, 0.25);
  border-color: #9f7aea;
}

.operator-stats-table {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.4fr;
  align-items: center;
  gap: 0.75rem;
}

.stat-label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
}

.stat-label span {
  font-size: 0.7rem;
  opacity: 0.75;
}

.stat-bar {
  height: 0.6rem;
  background: #111318;
  border: 1px solid #262a36;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.stat-fill {
  height: 100%;
  background: var(--accent, #4fd1ff);
  opacity: 0.8;
}

/* Fill amounts based on stat ranges */
.stat-fill.acc { width: 60%; }  /* 3–6 */
.stat-fill.dod { width: 50%; }  /* 2–5 */
.stat-fill.arm { width: 33%; }  /* 0–2 */
.stat-fill.hp  { width: 100%; } /* 17–22 */
.stat-fill.ld  { width: 40%; }  /* 1–3 */

.stat-range {
  font-size: 0.75rem;
  text-align: right;
  opacity: 0.8;
}
/* RANGE DIAGRAM */
.range-arc {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 1rem 0;
}

.arc {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #0b0d13;
  border: 2px solid #262a36;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.arc.shooter { border-color: #4fd1ff; color: #4fd1ff; }
.arc.target { border-color: #ff4b6a; color: #ff4b6a; }

.arc-band {
  flex: 1;
  padding: 0.4rem 0;
  text-align: center;
  border-radius: 4px;
  border: 1px solid #262a36;
  font-size: 0.75rem;
}

.arc-band.close { background: rgba(0,255,0,0.15); }
.arc-band.medium { background: rgba(255,255,0,0.15); }
.arc-band.long { background: rgba(255,0,0,0.15); }

.range-ruler {
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr auto;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.ruler-label {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
  background: #0b0d13;
  border: 1px solid #262a36;
  border-radius: 4px;
}

.ruler-label.shooter { color: #4fd1ff; }
.ruler-label.target { color: #ff4b6a; }

.ruler-band {
  background: #111318;
  border: 1px solid #262a36;
  border-radius: 4px;
  padding: 0.4rem 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.75rem;
}

.ruler-band.close { background: rgba(0,255,0,0.15); }
.ruler-band.medium { background: rgba(255,255,0,0.15); }
.ruler-band.long { background: rgba(255,0,0,0.15); }

.formula-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #0b0d13;
  border: 1px solid #262a36;
  border-radius: 6px;
}

.formula-left {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.formula-center {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 1rem;
}
/* ============================================================================
   COLLAPSIBLE SECTIONS FOR TABLES (MOBILE-FRIENDLY)
   ============================================================================ */

.collapsible-wrapper {
  margin: 1.5rem 0;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--bg-panel);
  overflow: hidden;
}

.collapsible-toggle {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: none;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s;
}

.collapsible-toggle:hover {
  background: var(--bg-panel);
}

.collapsible-toggle::after {
  content: "▼";
  font-size: 0.7rem;
  transition: transform 0.3s;
}

.collapsible-wrapper.active .collapsible-toggle::after {
  transform: rotate(-180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.collapsible-wrapper.active .collapsible-content {
  max-height: 5000px;
  transition: max-height 0.5s ease-in;
}

.collapsible-content-inner {
  padding: 1rem;
}

/* Mobile optimizations for tables */
@media (max-width: 980px) {
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  table {
    font-size: 0.85rem;
  }
  
  .collapsible-toggle {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
  }
}

/* ============================================================================
   ADDITIONAL MOBILE OPTIMIZATIONS
   ============================================================================ */

/* ============================================================================
   MOBILE MENU TOGGLE BUTTON
   ============================================================================ */

.mobile-menu-toggle {
  display: none; /* Hidden on desktop */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  padding: 1rem;
  background: var(--bg-elevated);
  border: none;
  border-bottom: 1px solid var(--border-soft);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
  position: relative;
  z-index: 100;
}

.mobile-menu-toggle:hover {
  background: var(--bg-panel);
}

.menu-icon {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

@media (max-width: 980px) {
  /* Show mobile menu button and make it fixed at top */
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  /* Make sidebar collapsible on mobile */
  body {
    flex-direction: column;
  }

  body.menu-open {
    overflow: hidden;
  }
  
  .sidebar {
    width: 100%;
    height: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    border: none;
    overflow: visible;
    padding: 0;
    z-index: 990;
    background: transparent;
  }
  
  /* Hide menu content by default on mobile */
  .sidebar-content {
    position: fixed;
    top: 3.9rem;
    left: 0.5rem;
    right: 0.5rem;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(5, 7, 10, 0.98) 0, rgba(11, 16, 22, 0.98) 100%);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
    transition: max-height 0.25s ease, opacity 0.2s ease, visibility 0.2s ease;
  }
  
  /* Show menu when sidebar is active */
  .sidebar.menu-open .sidebar-content {
    max-height: calc(100dvh - 4.1rem);
    opacity: 1;
    visibility: visible;
  }
  
  /* Change icon when menu is open */
  .sidebar.menu-open .menu-icon::before {
    content: "\00D7";
  }
  

  .menu-icon {
    transition: transform 0.2s ease;
  }

  .sidebar.menu-open .menu-icon {
    transform: rotate(90deg);
  }

  .nav-list {
    font-size: 0.98rem;
  }

  .nav-list a {
    padding: 0.42rem 0.55rem;
  }

  .sidebar-action-link,
  .print-button {
    font-size: 0.82rem;
    padding: 0.62rem 0.72rem;
  }

  .sidebar-tools-title {
    font-size: 0.78rem;
  }
  .sidebar.menu-open .menu-text::after {
    content: "";
  }
  
  .sidebar:not(.menu-open) .menu-text::after {
    content: "";
  }
  
  .main {
    width: 100%;
    padding: 4.2rem 1rem 1rem;
  }

  .section {
    scroll-margin-top: 4.8rem;
  }
  
  /* Improve two-column layout on mobile */
  .two-column {
    column-count: 1 !important;
    column-gap: 0;
  }
  
  .two-column img {
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
  }

  .glossary-grid {
    grid-template-columns: 1fr;
  }

  #section10 .token-types-list {
    grid-template-columns: 1fr;
  }

  #section10 .status-negative-grid,
  #section10 .status-positive-grid {
    grid-template-columns: 1fr;
  }

  #section10 .status-rule-grid,
  #section10 .status-interactions-grid {
    grid-template-columns: 1fr;
  }

  #section0 .world-brief-hero,
  #section0 .world-story-grid {
    grid-template-columns: 1fr;
  }

  #section0 .world-brief-image img {
    min-height: 220px;
  }

  #section1 .setup-brief-hero {
    grid-template-columns: 1fr;
  }

  #section1 .setup-brief-image img {
    min-height: 220px;
  }

  #section2 .concepts-brief-hero {
    grid-template-columns: 1fr;
  }

  #section2 .concepts-brief-image img {
    min-height: 220px;
  }

  #section3 .round-brief-hero {
    grid-template-columns: 1fr;
  }

  #section3 .round-brief-image img {
    min-height: 220px;
  }

  #section4 .combat-brief-hero {
    grid-template-columns: 1fr;
  }

  #section4 .combat-brief-image img {
    min-height: 220px;
  }

  #section5 .weapons-brief-hero {
    grid-template-columns: 1fr;
  }

  #section5 .weapons-brief-image img {
    min-height: 220px;
  }

  #section6 .armor-brief-hero {
    grid-template-columns: 1fr;
  }

  #section6 .armor-brief-image img {
    min-height: 220px;
  }

  #section7 .tactics-brief-hero {
    grid-template-columns: 1fr;
  }

  #section7 .tactics-brief-image img {
    min-height: 220px;
  }

  #section8 .operators-brief-hero {
    grid-template-columns: 1fr;
  }

  #section8 .operators-brief-image img {
    min-height: 220px;
  }

  #section8 .operator-block .operator-table:first-of-type td {
    font-size: 0.9rem;
  }

  #section9 .mercs-brief-hero {
    grid-template-columns: 1fr;
  }

  #section9 .mercs-brief-image img {
    min-height: 220px;
  }

  #section10 .status-brief-hero {
    grid-template-columns: 1fr;
  }

  #section10 .status-brief-image img {
    min-height: 220px;
  }

  #section11 .terrain-brief-hero {
    grid-template-columns: 1fr;
  }

  #section11 .terrain-brief-image img {
    min-height: 220px;
  }

  #appendixC .faction-header {
    grid-template-columns: 1fr 144px;
    grid-template-areas:
      "name image"
      "tagline image";
  }

  #appendixC .faction-header img {
    grid-area: image;
    width: 100%;
    max-width: none;
    min-height: 144px;
    height: 100%;
  }
  
  /* Make images responsive */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Adjust font sizes */
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.3rem;
  }
  
  h3 {
    font-size: 1.1rem;
  }
  
  /* Better spacing on mobile */
  .section {
    padding: 1rem;
  }
  
  /* Make navigation more compact */
  .nav-list {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .collapsible-toggle {
    font-size: 0.8rem;
    padding: 0.5rem 0.7rem;
  }
  
  table {
    font-size: 0.75rem;
  }
  
  th, td {
    padding: 0.4rem;
  }
}

/* Additional fixes for operator card layout */
.operator-block table {
  table-layout: fixed;
}

/* Ensure no extra space after tables */
.operator-block > table:last-child {
  margin-bottom: 0;
}

/* Eliminate any empty space at bottom of operator cards */
.operator-block > table:last-of-type {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.operator-block > table:last-of-type tr:last-child td {
  padding-bottom: 0.6rem;
  border-bottom: none;
}

/* Operator Bio Articles (outside of cards) */
.operator-bio {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}

.operator-bio .operator-header {
  position: relative;
  height: auto;
  padding: 0;
  margin-bottom: 1rem;
  display: block;
}

.operator-codename {
  font-size: 1.2rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}

.operator-hook {
  font-style: italic;
  color: var(--text-muted);
  margin: 0.5rem 0 1rem;
  font-size: 0.95rem;
}

.operator-dossier,
.operator-specialty,
.operator-psych {
  margin: 0.75rem 0;
  line-height: 1.6;
  font-size: 0.9rem;
}





















