/* ==========================================================================
   ERRORWARE BBS — 16-Color VGA ANSI & CRT Display Stylesheet
   ========================================================================== */

:root {
  /* Authentic IBM VGA 16-color ANSI Palette */
  --c-black:    #050608;
  --c-blue:     #0000aa;
  --c-green:    #00aa00;
  --c-cyan:     #00aaaa;
  --c-red:      #aa0000;
  --c-magenta:  #aa00aa;
  --c-brown:    #aa5500;
  --c-gray:     #b2b6be;

  --c-dgray:    #585c66;
  --c-bblue:    #5577ff;
  --c-bgreen:   #55ff55;
  --c-bcyan:    #55ffff;
  --c-bred:     #ff5555;
  --c-bmagenta: #ff55ff;
  --c-yellow:   #ffff55;
  --c-bwhite:   #ffffff;

  --screen-bg:  #04060a;
  --bar-bg:     #0000aa;
  --bar-fg:     #ffffff;
  --input-bg:   #000066;
  --hover-bg:   #00aaaa;
  --hover-fg:   #000000;
  --box-bg:     rgba(0, 0, 22, 0.28);
  --box-ring:   rgba(0, 0, 170, 0.35);
  --msg-hdr-bg: rgba(0, 0, 170, 0.32);
  --prompt-bg:  rgba(0, 0, 40, 0.55);
  --glow-rgb:   85, 255, 255;

  --font-mono:  'IBM Plex Mono', 'Cascadia Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Optional P3 Amber Phosphor Monochrome Mode */
body.theme-amber {
  --c-black:    #0a0600;
  --c-blue:     #5c3200;
  --c-green:    #b86e00;
  --c-cyan:     #d98600;
  --c-red:      #ff6b00;
  --c-magenta:  #e08e1b;
  --c-brown:    #8a4f00;
  --c-gray:     #e8a638;

  --c-dgray:    #996214;
  --c-bblue:    #f0a429;
  --c-bgreen:   #ffbe42;
  --c-bcyan:    #ffc857;
  --c-bred:     #ff851b;
  --c-bmagenta: #ffb338;
  --c-yellow:   #ffe08a;
  --c-bwhite:   #ffebb3;

  --screen-bg:  #090500;
  --bar-bg:     #a85d00;
  --bar-fg:     #0a0600;
  --input-bg:   #241300;
  --hover-bg:   #ffb000;
  --hover-fg:   #090500;
  --box-bg:     rgba(46, 24, 0, 0.28);
  --box-ring:   rgba(168, 93, 0, 0.35);
  --msg-hdr-bg: rgba(110, 60, 0, 0.32);
  --prompt-bg:  rgba(38, 20, 0, 0.6);
  --glow-rgb:   255, 176, 0;
}

/* Optional P1 Green Phosphor Monochrome Mode */
body.theme-green {
  --c-black:    #010a03;
  --c-blue:     #0b4d1d;
  --c-green:    #1bb846;
  --c-cyan:     #27d458;
  --c-red:      #7aff8f;
  --c-magenta:  #3be06a;
  --c-brown:    #13752d;
  --c-gray:     #56e67e;

  --c-dgray:    #2a8543;
  --c-bblue:    #44e66f;
  --c-bgreen:   #66ff8c;
  --c-bcyan:    #80ff9f;
  --c-bred:     #a6ffba;
  --c-bmagenta: #6eff93;
  --c-yellow:   #b8ffca;
  --c-bwhite:   #dcffe4;

  --screen-bg:  #020a04;
  --bar-bg:     #127a2e;
  --bar-fg:     #020a04;
  --input-bg:   #062610;
  --hover-bg:   #44ff77;
  --hover-fg:   #020a04;
  --box-bg:     rgba(6, 38, 14, 0.32);
  --box-ring:   rgba(18, 122, 46, 0.35);
  --msg-hdr-bg: rgba(14, 88, 34, 0.34);
  --prompt-bg:  rgba(5, 32, 12, 0.62);
  --glow-rgb:   68, 255, 119;
}

/* --------------------------------------------------------------------------
   Reset & Desk Backdrop
   -------------------------------------------------------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: #06070a;
  color: var(--c-gray);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  position: relative;
}

.desk-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(var(--glow-rgb), 0.08) 0%, rgba(10, 12, 18, 0.92) 55%, #030406 100%);
  pointer-events: none;
  z-index: 0;
  transition: background 0.35s ease;
}

/* --------------------------------------------------------------------------
   CRT Monitor Hardware Enclosure
   -------------------------------------------------------------------------- */

.monitor-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 940px);
  height: min(100%, 760px);
  max-height: calc(100dvh - 28px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1d2027 0%, #15171d 12%, #111318 88%, #181b22 100%);
  border: 1px solid #2a2e38;
  border-radius: 18px;
  padding: 10px 14px 10px 14px;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.88),
    0 0 80px rgba(var(--glow-rgb), 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 4px rgba(0, 0, 0, 0.65);
}

