/* ==========================================================================
   THE PRECISION INSTRUMENT — DESIGN SYSTEM REV 4.1
   Vintage Analog Hardware / Utilitarian Synthesis / Mechanical UI Physics
   ========================================================================== */

:root {
  /* Chassis & Housing */
  --casing-bg: #d4ccbd;
  --casing-rim: #b8af9e;
  --casing-highlight: #ece6da;
  --chassis-border: #1e1e1e;

  /* Display Wells (Recessed Charcoal) */
  --display-well: #131517;
  --display-inner: #0f1012;
  --display-bezel: #24272a;
  --display-border: #1a1a1a;

  /* Typography */
  --text-readout: #eee7db;
  --text-muted: #8e877c;
  --text-casing: #262624;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", "Space Mono", "Consolas", monospace;

  /* Accents */
  --accent-blue: #4a6b82;
  --accent-coral: #d95f47;
  --accent-amber: #d49b3d;

  /* Status Indicators */
  --led-green: #3cd070;
  --led-amber: #e5a93c;
  --led-red: #e04f43;
  --led-off: #2e3831;
}

/* Reset & Mechanical Rigidity */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: none !important;
  animation: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden; /* Prevent window bouncing or page scrolling on mobile */
  position: fixed;
  inset: 0;
}

body {
  background-color: #212325;
  background-image: 
    radial-gradient(#2d3034 1px, transparent 1px),
    linear-gradient(to bottom, #1d1f21, #18191b);
  background-size: 20px 20px, 100% 100%;
  color: var(--text-casing);
  font-family: var(--font-mono);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 12px;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   OPERATOR IDENTIFICATION MODAL
   ========================================================================== */
.operator-modal-overlay,
.operator-modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(14, 15, 17, 0.88);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 16px;
  box-sizing: border-box;
}

.operator-modal-housing {
  width: 100%;
  max-width: 440px;
  background: var(--casing-bg);
  border: 4px solid var(--chassis-border);
  border-radius: 8px;
  box-shadow: 
    0 16px 0 #0d0e0f,
    0 24px 36px rgba(0,0,0,0.85),
    inset 1px 1px 0 var(--casing-highlight),
    inset -2px -2px 0 var(--casing-rim);
  padding: 24px 20px;
  position: relative;
}

.modal-screw {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #a39c8e;
  border: 1px solid #1a1a1a;
  border-radius: 50%;
}
.modal-screw.screw-tl { top: 6px; left: 6px; }
.modal-screw.screw-tr { top: 6px; right: 6px; }
.modal-screw.screw-bl { bottom: 6px; left: 6px; }
.modal-screw.screw-br { bottom: 6px; right: 6px; }

.modal-header {
  border-bottom: 2px solid var(--chassis-border);
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #1a1a1a;
  text-transform: uppercase;
}

.modal-sub {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #555148;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #242422;
}

.modal-input-well {
  background: var(--display-inner);
  border: 2px solid var(--chassis-border);
  border-radius: 4px;
  padding: 8px 12px;
  box-shadow: inset 2px 2px 5px rgba(0,0,0,0.8);
}

.modal-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-readout);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.modal-input::placeholder {
  color: #5a5f67;
  font-size: 0.85rem;
}

.modal-btn {
  width: 100%;
  padding: 10px;
  font-size: 0.85rem;
}

/* ==========================================================================
   ROOM ACTION / KILLER MODAL
   ========================================================================== */
.modal-desc-text {
  font-size: 0.78rem;
  color: #2b2b28;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.4;
}
.modal-action-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-action-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 10px 12px;
  gap: 3px;
  border-radius: 4px;
  width: 100%;
}
.btn-primary-text {
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.8px;
}
.btn-sub-text {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.88;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
}
.btn-mech-danger {
  background: #d93838;
  color: #fff;
  border-color: #5c1414;
  box-shadow: 0 3px 0 #5c1414;
}
.btn-mech-danger:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 10px rgba(217, 56, 56, 0.5), 0 3px 0 #5c1414;
}
.btn-mech-danger:active, .btn-mech-danger.is-depressed {
  transform: translateY(2px) !important;
  box-shadow: 0 1px 0 #5c1414 !important;
}
.modal-action-btn-sm {
  align-self: center;
  padding: 6px 16px;
  font-size: 0.72rem;
  margin-top: 4px;
}

/* ==========================================================================
   CHASSIS (MAIN CASING)
   ========================================================================== */
.instrument-rack {
  width: 100%;
  max-width: 1200px;
  height: 100%;
  max-height: 940px;
  background-color: var(--casing-bg);
  border: 4px solid var(--chassis-border);
  border-radius: 8px;
  box-shadow:
    0 12px 0 #0d0e0f,
    0 24px 32px rgba(0, 0, 0, 0.7),
    inset 1px 1px 0 var(--casing-highlight),
    inset -2px -2px 0 var(--casing-rim);
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chassis-screw {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #a39c8e;
  border: 1px solid #1a1a1a;
  border-radius: 50%;
  box-shadow: inset 1px 1px 1px rgba(255,255,255,0.4), inset -1px -1px 1px rgba(0,0,0,0.6);
}
.chassis-screw::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 2px;
  width: 6px;
  height: 1px;
  background: #2b2b2b;
}
.screw-tl { top: 8px; left: 8px; }
.screw-tr { top: 8px; right: 8px; }
.screw-bl { bottom: 8px; left: 8px; }
.screw-br { bottom: 8px; right: 8px; }

/* ==========================================================================
   TOP BAR / HEADER PANEL
   ========================================================================== */
.header-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--chassis-border);
  padding-bottom: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.header-left-cluster, .header-right-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.model-plate {
  display: flex;
  flex-direction: column;
}

.model-title {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #1a1a1a;
}

.model-sub {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #555148;
}

.patch-bay {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--display-inner);
  border: 2px solid var(--chassis-border);
  border-radius: 4px;
  padding: 3px 6px;
  box-shadow: inset 2px 2px 4px rgba(0,0,0,0.9);
}

.patch-label {
  color: var(--accent-amber);
  font-size: 0.7rem;
  font-weight: 800;
}

.patch-input {
  background: transparent;
  border: none;
  color: var(--text-readout);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  width: 82px;
  outline: none;
}

.operator-badge-btn {
  font-size: 0.7rem;
  padding: 5px 8px;
  background: #2a2d31;
  color: var(--accent-amber);
}

.telemetry-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--casing-rim);
  border: 2px solid var(--chassis-border);
  padding: 4px 8px;
  border-radius: 4px;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.3);
}

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

