/* Keep decoration behind readable content in both themes. */
body { --tS:#c6d2e3; }
body .scanlines { display:none; }
body .scan-band::after { display:none; }
body .tactical { background-color:#0e192c !important; }
body .text-slate-400, body .text-slate-500, body .text-slate-600,
body.theme-parallax .text-slate-400, body.theme-parallax .text-slate-500,
body.theme-parallax .text-slate-600 { color:#bdcbdf; }
body .bg-grid { opacity:.22; }
body input::placeholder, body textarea::placeholder { color:#a9bcd4; opacity:1; }
body button:disabled { cursor:not-allowed; }
body button:focus-visible, body a:focus-visible, body select:focus-visible { outline:2px solid #8feaff; outline-offset:3px; }
body .online-page { font-family:system-ui,"Microsoft YaHei",sans-serif; }
body .online-page .font-mono { font-family:inherit; letter-spacing:normal; }
body .online-page [class*="text-[9px]"], body .online-page [class*="text-[10px]"],
body .online-page [class*="text-[11px]"] { font-size:13px; line-height:1.65; }
.online-services { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr)); gap:14px; }
.online-service { background:#101e33; border:1px solid #36526c; border-radius:12px; padding:18px; display:flex; flex-direction:column; gap:10px; }
.online-service h3 { color:#f1f6ff; font-size:17px; font-weight:700; }
.online-service p { color:#c6d2e3; font-size:14px; line-height:1.7; flex:1; }
.online-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
body .online-actions button, body .online-actions a { border:1px solid #557695; border-radius:7px; padding:8px 12px; color:#eff8ff; background:#1d334b; font-size:14px; text-decoration:none; cursor:pointer; }
body .online-actions .primary { background:#114b63; border-color:#4acbdf; color:#d6fbff; }
.online-status { font-size:13px; color:#bcccdd; }
.online-status.online { color:#65e6a6; }
.online-status.offline { color:#fba6ad; }
.online-tags { display:flex; flex-wrap:wrap; gap:6px; color:#a6e8f3; font-size:12px; }
.online-tags span { border:1px solid #396279; border-radius:5px; padding:2px 6px; }
.server-summary-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr)); gap:8px; }
body .server-summary { display:flex; align-items:center; justify-content:space-between; gap:12px; text-align:left; padding:11px 13px; border:1px solid #38526c; border-radius:8px; background:#102037; color:#eaf3ff; font-size:14px; }
body .server-summary.active { border-color:#55dced; background:#124459; }
.server-summary small { color:#c1cfe0; font-size:12px; display:block; }
#olRoomsSection { scroll-margin-top:105px; }
.online-notice { color:#c5d3e4; font-size:13px; line-height:1.7; margin:12px 0; }
.online-room-filter { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:14px 0; }
.online-room-filter select { color:#eff6ff; background:#152a40; border:1px solid #53718d; padding:8px 12px; border-radius:6px; }
.support-link { display:inline-flex; align-items:center; gap:4px; border:1px solid #bb923f; border-radius:6px; color:#ffe2a0 !important; background:#4a371b !important; padding:4px 10px; font-size:13px; }
.portal-link { color:#c8efff; text-decoration:underline; text-underline-offset:3px; font-size:13px; }
body .support-dialog { width:min(94vw,470px); max-height:92dvh; overflow:auto; padding:22px; border:1px solid #967947; border-radius:16px; background:#101b2c; color:#f4f7fc; position:relative; box-shadow:0 25px 100px #0008; }
.support-dialog h2 { margin:0 36px 14px 0; font-size:19px; font-weight:700; }
.support-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
body .support-tabs button { color:#d8e5f6; background:#24374d; border:1px solid #56708c; border-radius:7px; padding:7px 10px; font-size:13px; }
body .support-tabs button[aria-selected="true"] { color:#ffe5aa; border-color:#e6b957; background:#49361a; }
.support-dialog figure { margin:0; }
.support-dialog img { display:block; width:100%; height:auto; max-height:58dvh; object-fit:contain; border-radius:5px; }
.support-dialog figcaption { font-size:14px; text-align:center; color:#e1eafa; margin:10px 0; }
.support-dialog .support-hint { color:#c1ccda; text-align:center; font-size:13px; }
.support-close { position:absolute; right:15px; top:12px; background:transparent; border:0; padding:4px 8px; color:#fff; font-size:24px; cursor:pointer; }
@media (max-width:600px) { .online-service { padding:15px; } .support-dialog { padding:18px; } }

/* Online view: one directory, with optional explanations next to their actions. */
body.is-online .site-hero { display:none; }
body.is-online #navStatus > span { display:none; }
body.is-online #view { padding-top:24px; }
.online-page .online-services { grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); }
.online-page .online-service { gap:8px; padding:16px; }
.online-page .online-service p { margin:0; }
.online-page .online-service h3 { margin:0; }
.online-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; }
.online-heading h1 { margin:0; }
.online-intro { margin:5px 0 0; }
.online-tools { display:flex; align-items:center; gap:16px; }
.online-help { border:1px solid currentColor; border-radius:8px; padding:0 14px; margin-top:14px; }
.online-help summary { cursor:pointer; padding:12px 0; }
.online-help[open] { padding-bottom:14px; }
.online-help p { margin:8px 0; }
.online-help summary:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
.online-developer-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:12px; margin-left:auto; max-width:100%; }
body .bvn-support-button { display:inline-flex; align-items:center; justify-content:center; flex:none; gap:6px; width:82px; height:34px; box-sizing:border-box; padding:6px 10px; border-radius:8px; font-family:system-ui,"Microsoft YaHei",sans-serif; font-size:14px; line-height:20px; letter-spacing:normal; white-space:nowrap; cursor:pointer; }
.bvn-support-button svg { display:block; flex:none; width:16px; height:16px; }
.bvn-support-button span { font-size:inherit; line-height:inherit; }
@media(max-width:600px) { body.is-online #view { padding:18px 12px 28px; } .online-tools { gap:12px; } }

/* BEGIN BVN COLOUR MODES — semantic colours shared by both appearances. */
html[data-theme="light"] {
  color-scheme:light;
  --ui-bg:#f3f6fb; --ui-panel:#ffffff; --ui-card:#f8fafd; --ui-field:#ffffff;
  --ui-text:#111111; --ui-muted:#333333; --ui-border:#bdccde;
  --ui-accent:#12618b; --ui-soft:#e7f2fa; --ui-primary:#14668f; --ui-on-primary:#ffffff;
  --ui-ok:#197247; --ui-danger:#b33143; --ui-warn:#875914;
  --ui-support:#fff4d9; --ui-support-text:#785117;
  --ui-shadow:0 8px 24px #2038580c; --ui-overlay:rgba(17,33,54,.45);
}
html[data-theme="dark"] {
  color-scheme:dark;
  --ui-bg:#080f1c; --ui-panel:#101c2e; --ui-card:#142237; --ui-field:#0d192b;
  --ui-text:#fafafa; --ui-muted:#e8e8e8; --ui-border:#405773;
  --ui-accent:#8cdfff; --ui-soft:#18384d; --ui-primary:#226684; --ui-on-primary:#ffffff;
  --ui-ok:#71dfad; --ui-danger:#ffadbc; --ui-warn:#f0c67e;
  --ui-support:#48361d; --ui-support-text:#ffe0a0;
  --ui-shadow:0 10px 28px #00000030; --ui-overlay:rgba(2,6,15,.8);
}
html[data-theme], html[data-theme] body {
  background:var(--ui-bg); color:var(--ui-text);
  --bg:var(--ui-bg); --panel:var(--ui-panel); --tP:var(--ui-text); --tS:var(--ui-muted);
  --hud:var(--ui-accent); --hud-bright:var(--ui-accent); --hud-blue:var(--ui-accent);
  --ok:var(--ui-ok); --warn:var(--ui-warn); --danger:var(--ui-danger);
}
html[data-theme] body :is(nav.sticky,footer,#mobileTabBar) {
  background:var(--ui-panel); color:var(--ui-muted); border-color:var(--ui-border);
}
html[data-theme] body :is(.tactical,.support-dialog) {
  background:var(--ui-panel) !important; color:var(--ui-text); border-color:var(--ui-border);
  box-shadow:var(--ui-shadow);
}
html[data-theme] body :is(.online-service,.online-help,.step-item,.server-summary) {
  background:var(--ui-card); border-color:var(--ui-border); color:var(--ui-text);
}
html[data-theme] body :is(.online-service h3,.online-help summary,.online-help strong,.support-dialog h2,.support-close) {
  color:var(--ui-text);
}
html[data-theme] body :is(.online-service p,.online-status,.online-intro,.online-notice,.online-help p,.online-credits,.support-hint,.support-dialog figcaption,.server-summary small,.mtab) {
  color:var(--ui-muted);
}
html[data-theme] body :is(.online-status.online,[class*="text-green-"],[class*="text-emerald-"]) { color:var(--ui-ok); }
html[data-theme] body :is(.online-status.offline,[class*="text-red-"],[class*="text-rose-"]) { color:var(--ui-danger); }
html[data-theme] body :is([class*="text-amber-"],[class*="text-orange-"],[class*="text-yellow-"]) { color:var(--ui-warn); }
html[data-theme] body :is(.online-tags,.portal-link,.online-credits a,[class*="text-cyan-"],[class*="text-sky-"]) { color:var(--ui-accent); }
html[data-theme] body :is([class*="text-slate-"],[class*="text-gray-"]) { color:var(--ui-muted); }
html[data-theme] body :is(.text-slate-100,.text-slate-200,.text-white,[class*="text-[#E5F2FF]"]) { color:var(--ui-text); }
html[data-theme] body :is([class*="bg-slate-"],[class*="bg-[#020617]"]) { background-color:var(--ui-card); }
html[data-theme] body :is([class*="bg-cyan-"],[class*="bg-sky-"]) { background-color:var(--ui-soft); }
html[data-theme] body :is([class*="border-cyan-"],[class*="border-slate-"],.online-tags span) { border-color:var(--ui-border); }
html[data-theme] body :is(input,select,textarea) {
  background:var(--ui-field); color:var(--ui-text); border-color:var(--ui-border);
  accent-color:var(--ui-primary);
}
html[data-theme] body :is(input,textarea)::placeholder { color:var(--ui-muted); opacity:1; }
html[data-theme] body :is(.online-actions button,.online-actions a,.support-tabs button) {
  background:var(--ui-soft); color:var(--ui-accent); border-color:var(--ui-border);
}
html[data-theme] body .online-actions .primary {
  background:var(--ui-primary); border-color:var(--ui-primary); color:var(--ui-on-primary);
}
html[data-theme] body :is(.nav-on,.mtab-on) { background:var(--ui-soft); color:var(--ui-accent); text-shadow:none; }
html[data-theme] body .server-summary.active { background:var(--ui-soft); border-color:var(--ui-accent); }
html[data-theme] body .holo-text { background:none; color:var(--ui-text); text-shadow:none; animation:none; }
html[data-theme] body .blink { animation:none; }
html[data-theme] body :is(.support-link,.support-tabs button[aria-selected="true"]) {
  background:var(--ui-support) !important; color:var(--ui-support-text) !important; border-color:var(--ui-warn);
}
html[data-theme] body #sponsorBtn { background:var(--ui-support); color:var(--ui-support-text); border-color:var(--ui-warn); }
html[data-theme] body #themeToggle {
  min-height:36px; min-width:78px; font-size:13px; letter-spacing:normal; white-space:nowrap;
  background:var(--ui-soft); color:var(--ui-accent); border-color:var(--ui-border);
}
html[data-theme] body :is(#accountModal,#sponsorModal) { background:var(--ui-overlay) !important; }
html[data-theme] body :is(button,a,summary,input,select,textarea):focus-visible { outline-color:var(--ui-accent); }
html[data-theme] body .toast { background:var(--ui-panel); color:var(--ui-text); }
html[data-theme] ::selection { background:var(--ui-accent); color:var(--ui-on-primary); }
html[data-theme] ::-webkit-scrollbar-track { background:var(--ui-bg); }
html[data-theme] ::-webkit-scrollbar-thumb { background:var(--ui-border); border-color:var(--ui-bg); }

/* Light mode uses restrained decoration; portraits and game assets keep their colours. */
html[data-theme="light"] body :is(.bg-fx,.scanlines,.corners>i,.radar),
html[data-theme="light"] body .corners::before,
html[data-theme="light"] body .scan-band::after { display:none; }
html[data-theme="light"] body :is(.hud-active,.nav-on,[class*="shadow-"]) { box-shadow:none; }
/* END BVN COLOUR MODES */

/* Keep server enter buttons readable after unified theme overrides. */
html body .online-actions a,
html body .online-actions button {
 min-height:36px;padding:8px 12px;font-size:14px !important;line-height:1.45 !important;
 font-weight:600;letter-spacing:0;opacity:1 !important;text-indent:0 !important;
 overflow:visible !important;clip-path:none !important;
}
html body .online-actions a.ol-host.primary {
 background:#14668f !important;color:#ffffff !important;-webkit-text-fill-color:#ffffff !important;
 border:1px solid #0e5474 !important;
}
html[data-theme="dark"] body .online-actions a.ol-host.primary,
html[data-bvn-theme="dark"] .online-actions a.ol-host.primary {
 background:#2a7ca0 !important;color:#ffffff !important;-webkit-text-fill-color:#ffffff !important;
 border-color:#4acbdf !important;
}
html body .online-actions button.ol-go {
 background:#e7f2fa !important;color:#12618b !important;-webkit-text-fill-color:#12618b !important;
 border:1px solid #bdccde !important;
}
html[data-theme="dark"] body .online-actions button.ol-go,
html[data-bvn-theme="dark"] .online-actions button.ol-go {
 background:#18384d !important;color:#8cdfff !important;-webkit-text-fill-color:#8cdfff !important;
 border-color:#405773 !important;
}

/* ===== handbook UI (merged; portal allowlist has no new CSS names) ===== */
/* 战术全书 · handbook UI
   Loaded last. Turns the leftover sci-fi HUD into a readable guidebook. */

:root {
  --hb-bg: #f3eee4;
  --hb-panel: #fffaf2;
  --hb-card: #f7f1e6;
  --hb-ink: #1c1914;
  --hb-muted: #5e574c;
  --hb-line: #d5ccbc;
  --hb-seal: #9d3b2a;
  --hb-seal-soft: #f3e0d4;
  --hb-gold: #8a6230;
  --hb-gold-soft: #f3e7cc;
  --hb-soft: #efe4d4;
  --hb-ok: #2f6b45;
  --hb-danger: #b33143;
  --hb-warn: #8a5a18;
  --hb-shadow: 0 14px 36px rgba(48, 36, 20, 0.08);
  --hb-shadow-sm: 0 4px 14px rgba(48, 36, 20, 0.06);
  --hb-radius: 16px;
  --hb-font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
}

html[data-theme="dark"],
html[data-bvn-theme="dark"] {
  --hb-bg: #10141b;
  --hb-panel: #181e28;
  --hb-card: #1c232e;
  --hb-ink: #f1e8d8;
  --hb-muted: #b7ae9e;
  --hb-line: #3a4352;
  --hb-seal: #e0b36a;
  --hb-seal-soft: #2c2418;
  --hb-gold: #e0b36a;
  --hb-gold-soft: #2c2418;
  --hb-soft: #222833;
  --hb-ok: #7ed0a4;
  --hb-danger: #ffadb8;
  --hb-warn: #f0c67e;
  --hb-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
  --hb-shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.22);
}

html[data-theme="light"],
html[data-bvn-theme="light"],
html[data-theme="dark"],
html[data-bvn-theme="dark"] {
  --ui-bg: var(--hb-bg);
  --ui-panel: var(--hb-panel);
  --ui-card: var(--hb-card);
  --ui-field: var(--hb-panel);
  --ui-text: var(--hb-ink);
  --ui-muted: var(--hb-muted);
  --ui-border: var(--hb-line);
  --ui-accent: var(--hb-seal);
  --ui-soft: var(--hb-soft);
  --ui-primary: var(--hb-seal);
  --ui-on-primary: #fffaf2;
  --ui-ok: var(--hb-ok);
  --ui-danger: var(--hb-danger);
  --ui-warn: var(--hb-warn);
  --ui-support: var(--hb-gold-soft);
  --ui-support-text: var(--hb-gold);
  --ui-shadow: var(--hb-shadow);
  --bvn-bg: var(--hb-bg);
  --bvn-panel: var(--hb-panel);
  --bvn-card: var(--hb-card);
  --bvn-field: var(--hb-panel);
  --bvn-text: var(--hb-ink);
  --bvn-muted: var(--hb-muted);
  --bvn-line: var(--hb-line);
  --bvn-accent: var(--hb-seal);
  --bvn-soft: var(--hb-soft);
  --bvn-primary: var(--hb-seal);
  --bvn-on-primary: #fffaf2;
  --bvn-gold: var(--hb-gold);
  --bvn-gold-soft: var(--hb-gold-soft);
  --bvn-danger: var(--hb-danger);
  --bvn-ok: var(--hb-ok);
  --bvn-shadow: var(--hb-shadow);
}

html[data-theme="dark"],
html[data-bvn-theme="dark"] {
  --ui-on-primary: #1a140c;
  --bvn-on-primary: #1a140c;
}

html, body {
  background: var(--hb-bg) !important;
  color: var(--hb-ink) !important;
}

body,
body.font-mono,
body.hb-app {
  font-family: var(--hb-font) !important;
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body .font-mono,
body .mono,
#view .font-mono,
#navModes,
#navStatus,
#mobileTabBar {
  font-family: var(--hb-font) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body [class*="uppercase"],
body [class*="tracking-widest"],
body [class*="tracking-wider"],
body [class*="tracking-wide"] {
  letter-spacing: 0.01em !important;
  text-transform: none !important;
}

body [class*="text-[9px]"],
body [class*="text-[10px]"],
body [class*="text-[11px]"] {
  font-size: 13px !important;
  line-height: 1.55 !important;
}

/* ---- hide leftover HUD décor ---- */
body .bg-fx,
body .scanlines,
body .corners > i,
body .radar,
body .corners::before,
body .scan-band::after,
body .holo-text,
.hud-active::before,
#navModes button::after {
  display: none !important;
}

body .holo-text {
  display: block !important;
  background: none !important;
  color: var(--hb-ink) !important;
  -webkit-text-fill-color: var(--hb-ink);
  animation: none !important;
}

body .blink { animation: none !important; }

/* ---- brand / chrome ---- */
.hb-seal {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--hb-seal);
  color: var(--hb-seal);
  border-radius: 9px;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  background: var(--hb-seal-soft);
  flex: none;
}

.hb-seal-lg {
  width: 72px;
  height: 72px;
  font-size: 32px;
  border-radius: 18px;
  border-width: 2px;
}

.hb-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--hb-ink) !important;
  text-decoration: none;
  font-weight: 700;
}

.hb-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.hb-brand-text strong {
  font-size: 16px;
  font-weight: 750;
}

.hb-brand-text small,
.hb-kicker {
  font-size: 11px;
  font-weight: 600;
  color: var(--hb-muted);
  letter-spacing: 0.08em;
}

.hb-nav,
body > nav.sticky,
body > nav.fixed.top-0,
html[data-theme] body :is(nav.sticky),
html[data-bvn-theme] body > nav.fixed {
  background: color-mix(in srgb, var(--hb-panel) 88%, transparent) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--hb-line) !important;
  color: var(--hb-ink) !important;
  box-shadow: none !important;
}

.hb-nav-inner,
body > nav.sticky > div,
body > nav.fixed.top-0 > div {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 20px;
}

.hb-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hb-nav-link,
button.hb-nav-link,
html[data-bvn-theme] body button.hb-nav-link,
html[data-theme] body button.hb-nav-link,
body > nav a.hud-active {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 12px;
  border: 1px solid var(--hb-line) !important;
  border-radius: 999px !important;
  background: var(--hb-panel) !important;
  color: var(--hb-ink) !important;
  text-decoration: none;
  font-size: 13px !important;
  font-weight: 600;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.hb-nav-link:hover,
body > nav a.hud-active:hover {
  border-color: var(--hb-seal) !important;
  color: var(--hb-seal) !important;
  background: var(--hb-seal-soft) !important;
}

.hb-modes,
#navModes {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--hb-soft);
  border: 1px solid var(--hb-line);
  border-radius: 999px;
}

#navModes button,
.hb-mode,
html[data-bvn-theme] body #navModes button,
html[data-theme] body #navModes button {
  appearance: none;
  border: 0 !important;
  background: transparent !important;
  color: var(--hb-muted) !important;
  min-height: 34px;
  padding: 6px 14px !important;
  border-radius: 999px !important;
  font-family: var(--hb-font) !important;
  font-size: 13px !important;
  font-weight: 650;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: none !important;
  animation: none !important;
  cursor: pointer;
}

#navModes button:hover,
.hb-mode:hover {
  color: var(--hb-ink) !important;
  background: color-mix(in srgb, var(--hb-panel) 70%, transparent) !important;
}

#navModes button.nav-on,
#navModes button.is-on,
.hb-mode.is-on,
html[data-theme] body #navModes button.nav-on,
html[data-bvn-theme] body #navModes button.nav-on {
  background: var(--hb-panel) !important;
  color: var(--hb-ink) !important;
  box-shadow: var(--hb-shadow-sm) !important;
}

.hb-nav-tools,
#navStatus {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--hb-muted);
  font-size: 12px;
}

#navStatus > span {
  font-size: 12px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

#clock { font-variant-numeric: tabular-nums; opacity: 0.7; }

#acctBtn,
html[data-bvn-theme] body #acctBtn,
html[data-theme] body #acctBtn {
  min-height: 34px;
  padding: 4px 12px !important;
  border: 1px solid var(--hb-line) !important;
  border-radius: 999px !important;
  background: var(--hb-panel) !important;
  color: var(--hb-ink) !important;
  font-size: 13px !important;
  font-weight: 650;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

html[data-bvn-theme] body #bvn-theme-control,
html[data-theme] body #bvn-theme-control {
  background: var(--hb-panel) !important;
  border: 1px solid var(--hb-line) !important;
  border-radius: 999px !important;
  color: var(--hb-muted) !important;
  padding: 2px 8px 2px 12px !important;
}

html[data-bvn-theme] body #sponsorBtn,
html[data-theme] body #sponsorBtn,
html[data-bvn-theme] body .bvn-support-button,
html[data-theme] body .bvn-support-button {
  background: var(--hb-gold-soft) !important;
  color: var(--hb-gold) !important;
  border: 1px solid color-mix(in srgb, var(--hb-gold) 45%, var(--hb-line)) !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}

/* ---- hero / footer ---- */
.site-hero,
.hb-hero {
  position: relative;
  background: transparent !important;
  border: 0 !important;
  padding: 28px 24px 4px !important;
  color: var(--hb-ink) !important;
}

.site-hero .max-w-7xl,
.hb-hero .hb-hero-inner {
  max-width: 72rem;
  margin: 0 auto;
}

.site-hero p:first-child,
.hb-kicker {
  margin: 0 0 6px;
  color: var(--hb-seal);
  font-size: 12px;
  font-weight: 700;
}

.site-hero h1,
.hb-hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 780;
  letter-spacing: -0.02em;
  color: var(--hb-ink) !important;
  line-height: 1.2;
}

.site-hero p:last-of-type,
.hb-lede {
  margin: 10px 0 0;
  max-width: 36rem;
  color: var(--hb-muted);
  font-size: 15px;
  line-height: 1.7;
}

body.is-online .site-hero { display: none !important; }

#view,
.hb-main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 22px 20px 48px;
  position: relative;
  z-index: 1;
}

body.is-online #view { padding-top: 20px; }

.hb-foot,
body > footer:not(.fixed) {
  background: transparent !important;
  border-top: 1px solid var(--hb-line) !important;
  color: var(--hb-muted) !important;
  padding: 22px 20px 36px !important;
  box-shadow: none !important;
}

.hb-foot > div,
body > footer:not(.fixed) > div {
  max-width: 72rem;
  margin: 0 auto;
}

.hb-foot span,
body > footer:not(.fixed) span {
  font-family: var(--hb-font) !important;
  font-size: 13px !important;
  letter-spacing: 0 !important;
  color: var(--hb-muted) !important;
}

/* ---- cards / panels ---- */
.hb-card,
body .tactical,
body .corners.tactical,
html[data-theme] body .tactical,
html[data-bvn-theme] body .tactical,
body .admin-panel,
html[data-bvn-theme] body .admin-panel {
  background: var(--hb-panel) !important;
  color: var(--hb-ink) !important;
  border: 1px solid var(--hb-line) !important;
  border-radius: var(--hb-radius) !important;
  box-shadow: var(--hb-shadow) !important;
  backdrop-filter: none !important;
  padding: 22px;
}

body .corners.tactical { padding: 22px !important; }

body .tactical h1,
body .tactical h2,
body .tactical h3,
.online-heading h1 {
  color: var(--hb-ink) !important;
  letter-spacing: -0.02em;
  font-weight: 750;
}

.online-heading h1 { font-size: 26px; margin: 0; }
.online-intro,
.online-notice { color: var(--hb-muted) !important; }

.online-developer {
  background: var(--hb-soft) !important;
  border: 1px solid var(--hb-line) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  padding: 12px 14px !important;
}

.online-service,
.server-summary,
.online-help,
.step-item,
html[data-theme] body :is(.online-service, .online-help, .step-item, .server-summary) {
  background: var(--hb-card) !important;
  border: 1px solid var(--hb-line) !important;
  border-radius: 14px !important;
  box-shadow: none;
}

.online-service { padding: 18px !important; }
.online-service h3 { font-size: 17px; font-weight: 750; color: var(--hb-ink) !important; }
.online-service p { color: var(--hb-muted) !important; }

.server-summary.active {
  background: var(--hb-seal-soft) !important;
  border-color: var(--hb-seal) !important;
}

/* ---- buttons / fields ---- */
html[data-bvn-theme] body #view button:not(.chip):not(.mtab),
html[data-theme] body #view button:not(.chip):not(.mtab),
html[data-bvn-theme] body button.hud-active:not(.chip),
html[data-theme] body button.hud-active:not(.chip),
html[data-bvn-theme] body .ol-cat,
html[data-theme] body .ol-cat,
body #view button:not(.chip):not(.mtab) {
  font-family: var(--hb-font) !important;
  font-size: 13px !important;
  font-weight: 650;
  letter-spacing: 0 !important;
  text-transform: none !important;
  min-height: 36px;
  padding: 6px 12px !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  animation: none !important;
  background: var(--hb-soft) !important;
  color: var(--hb-ink) !important;
  border: 1px solid var(--hb-line) !important;
}

html[data-bvn-theme] body #view button:not(.chip):hover,
html[data-theme] body #view button:not(.chip):hover,
html[data-bvn-theme] body button.hud-active:not(.chip):hover {
  background: var(--hb-card) !important;
  border-color: var(--hb-seal) !important;
}

html[data-bvn-theme] body #view button[class*="bg-cyan-"]:not(.chip),
html[data-theme] body #view button[class*="bg-cyan-"]:not(.chip),
html[data-bvn-theme] body button.hud-active[class*="bg-cyan-"]:not(.chip),
html[data-bvn-theme] body .online-actions a.ol-host.primary,
html[data-theme] body .online-actions a.ol-host.primary,
html body .online-actions a.ol-host.primary {
  background: var(--hb-seal) !important;
  color: #fffaf2 !important;
  -webkit-text-fill-color: #fffaf2 !important;
  border-color: var(--hb-seal) !important;
}

html[data-theme="dark"] body .online-actions a.ol-host.primary,
html[data-bvn-theme="dark"] .online-actions a.ol-host.primary {
  color: #1a140c !important;
  -webkit-text-fill-color: #1a140c !important;
}

html[data-bvn-theme] body #view button[class*="bg-green-"]:not(.chip),
html[data-theme] body #view button[class*="bg-green-"]:not(.chip) {
  background: color-mix(in srgb, var(--hb-ok) 16%, var(--hb-panel)) !important;
  color: var(--hb-ok) !important;
  border-color: color-mix(in srgb, var(--hb-ok) 40%, var(--hb-line)) !important;
}

html[data-bvn-theme] body #view button[class*="text-red-"]:not(.chip),
html[data-bvn-theme] body #view button[class*="border-red-"]:not(.chip) {
  color: var(--hb-danger) !important;
}

html[data-bvn-theme] body input,
html[data-bvn-theme] body select,
html[data-bvn-theme] body textarea,
html[data-theme] body input,
html[data-theme] body select,
html[data-theme] body textarea,
body input, body select, body textarea {
  background: var(--hb-panel) !important;
  color: var(--hb-ink) !important;
  border: 1px solid var(--hb-line) !important;
  border-radius: 10px !important;
  font-family: var(--hb-font) !important;
  font-size: 14px !important;
  min-height: 40px;
  padding: 8px 12px;
}

body input:focus,
body select:focus,
body textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--hb-seal) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--hb-seal) !important;
}

/* subtabs (sandbox / workshop / figure filters) */
#view > .max-w-7xl.mb-4,
.hb-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 auto 16px;
}

#view > .max-w-7xl.mb-4 button,
html[data-bvn-theme] body #view > .max-w-7xl.mb-4 button {
  border-radius: 999px !important;
  min-height: 38px;
  padding: 7px 16px !important;
}

#view > .max-w-7xl.mb-4 button[class*="bg-cyan-"],
html[data-bvn-theme] body #view > .max-w-7xl.mb-4 button[class*="bg-cyan-"] {
  background: var(--hb-seal) !important;
  color: #fffaf2 !important;
  border-color: var(--hb-seal) !important;
}

html[data-theme="dark"] body #view > .max-w-7xl.mb-4 button[class*="bg-cyan-"],
html[data-bvn-theme="dark"] body #view > .max-w-7xl.mb-4 button[class*="bg-cyan-"] {
  color: #1a140c !important;
}