.monitor-bezel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 8px 6px;
  user-select: none;
}

.bezel-vents {
  display: flex;
  gap: 5px;
}

.bezel-vents span {
  display: block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: #0a0b0e;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.05);
}

.bezel-model {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: #5b6170;
  text-transform: uppercase;
}

/* Recessed Bevel Around Glass */
.crt-recess {
  flex: 1;
  min-height: 0;
  background: #07080b;
  border-radius: 14px;
  padding: 7px;
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, 0.95),
    inset 0 0 0 1px #030305,
    0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
}

/* The Curved Glass Tube */
.crt-glass {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--screen-bg);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.75);
}

body.crt-on .crt-glass {
  box-shadow:
    inset 0 0 55px rgba(0, 0, 0, 0.85),
    inset 0 0 14px rgba(var(--glow-rgb), 0.12);
}

/* CRT Power-On Warmup Animation */
body.crt-on .crt-glass.crt-boot {
  animation: crtPowerOn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes crtPowerOn {
  0% {
    transform: scaleY(0.008) scaleX(0.18);
    filter: brightness(4);
  }
  42% {
    transform: scaleY(0.015) scaleX(1);
    filter: brightness(2.6);
  }
  100% {
    transform: scaleY(1) scaleX(1);
    filter: brightness(1);
  }
}

/* CRT Optical Overlay Layers */
.crt-scanlines,
.crt-beam,
.crt-vignette,
.crt-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.crt-on .crt-scanlines {
  z-index: 30;
  opacity: 1;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 1.5px,
      rgba(0, 0, 0, 0.32) 2px,
      rgba(0, 0, 0, 0.32) 3px
    ),
    repeating-linear-gradient(
      to right,
      rgba(255, 0, 0, 0.025) 0px,
      rgba(0, 255, 0, 0.025) 1px,
      rgba(0, 128, 255, 0.025) 2px
    );
}

body.crt-on .crt-beam {
  z-index: 31;
  opacity: 1;
  background: linear-gradient(
    to bottom,
    rgba(var(--glow-rgb), 0) 0%,
    rgba(var(--glow-rgb), 0.045) 50%,
    rgba(var(--glow-rgb), 0) 100%
  );
  height: 18%;
  top: -20%;
  animation: crtBeam 7.5s linear infinite;
}

@keyframes crtBeam {
  0%   { top: -20%; }
  100% { top: 115%; }
}

body.crt-on .crt-vignette {
  z-index: 32;
  opacity: 1;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 64%,
    rgba(0, 0, 0, 0.36) 88%,
    rgba(0, 0, 0, 0.72) 100%
  );
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.8);
}

body.crt-on .crt-glare {
  z-index: 33;
  opacity: 1;
  background: linear-gradient(
    132deg,
    rgba(255, 255, 255, 0.045) 0%,
    rgba(255, 255, 255, 0.012) 18%,
    rgba(255, 255, 255, 0) 42%
  );
}

/* Subtle phosphor hum */
body.crt-on .bbs-viewport {
  animation: crtFlicker 6s infinite;
}