.hardware-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #111;
  background: var(--led-off);
}
.hardware-led.active-green {
  background: var(--led-green);
  box-shadow: 0 0 5px var(--led-green);
}
.hardware-led.active-amber {
  background: var(--led-amber);
  box-shadow: 0 0 5px var(--led-amber);
}
.hardware-led.active-red {
  background: var(--led-red);
  box-shadow: 0 0 5px var(--led-red);
}

.led-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #2b2b28;
}

/* ==========================================================================
   MECHANICAL SWITCHES (TACTILE DEPRESSION PHYSICS)
   ========================================================================== */
.btn-mech {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 2px solid var(--chassis-border);
  cursor: pointer;
  user-select: none;
  background: var(--casing-rim);
  color: #1a1a1a;
  box-shadow: 0 3px 0 var(--chassis-border);
  transform: translateY(0);
}

.btn-mech:hover {
  filter: brightness(1.05);
}

.btn-mech:active, .btn-mech.is-depressed {
  transform: translateY(2px) !important;
  box-shadow: 0 1px 0 var(--chassis-border) !important;
}

.btn-mech-blue {
  background: var(--accent-blue);
  color: #fff;
  border-color: #15222d;
  box-shadow: 0 3px 0 #15222d;
}
.btn-mech-blue:active, .btn-mech-blue.is-depressed {
  box-shadow: 0 1px 0 #15222d !important;
}

.btn-mech-coral {
  background: var(--accent-coral);
  color: #fff;
  border-color: #2b110b;
  box-shadow: 0 3px 0 #2b110b;
}
.btn-mech-coral:active, .btn-mech-coral.is-depressed {
  box-shadow: 0 1px 0 #2b110b !important;
}

.btn-mech-emerald {
  background: #2b8a6d;
  color: #fff;
  border-color: #123d30;
  box-shadow: 0 3px 0 #123d30;
}
.btn-mech-emerald:active, .btn-mech-emerald.is-depressed {
  box-shadow: 0 1px 0 #123d30 !important;
}

.btn-mech-muted {
  background: #343a40;
  color: #ff6b6b;
  border-color: #212529;
  box-shadow: 0 3px 0 #212529;
}
.btn-mech-muted:active, .btn-mech-muted.is-depressed {
  box-shadow: 0 1px 0 #212529 !important;
}

.btn-mech-close-room {
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 900;
  background: #2b2e32;
  color: #e04f43;
  border: 2px solid var(--chassis-border);
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--chassis-border);
  line-height: 1;
}
.btn-mech-close-room:hover {
  background: #3c4046;
  color: #ff6b5e;
}
.btn-mech-close-room:active {
  transform: translateY(2px) !important;
  box-shadow: 0 0 0 var(--chassis-border) !important;
}

.btn-mech-dark {
  background: #2c2f33;
  color: var(--text-readout);
  border-color: #111;
  box-shadow: 0 3px 0 #111;
}
.btn-mech-dark:active, .btn-mech-dark.is-depressed {
  box-shadow: 0 1px 0 #111 !important;
}

/* ==========================================================================
   FEED LOADER PANEL
   ========================================================================== */
.feed-loader-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--casing-rim);
  border: 2px solid var(--chassis-border);
  border-radius: 4px;
  padding: 6px 10px;
  margin-bottom: 10px;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.4);
  flex-shrink: 0;
}

.feed-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.feed-input-well {
  position: relative;
  flex: 1;
  background: var(--display-inner);
  border: 2px solid var(--chassis-border);
  border-radius: 3px;
  padding: 5px 8px;
  box-shadow: inset 2px 2px 4px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
}

/* Quick Instant Search Dropdown Attached to Feed Source */
.feed-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #121518;
  border: 1px solid #38d9a9;
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.9), 0 0 10px rgba(56, 217, 169, 0.2);
  z-index: 1200;
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.feed-dropdown-loading {
  padding: 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #8b949e;
  letter-spacing: 0.5px;
}

.feed-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #202428;
  cursor: pointer;
  background: #14171b;
  transition: background 0.15s, border-color 0.15s;
}

.feed-dropdown-item:hover {
  background: #1d2329;
}

.feed-dropdown-thumb {
  width: 32px;
  height: 48px;
  object-fit: cover;
  border-radius: 2px;
  background: #0d0f11;
  flex-shrink: 0;
  border: 1px solid #2b313a;
}

.feed-dropdown-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-dropdown-title {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: #e6edf3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-dropdown-meta {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: #8b949e;
  display: flex;
  gap: 6px;
  align-items: center;
}

.feed-dropdown-badge {
  background: rgba(56, 217, 169, 0.15);
  color: #38d9a9;
  font-size: 0.56rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 2px;
  border: 1px solid rgba(56, 217, 169, 0.4);
}

.feed-dropdown-footer {
  padding: 9px 12px;
  background: #0b0d0f;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #38d9a9;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}

.feed-dropdown-footer:hover {
  background: #197163;
  color: #ffffff;
}

.feed-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-readout);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}
.feed-input::placeholder {
  color: #5d6168;
}

.btn-library-toggle {
  white-space: nowrap;
  font-size: 0.7rem;
  padding: 6px 10px;
  background: #25282c;
  color: var(--accent-amber);
  border-color: #1a1c1e;
}
.btn-library-toggle:hover {
  color: #fff;
  border-color: var(--accent-amber);
}

.btn-search-toggle {
  white-space: nowrap;
  font-size: 0.7rem;
  padding: 6px 10px;
  background: linear-gradient(180deg, #1d404d 0%, #102630 100%);
  color: #38d9a9;
  border: 1px solid #197163;
}
.btn-search-toggle:hover {
  color: #fff;
  border-color: #38d9a9;
}

.btn-mech-cyan {
  background: linear-gradient(180deg, #1d404d 0%, #102630 100%);
  color: #38d9a9;
  border: 1px solid #197163;
  box-shadow: 0 1px 0 rgba(255,255,255,0.1), inset 0 1px 0 rgba(255,255,255,0.15);
  white-space: nowrap;
}
.btn-mech-cyan:hover {
  background: linear-gradient(180deg, #265566 0%, #163645 100%);
  color: #63e6be;
  border-color: #20c997;
}

.btn-search-toggle {
  white-space: nowrap;
  font-size: 0.7rem;
  padding: 6px 10px;
  flex-shrink: 0;
}

.scope-feed-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  max-width: 68%;
  min-width: 0;
  flex-shrink: 1;
}

.carrier-badge {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 5px;
  border-radius: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.carrier-badge-yt {
  background: #381a1a;
  color: #ff6b6b;
  border: 1px solid #732222;
}
.carrier-badge-cinema {
  background: #112d38;
  color: #38d9a9;
  border: 1px solid #197163;
  box-shadow: 0 0 6px rgba(56, 217, 169, 0.3);
}

/* Cinema Multi-Server Mirror Switcher Bar (Hidden per user request to maximize screen focus) */
.cinema-server-pills {
  display: flex;
  align-items: center;
  gap: 5px;
}

.server-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 800;
  color: #8b949e;
  letter-spacing: 0.5px;
  margin-right: 3px;
}

.btn-server-pill {
  background: #191e24;
  color: #adb5bd;
  border: 1px solid #343a40;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-server-pill:hover {
  background: #252d37;
  color: #e6edf3;
  border-color: #38d9a9;
}

.btn-server-pill.active {
  background: rgba(56, 217, 169, 0.22);
  color: #38d9a9;
  border-color: #38d9a9;
  box-shadow: 0 0 8px rgba(56, 217, 169, 0.45);
}

.btn-label-full {
  display: inline;
}
.btn-label-short {
  display: none;
}

/* ==========================================================================
   TMDB SEARCH BAY MODAL
   ========================================================================== */
.search-modal-backdrop {
  z-index: 100;
}

.search-modal-housing {
  width: 95%;
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px;
}

.search-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--chassis-border);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.btn-mech-close-search {
  padding: 3px 8px;
  font-size: 0.7rem;
}

.search-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: calc(88vh - 75px);
  padding-right: 2px;
}