/* ---- chips / portraits ---- */
body .chip,
html[data-bvn-theme] body button.chip {
  border-radius: 12px !important;
  overflow: hidden;
  background: var(--hb-card) !important;
  border: 1px solid var(--hb-line) !important;
  box-shadow: var(--hb-shadow-sm);
  min-height: 0 !important;
  padding: 0 !important;
}

body .chip:hover {
  transform: translateY(-2px);
  border-color: var(--hb-seal) !important;
}

body .chip-icon { background: #14110d; }
body .chip-fallback {
  color: var(--hb-gold);
  text-shadow: none;
  font-family: var(--hb-font);
}

body .chip.pending,
body .pal-sel {
  outline: 2px solid var(--hb-seal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hb-seal) 22%, transparent);
}

[data-slot].drag-over {
  border-color: var(--hb-seal) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hb-seal) 20%, transparent) !important;
}

/* ---- mobile tabs ---- */
#mobileTabBar,
html[data-theme] body #mobileTabBar {
  background: color-mix(in srgb, var(--hb-panel) 94%, transparent) !important;
  border-top: 1px solid var(--hb-line) !important;
  box-shadow: 0 -10px 28px rgba(28, 25, 20, 0.08) !important;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  gap: 4px;
}

.mtab,
html[data-theme] body .mtab,
html[data-bvn-theme] body .mtab {
  background: transparent !important;
  border: 0 !important;
  border-radius: 12px;
  color: var(--hb-muted) !important;
  font-family: var(--hb-font) !important;
  min-height: 56px;
  box-shadow: none !important;
}