@keyframes crtFlicker {
  0%, 100% { opacity: 0.992; }
  48%      { opacity: 0.998; }
  50%      { opacity: 0.982; }
  52%      { opacity: 0.997; }
}

/* --------------------------------------------------------------------------
   BBS Viewport: Topbar, Main Screen, Prompt Bar
   -------------------------------------------------------------------------- */

.bbs-viewport {
  position: relative;
  z-index: 10;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  font-size: clamp(11px, 1.55vw, 14.5px);
  line-height: 1.32;
}

body.crt-on .bbs-viewport {
  text-shadow: 0 0 6px rgba(var(--glow-rgb), 0.24);
}

/* Top ANSI Status Strip */
.bbs-topbar {
  flex-shrink: 0;
  background: var(--bar-bg);
  color: var(--bar-fg);
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88em;
  font-weight: 700;
  letter-spacing: 0.03em;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}

.topbar-brand {
  color: var(--c-yellow);
}

body.theme-amber .topbar-brand,
body.theme-green .topbar-brand {
  color: var(--bar-fg);
}

.topbar-sep {
  opacity: 0.45;
  font-weight: 400;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-badge {
  color: var(--c-bgreen);
  font-weight: 700;
}

.mode-badge.local {
  color: var(--c-yellow);
}

body.theme-amber .mode-badge,
body.theme-green .mode-badge {
  color: var(--bar-fg);
}

/* Main Terminal Screen */
.bbs-screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px 18px 16px;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: var(--c-dgray) transparent;
}

.bbs-screen::-webkit-scrollbar {
  width: 7px;
}

.bbs-screen::-webkit-scrollbar-track {
  background: transparent;
}

.bbs-screen::-webkit-scrollbar-thumb {
  background: var(--c-dgray);
  border-radius: 0;
}

/* ANSI Preformatted Lines */
.ansi-pre {
  font-family: var(--font-mono);
  white-space: pre;
  margin: 0;
  line-height: 1.24;
  overflow-x: auto;
  scrollbar-width: none;
}

.ansi-pre::-webkit-scrollbar {
  display: none;
}

.ansi-wrap {
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  line-height: 1.42;
}

.ansi-section {
  margin-bottom: 10px;
}

.ansi-divider {
  color: var(--c-blue);
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  margin: 8px 0;
}

/* --------------------------------------------------------------------------
   16-Color VGA Foreground & Background Classes
   -------------------------------------------------------------------------- */

.fg-black    { color: var(--c-black); }
.fg-blue     { color: var(--c-blue); }
.fg-green    { color: var(--c-green); }
.fg-cyan     { color: var(--c-cyan); }
.fg-red      { color: var(--c-red); }
.fg-magenta  { color: var(--c-magenta); }
.fg-brown    { color: var(--c-brown); }
.fg-gray     { color: var(--c-gray); }
.fg-dgray    { color: var(--c-dgray); }
.fg-bblue    { color: var(--c-bblue); }
.fg-bgreen   { color: var(--c-bgreen); }
.fg-bcyan    { color: var(--c-bcyan); }
.fg-bred     { color: var(--c-bred); }
.fg-bmagenta { color: var(--c-bmagenta); }
.fg-yellow   { color: var(--c-yellow); }
.fg-bwhite   { color: var(--c-bwhite); }

.bg-blue     { background: var(--c-blue); color: var(--c-bwhite); }
.bg-cyan     { background: var(--c-cyan); color: var(--c-black); }
.bg-red      { background: var(--c-red); color: var(--c-bwhite); }
.bg-magenta  { background: var(--c-magenta); color: var(--c-bwhite); }
.bg-green    { background: var(--c-green); color: var(--c-black); }

body.crt-on .fg-bcyan    { text-shadow: 0 0 8px rgba(85, 255, 255, 0.45); }
body.crt-on .fg-bgreen   { text-shadow: 0 0 8px rgba(85, 255, 85, 0.45); }
body.crt-on .fg-yellow   { text-shadow: 0 0 8px rgba(255, 255, 85, 0.42); }
body.crt-on .fg-bmagenta { text-shadow: 0 0 8px rgba(255, 85, 255, 0.42); }
body.crt-on .fg-bred     { text-shadow: 0 0 8px rgba(255, 85, 85, 0.45); }
body.crt-on .fg-bwhite   { text-shadow: 0 0 7px rgba(255, 255, 255, 0.32); }

