/* ============================================================
   The Horizon BBS — "Modern Terminal" theme (retro-theme.css)
   Bootstrap 5 companion sheet. Replaces combined.min.css and
   hamburger-menu-modern.css (old files kept on disk).
   Palette per spec 2026-07-09; do not introduce new hues.
   ============================================================ */

/* ---- self-hosted fonts ---- */
@font-face {
  font-family: 'Web437 IBM VGA';
  src: url('../fonts/web437-ibm-vga-8x16.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---- design tokens: light mode on :root, dark under body.dark ---- */
:root {
  --hz-blue: #2E9AFE;
  --hz-blue-lt: #75b8f1;
  --hz-blue-hover: #A9E2F3;
  --hz-green: #82E0AA;
  --hz-orange: #F0B27A;
  --hz-downvote: #85C1E9;

  --hz-page: #f0f0f0;
  --hz-surface: #ffffff;
  --hz-surface-2: #f7f9fc;
  --hz-fg: #333333;
  --hz-fg-muted: #667788;
  --hz-heading: #222222;
  --hz-link: #1a7fe0;
  --hz-border: rgba(46, 154, 254, 0.45);
  --hz-border-soft: rgba(46, 154, 254, 0.25);
  --hz-prompt: #2e9a5e;

  --hz-glow-card: none;
  --hz-glow-btn: none;
  --hz-glow-text: none;

  --hz-hero-bg: linear-gradient(180deg, #dfeaf6, #c3d9f0 78%, #f0f0f0);
  --hz-hero-title: #223a55;
  --hz-star: #5a8fc0;

  --hz-font-display: 'Web437 IBM VGA', 'VT323', 'Courier New', monospace;
  --hz-font-body: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', 'Courier New', monospace;

  --hz-radius: 6px;
  --hz-transition: 200ms ease-in-out;
}
body.dark {
  --hz-page: #0d1117;
  --hz-surface: #10161f;
  --hz-surface-2: #0b1018;
  --hz-fg: #b9c8d8;
  --hz-fg-muted: #8aa4bd;
  --hz-heading: #e8f4fb;
  --hz-link: #75b8f1;
  --hz-border: rgba(46, 154, 254, 0.35);
  --hz-border-soft: rgba(46, 154, 254, 0.2);
  --hz-prompt: #82E0AA;

  --hz-glow-card: 0 0 14px rgba(46, 154, 254, 0.10);
  --hz-glow-btn: 0 0 10px rgba(46, 154, 254, 0.35), inset 0 0 10px rgba(46, 154, 254, 0.12);
  --hz-glow-text: 0 0 12px rgba(46, 154, 254, 0.6);

  --hz-hero-bg: linear-gradient(180deg, #020409, #0a1830 78%, #0d1117);
  --hz-hero-title: #ffffff;
  --hz-star: #A9E2F3;
}

/* ---- base ---- */
.hidden { display: none; }
html, body { overflow-x: hidden; }
body {
  padding-top: 70px;
  background-color: var(--hz-page);
  color: var(--hz-fg);
  font-family: var(--hz-font-body);
  font-size: 14px;
  line-height: 1.6;
  transition: background-color var(--hz-transition), color var(--hz-transition);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--hz-font-display);
  color: var(--hz-heading);
  text-shadow: var(--hz-glow-text);
  line-height: 1.25;
  letter-spacing: 1px;
}
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }
h5, h6 { font-size: 16px; }
a { color: var(--hz-link); text-decoration: none; }
a:hover { color: var(--hz-blue-hover); }
hr { border-color: var(--hz-border-soft); opacity: 1; }
::selection { background: var(--hz-blue); color: #03080f; }

/* terminal-flavored scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--hz-page); }
::-webkit-scrollbar-thumb { background: var(--hz-border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--hz-blue); }

/* ---- navbar ---- */
.navbar, .navbar.navbar-light, .navbar.bg-light {
  background-color: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(10px);
  border: none;
  border-bottom: 1px solid var(--hz-border);
  box-shadow: none;
}
body.dark .navbar, body.dark .navbar.navbar-light, body.dark .navbar.bg-light {
  background-color: rgba(13, 17, 23, 0.92) !important;
}
.navbar-brand {
  font-family: var(--hz-font-display);
  font-size: 22px;
  color: var(--hz-heading) !important;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  text-shadow: var(--hz-glow-text);
}
.navbar-brand::after {
  content: "\258A"; /* ▊ block cursor */
  color: var(--hz-blue);
  margin-left: 2px;
  animation: hz-blink 1.1s steps(1) infinite;
}
.navbar-brand .brand-icon { color: var(--hz-blue); margin-right: 6px; }
.navbar .nav-link {
  font-family: var(--hz-font-body);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--hz-fg-muted) !important;
}
.navbar .nav-link:hover, .navbar .nav-link:focus {
  color: var(--hz-blue) !important;
  text-shadow: var(--hz-glow-text);
}
.dropdown-menu {
  background-color: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  box-shadow: var(--hz-glow-card);
  padding: 6px 0;
}
.dropdown-item {
  font-family: var(--hz-font-body);
  font-size: 13px;
  color: var(--hz-fg);
  cursor: pointer;
}
.dropdown-item:hover, .dropdown-item:focus {
  background-color: var(--hz-surface-2);
  color: var(--hz-blue);
}
#button-logout { cursor: pointer; }
#login-form { min-width: 240px; }
#login-form .form-control { margin-bottom: 8px; }

/* ---- hero (home page, rendered full-width above the container) ---- */
.hz-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 34px;
  align-items: center;
  padding: 34px clamp(16px, 5vw, 64px) 44px;
  background: var(--hz-hero-bg);
  border-bottom: 1px solid var(--hz-border);
  margin-bottom: 24px;
}
.hz-hero-copy { flex: 1 1 320px; min-width: 0; position: relative; z-index: 2; }
.hz-title {
  font-family: var(--hz-font-display);
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  color: var(--hz-hero-title);
  letter-spacing: 3px;
  text-shadow: 0 0 16px rgba(46, 154, 254, 0.8);
}
.hz-sub {
  color: var(--hz-blue-lt);
  font-size: 13px;
  letter-spacing: 2px;
  margin: 10px 0 6px;
}
.hz-blurb { color: var(--hz-fg-muted); font-size: 13px; margin-bottom: 18px; }
.hz-btn {
  display: inline-block;
  font-family: var(--hz-font-display);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 1px solid var(--hz-blue);
  color: var(--hz-blue);
  background: transparent;
  border-radius: 4px;
  padding: 9px 22px;
  margin: 0 8px 8px 0;
  box-shadow: var(--hz-glow-btn);
  transition: all var(--hz-transition);
  cursor: pointer;
}
.hz-btn:hover { background: rgba(46, 154, 254, 0.15); color: var(--hz-blue-hover); }
.hz-btn-fill { background: var(--hz-blue); color: #03080f; font-weight: 600; }
.hz-btn-fill:hover { background: var(--hz-blue-lt); color: #03080f; }

/* CRT bezel + terminal: fits a native 640x400 (80x25) fTelnet canvas */
.hz-bezel {
  flex: 0 1 672px;
  min-width: 0;
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #1a2029, #10141b);
  border: 1px solid var(--hz-border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 0 26px rgba(46, 154, 254, 0.18);
}
.hz-term {
  background: #000;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  min-height: 200px;
}
/* scanlines live ONLY here, per the effects budget */
.hz-term::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
}
/* scale the fTelnet canvas proportionally, never crop */
.hz-term .fTelnetContainer { width: 100%; }
.hz-term canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
  image-rendering: pixelated;
}
.hz-leds { display: flex; gap: 6px; padding: 8px 4px 0; align-items: center; }
.hz-modlabel {
  font-size: 10px;
  color: #556677;
  letter-spacing: 2px;
  margin-right: auto;
  font-family: var(--hz-font-body);
}
.hz-led { width: 7px; height: 7px; border-radius: 50%; }
.hz-led-g { background: var(--hz-green); box-shadow: 0 0 6px var(--hz-green); }
.hz-led-o { background: var(--hz-orange); box-shadow: 0 0 6px var(--hz-orange); }

/* hero art: pixel starfield, ringed planet, glowing horizon line */
.hz-stars {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background-image:
    radial-gradient(1px 1px at 20px 30px, var(--hz-star) 50%, transparent 51%),
    radial-gradient(2px 2px at 80px 10px, var(--hz-blue) 50%, transparent 51%),
    radial-gradient(1px 1px at 130px 65px, var(--hz-hero-title) 50%, transparent 51%),
    radial-gradient(2px 2px at 190px 22px, var(--hz-blue-lt) 50%, transparent 51%),
    radial-gradient(1px 1px at 240px 85px, var(--hz-star) 50%, transparent 51%),
    radial-gradient(1px 1px at 300px 15px, var(--hz-hero-title) 50%, transparent 51%),
    radial-gradient(2px 2px at 350px 48px, var(--hz-blue) 50%, transparent 51%),
    radial-gradient(1px 1px at 410px 75px, var(--hz-star) 50%, transparent 51%);
  background-size: 440px 100px;
  image-rendering: pixelated;
}
.hz-star-tw {
  position: absolute; width: 2px; height: 2px;
  background: var(--hz-hero-title);
  animation: hz-blink 2.3s steps(1) infinite;
}
.hz-planet {
  position: absolute; left: 34%; top: 18px;
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #2a5aa0, #12294f 60%, #0a1830 85%);
  box-shadow: 0 0 24px rgba(46, 154, 254, 0.35), inset -10px -10px 0 rgba(0, 0, 0, 0.35);
  pointer-events: none; z-index: 1;
}
.hz-planet::after {
  content: ""; position: absolute; left: -14px; top: 28px;
  width: 92px; height: 11px; border-radius: 50%;
  border: 2px solid rgba(169, 226, 243, 0.5);
  transform: rotate(-14deg);
}
.hz-horizon {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46px;
  pointer-events: none; z-index: 1;
  background: radial-gradient(120% 90px at 50% 115%, rgba(46, 154, 254, 0.45), rgba(46, 154, 254, 0.12) 55%, transparent 75%);
}
.hz-horizon::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--hz-blue) 30%, var(--hz-blue-hover) 50%, var(--hz-blue) 70%, transparent);
  box-shadow: 0 0 12px rgba(46, 154, 254, 0.8);
}
@media (max-width: 999.98px) {
  .hz-hero { flex-direction: column; align-items: stretch; text-align: center; }
  .hz-bezel { flex-basis: auto; width: 100%; max-width: 672px; margin: 0 auto; }
}