.mtab-label {
  font-size: 12px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  font-weight: 650;
}

.mtab-on,
html[data-theme] body .mtab-on,
html[data-bvn-theme] body .mtab-on {
  background: var(--hb-seal-soft) !important;
  color: var(--hb-seal) !important;
  text-shadow: none !important;
}

.mtab-on .mtab-ico::after { display: none !important; }

/* ---- tutorial / deck slides ---- */
body > footer.fixed {
  background: color-mix(in srgb, var(--hb-panel) 90%, transparent) !important;
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--hb-line) !important;
  color: var(--hb-ink) !important;
}

#stage { color: var(--hb-ink); padding: 72px 16px 88px; box-sizing: border-box; }

body > footer #nextBtn,
html[data-bvn-theme] body > footer #nextBtn,
html[data-theme] body > footer #nextBtn {
  background: var(--hb-seal) !important;
  color: #fffaf2 !important;
  border: 1px solid var(--hb-seal) !important;
  border-radius: 999px !important;
  min-height: 34px;
  padding: 4px 14px !important;
  font-weight: 700;
}

html[data-theme="dark"] body > footer #nextBtn,
html[data-bvn-theme="dark"] body > footer #nextBtn {
  color: #1a140c !important;
}

.deck-page h1,
#stage h1 {
  font-family: var(--hb-font) !important;
  letter-spacing: -0.03em !important;
}