body.crt-on.theme-amber .fg-bcyan,
body.crt-on.theme-amber .fg-bgreen,
body.crt-on.theme-amber .fg-yellow,
body.crt-on.theme-amber .fg-bmagenta,
body.crt-on.theme-amber .fg-bred,
body.crt-on.theme-amber .fg-bwhite {
  text-shadow: 0 0 9px rgba(255, 176, 0, 0.55);
}

body.crt-on.theme-green .fg-bcyan,
body.crt-on.theme-green .fg-bgreen,
body.crt-on.theme-green .fg-yellow,
body.crt-on.theme-green .fg-bmagenta,
body.crt-on.theme-green .fg-bred,
body.crt-on.theme-green .fg-bwhite {
  text-shadow: 0 0 9px rgba(68, 255, 119, 0.55);
}

/* --------------------------------------------------------------------------
   Interactive ANSI Menu Items, Buttons, Rows & Forms
   -------------------------------------------------------------------------- */

/* ANSI Double-Border Banner Frame (pixel-aligned across all fonts/OSes) */
.ansi-banner-box {
  border: 3px double var(--c-bcyan);
  background: var(--box-bg);
  margin-bottom: 10px;
}

.ansi-banner-art {
  padding: 8px 10px 6px 10px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.ansi-banner-sub {
  border-top: 1px solid var(--c-bcyan);
  padding: 4px 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 10px;
  font-size: 0.9em;
  background: var(--msg-hdr-bg);
}

.ansi-box {
  border: 1px solid var(--c-cyan);
  box-shadow: inset 0 0 0 1px var(--box-ring);
  margin: 8px 0 12px 0;
  background: var(--box-bg);
}

.ansi-box-title {
  background: var(--c-blue);
  color: var(--c-yellow);
  padding: 3px 10px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--c-cyan);
}

body.theme-amber .ansi-box-title,
body.theme-green .ansi-box-title {
  color: var(--bar-fg);
}

.ansi-box-body {
  padding: 10px 12px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
}

.ansi-cmd {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--c-gray);
  font-family: var(--font-mono);
  font-size: inherit;
  line-height: 1.45;
  text-align: left;
  padding: 3px 6px;
  cursor: pointer;
  transition: background 0.08s, color 0.08s;
}

.ansi-cmd:hover,
.ansi-cmd:focus-visible {
  background: var(--hover-bg);
  color: var(--hover-fg);
  outline: none;
}

.ansi-cmd:hover .hotkey,
.ansi-cmd:focus-visible .hotkey,
.ansi-cmd:hover .cmd-desc,
.ansi-cmd:focus-visible .cmd-desc {
  color: var(--hover-fg);
  text-shadow: none;
}

.hotkey {
  color: var(--c-yellow);
  font-weight: 700;
  flex-shrink: 0;
}

.cmd-label {
  color: var(--c-bwhite);
  font-weight: 700;
}

.ansi-cmd:hover .cmd-label,
.ansi-cmd:focus-visible .cmd-label {
  color: var(--hover-fg);
}

