/* RadioGx v2: labs, pixel scenes, game, OHIF embed and the OpenTTD-flavoured game mode. © 2026 RadioGx™. */
@font-face { font-family: "Silkscreen"; src: url("../fonts/Silkscreen-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("../fonts/Silkscreen-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
.rgx { --pixel: "Silkscreen", ui-monospace, monospace; --bevel-hi: rgba(255, 255, 255, .65); --bevel-lo: rgba(11, 37, 69, .35); }
.rgx[data-theme="dark"] { --bevel-hi: rgba(255, 255, 255, .14); --bevel-lo: rgba(0, 0, 0, .55); }
@media (prefers-color-scheme: dark) { .rgx:not([data-theme="light"]) { --bevel-hi: rgba(255, 255, 255, .14); --bevel-lo: rgba(0, 0, 0, .55); } }
.rgx-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.rgx-linkbtn { background: none; border: 0; padding: 0; color: var(--teal-ink); text-decoration: underline; cursor: pointer; font: inherit; }
.rgx-text-bad { color: var(--rose); }

/* labs */
.rgx-lab-panel { margin-top: 18px; }
.rgx-lab-h { font-size: 1.2rem; margin: 0 0 10px; }
.rgx-lab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; align-items: end; }
.rgx-lab-field { display: grid; gap: 4px; font-size: .88rem; color: var(--ink-2); }
.rgx-lab-field small { color: var(--muted); font-size: .76rem; }
.rgx-lab-field .rgx-input, .rgx-lab-field .rgx-select, .rgx-lab-field textarea { width: 100%; }
.rgx-lab-panel textarea.rgx-input { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.rgx-lab-rows { display: grid; gap: 8px; }
.rgx-lab-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) minmax(90px, 1fr) minmax(90px, .8fr) auto; gap: 8px; align-items: center; }
.rgx-lab-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.rgx-lab-stat { display: grid; gap: 2px; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: var(--r-s); min-width: 0; }
.rgx-lab-stat span { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rgx-lab-stat b { font: 700 1.12rem/1.2 var(--font-display); color: var(--ink); overflow-wrap: anywhere; }
.rgx-lab-stat small { color: var(--muted); font-size: .74rem; }
.rgx-lab-chart { margin: 14px 0; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); }
.rgx-lab-chart canvas { display: block; width: 100%; }
.rgx-lab-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--ink-2); margin-top: 6px; }
.rgx-lab-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -1px; }
.rgx-lab-verdict { margin: 14px 0; padding: 14px 16px; font: 700 1.1rem/1.3 var(--font-display); border: 2px solid; border-radius: var(--r-s); display: grid; gap: 2px; }
.rgx-lab-verdict small { font: 500 .85rem var(--font-ui); }
.rgx-lab-verdict.is-ok { color: var(--green); background: var(--green-bg); }
.rgx-lab-verdict.is-warn { color: var(--amber); background: var(--amber-bg); }
.rgx-lab-verdict.is-bad { color: var(--rose); background: var(--rose-bg); }
.rgx-lab-bars { display: grid; gap: 6px; }
.rgx-lab-bar { display: grid; grid-template-columns: 110px 1fr 56px; gap: 8px; align-items: center; font-size: .85rem; }
.rgx-lab-bar i { display: block; height: 12px; background: linear-gradient(90deg, var(--teal), var(--orange)); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.rgx-lab-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.rgx-lab-bars-sm .rgx-lab-bar { grid-template-columns: 120px 1fr 34px; font-size: .78rem; }
.rgx-lab-picks { display: flex; flex-wrap: wrap; gap: 4px 14px; border: 1px dashed var(--line); border-radius: var(--r-s); padding: 8px 12px; }
.rgx-lab-picks legend { font-size: .85rem; font-weight: 600; padding: 0 4px; }
.rgx-lab-game-score { margin-top: 10px; font-family: var(--pixel); font-size: .85rem; }
.rgx-lab-ai:not(:empty) { margin-top: 14px; padding: 14px 16px; border: 2px solid var(--orange-soft); border-left-width: 6px; background: var(--orange-wash); border-radius: var(--r-s); color: var(--ink); }
.rgx-lab-ai-text { white-space: pre-wrap; line-height: 1.55; }
.rgx[data-theme="dark"] .rgx-lab-ai:not(:empty) { background: rgba(242, 107, 29, .08); }
.rgx-btn-ai { border-color: var(--orange); color: var(--orange-ink); }
.rgx-btn-ai.is-off { opacity: .85; border-style: dashed; }
.rgx-lab-molcard { display: grid; grid-template-columns: 180px 1fr; gap: 16px; margin-top: 16px; }
.rgx-lab-molcard h3 { margin: 0 0 4px; }
.rgx-lab-mol { width: 100%; max-width: 180px; height: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-s); }
.rgx-table .rgx-lab-mol { max-width: 110px; }
@media (max-width: 640px) { .rgx-lab-molcard { grid-template-columns: 1fr; } .rgx-lab-row { grid-template-columns: 1fr 1fr; } }