.search-input-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-input-well {
  display: flex;
  align-items: center;
  background: var(--display-inner);
  border: 2px solid #333940;
  border-radius: 4px;
  padding: 6px 12px;
  box-shadow: inset 2px 2px 5px rgba(0,0,0,0.85);
  gap: 8px;
}

.search-input-icon {
  font-size: 0.85rem;
  opacity: 0.7;
}

.search-main-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-readout);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}
.search-main-input::placeholder {
  color: #555c66;
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: #727a85;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
}
.search-clear-btn:hover {
  color: #fff;
}

.search-filter-pills {
  display: flex;
  gap: 6px;
}

.filter-pill {
  background: #1c1f24;
  border: 1px solid #2d333b;
  color: #8b949e;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-pill:hover {
  color: #fff;
  border-color: #444c56;
}
.filter-pill.is-active {
  background: #112d38;
  color: #38d9a9;
  border-color: #197163;
  box-shadow: 0 0 6px rgba(56, 217, 169, 0.25);
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: #333 #15181b;
  min-height: 200px;
}

.search-loading-text {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  color: #6a737d;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.search-card {
  background: #14171a;
  border: 1px solid #282d33;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 270px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.6);
  transition: transform 0.15s, border-color 0.15s;
}
.search-card:hover {
  transform: translateY(-2px);
  border-color: #38d9a9;
}

.search-card-poster {
  position: relative;
  width: 100%;
  height: 180px;
  min-height: 150px;
  background: #0d0f11;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}

.search-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-card-rating {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffd43b;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 212, 59, 0.4);
}

.search-card-type {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(17, 45, 56, 0.9);
  color: #38d9a9;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid rgba(56, 217, 169, 0.4);
}

.search-card-content {
  padding: 8px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
  justify-content: space-between;
}

.search-card-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-readout);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}
.search-card-title:hover {
  color: #38d9a9;
}

.search-card-meta {
  font-size: 0.62rem;
  color: #6a737d;
  font-family: var(--font-mono);
}

.search-card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #202428;
}

.btn-card-tune-cinema {
  flex: 1;
  font-size: 0.64rem;
  padding: 4px 6px;
}

.btn-card-add-lib {
  font-size: 0.64rem;
  padding: 4px 8px;
}

/* TV Episode Selector Drawer inside Search Bay */
.search-episode-drawer {
  background: #101316;
  border: 1px solid #282d33;
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.episode-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid #202428;
  padding-bottom: 8px;
}

.btn-back-results {
  font-size: 0.68rem;
  padding: 4px 8px;
}

.drawer-show-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #38d9a9;
  letter-spacing: 0.5px;
}

.season-select-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #8b949e;
}

.season-dropdown {
  background: #181b20;
  border: 1px solid #333940;
  color: var(--text-readout);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 3px;
  outline: none;
}

.drawer-episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.episode-card {
  background: #14171a;
  border: 1px solid #262a30;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  transition: border-color 0.15s, transform 0.15s;
}
.episode-card:hover {
  border-color: #38d9a9;
  transform: translateY(-1px);
}

.episode-card-still {
  width: 100%;
  height: 110px;
  min-height: 90px;
  background: #000;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.episode-still-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-number-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0,0,0,0.85);
  color: #38d9a9;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 4px;
  border-radius: 2px;
}

.episode-card-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
  justify-content: space-between;
}

.episode-card-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-readout);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-card-overview {
  font-size: 0.62rem;
  color: #6a737d;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-card-actions {
  display: flex;
  gap: 4px;
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px solid #202428;
}

/* ==========================================================================
   PER-ROOM LIBRARY MODAL
   ========================================================================== */
.library-modal-backdrop {
  z-index: 100;
}

.library-modal-housing {
  width: 95%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px;
}

.library-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--chassis-border);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.library-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: calc(85vh - 80px);
  padding-right: 2px;
}

.library-import-strip {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.library-import-well {
  flex: 1;
  min-width: 180px;
  background: var(--display-inner);
  border: 1px solid #333940;
  border-radius: 3px;
  padding: 6px 10px;
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.8);
}

.library-import-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-readout);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.library-import-input::placeholder {
  color: #555c66;
}

.library-tracks-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: #333 #15181b;
  min-height: 120px;
}

.library-empty-state {
  grid-column: 1 / -1;
  width: 100%;
  text-align: center;
  padding: 26px 10px;
  color: #616872;
  font-size: 0.74rem;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  border: 1px dashed #2d333b;
  border-radius: 4px;
}

/* ==========================================================================
   SUB-PLAYLIST CARDS: Collapsible TV Series & YouTube Sub-Playlists
   ========================================================================== */
.library-subplaylist-card {
  grid-column: 1 / -1;
  background: #121518;
  border: 1px solid #282f37;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: border-color 0.15s ease;
}

.library-subplaylist-card:hover {
  border-color: #38d9a9;
}

.subplaylist-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #171b20;
  border-bottom: 1px solid #252a30;
  cursor: pointer;
  user-select: none;
}

.subplaylist-poster {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #333a42;
  flex-shrink: 0;
  background: #0a0c0e;
}

.subplaylist-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.subplaylist-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #e6edf3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
}

.subplaylist-progress-badge {
  font-size: 0.62rem;
  font-weight: 800;
  color: #ffd43b;
  background: rgba(255, 212, 59, 0.12);
  border: 1px solid rgba(255, 212, 59, 0.35);
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}