.cmd-desc {
  color: var(--c-dgray);
  font-size: 0.9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Inline Action Buttons */
.ansi-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ansi-btn {
  background: var(--c-blue);
  color: var(--c-bwhite);
  border: 1px solid var(--c-bcyan);
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.08s, color 0.08s;
}

body.theme-amber .ansi-btn:not(.secondary),
body.theme-green .ansi-btn:not(.secondary) {
  color: var(--c-bwhite);
}

.ansi-btn:hover,
.ansi-btn:focus-visible {
  background: var(--hover-bg);
  color: var(--hover-fg);
  border-color: var(--c-bwhite);
  outline: none;
  text-shadow: none;
}

.ansi-btn.secondary {
  background: transparent;
  color: var(--c-bcyan);
  border-color: var(--c-dgray);
}

.ansi-btn.secondary:hover,
.ansi-btn.secondary:focus-visible {
  background: var(--hover-bg);
  color: var(--hover-fg);
  border-color: var(--hover-bg);
}

.ansi-btn.danger {
  background: var(--c-red);
  border-color: var(--c-bred);
  color: var(--c-bwhite);
}

.ansi-link {
  color: var(--c-bcyan);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.ansi-link:hover {
  background: var(--hover-bg);
  color: var(--hover-fg);
  text-decoration: none;
  text-shadow: none;
}

/* Tables (Boards, Files, Callers) */
.bbs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

.bbs-table th {
  text-align: left;
  color: var(--c-yellow);
  border-bottom: 1px dashed var(--c-cyan);
  padding: 3px 6px 5px 6px;
  font-weight: 700;
  white-space: nowrap;
}

.bbs-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(88, 92, 102, 0.25);
  vertical-align: top;
}

.bbs-table tr.clickable {
  cursor: pointer;
}

.bbs-table tr.clickable:hover td {
  background: var(--hover-bg);
  color: var(--hover-fg);
  text-shadow: none;
}

.bbs-table tr.clickable:hover td * {
  color: var(--hover-fg) !important;
  text-shadow: none !important;
}

/* One-Liners Wall */
.oneliner-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.oneliner-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  line-height: 1.38;
  padding: 2px 4px;
  border-left: 2px solid var(--c-dgray);
  padding-left: 8px;
}

.oneliner-handle {
  font-weight: 700;
  color: var(--c-bwhite);
}

.oneliner-date {
  color: var(--c-dgray);
  font-size: 0.85em;
  margin-left: auto;
}

/* Classic DOS Inline Form */
.bbs-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--c-dgray);
}

.bbs-field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bbs-label {
  color: var(--c-bcyan);
  font-weight: 700;
  min-width: 82px;
}

.bbs-input,
.bbs-textarea,
.bbs-select {
  flex: 1;
  min-width: 180px;
  background: var(--input-bg);
  color: var(--c-bwhite);
  border: 1px solid var(--c-cyan);
  font-family: var(--font-mono);
  font-size: 0.95em;
  padding: 5px 8px;
  outline: none;
}

.bbs-input:focus,
.bbs-textarea:focus,
.bbs-select:focus {
  border-color: var(--c-yellow);
  box-shadow: 0 0 0 1px var(--c-yellow);
}

.bbs-textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.4;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ANSI Color Swatch Picker for One-Liners */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-swatch {
  background: transparent;
  border: 1px solid var(--c-dgray);
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 7px;
  cursor: pointer;
}

.color-swatch.active {
  border-color: var(--c-bwhite);
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

/* Message Thread Post Card */
.msg-card {
  border: 1px solid var(--c-dgray);
  margin-bottom: 10px;
  background: var(--box-bg);
}

.msg-header {
  background: var(--msg-hdr-bg);
  border-bottom: 1px dashed var(--c-dgray);
  padding: 5px 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 12px;
  font-size: 0.9em;
}

.msg-body {
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--c-gray);
  line-height: 1.45;
}

/* Status / Notice Toast Inside Terminal */
.bbs-notice {
  padding: 5px 10px;
  margin: 8px 0;
  border: 1px solid var(--c-bgreen);
  color: var(--c-bgreen);
  background: rgba(0, 170, 0, 0.12);
  font-size: 0.92em;
}

.bbs-notice.error {
  border-color: var(--c-bred);
  color: var(--c-bred);
  background: rgba(170, 0, 0, 0.16);
}

/* --------------------------------------------------------------------------
   Bottom Command Prompt Bar & Quick Keys
   -------------------------------------------------------------------------- */