.step-item {
  padding: 18px !important;
}

.kbd {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  border: 1px solid var(--hb-line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--hb-ink);
  background: var(--hb-card);
}

.progress-track {
  background: var(--hb-soft) !important;
  border: 1px solid var(--hb-line) !important;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  background: var(--hb-seal) !important;
  box-shadow: none !important;
}

.progress-fill::after { display: none !important; }

.case-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--hb-seal);
  color: #fffaf2;
  font-size: 11px;
  font-weight: 700;
}

.hb-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 28px 12px;
}

.hb-cover h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--hb-ink) !important;
}

.flow-node::after {
  background: linear-gradient(90deg, var(--hb-line), transparent) !important;
}

.timeline::before {
  background: linear-gradient(180deg, var(--hb-seal), transparent) !important;
}

/* ---- account / toast / misc ---- */
#accountModal { background: rgba(20, 16, 12, 0.46) !important; }

#accountModal .tactical,
#accountModal .hb-card {
  max-width: 26rem;
  width: calc(100% - 28px);
}

.toast {
  font-family: var(--hb-font) !important;
  background: var(--hb-panel) !important;
  color: var(--hb-ink) !important;
  border: 1px solid var(--hb-line);
  border-left: 3px solid var(--hb-seal);
  border-radius: 12px;
  box-shadow: var(--hb-shadow);
}

