:root {
  color-scheme: dark;
  --panel-black: rgba(6, 7, 9, 0.92);
  --panel-line: rgba(255, 255, 255, 0.11);
  --text: #eef1f5;
  --muted: #8f98a8;
  --red: #f23a31;
  --green: #74e89a;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

body {
  min-height: 100dvh;
}

.kiosk-stage {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: clamp(8px, 1.6vh, 18px);
  padding:
    max(10px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
  background: #000;
}

.kitt-console {
  position: relative;
  width: min(92vw, calc(78vh * 600 / 584));
  aspect-ratio: 600 / 584;
  overflow: hidden;
  border-radius: 13%;
  background: #141414;
  isolation: isolate;
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.78),
    0 0 34px rgba(255, 35, 12, 0.055);
}

.kitt-console > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1;
}

.kitt-spectrum-mask {
  position: absolute;
  left: 36.25%;
  top: 5.45%;
  width: 27.75%;
  height: 44.70%;
  background: rgb(20, 20, 20);
  z-index: 2;
}

.kitt-spectrum-column {
  position: absolute;
  top: 6.34%;
  height: 43.15%;
  display: grid;
  grid-template-rows: repeat(16, 1fr);
  gap: 1.05%;
  z-index: 3;
}

.kitt-spectrum-left {
  left: 37.33%;
  width: 5.83%;
}

.kitt-spectrum-center {
  left: 47.50%;
  width: 5.67%;
}

.kitt-spectrum-right {
  left: 57.33%;
  width: 5.67%;
}

.kitt-led {
  display: block;
  min-height: 0;
  border-radius: 1px;
  background: linear-gradient(
    180deg,
    rgba(95, 13, 6, 0.62),
    rgba(64, 6, 3, 0.78)
  );
  box-shadow:
    inset 0 1px rgba(255, 80, 45, 0.05),
    inset 0 -1px rgba(0, 0, 0, 0.45);
  transition:
    background 14ms linear,
    box-shadow 14ms linear,
    filter 14ms linear,
    opacity 14ms linear;
  opacity: 0.78;
}

.kitt-led.active {
  opacity: 1;
  background: linear-gradient(
    180deg,
    rgba(255, 76, 43, var(--led-intensity, 1)),
    rgba(231, 29, 8, var(--led-intensity, 1))
  );
  box-shadow:
    0 0 5px rgba(255, 33, 14, 0.72),
    0 0 11px rgba(255, 24, 5, 0.24),
    inset 0 1px rgba(255, 174, 143, 0.38);
  filter: saturate(1.18) brightness(1.08);
}

.kitt-led.peak {
  opacity: 0.92;
  background:
    linear-gradient(
      180deg,
      rgba(255, 62, 31, 0.72),
      rgba(178, 17, 5, 0.74)
    );
  box-shadow:
    0 0 3px rgba(255, 35, 15, 0.48),
    inset 0 1px rgba(255, 150, 120, 0.22);
  filter: saturate(1.12) brightness(0.96);
}


/* Compact interactive strip. The KITT image remains the main UI. */
.command-panel {
  width: min(880px, 96vw);
  border: 1px solid var(--panel-line);
  border-radius: 15px;
  padding: 8px 10px 7px;
  background:
    linear-gradient(180deg, rgba(17, 19, 24, 0.92), rgba(5, 6, 8, 0.96));
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.52),
    inset 0 0 18px rgba(255, 255, 255, 0.018);
  backdrop-filter: blur(14px);
}

.command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 78px;
  gap: 7px;
}