.bbs-prompt-bar {
  flex-shrink: 0;
  border-top: 1px solid var(--c-blue);
  background: var(--prompt-bg);
  padding: 6px 12px 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.prompt-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prompt-label {
  color: var(--c-bcyan);
  font-weight: 700;
  white-space: nowrap;
}

.prompt-form {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.prompt-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--c-yellow);
  font-family: var(--font-mono);
  font-size: inherit;
  font-weight: 700;
  outline: none;
  caret-color: transparent;
}

.block-cursor {
  color: var(--c-bwhite);
  animation: blinkCursor 1s steps(1) infinite;
  margin-left: 2px;
  user-select: none;
}

@keyframes blinkCursor {
  0%, 49%  { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.quick-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.qkey {
  background: transparent;
  border: 1px solid var(--c-dgray);
  color: var(--c-gray);
  font-family: var(--font-mono);
  font-size: 0.8em;
  padding: 2px 7px;
  cursor: pointer;
  transition: background 0.08s, color 0.08s;
}

.qkey:hover,
.qkey:focus-visible,
.qkey.active {
  background: var(--hover-bg);
  color: var(--hover-fg);
  border-color: var(--hover-bg);
  outline: none;
  text-shadow: none;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Bottom Hardware Monitor Bezel & Tactile Controls
   -------------------------------------------------------------------------- */

.monitor-bezel-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 6px 2px 6px;
  user-select: none;
}

.hardware-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-plate {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #8b92a3;
}

.bezel-logo {
  opacity: 0.85;
  display: block;
}

.modem-leds {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #697080;
}

.led-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.led {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #23262e;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: background 0.1s, box-shadow 0.1s;
}

.led-pwr.on {
  background: #3ecf6e;
  box-shadow: 0 0 7px rgba(62, 207, 110, 0.85);
}

.led-cd.on {
  background: #3ecf6e;
  box-shadow: 0 0 7px rgba(62, 207, 110, 0.85);
}

.led-rx.on {
  background: #f5b942;
  box-shadow: 0 0 7px rgba(245, 185, 66, 0.9);
}

.led-tx.on {
  background: #ff5555;
  box-shadow: 0 0 7px rgba(255, 85, 85, 0.9);
}

.hardware-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hw-btn {
  background: linear-gradient(180deg, #252933 0%, #171a21 100%);
  color: #a4acb9;
  border: 1px solid #353b48;
  border-bottom-color: #0b0d11;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.6);
  transition: color 0.12s, border-color 0.12s, transform 0.05s;
}

.hw-btn:hover {
  color: #ffffff;
  border-color: #545d72;
}

.hw-btn:active {
  transform: translateY(1px);
}

.hw-btn.active {
  color: #55ffff;
  border-color: #2f6c78;
}

body.theme-amber .hw-btn.active {
  color: #ffb000;
  border-color: #7d5600;
}

body.theme-green .hw-btn.active {
  color: #44ff77;
  border-color: #1f6e33;
}

/* Banner Responsive Sizing */
.banner-desktop {
  display: block;
  font-size: clamp(9px, 1.32vw, 13.5px);
  line-height: 1.12;
}

.banner-mobile {
  display: none;
  font-size: 12px;
  line-height: 1.2;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */

@media (max-width: 720px) {
  body {
    padding: 6px;
  }

  .monitor-shell {
    height: 100%;
    max-height: calc(100dvh - 12px);
    border-radius: 12px;
    padding: 8px;
  }

  .monitor-bezel-top {
    display: none;
  }

  .crt-recess {
    padding: 4px;
    border-radius: 10px;
  }

  .bbs-screen {
    padding: 10px 10px 14px 10px;
  }

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

  .msg-header {
    grid-template-columns: 1fr;
  }

  .hide-sm {
    display: none;
  }

  .banner-desktop {
    display: none;
  }

  .banner-mobile {
    display: block;
  }
}

@media (max-width: 480px) {
  .hide-xs {
    display: none;
  }

  .modem-leds {
    display: none;
  }

  .bbs-viewport {
    font-size: 12px;
  }

  .prompt-label {
    font-size: 0.9em;
  }
}

/* Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .crt-glass.crt-boot,
  .crt-beam,
  .bbs-viewport,
  .block-cursor {
    animation: none !important;
  }
}