/* ---- terminal cards (home content + generic) ---- */
.hz-card {
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  border-radius: var(--hz-radius);
  box-shadow: var(--hz-glow-card);
  margin-bottom: 16px;
  overflow: hidden;
}
.hz-card-hd {
  padding: 9px 14px;
  font-family: var(--hz-font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--hz-blue);
  border-bottom: 1px solid var(--hz-border-soft);
}
.hz-card-hd::before { content: "> "; color: var(--hz-prompt); }
.hz-card-bd { padding: 12px 14px; }
.hz-card-bd p:last-child { margin-bottom: 0; }
.hz-news-row { display: flex; gap: 12px; padding: 4px 0; }
.hz-news-date { color: var(--hz-orange); white-space: nowrap; font-size: 12px; padding-top: 1px; }

/* ---- sidebar widgets become terminal cards ---- */
#sidebar .list-group { gap: 16px; display: flex; flex-direction: column; }
#sidebar .list-group-item.sidebar {
  background: var(--hz-surface);
  border: 1px solid var(--hz-border) !important;
  border-radius: var(--hz-radius);
  box-shadow: var(--hz-glow-card);
  color: var(--hz-fg);
  padding: 0 0 8px;
  overflow: hidden;
}
#sidebar .list-group-item.sidebar > h4 {
  font-family: var(--hz-font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--hz-blue);
  text-shadow: none;
  border-bottom: 1px solid var(--hz-border-soft);
  padding: 9px 14px;
  margin: 0 0 8px;
}
#sidebar .list-group-item.sidebar > h4::before { content: "> "; color: var(--hz-prompt); }
#sidebar .list-group-item a { color: var(--hz-link); }
#sidebar .list-group-item a:hover { color: var(--hz-blue-hover); }
#sidebar table { margin-bottom: 4px; }