.subplaylist-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-subplaylist-resume {
  font-size: 0.68rem;
  padding: 4px 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.subplaylist-toggle-icon {
  font-size: 0.75rem;
  color: #8b949e;
  transition: transform 0.2s ease;
}

.subplaylist-drawer {
  padding: 10px;
  background: #0e1013;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subplaylist-episodes-reel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: #38d9a9 #161a1f;
}

.subplaylist-ep-card {
  flex: 0 0 135px;
  background: #161a1f;
  border: 1px solid #282f37;
  border-radius: 4px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.subplaylist-ep-card:hover {
  border-color: #38d9a9;
  background: #1c2229;
}

.subplaylist-ep-card.is-active-ep {
  border-color: #ffd43b;
  box-shadow: 0 0 8px rgba(255, 212, 59, 0.3);
}

.subplaylist-ep-badge {
  font-size: 0.62rem;
  font-weight: 800;
  color: #38d9a9;
}

.subplaylist-ep-title {
  font-size: 0.66rem;
  font-weight: 700;
  color: #adb5bd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subplaylist-ep-progress-bar {
  width: 100%;
  height: 4px;
  background: #252b33;
  border-radius: 2px;
  overflow: hidden;
  margin-top: auto;
}

.subplaylist-ep-progress-fill {
  height: 100%;
  background: #ffd43b;
  width: 0%;
}

.subplaylist-ep-time {
  font-size: 0.58rem;
  color: #8b949e;
  display: flex;
  justify-content: space-between;
}

.library-track-card {
  background: #14171a;
  border: 1px solid #2a2f35;
  border-radius: 4px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
}
.library-track-card:hover {
  border-color: var(--accent-amber);
  transform: translateY(-1px);
}

.btn-mech-close-library {
  padding: 3px 8px;
  font-size: 0.7rem;
}

.track-thumb-box {
  position: relative;
  width: 100%;
  height: 75px;
  background: #000;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
}

.track-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.track-thumb-box:hover .track-play-overlay {
  opacity: 1;
}

.track-play-btn-round {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-coral);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 0 8px rgba(0,0,0,0.8);
}

.track-card-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-readout);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  min-height: 26px;
}

.track-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px solid #202428;
}

.btn-card-tune {
  font-size: 0.62rem;
  padding: 3px 6px;
}

.btn-card-del {
  background: transparent;
  border: none;
  color: #727a85;
  font-size: 0.68rem;
  cursor: pointer;
  padding: 2px 4px;
}
.btn-card-del:hover {
  color: #e63946;
}

/* ==========================================================================
   WORKSPACE GRID (SCOPE DISPLAY + TELETYPE DECK)
   ========================================================================== */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 14px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

/* ==========================================================================
   PRIMARY SCOPE (VIDEO DISPLAY BEZEL)
   ========================================================================== */
.scope-housing {
  background: var(--display-well);
  border: 3px solid var(--chassis-border);
  border-radius: 6px;
  padding: 8px;
  box-shadow: 
    inset 4px 4px 10px rgba(0,0,0,0.9),
    inset -2px -2px 4px rgba(255,255,255,0.06),
    0 4px 0 var(--chassis-border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.scope-header-readout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 4px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--display-bezel);
  font-size: 0.68rem;
  gap: 8px;
  flex-shrink: 0;
}

#scopeFeedId {
  color: var(--accent-amber);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hardware-ticker {
  color: #3cd070;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}

.video-screen-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 200px;
  background: #000;
  border: 2px solid #000;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 16px rgba(0,0,0,0.9);
}

.video-screen-wrapper iframe,
.video-screen-wrapper #player,
.video-screen-wrapper #cinemaContainer,
.video-screen-wrapper #cinemaFrame,
.video-screen-wrapper #cinemaVideo,
.cinema-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  object-fit: contain;
}

.cinema-pause-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(17, 24, 39, 0.96) 0%, rgba(5, 7, 10, 0.99) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 25;
  text-align: center;
  padding: 16px;
  cursor: pointer;
  border: 1px solid rgba(255, 107, 107, 0.25);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9);
}

.cinema-pause-screen .pause-screen-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cinema-pause-screen .pause-icon {
  font-size: 2.2rem;
  color: var(--accent-coral, #ff6b6b);
  letter-spacing: 4px;
  filter: drop-shadow(0 0 8px rgba(255, 107, 107, 0.6));
  animation: pulse-pause 2s infinite ease-in-out;
}

@keyframes pulse-pause {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.96); }
}

.cinema-pause-screen .pause-title {
  font-family: var(--font-mono, monospace);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  text-transform: uppercase;
}

.cinema-pause-screen .pause-user {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-cyan, #38d9a9);
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(56, 217, 169, 0.08);
  border: 1px solid rgba(56, 217, 169, 0.28);
  padding: 3px 10px;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(56, 217, 169, 0.15);
}

.cinema-pause-screen .pause-time {
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-amber, #fcc419);
  letter-spacing: 0.5px;
}

.cinema-pause-screen button {
  margin-top: 4px;
  font-size: 0.76rem;
  padding: 8px 16px;
}

/* Standby Screen (Awaiting Feed) */
.standby-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #161a1e 0%, #0c0e10 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  text-align: center;
  padding: 24px;
}

.standby-screen .standby-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 420px;
}

.standby-screen .standby-icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 10px rgba(56, 217, 169, 0.4));
  margin-bottom: 2px;
}

.standby-screen .standby-title {
  font-family: var(--font-mono, monospace);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-mint, #38d9a9);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.standby-screen .standby-desc {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  color: #7b8893;
  line-height: 1.5;
  letter-spacing: 0.5px;
}

/* Floating Unmute Audio Badge */
.unmute-badge {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 17, 22, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  padding: 8px 18px;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 30;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 12px rgba(255, 212, 59, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
  animation: pulse-badge 2s infinite ease-in-out;
  pointer-events: auto;
}

.unmute-badge:hover {
  background: rgba(24, 30, 38, 0.98);
  border-color: rgba(255, 212, 59, 0.6);
  color: #ffd43b;
}

.unmute-badge .unmute-icon {
  font-size: 1rem;
}

.unmute-badge .unmute-text {
  font-size: 0.76rem;
  font-weight: 700;
}

.cinema-sync-badge {
  border-color: rgba(99, 184, 188, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 14px rgba(99, 184, 188, 0.3);
}

.cinema-sync-badge:hover {
  border-color: rgba(99, 184, 188, 0.85);
  color: #63b8bc;
}

@keyframes pulse-badge {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.03); }
}


/* ==========================================================================
   PRECISION ANALOG SCRUBBER
   Mechanical recessed timeline well with amber/green position needle
   ========================================================================== */
.analog-scrubber-well {
  position: relative;
  width: 100%;
  margin: 6px 0 2px 0;
  padding: 5px 0;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  flex-shrink: 0;
}