.command-input {
  width: 100%;
  min-width: 0;
  height: 43px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  outline: 0;
  padding: 0 13px;
  background: rgba(3, 4, 6, 0.88);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.command-input::placeholder {
  color: #616a78;
}

.command-input:focus {
  border-color: rgba(242, 58, 49, 0.5);
  box-shadow: 0 0 0 2px rgba(242, 58, 49, 0.075);
}

.command-button {
  height: 43px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #f5f5f5;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.command-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.send-button {
  background: linear-gradient(180deg, #d82e34, #98151a);
  border-color: rgba(255, 80, 80, 0.4);
}

.mic-button {
  background: rgba(255, 35, 35, 0.07);
  border-color: rgba(255, 70, 70, 0.28);
  color: #ff8981;
}

.mic-button.active {
  color: #fff;
  border-color: rgba(255, 80, 68, 0.78);
  background: rgba(255, 42, 31, 0.22);
  box-shadow: 0 0 18px rgba(255, 35, 24, 0.22);
}

.mic-button.listening {
  animation: mic-pulse 1.05s ease-out infinite;
}

.command-status {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 19px;
  padding: 4px 2px 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.13em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-light {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #69717e;
}

.status-light.ready {
  background: var(--green);
  box-shadow: 0 0 7px rgba(116, 232, 154, 0.5);
}

.status-light.busy,
.status-light.listening {
  background: var(--red);
  box-shadow: 0 0 8px rgba(242, 58, 49, 0.55);
}

@keyframes mic-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(255, 45, 32, 0.46),
      0 0 18px rgba(255, 35, 24, 0.24);
  }
  72% {
    box-shadow:
      0 0 0 10px rgba(255, 45, 32, 0),
      0 0 22px rgba(255, 35, 24, 0.3);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(255, 45, 32, 0),
      0 0 18px rgba(255, 35, 24, 0.2);
  }
}

@media (max-width: 600px) {
  .kiosk-stage {
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 8px;
  }

  .kitt-console {
    width: min(96vw, calc(68vh * 600 / 584));
  }

  .command-panel {
    width: 100%;
    border-radius: 12px;
  }

  .command-row {
    grid-template-columns: minmax(0, 1fr) 58px 64px;
    gap: 5px;
  }

  .command-input {
    font-size: 16px; /* prevents iOS zoom */
    padding: 0 10px;
  }

  .command-button {
    font-size: 9px;
    letter-spacing: 0.06em;
  }
}


/* Clickable console controls */
.kitt-hotspot {
  position: absolute;
  z-index: 6;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  border-radius: 40%;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
}
.kitt-hotspot:hover,
.kitt-hotspot:focus-visible {
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.13),
    0 0 13px rgba(255,72,38,.2);
}
.kitt-hotspot.pressed {
  background: rgba(255,255,255,.075);
  box-shadow:
    inset 0 0 10px rgba(255,255,255,.12),
    0 0 17px rgba(255,51,24,.3);
}

.hot-air     { left: 7.1%;  top: 14.4%; width: 16.7%; height: 11.8%; }
.hot-oil     { left: 7.1%;  top: 33.4%; width: 16.7%; height: 11.8%; }
.hot-p1      { left: 7.1%;  top: 52.9%; width: 16.7%; height: 11.8%; }
.hot-p2      { left: 7.1%;  top: 71.8%; width: 16.7%; height: 11.8%; }

.hot-s1      { left: 76.2%; top: 14.4%; width: 16.7%; height: 11.8%; }
.hot-s2      { left: 76.2%; top: 33.4%; width: 16.7%; height: 11.8%; }
.hot-p3      { left: 76.2%; top: 52.9%; width: 16.7%; height: 11.8%; }
.hot-p4      { left: 76.2%; top: 71.8%; width: 16.7%; height: 11.8%; }

.hot-auto    { left: 33.2%; top: 55.3%; width: 34.0%; height: 11.3%; border-radius: 6%; }
.hot-normal  { left: 33.2%; top: 68.8%; width: 34.0%; height: 11.3%; border-radius: 6%; }
.hot-pursuit { left: 33.2%; top: 82.1%; width: 34.0%; height: 10.8%; border-radius: 6%; }

/* Sky News World ticker */
.news-ticker {
  flex: 0 0 auto;
  min-height: 32px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: center;
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,.075);
  background: rgba(4,5,7,.97);
}
.news-label {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border-right: 1px solid rgba(255,255,255,.08);
  color: #ff6e66;
  background: rgba(116,8,10,.17);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  white-space: nowrap;
  z-index: 2;
}
.news-viewport {
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(
    90deg,
    transparent 0,
    black 18px,
    black calc(100% - 18px),
    transparent 100%
  );
}
.news-track {
  width: max-content;
  min-width: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  color: #ccd2db;
  font-size: 11px;
  letter-spacing: .025em;
  animation: kitt-news-scroll var(--news-duration,82s) linear infinite;
  will-change: transform;
}
.news-track:hover { animation-play-state: paused; }
.news-item { display: inline-flex; align-items: center; }
.news-item::after {
  content: "◆";
  margin: 0 19px;
  color: rgba(242,58,49,.75);
  font-size: 7px;
}
.news-item a { color: inherit; text-decoration: none; }
.news-item a:hover { color: #fff; text-decoration: underline; }

@keyframes kitt-news-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}