/* ---- footer as a terminal status line ---- */
footer {
  padding: 16px 0 26px;
  border-top: 1px solid var(--hz-border-soft);
  color: var(--hz-fg-muted);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
footer p { margin: 0; }

/* ---- buttons (Bootstrap) ---- */
.btn {
  font-family: var(--hz-font-display);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 4px;
  transition: all var(--hz-transition);
}
.btn-primary {
  background: var(--hz-blue);
  border-color: var(--hz-blue);
  color: #03080f;
  box-shadow: var(--hz-glow-btn);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--hz-blue-lt);
  border-color: var(--hz-blue-lt);
  color: #03080f;
}
.btn-default, .btn-secondary, .btn-outline-secondary {
  background: transparent;
  border: 1px solid var(--hz-border);
  color: var(--hz-fg);
}
.btn-default:hover, .btn-secondary:hover, .btn-outline-secondary:hover {
  border-color: var(--hz-blue);
  color: var(--hz-blue);
}
.btn-success { background: var(--hz-green); border-color: var(--hz-green); color: #03260f; }
.btn-danger { color: #fff; }

/* ---- badges ---- */
.badge {
  font-family: var(--hz-font-body);
  font-weight: 600;
  letter-spacing: 1px;
}
span.badge.new, .badge.bg-primary { background: var(--hz-blue) !important; color: #fff; }
.badge.scanned { background: var(--hz-orange); color: #03080f; }

/* ---- tables ---- */
.table { color: var(--hz-fg); border-color: var(--hz-border-soft); }
.table > :not(caption) > * > * { background: transparent; color: inherit; border-color: var(--hz-border-soft); }
.table th { color: var(--hz-heading); font-weight: 600; }
.table-condensed th, .table-condensed td { padding: 4px 8px; }
.striped:nth-of-type(even),
.table-striped > tbody > tr:nth-child(odd) > td,
.table-striped > tbody > tr:nth-child(odd) > th {
  background: var(--hz-surface-2);
}

/* ---- list groups (forum, files, games, mail) ---- */
.list-group-item {
  background: var(--hz-surface);
  border-color: var(--hz-border-soft);
  color: var(--hz-fg);
}
a.list-group-item, .list-group-item a { color: var(--hz-link); }
a.list-group-item:hover, a.list-group-item:active, li.list-group-item.mail:hover {
  background-color: rgba(46, 154, 254, 0.12);
  color: var(--hz-blue-hover);
}
a.list-group-item.scanned:hover { background-color: rgba(46, 154, 254, 0.12); }
/* mail read/unread states */
a.unread { background: var(--hz-surface); font-weight: 600; border-left: 3px solid var(--hz-blue); }
a.read { background: var(--hz-surface-2); }

/* ---- breadcrumbs & pagination ---- */
.breadcrumb {
  background: var(--hz-surface);
  border: 1px solid var(--hz-border-soft);
  border-radius: var(--hz-radius);
  padding: 8px 14px;
  font-family: var(--hz-font-body);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.breadcrumb-item + .breadcrumb-item::before { content: "/"; color: var(--hz-fg-muted); }
.page-link {
  background: var(--hz-surface);
  border-color: var(--hz-border-soft);
  color: var(--hz-link);
  font-family: var(--hz-font-body);
}
.page-item.active .page-link { background: var(--hz-blue); border-color: var(--hz-blue); color: #03080f; }

/* ---- games page: pills become launch chips ---- */
#xtrn-list .list-group-item { padding: 12px 14px; }
#xtrn-list h4 {
  font-family: var(--hz-font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--hz-blue);
  text-shadow: none;
}
#xtrn-list h4::before { content: "> "; color: var(--hz-prompt); }
#xtrn-list .nav-pills { display: flex; flex-wrap: wrap; gap: 8px; }
#xtrn-list .nav-pills a {
  display: inline-block;
  border: 1px solid var(--hz-border);
  border-radius: 4px;
  padding: 5px 12px;
  color: var(--hz-link);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--hz-transition);
}
#xtrn-list .nav-pills a:hover {
  border-color: var(--hz-blue);
  color: var(--hz-blue-hover);
  box-shadow: var(--hz-glow-btn);
}

/* ---- forms ---- */
.form-control, .form-select {
  background: var(--hz-surface-2);
  border: 1px solid var(--hz-border-soft);
  color: var(--hz-fg);
  font-family: var(--hz-font-body);
  border-radius: 4px;
}
.form-control:focus, .form-select:focus {
  background: var(--hz-surface-2);
  border-color: var(--hz-blue);
  color: var(--hz-fg);
  box-shadow: 0 0 0 0.2rem rgba(46, 154, 254, 0.25);
}
.form-control::placeholder { color: var(--hz-fg-muted); }
label, .form-label, .control-label { color: var(--hz-fg-muted); font-size: 12px; letter-spacing: 1px; }

/* ---- modals & alerts ---- */
.modal-content {
  background: var(--hz-surface);
  border: 1px solid var(--hz-border);
  color: var(--hz-fg);
}
.modal-header, .modal-footer { border-color: var(--hz-border-soft); }
.alert { border-radius: var(--hz-radius); font-family: var(--hz-font-body); }

/* ---- dark mode switch in navbar ---- */
.dark-mode-switch .form-check-input {
  cursor: pointer;
  background-color: #6c757d;
  border-color: var(--hz-border);
}
.dark-mode-switch .form-check-input:checked {
  background-color: var(--hz-blue);
  border-color: var(--hz-blue);
}
.navbar-darkswitch { background-color: transparent !important; }

/* ---- offcanvas sidebar behavior (ported from offcanvas.css) ---- */
@media screen and (max-width: 767px) {
  .sidebar-offcanvas { display: none; }
}

/* ---- accessibility: kill all animation on request ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes hz-blink { 50% { opacity: 0; } }

/* ---- hamburger menu (ported verbatim from hamburger-menu-modern.css) ---- */
/* Modern Hamburger Menu Design for WebV4 */
/* ======================================= */

/* CSS Custom Properties for Theming */
:root {
  /* Light Mode Colors */
  --hamburger-color: #333;
  --hamburger-hover-color: #000;
  --navbar-bg: #f8f9fa;
  --navbar-border: #dee2e6;
  --menu-bg: #ffffff;
  --menu-text: #333;
  --menu-hover-bg: #f8f9fa;
  --menu-shadow: rgba(0, 0, 0, 0.1);
  
  /* Animation Properties */
  --hamburger-animation-duration: 0.3s;
  --menu-animation-duration: 0.4s;
  
  /* Dimensions */
  --hamburger-size: 44px;
  --hamburger-line-height: 3px;
  --hamburger-line-spacing: 6px;
  --hamburger-padding: 10px;
}

/* Dark Mode Custom Properties */
body.dark {
  --hamburger-color: #f8f9fa;
  --hamburger-hover-color: #ffffff;
  --navbar-bg: #212529;
  --navbar-border: #495057;
  --menu-bg: #343a40;
  --menu-text: #f8f9fa;
  --menu-hover-bg: #495057;
  --menu-shadow: rgba(0, 0, 0, 0.3);
}

/* Hamburger Button Styling */
.navbar-toggler {
  position: relative;
  width: var(--hamburger-size);
  height: var(--hamburger-size);
  padding: var(--hamburger-padding);
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: all var(--hamburger-animation-duration) ease;
  overflow: visible;
  z-index: 1040;
}

/* Focus State */
.navbar-toggler:focus {
  outline: 2px solid var(--hamburger-color);
  outline-offset: 2px;
  box-shadow: none;
}

/* Remove Bootstrap's Default Icon */
.navbar-toggler-icon {
  display: none;
}

/* Custom Hamburger Lines Container */
.hamburger-lines {
  position: relative;
  display: block;
  width: 24px;
  height: 20px;
  margin: 0 auto;
}

/* Individual Hamburger Lines */
.hamburger-line {
  position: absolute;
  display: block;
  width: 100%;
  height: var(--hamburger-line-height);
  background: var(--hamburger-color);
  border-radius: 2px;
  transition: all var(--hamburger-animation-duration) cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-origin: center;
}

/* Line Positions */
.hamburger-line:nth-child(1) {
  top: 0;
}

.hamburger-line:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-line:nth-child(3) {
  bottom: 0;
}

/* Hover State */
.navbar-toggler:hover .hamburger-line {
  background: var(--hamburger-hover-color);
}

/* Active/Open State - Transform to X */
/* Note: Bootstrap adds 'collapsed' class when menu is CLOSED, not open */
.navbar-toggler:not(.collapsed) .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.navbar-toggler:not(.collapsed) .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.navbar-toggler:not(.collapsed) .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu Container */
@media (max-width: 991.98px) {
  .navbar-collapse {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--menu-bg);
    border-top: 1px solid var(--navbar-border);
    box-shadow: 0 4px 6px var(--menu-shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--menu-animation-duration) ease-in-out;
  }
  
  .navbar-collapse.show {
    max-height: calc(100vh - 56px);
    overflow-y: auto;
  }
  
  /* Menu Items */
  .navbar-nav {
    padding: 1rem 0;
  }
  
  .navbar-nav .nav-item {
    border-bottom: 1px solid var(--navbar-border);
  }
  
  .navbar-nav .nav-item:last-child {
    border-bottom: none;
  }
  
  .navbar-nav .nav-link {
    color: var(--menu-text);
    padding: 0.75rem 1.5rem;
    transition: background-color 0.2s ease;
  }
  
  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link:focus {
    background: var(--menu-hover-bg);
    color: var(--menu-text);
  }
  
  /* Dropdown Menus in Mobile */
  .navbar-nav .dropdown-menu {
    position: static;
    float: none;
    width: 100%;
    margin: 0;
    background: var(--menu-hover-bg);
    border: none;
    box-shadow: none;
  }
  
  .navbar-nav .dropdown-item {
    padding: 0.5rem 2.5rem;
    color: var(--menu-text);
  }
  
  .navbar-nav .dropdown-item:hover,
  .navbar-nav .dropdown-item:focus {
    background: var(--navbar-border);
  }
}

/* Smooth Scrolling for Mobile Menu */
@media (max-width: 991.98px) {
  .navbar-collapse {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Prevent body scroll when menu is open */
  body.navbar-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
}

/* Accessibility Improvements */
.navbar-toggler[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.05);
}

body.dark .navbar-toggler[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.05);
}