.rv-slider {
  background: linear-gradient(90deg, var(--hb-gold), var(--hb-seal));
  box-shadow: none;
}

.rv-slider::-webkit-slider-thumb,
.rv-slider::-moz-range-thumb {
  background: var(--hb-seal);
  border: 2px solid var(--hb-panel);
  box-shadow: var(--hb-shadow-sm);
}

body .support-dialog {
  background: var(--hb-panel) !important;
  color: var(--hb-ink) !important;
  border-color: var(--hb-line) !important;
  border-radius: 18px !important;
}

html[data-theme] body :is([class*="text-cyan-"], [class*="text-sky-"], .portal-link) {
  color: var(--hb-seal);
}

html[data-theme] body :is([class*="text-slate-"], [class*="text-gray-"]) {
  color: var(--hb-muted);
}

html[data-theme] body :is(.text-slate-100, .text-slate-200, .text-white, [class*="text-[#E5F2FF]"]) {
  color: var(--hb-ink);
}

html[data-theme] body :is([class*="bg-slate-"], [class*="bg-[#020617]"]) {
  background-color: var(--hb-card);
}

html[data-theme] body :is([class*="border-cyan-"], [class*="border-slate-"]) {
  border-color: var(--hb-line);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--hb-bg); }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--hb-line) 80%, var(--hb-muted));
  border: 2px solid var(--hb-bg);
  border-radius: 8px;
}

::selection {
  background: color-mix(in srgb, var(--hb-seal) 28%, transparent);
  color: var(--hb-ink);
}

@media (max-width: 1023px) {
  #view, .hb-main { padding-bottom: 6.5rem; }
  .hb-brand-text small { display: none; }
}

@media (max-width: 600px) {
  .hb-nav-inner,
  body > nav.sticky > div,
  body > nav.fixed.top-0 > div {
    padding: 8px 12px;
  }
  #view, .hb-main { padding: 16px 12px 6.5rem; }
  body .corners.tactical { padding: 16px !important; }
  .site-hero, .hb-hero { padding: 18px 12px 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