/* pixel scenes */
.rgx-pixel-canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; }
.rgx-county { position: relative; margin: 0 auto; max-width: 1100px; border: 3px solid var(--navy); background: linear-gradient(#bfe3ff, #e9f6ff 55%); box-shadow: 6px 6px 0 var(--bevel-lo); border-radius: 4px; overflow: hidden; }
.rgx[data-theme="dark"] .rgx-county { background: linear-gradient(#0b1f3a, #14325a 60%); }
.rgx-county-spots { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; }
.rgx-county-spots li { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; }
.rgx-county-spot { display: grid; text-align: center; gap: 1px; padding: 3px 7px 4px; background: rgba(6, 22, 41, .82); color: #fff; text-decoration: none; border: 2px solid #ffd400; border-radius: 2px; font: 700 .64rem/1.15 var(--pixel); letter-spacing: .02em; white-space: nowrap; box-shadow: 2px 2px 0 rgba(0, 0, 0, .45); transition: transform .12s; }
.rgx-county-spot small { font: 400 .58rem/1.1 var(--pixel); color: #ffe27a; }
.rgx-county-spot:hover, .rgx-county-spot:focus-visible { transform: translateY(-3px); background: #f26b1d; outline: none; color: #fff; }
.rgx-county-caption { text-align: center; font: 400 .7rem/1.4 var(--pixel); color: var(--muted); margin-top: 10px; }
@media (max-width: 720px) { .rgx-county-spot small { display: none; } .rgx-county-spot { font-size: .55rem; padding: 2px 4px; } }

/* game */
.rgx-game { border: 3px solid var(--navy); background: var(--paper); box-shadow: 6px 6px 0 var(--bevel-lo); border-radius: 4px; overflow: hidden; }
.rgx-game-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: linear-gradient(#8a7a5c, #6e5f45); border-bottom: 3px solid #3d3324; }
.rgx-game-tool, .rgx-game-speed { font: 700 .72rem/1 var(--pixel); color: #1d160c; background: #c9b48a; border: 2px solid; border-color: #efe2c2 #5b4c33 #5b4c33 #efe2c2; padding: 7px 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.rgx-game-tool[aria-pressed="true"] { border-color: #5b4c33 #efe2c2 #efe2c2 #5b4c33; background: #b09a6e; }
.rgx-game-speed select { font: inherit; background: #efe2c2; border: 1px solid #5b4c33; color: #1d160c; }
.rgx-game-hud { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: #13315c; }
.rgx-game-chip { font: 700 .72rem/1 var(--pixel); color: #ffe27a; background: #061629; border: 2px solid #2d5b8c; padding: 6px 9px; }
.rgx-game-chip.is-bad { color: #ff8a80; }
.rgx-game-stage { position: relative; background: linear-gradient(#bfe3ff, #e9f6ff); }
.rgx[data-theme="dark"] .rgx-game-stage { background: linear-gradient(#0b1f3a, #14325a); }
.rgx-game-tip { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); font: 700 .7rem/1.3 var(--pixel); color: #fff; background: rgba(6, 22, 41, .85); border: 2px solid #ffd400; padding: 6px 8px; }
.rgx-game-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; border-top: 3px solid var(--navy); }
.rgx-game-cols section { padding: 12px 14px; min-width: 0; }
.rgx-game-cols section + section { border-left: 3px solid var(--navy); }
.rgx-game-cols h3 { font: 700 .8rem/1.2 var(--pixel); margin: 0 0 8px; text-transform: uppercase; }
.rgx-game-news { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .84rem; }
.rgx-game-news li { padding: 6px 8px; background: var(--canvas); border-left: 4px solid var(--line); }
.rgx-game-news li.is-good { border-left-color: var(--green); }
.rgx-game-news li.is-bad { border-left-color: var(--rose); }
.rgx-game-news time { font: 700 .66rem var(--pixel); color: var(--muted); }
.rgx-game-fleet { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .84rem; }
.rgx-game-fleet small { display: block; color: var(--muted); }
@media (max-width: 760px) { .rgx-game-cols { grid-template-columns: 1fr; } .rgx-game-cols section + section { border-left: 0; border-top: 3px solid var(--navy); } }

/* labs hub and apps cards */
.rgx-labcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 22px; }
.rgx-labcard { display: grid; align-content: start; gap: 6px; padding: 16px; border: 2px solid var(--navy); background: var(--paper); text-decoration: none; color: var(--ink); box-shadow: 4px 4px 0 var(--bevel-lo); border-radius: 3px; transition: transform .12s, box-shadow .12s; }
.rgx-labcard:hover, .rgx-labcard:focus-visible { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--bevel-lo); }
.rgx-labcard b { font: 700 1.05rem var(--font-display); }
.rgx-labcard span { font-size: .88rem; color: var(--ink-2); }
.rgx-labcard em { font: 400 .62rem/1.3 var(--pixel); font-style: normal; color: var(--teal-ink); text-transform: uppercase; letter-spacing: .03em; }
.rgx-repo-credits { columns: 2 280px; font-size: .88rem; }
.rgx-repo-credits li { break-inside: avoid; margin-bottom: 6px; }

/* imaging: OHIF and AI */
.rgx-ohif-frame { width: 100%; height: min(78vh, 820px); border: 3px solid var(--navy); background: #000; display: block; border-radius: 3px; }
.rgx-ai-overlay-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rgx-ai-overlay-legend span { font-size: .78rem; padding: 3px 8px; border-left: 10px solid; background: var(--canvas); }

/* Game mode: OpenTTD-flavoured chrome. Toggle in the header; on by default and remembered on this device. */
.rgx[data-game] .rgx-header { background: linear-gradient(#1e4275, #13315c); border-bottom: 3px solid #061629; backdrop-filter: none; }
.rgx[data-game] .rgx-header .rgx-word, .rgx[data-game] .rgx-header .rgx-brand-sub { color: #fff; }
.rgx[data-game] .rgx-header .rgx-word-gx { color: #ffb37a; }
.rgx[data-game] .rgx-nav a { color: #d7e6f5; font-family: var(--pixel); font-size: .74rem; letter-spacing: .02em; border: 2px solid transparent; border-radius: 2px; }
.rgx[data-game] .rgx-nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.rgx[data-game] .rgx-nav a[aria-current="page"] { background: #c9b48a; color: #1d160c; border-color: #efe2c2 #5b4c33 #5b4c33 #efe2c2; }
.rgx[data-game] .rgx-header .rgx-btn { background: #c9b48a; color: #1d160c; border: 2px solid; border-color: #efe2c2 #5b4c33 #5b4c33 #efe2c2; border-radius: 2px; }
.rgx[data-game] .rgx-card { border: 2px solid var(--navy); border-radius: 3px; box-shadow: inset 1px 1px 0 var(--bevel-hi), 4px 4px 0 var(--bevel-lo); }
.rgx[data-game] .rgx-btn { border-radius: 2px; border-width: 2px; box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo); }
.rgx[data-game] .rgx-btn:active { box-shadow: inset -1px -1px 0 var(--bevel-hi), inset 1px 1px 0 var(--bevel-lo); transform: translateY(1px); }
.rgx[data-game] .rgx-page-head h1::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .35em; background: var(--orange); box-shadow: .12em .12em 0 var(--navy); vertical-align: .08em; }
.rgx[data-game] .rgx-badge { font-family: var(--pixel); font-size: .62rem; border-radius: 0; }
.rgx[data-game] .rgx-footer { border-top: 3px solid var(--navy); }
.rgx-game-toggle[aria-pressed="true"] { color: var(--orange-ink); }
@media (max-width: 1180px) { .rgx[data-game] .rgx-nav a { font-size: .68rem; padding: 7px 8px; } }
@media (max-width: 960px) { .rgx[data-game] .rgx-nav.is-open { background: #13315c; } }
.rgx-labcard > svg { width: 30px; height: 30px; color: var(--orange-ink); }
.rgx-labcard { min-width: 0; }
@media (max-width: 520px) { .rgx-head-tools [data-rgx="palette"] { display: none; } .rgx-head-tools { gap: 4px; } .rgx-county-spot { font-size: .5rem; padding: 2px 3px; border-width: 1px; } }
/* contact profile */
.rgx-profile { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; margin-top: 8px; }
.rgx .rgx-profile-photo { width: 100%; height: auto; display: block; border: 3px solid var(--navy); border-radius: 3px; box-shadow: 4px 4px 0 var(--bevel-lo); }
.rgx-profile-kicker { font: 700 .7rem/1 var(--pixel); text-transform: uppercase; color: var(--orange-ink); margin: 0 0 6px; letter-spacing: .04em; }
.rgx-profile-body h2 { margin: 0 0 10px; font-size: 1.7rem; }
.rgx-profile-creds { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.rgx-profile-creds li { display: grid; gap: 2px; padding: 10px 12px; background: var(--canvas); border-left: 4px solid var(--teal); }
.rgx-profile-creds span { font-size: .82rem; color: var(--muted); }
.rgx-contact-topics { list-style: none; padding: 0; }
.rgx-section-tight { margin-top: 28px; }
@media (max-width: 640px) { .rgx-profile { grid-template-columns: 1fr; } .rgx .rgx-profile-photo { max-width: 220px; } }
/* Keep the expanded research navigation within the shared header. */
@media (max-width: 1500px) { .rgx .rgx-header .rgx-brand-sub { display: none; } }
@media (max-width: 1250px) {
  .rgx .rgx-header-in { gap: 12px; }
  .rgx .rgx-head-tools { margin-left: auto; }
  .rgx .rgx-menu-btn { display: inline-flex; }
  .rgx .rgx-nav { display: none; position: absolute; left: -16px; right: -16px; top: 100%; margin-left: 0; background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; box-shadow: var(--shadow-2); }
  .rgx .rgx-nav.is-open { display: flex; }
  .rgx .rgx-nav a { padding: 12px; }
  .rgx[data-game] .rgx-nav.is-open { background: #13315c; }
  .rgx-home .rgx-nav { background: var(--night); }
}