/* Screen Reader Text */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Keyboard Navigation Indicators */
.navbar-toggler:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible {
  outline: 2px solid var(--hamburger-color);
  outline-offset: 2px;
}

/* Animation Performance Optimization */
.hamburger-line,
.navbar-collapse,
.nav-link {
  will-change: transform, opacity, max-height;
}

/* Desktop Styles - Hide Hamburger */
@media (min-width: 992px) {
  .navbar-toggler {
    display: none;
  }
  
  .navbar-collapse {
    display: flex !important;
    position: static;
    max-height: none;
    box-shadow: none;
    border: none;
    background: transparent;
  }
  
  body.navbar-menu-open {
    overflow: auto;
    position: static;
  }
}

/* Fix for Bootstrap 5 Compatibility */
.navbar-expand-lg .navbar-toggler {
  display: block;
}

@media (min-width: 992px) {
  .navbar-expand-lg .navbar-toggler {
    display: none;
  }
}

/* Override Any Previous Hamburger Fixes */
.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  display: none !important;
}

/* Clean up old SVG background */
.navbar-toggler-icon {
  background-image: none !important;
}

/* Override problematic overflow-x from offcanvas.css */
@media (max-width: 991.98px) {
  /* Only hide overflow when menu is closed */
  body:not(.navbar-menu-open) {
    overflow-x: hidden;
  }
}