.scrubber-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: var(--display-inner);
  border: 1px solid #282c31;
  border-radius: 4px;
  overflow: visible;
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.95);
}

.scrubber-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #996c22, #e5a93c);
  border-radius: 3px 0 0 3px;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(229, 169, 60, 0.4);
}

.scrubber-needle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 16px;
  background: #3cd070;
  border: 1px solid #141618;
  border-radius: 2px;
  box-shadow: 
    0 0 5px rgba(60, 208, 112, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  pointer-events: none;
  z-index: 2;
}

.scrubber-tooltip {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: #111315;
  color: #3cd070;
  border: 1px solid #2b3036;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.analog-scrubber-well:hover .scrubber-tooltip,
.analog-scrubber-well.is-dragging .scrubber-tooltip {
  opacity: 1;
}

/* Scope Controls Rack (Below Video) */
.scope-control-strip {
  margin-top: 8px;
  background: #191c1f;
  border: 2px solid #282c30;
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.transport-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.time-gauge {
  background: #0c0d0f;
  border: 2px solid #26292d;
  padding: 4px 8px;
  border-radius: 3px;
  box-shadow: inset 1px 1px 4px rgba(0,0,0,0.9);
  color: var(--text-readout);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.time-gauge .dim-text {
  color: #666055;
}

/* Video Volume Control Bay */
.video-volume-bay {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-vol-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--accent-cyan, #38d9a9);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.btn-vol-toggle .vol-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.btn-vol-toggle .vol-readout {
  font-variant-numeric: tabular-nums;
  font-size: 0.68rem;
  color: var(--text-readout, #e6edf3);
}

.btn-vol-toggle.is-muted {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.4);
}

.btn-vol-toggle.is-muted .vol-readout {
  color: #ff6b6b;
}

/* Video Volume Flyout Slider */
.vol-slider-flyout {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #14171a;
  border: 2px solid var(--chassis-border, #333a42);
  border-radius: 6px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 12px rgba(56, 217, 169, 0.15);
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 1500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.vol-slider-flyout::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #14171a transparent transparent transparent;
}

.video-volume-bay:hover .vol-slider-flyout,
.vol-slider-flyout.is-open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.flyout-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--accent-cyan, #38d9a9);
  letter-spacing: 1px;
}

/* Custom Mechanical Slider */
.mech-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 6px;
  background: #090b0d;
  border: 1px solid #2d333b;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.mech-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #38d9a9 0%, #12b886 100%);
  border: 1px solid #0ca678;
  box-shadow: 0 0 8px rgba(56, 217, 169, 0.6);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.mech-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.mech-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #38d9a9 0%, #12b886 100%);
  border: 1px solid #0ca678;
  box-shadow: 0 0 8px rgba(56, 217, 169, 0.6);
  cursor: pointer;
}

/* ==========================================================================
   COMMUNICATIONS DECK (TELETYPE CHAT)
   ========================================================================== */
.comms-housing {
  background: var(--display-well);
  border: 3px solid var(--chassis-border);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 
    inset 4px 4px 10px rgba(0,0,0,0.9),
    inset -2px -2px 4px rgba(255,255,255,0.06),
    0 4px 0 var(--chassis-border);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.comms-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--display-bezel);
  gap: 8px;
  flex-shrink: 0;
}

.comms-title {
  color: var(--text-readout);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.active-callsign-tag {
  color: var(--accent-amber);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.teletype-screen {
  flex: 1;
  background: var(--display-inner);
  border: 2px solid #202428;
  border-radius: 4px;
  padding: 8px;
  overflow-y: auto;
  box-shadow: inset 2px 2px 6px rgba(0,0,0,0.95);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-readout);
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: #333 #111;
}

.teletype-line {
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
}

.teletype-meta {
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  margin-bottom: 1px;
}

.meta-time {
  color: #555b63;
}

.meta-sender-self {
  color: #589bcf;
  font-weight: 800;
}

.meta-sender-peer {
  color: #d95f47;
  font-weight: 800;
}

.teletype-body {
  color: var(--text-readout);
  padding-left: 2px;
}

.comms-input-bay {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-shrink: 0;
}

.comms-input {
  flex: 1;
  background: var(--display-inner);
  border: 2px solid var(--chassis-border);
  border-radius: 4px;
  padding: 7px 10px;
  color: var(--text-readout);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  outline: none;
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.8);
}
.comms-textarea {
  resize: none;
  min-height: 38px;
  max-height: 60px;
  height: 38px;
  line-height: 1.3;
  padding: 8px 10px;
  box-sizing: border-box;
}
.comms-input::placeholder {
  color: #494e55;
}

/* ==========================================================================
   DESKTOP UNMUTE BADGE & AUDIO CONTROLS
   ========================================================================== */
.unmute-badge {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 16, 19, 0.92);
  backdrop-filter: blur(6px);
  border: 2px solid var(--accent-amber);
  border-radius: 4px;
  padding: 8px 16px;
  color: var(--accent-amber);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.8), 0 0 10px rgba(212, 143, 56, 0.3);
  animation: badge-glow 1.5s infinite alternate;
  user-select: none;
}
.unmute-badge:hover {
  background: rgba(24, 28, 33, 0.98);
  color: #fff;
  border-color: #ffd166;
}
.unmute-icon {
  font-size: 0.95rem;
}
.unmute-text {
  text-transform: uppercase;
}

@keyframes badge-glow {
  from { box-shadow: 0 4px 16px rgba(0,0,0,0.8), 0 0 6px rgba(212, 143, 56, 0.2); }
  to { box-shadow: 0 4px 16px rgba(0,0,0,0.8), 0 0 16px rgba(212, 143, 56, 0.6); }
}

/* ==========================================================================
   MINUSCULE CORNER FLOATING AUDIO BUTTON (TRANSPARENT / ICON-ONLY)
   ========================================================================== */
.floating-audio-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 45;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.35s ease, transform 0.25s ease, background 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.floating-audio-btn:hover {
  background: rgba(0, 0, 0, 0.45);
}

.floating-audio-btn.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
}

.floating-audio-btn .floating-audio-icon {
  font-size: 14px;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9));
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.floating-audio-btn:active .floating-audio-icon {
  transform: scale(0.88);
}

.floating-audio-btn.is-muted .floating-audio-icon {
  filter: drop-shadow(0 1px 2px rgba(255, 107, 107, 0.6));
}

/* ==========================================================================
   DYNAMIC 1:1 MERGED ACTION BUTTON (MIC / SEND)
   ========================================================================== */