.kiosk-stage {
  grid-template-rows: minmax(0, 1fr) auto auto;
}

.kiosk-news {
  width: min(980px, 96vw);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  min-height: 30px;
  box-shadow: 0 10px 28px rgba(0,0,0,.38);
}

@media (max-width: 600px) {
  .kiosk-stage {
    grid-template-rows: minmax(0, 1fr) auto auto;
  }
  .kiosk-news { width: 100%; }
  .news-label { padding: 0 7px; font-size: 8px; }
  .news-track { font-size: 10px; }
}




.memory-status { display:grid; grid-template-columns:auto auto minmax(0,1fr); align-items:center; gap:8px; margin-top:7px; padding-top:7px; border-top:1px solid rgba(255,255,255,.06); color:#8c96a8; font-size:9px; letter-spacing:.09em; }
.memory-status strong { color:#ffb66d; font-size:9px; }
.memory-status strong.obsidian { color:#74e89a; }
.memory-status #memoryDetail { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; letter-spacing:.03em; text-transform:none; }


/* ---------------------------------------------------------------
   v3.7.3 clean kiosk UI
   Keep compatibility hooks in the DOM but never render them.
   --------------------------------------------------------------- */

.web-hidden-control,
[hidden].web-hidden-control,
.command-status.web-hidden-control,
.memory-status.web-hidden-control,
.music-diagnostics.web-hidden-control,
.kiosk-news.web-hidden-control,
#enableAudioButton,
#testAudioButton,
#buildBadge,
#musicDiagnostics {
  display: none !important;
}

/* Once the hidden rows are removed, the command panel is just input + SEND. */
.command-panel {
  padding-bottom: 8px;
}

.command-row {
  grid-template-columns: minmax(0, 1fr) 72px;
}

@media (max-width: 600px) {
  .command-row {
    grid-template-columns: minmax(0, 1fr) 64px;
  }
}


/* ---------------------------------------------------------------
   v3.8.0 mobile/car microphone
   --------------------------------------------------------------- */

.command-row {
  grid-template-columns: minmax(0, 1fr) 72px 78px;
}

#micButton {
  display: block !important;
}

.mic-button {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.mic-button.active {
  color: #fff;
  border-color: rgba(80, 255, 126, 0.58);
  background: rgba(21, 135, 59, 0.22);
  box-shadow: 0 0 18px rgba(39, 220, 92, 0.16);
}

.mic-button.listening {
  animation: none;
}

.mic-button.armed {
  color: #fff;
  border-color: rgba(255, 169, 66, 0.7);
  background: rgba(172, 91, 13, 0.24);
  box-shadow: 0 0 18px rgba(255, 146, 35, 0.18);
}

.mic-button.error {
  color: #fff;
  border-color: rgba(255, 75, 75, 0.72);
  background: rgba(160, 20, 24, 0.30);
}

.mic-toast {
  position: fixed;
  left: 50%;
  bottom: max(78px, calc(env(safe-area-inset-bottom) + 70px));
  transform: translateX(-50%);
  z-index: 100;
  width: min(92vw, 520px);
  padding: 10px 13px;
  border: 1px solid rgba(255, 90, 90, 0.28);
  border-radius: 10px;
  background: rgba(7, 9, 12, 0.96);
  color: #e9edf3;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 16px 42px rgba(0,0,0,.48);
  pointer-events: none;
}

.mic-toast.error {
  border-color: rgba(255, 80, 80, 0.52);
  color: #ffb1b1;
}

@media (max-width: 600px) {
  .command-row {
    grid-template-columns: minmax(0, 1fr) 58px 72px;
  }

  .mic-button,
  .send-button {
    min-width: 0;
  }
}