/* Ensure proper navbar spacing */
body {
  padding-top: 56px; /* Standard navbar height */
}

@media (min-width: 992px) {
  body {
    padding-top: 70px; /* Match existing desktop spacing */
  }
}
/* hamburger recolor to theme tokens (overrides ported rules above) */
.hamburger-line { background-color: var(--hz-fg) !important; }
.navbar-toggler:hover .hamburger-line { background-color: var(--hz-blue) !important; }
@media (max-width: 991.98px) {
  .navbar-collapse { background-color: var(--hz-surface); border: 1px solid var(--hz-border); border-radius: var(--hz-radius); }
}

/* ============================================================
   Post-review fixes (whole-branch review 2026-07-09)
   ============================================================ */

/* 1. Light-mode legibility: darker hover/date/sub tokens on :root,
      original bright values restored under body.dark */
:root {
  --hz-hover: #1a7fe0;
  --hz-date: #a35f1b;
  --hz-hero-sub: #2a5aa0;
}
body.dark {
  --hz-hover: #A9E2F3;
  --hz-date: #F0B27A;
  --hz-hero-sub: #75b8f1;
}
a:hover { color: var(--hz-hover); }
.hz-btn:hover { color: var(--hz-hover); }
a.list-group-item:hover, a.list-group-item:active, li.list-group-item.mail:hover { color: var(--hz-hover); }
.hz-news-date { color: var(--hz-date); }
.hz-sub { color: var(--hz-hero-sub); }