.btn-mech-action {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  border: 2px solid var(--chassis-border);
  box-shadow: 0 3px 0 var(--chassis-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  touch-action: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-mech-action .action-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  pointer-events: none;
  transition: transform 0.15s ease;
}

/* MIC STATE (Default when typing box is empty) */
.btn-mech-action.is-mic {
  background: var(--display-inner);
  border-color: var(--chassis-border);
  color: var(--accent-amber);
  box-shadow: 0 3px 0 var(--chassis-border);
}
.btn-mech-action.is-mic .icon-mic {
  display: block;
}
.btn-mech-action.is-mic .icon-send {
  display: none;
}
.btn-mech-action.is-mic:hover {
  filter: brightness(1.15);
  color: #fff;
}
.btn-mech-action.is-mic.is-recording {
  background: #d93838 !important;
  color: #fff !important;
  border-color: #5c1414 !important;
  box-shadow: 0 0 14px rgba(217, 56, 56, 0.9), 0 1px 0 #5c1414 !important;
  transform: translateY(2px) !important;
  animation: pulse-mic 0.7s infinite alternate !important;
}

/* SEND STATE (Active when user types any character) */
.btn-mech-action.is-send {
  background: var(--accent-coral);
  border-color: #2b110b;
  color: #fff;
  box-shadow: 0 3px 0 #2b110b;
}
.btn-mech-action.is-send .icon-mic {
  display: none;
}
.btn-mech-action.is-send .icon-send {
  display: block;
  transform: translate(1px, -1px);
}
.btn-mech-action.is-send:hover {
  filter: brightness(1.1);
}
.btn-mech-action.is-send:active,
.btn-mech-action.is-send.is-depressed {
  transform: translateY(2px) !important;
  box-shadow: 0 1px 0 #2b110b !important;
}

@keyframes pulse-mic {
  from { filter: brightness(1); }
  to { filter: brightness(1.35); }
}

/* ==========================================================================
   PARTNER LIVE RECORDING NOTIFICATION STRIP
   ========================================================================== */
.teletype-recording-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin: 6px 0;
  background: rgba(30, 22, 16, 0.88);
  border: 1px dashed var(--accent-amber);
  border-radius: 4px;
  color: var(--accent-amber);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: inset 1px 1px 4px rgba(0,0,0,0.8);
  animation: rec-strip-glow 1.2s infinite alternate;
  user-select: none;
}

.rec-strip-sender {
  color: #ff9e42;
  font-weight: 800;
}

.rec-strip-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rec-waveform {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  padding: 0 2px;
}
.rec-waveform span {
  display: inline-block;
  width: 3px;
  background: var(--accent-amber);
  border-radius: 1px;
  animation: wave-bounce 0.8s infinite ease-in-out;
}
.rec-waveform span:nth-child(1) { height: 4px; animation-delay: 0s; }
.rec-waveform span:nth-child(2) { height: 10px; animation-delay: 0.2s; }
.rec-waveform span:nth-child(3) { height: 6px; animation-delay: 0.4s; }
.rec-waveform span:nth-child(4) { height: 12px; animation-delay: 0.15s; }

.rec-cursor {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent-coral);
  animation: rec-blink 0.7s infinite;
}

@keyframes wave-bounce {
  0%, 100% { height: 3px; }
  50% { height: 12px; }
}

@keyframes rec-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes rec-strip-glow {
  from { box-shadow: 0 0 4px rgba(212, 143, 56, 0.2); }
  to { box-shadow: 0 0 10px rgba(212, 143, 56, 0.6); }
}

/* ==========================================================================
   TELETYPE VOICE MESSAGE TAPE CASSETTE
   ========================================================================== */
.teletype-voice-tape {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #14171a;
  border: 1px solid #2e343b;
  border-radius: 4px;
  padding: 6px 12px;
  margin-top: 4px;
  cursor: pointer;
  user-select: none;
  max-width: 270px;
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.8);
  transition: background 0.15s, border-color 0.15s;
}

.teletype-voice-tape:hover {
  background: #1c2126;
  border-color: var(--accent-amber);
}

.voice-play-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #252b33;
  border: 1px solid #3d4550;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--accent-amber);
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.teletype-voice-tape.is-playing .voice-play-icon {
  background: var(--accent-coral);
  border-color: #fff;
  color: #fff;
  box-shadow: 0 0 8px rgba(217, 95, 71, 0.6);
}

.voice-meta {
  display: flex;
  flex-direction: column;
}

.voice-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-readout);
}

.voice-duration {
  font-size: 0.62rem;
  color: #727a85;
  font-family: var(--font-mono);
}

/* ==========================================================================
   FOOTER CHASSIS DETAILS & STATUS STRIP
   ========================================================================== */
.footer-panel {
  margin-top: 10px;
  border-top: 2px solid var(--chassis-border);
  padding-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #4a473f;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.footer-serial {
  text-transform: uppercase;
}