/* 2. Bootstrap .card surfaces (register, userlist, sbbslist) */
.card { background: var(--hz-surface); border: 1px solid var(--hz-border); color: var(--hz-fg); }
.card .card-title { color: var(--hz-heading); }
.card .card-header { background: var(--hz-surface-2); border-bottom: 1px solid var(--hz-border-soft); }

/* 3. Forum vote badges (classes emitted by 001-forum.ssjs) */
.upvote-bg { background: var(--hz-orange) !important; color: #03080f; }
.downvote-bg { background: var(--hz-downvote) !important; color: #03080f; }
.upvote-fg, .upvote:hover { color: var(--hz-orange); }
.downvote-fg, .downvote:hover { color: var(--hz-downvote); }

/* 4. Muted/status text on dark surfaces (BS5 defaults are near-invisible) */
body.dark .text-muted { color: var(--hz-fg-muted) !important; }
body.dark .text-danger { color: #f1948a !important; }
body.dark .text-success { color: var(--hz-green) !important; }

/* 5. Terminal-block rendering for message <pre> bodies (ANSI/CP437 posts
      are authored against a black background; .ansi needs line-height 1) */
pre { background: #000; color: #82E0AA; padding: 8px 10px; border-radius: 4px; overflow-x: auto; }
pre.ansi { line-height: 1; }

/* 6. Forum/mail control button spacing (ported .icon rule from legacy sheet) */
.icon { margin: 0 1em 1em 0; }