.footer-clock {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   LOW-BANDWIDTH WEBRTC VOICE LINK (14 KBPS AUDIO CARRIER)
   ========================================================================== */

.comms-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.comms-header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-mech-call {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  background: linear-gradient(180deg, #1f2b27 0%, #111a17 100%);
  color: var(--accent-cyan, #38d9a9);
  border: 1px solid rgba(56, 217, 169, 0.45);
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-mech-call:hover {
  background: linear-gradient(180deg, #283a35 0%, #182622 100%);
  border-color: var(--accent-cyan, #38d9a9);
  box-shadow: 0 0 8px rgba(56, 217, 169, 0.35);
}

.btn-mech-call.is-calling {
  color: var(--accent-amber, #ffd43b);
  border-color: var(--accent-amber, #ffd43b);
  animation: callPulse 1.2s infinite ease-in-out;
}

.btn-mech-call.is-in-call {
  background: linear-gradient(180deg, #1b332b 0%, #0d1e18 100%);
  color: #51cf66;
  border-color: #51cf66;
  box-shadow: 0 0 10px rgba(81, 207, 102, 0.4);
}

.btn-mech-call.is-incoming {
  background: linear-gradient(180deg, #1b3d33 0%, #0d261e 100%);
  color: #51cf66;
  border-color: #51cf66;
  animation: incomingPulse 0.8s infinite alternate ease-in-out;
}

@keyframes incomingPulse {
  0% { box-shadow: 0 0 4px rgba(81, 207, 102, 0.4); transform: scale(1); }
  100% { box-shadow: 0 0 16px rgba(81, 207, 102, 0.9); transform: scale(1.04); }
}

@keyframes callPulse {
  0% { box-shadow: 0 0 2px rgba(255, 212, 59, 0.4); }
  50% { box-shadow: 0 0 12px rgba(255, 212, 59, 0.8); }
  100% { box-shadow: 0 0 2px rgba(255, 212, 59, 0.4); }
}

.call-btn-icon {
  font-size: 0.75rem;
  line-height: 1;
}

/* Active Voice Call HUD Bar */
.active-call-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  margin-bottom: 6px;
  background: #0f1614;
  border: 1px solid rgba(56, 217, 169, 0.35);
  border-radius: 4px;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8), 0 0 10px rgba(56, 217, 169, 0.15);
  flex-shrink: 0;
  animation: slideDownBar 0.2s ease-out;
}

@keyframes slideDownBar {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.call-hud-info {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.call-live-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #495057;
  border: 1px solid #212529;
  transition: all 0.12s ease;
  flex-shrink: 0;
}

.call-live-led.is-active {
  background: #51cf66;
  border-color: #2f9e44;
  box-shadow: 0 0 8px #51cf66;
}

.call-live-led.is-speaking {
  background: #ff6b6b;
  border-color: #c92a2a;
  box-shadow: 0 0 10px #ff6b6b;
  animation: pulseLed 0.4s infinite alternate;
}

@keyframes pulseLed {
  from { transform: scale(1); }
  to { transform: scale(1.25); }
}

.call-peer-name {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-readout, #e6edf3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-timer {
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-cyan, #38d9a9);
  letter-spacing: 1px;
}

.call-bitrate-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.55rem;
  font-weight: 800;
  color: #ffd43b;
  background: rgba(255, 212, 59, 0.12);
  border: 1px solid rgba(255, 212, 59, 0.35);
  padding: 1px 4px;
  border-radius: 2px;
  letter-spacing: 0.5px;
}

.call-hud-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-call-tool {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  font-size: 0.58rem;
  font-weight: 800;
  background: #181c1f;
  border: 1px solid #333a42;
  border-radius: 3px;
  color: #a0aec0;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-call-tool:hover {
  background: #23292e;
  border-color: #4a5568;
  color: #fff;
}

.btn-call-tool.active-muted {
  background: rgba(255, 107, 107, 0.15);
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.btn-call-tool.active-deafened {
  background: rgba(255, 212, 59, 0.15);
  border-color: #ffd43b;
  color: #ffd43b;
}

/* Call Voice Volume Bay */
.call-volume-bay {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-tool-callvol {
  font-family: var(--font-mono, monospace);
  font-variant-numeric: tabular-nums;
  gap: 3px;
}

.btn-tool-callvol.is-muted {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.4);
}

.call-vol-flyout {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #14171a;
  border: 2px solid var(--chassis-border, #333a42);
  border-radius: 6px;
  padding: 6px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9), 0 0 12px rgba(255, 212, 59, 0.15);
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 1500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.call-volume-bay:hover .call-vol-flyout,
.call-vol-flyout.is-open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.call-range-slider::-webkit-slider-thumb {
  background: linear-gradient(180deg, #ffd43b 0%, #fab005 100%) !important;
  border-color: #f59f00 !important;
  box-shadow: 0 0 8px rgba(255, 212, 59, 0.6) !important;
}

.call-range-slider::-moz-range-thumb {
  background: linear-gradient(180deg, #ffd43b 0%, #fab005 100%) !important;
  border-color: #f59f00 !important;
  box-shadow: 0 0 8px rgba(255, 212, 59, 0.6) !important;
}

.btn-tool-hangup {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.4);
  color: #ff6b6b;
}

.btn-tool-hangup:hover {
  background: #c92a2a;
  border-color: #e03131;
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

/* Incoming Call Radar Modal */
.call-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: rgba(6, 9, 12, 0.92) !important;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999999 !important;
  padding: 16px;
  box-sizing: border-box;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  touch-action: manipulation;
  pointer-events: auto;
}

.call-modal-housing {
  width: 90% !important;
  max-width: 380px !important;
  text-align: center;
  border: 4px solid var(--accent-cyan, #38d9a9) !important;
  box-shadow: 0 0 35px rgba(56, 217, 169, 0.35), 0 20px 40px rgba(0, 0, 0, 0.9) !important;
  background: #111715 !important;
  position: relative !important;
  z-index: 1000000 !important;
  padding: 22px 18px !important;
  margin: auto !important;
  box-sizing: border-box !important;
  border-radius: 8px !important;
}

.call-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 6px;
  gap: 12px;
}

.radar-ping-container {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.radar-ping-icon {
  font-size: 2rem;
  z-index: 2;
  filter: drop-shadow(0 0 10px rgba(56, 217, 169, 0.8));
}

.radar-ping-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan, #38d9a9);
  opacity: 0;
  animation: radarPing 1.8s infinite cubic-bezier(0.2, 0.6, 0.3, 1);
}

.radar-ping-circle.ping-2 {
  animation-delay: 0.9s;
}

@keyframes radarPing {
  0% { transform: scale(0.3); opacity: 1; }
  80% { transform: scale(1.6); opacity: 0.1; }
  100% { transform: scale(1.9); opacity: 0; }
}

.incoming-caller-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #8b949e;
  text-transform: uppercase;
}

.incoming-caller-name {
  font-family: var(--font-mono, monospace);
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--accent-cyan, #38d9a9);
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(56, 217, 169, 0.5);
  text-transform: uppercase;
}

.incoming-call-notice {
  font-size: 0.58rem;
  color: #6e7681;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  max-width: 280px;
}

.incoming-call-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

.btn-call-accept {
  flex: 1.3;
  padding: 12px 14px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  background: linear-gradient(180deg, #1b3d33 0%, #0d261e 100%);
  color: #51cf66;
  border: 1px solid #51cf66;
  box-shadow: 0 0 12px rgba(81, 207, 102, 0.35);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-call-accept:active,
.btn-call-accept:hover {
  background: #51cf66;
  color: #0d261e;
  box-shadow: 0 0 20px rgba(81, 207, 102, 0.6);
}

.btn-call-decline {
  flex: 1;
  padding: 12px 14px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  background: linear-gradient(180deg, #3d1b1b 0%, #260d0d 100%);
  color: #ff6b6b;
  border: 1px solid #ff6b6b;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-call-decline:active,
.btn-call-decline:hover {
  background: #ff6b6b;
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
}

/* ==========================================================================
   TABLET & COMPACT DESKTOP (960PX AND BELOW)
   ========================================================================== */
@media (max-width: 960px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: 8px;
  }
}

/* ==========================================================================
   MOBILE ARCHITECTURE: DUAL PANE (VIDEO PERMANENTLY AT TOP + CHAT BELOW)
   ========================================================================== */
@media (max-width: 768px) {
  html, body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  .chassis-screw {
    display: none;
  }

  .instrument-rack {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Compact Header on Mobile */
  .header-panel {
    padding-bottom: 2px;
    margin-bottom: 3px;
    border-bottom-width: 2px;
    flex-wrap: nowrap;
    gap: 4px;
    flex-shrink: 0;
  }

  .model-plate {
    display: none;
  }

  .header-left-cluster {
    flex: 1;
    gap: 4px;
  }

  .patch-bay {
    padding: 2px 4px;
    gap: 3px;
  }

  .patch-input {
    width: 58px;
    font-size: 0.70rem;
  }

  .btn-mech-close-room {
    padding: 2px 5px !important;
    font-size: 0.62rem !important;
  }

  .header-right-cluster {
    gap: 4px;
  }

  .operator-badge-btn {
    padding: 2px 5px;
    font-size: 0.65rem;
  }

  .telemetry-cluster {
    padding: 2px 5px;
    gap: 5px;
  }

  .led-label {
    font-size: 0.58rem;
  }

  /* Compact Feed Loader on Mobile */
  .feed-loader-strip {
    padding: 2px 4px;
    margin-bottom: 3px;
    border-width: 2px;
    gap: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }

  .feed-label {
    display: none;
  }

  .feed-input-well {
    padding: 3px 6px;
    min-width: 0 !important;
    flex: 1 1 0% !important;
  }

  .feed-input {
    font-size: 0.72rem;
  }

  .btn-label-full {
    display: none !important;
  }
  .btn-label-short {
    display: inline !important;
  }

  #btnLoadFeed {
    flex-shrink: 0 !important;
    padding: 3px 6px !important;
    font-size: 0.65rem !important;
  }

  .btn-library-toggle {
    flex-shrink: 0 !important;
    padding: 3px 6px !important;
    font-size: 0.65rem !important;
  }

  .btn-search-toggle {
    flex-shrink: 0 !important;
    padding: 3px 6px !important;
    font-size: 0.65rem !important;
  }

  .search-modal-housing {
    width: 96% !important;
    max-height: 92vh !important;
    padding: 10px !important;
  }

  .search-results-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    max-height: 55vh !important;
  }
  .search-card {
    min-height: 230px !important;
  }
  .search-card-poster {
    height: 140px !important;
    min-height: 120px !important;
  }

  .drawer-episodes-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    max-height: 50vh !important;
  }
  .episode-card {
    min-height: 190px !important;
  }
  .episode-card-still {
    height: 100px !important;
    min-height: 85px !important;
  }

  .library-modal-housing {
    width: 96% !important;
    max-height: 90vh !important;
    padding: 10px !important;
  }

  .library-tracks-list {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
    max-height: 52vh !important;
  }

  .library-track-card {
    padding: 4px !important;
  }
  .track-thumb-box {
    height: 65px !important;
  }

  /* Vertical Layout on Mobile */
  .workspace-grid {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 4px;
    overflow: hidden;
  }

  /* Video scope is FIXED at top, NEVER scrolls away */
  .scope-housing {
    flex-shrink: 0;
    max-height: 48vh !important;
    padding: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    margin-left: -4px !important;
    margin-right: -4px !important;
    width: calc(100% + 8px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .scope-header-readout {
    padding: 2px 4px;
    margin-bottom: 2px;
    font-size: 0.62rem;
  }

  /* Stable full-width 16:9 video screen without black pillarboxes */
  .video-screen-wrapper {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    min-height: 120px !important;
    max-height: calc(48vh - 75px) !important;
    flex: none !important;
    padding-top: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-radius: 0 !important;
  }

  .scope-control-strip {
    margin-top: 3px;
    padding: 3px 4px;
    flex-shrink: 0;
  }

  .transport-buttons {
    gap: 2px;
  }

  .btn-mech {
    padding: 4px 6px;
    font-size: 0.68rem;
  }

  .time-gauge {
    padding: 2px 4px;
    font-size: 0.68rem;
  }

  /* Video volume bay mobile layout */
  .btn-vol-toggle {
    padding: 3px 5px;
    font-size: 0.62rem;
  }

  .btn-vol-toggle .vol-icon {
    font-size: 0.72rem;
  }

  .btn-vol-toggle .vol-readout {
    font-size: 0.6rem;
  }

  .vol-slider-flyout {
    bottom: calc(100% + 4px);
    left: auto;
    right: 0;
    transform: translateY(4px);
    padding: 6px 8px;
    gap: 6px;
  }

  .vol-slider-flyout::after {
    left: auto;
    right: 18px;
    transform: none;
  }

  .video-volume-bay:hover .vol-slider-flyout,
  .vol-slider-flyout.is-open {
    transform: translateY(0);
  }

  .mech-slider {
    width: 80px;
    height: 5px;
  }

  /* Scrubber mobile sizing */
  .analog-scrubber-well {
    margin: 3px 0 1px 0;
    padding: 6px 0;
  }
  .scrubber-track {
    height: 7px;
  }
  .scrubber-needle {
    width: 10px;
    height: 16px;
  }

  /* Communications deck takes remaining height */
  .comms-housing {
    flex: 1;
    min-height: 0;
    padding: 4px;
    display: flex;
    flex-direction: column;
    border-width: 2px;
    overflow: hidden;
  }

  .comms-header {
    padding-bottom: 2px;
    margin-bottom: 2px;
    flex-shrink: 0;
  }

  .comms-title {
    font-size: 0.68rem;
  }

  .teletype-screen {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px;
    font-size: 0.72rem;
  }

  .comms-input-bay {
    flex-shrink: 0;
    margin-top: 4px;
    padding-bottom: 1px;
    display: flex;
    gap: 4px;
  }

  .comms-textarea {
    min-height: 36px;
    height: 36px;
    padding: 6px 8px;
    font-size: 0.74rem;
  }

  .footer-panel {
    display: none;
  }

  .btn-mech-call {
    padding: 2px 6px;
    font-size: 0.58rem;
  }

  .active-call-bar {
    padding: 3px 6px;
    margin-bottom: 3px;
  }

  .call-peer-name {
    max-width: 65px;
    font-size: 0.62rem;
  }

  .btn-call-tool {
    padding: 2px 4px;
    font-size: 0.52rem;
  }

  .btn-tool-callvol {
    padding: 2px 4px;
    font-size: 0.52rem;
  }

  .call-vol-flyout {
    bottom: calc(100% + 4px);
    right: 0;
    padding: 6px 8px;
    gap: 6px;
  }

  .call-modal-backdrop {
    padding: 12px !important;
  }

  .call-modal-housing {
    width: 92% !important;
    max-width: 330px !important;
    padding: 18px 14px !important;
  }

  .incoming-caller-name {
    font-size: 1.15rem !important;
  }

  .btn-call-accept,
  .btn-call-decline {
    min-height: 48px !important;
    padding: 12px 8px !important;
    font-size: 0.72rem !important;
  }
}
