/* Monday HUD — neon holographic style, matched to the reference */

:root {
  --void: #02080e;
  --cyan: #00e5ff;
  --cyan-hot: #b8ffff;
  --cyan-mid: #00c8d8;
  --cyan-dim: rgba(0, 229, 255, 0.45);
  --red: #e01018;
  --text: rgba(180, 245, 255, 0.92);
  --reactor-size: min(64vw, 268px);
  --mic-level: 0.15;
  --audio-level: 0.35;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --hud-pad: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  width: 100%;
  background: #000;
  color: var(--text);
  font-family: "Rajdhani", "Outfit", "SF Pro Display", sans-serif;
  overflow: hidden;
  touch-action: manipulation;
  overscroll-behavior: none;
}

body { min-height: 100dvh; min-height: -webkit-fill-available; }

#app {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100dvh;
  height: 100vh;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, #041820 0%, var(--void) 55%, #010204 100%);
  overflow: hidden;
}

#hud-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }

.hud-wash {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 50% 44%, rgba(0, 80, 110, 0.18), transparent 70%),
    radial-gradient(ellipse 30% 24% at 80% 20%, rgba(0, 60, 90, 0.12), transparent 70%);
}

.vignette {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, transparent 40%, rgba(0,0,0,0.45) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 12%, transparent 90%, rgba(0,0,0,0.55) 100%);
}

.grain {
  position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0.04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ---------- Layout ---------- */

.hud {
  position: relative;
  z-index: 3;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr auto auto;
  grid-template-areas:
    "top"
    "left"
    "center"
    "right"
    "graphs";
  padding: calc(var(--safe-top) + 8px) var(--hud-pad) calc(var(--safe-bottom) + 14px);
  gap: 6px;
  pointer-events: none;
}

.hud > * { min-width: 0; }
.hud button, .hud a { pointer-events: auto; }

.hud-top { grid-area: top; }
.col-left { grid-area: left; display: flex; flex-direction: column; gap: 8px; }
.col-center { grid-area: center; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; overflow: visible; }
.col-right { grid-area: right; display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.hud-graphs { grid-area: graphs; }

.brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 2px 4px;
}

.wordmark {
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.62em;
  text-transform: uppercase;
  text-indent: 0.62em;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.7), 0 0 28px rgba(0, 229, 255, 0.35);
}

.sys-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.45);
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 58%;
  text-align: right;
}

/* ---------- Date strip: day numbers, today boxed ---------- */

.date-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0;
  padding: 0 0 2px;
}

.date-cell {
  flex: 1;
  text-align: center;
  padding: 3px 0;
  min-width: 0;
}

.date-cell .dow { display: none; }

.date-cell .dom {
  display: inline-block;
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(0, 229, 255, 0.72);
  min-width: 1.4em;
  padding: 1px 3px;
}

.date-cell.is-today .dom {
  color: #fff;
  background: transparent;
  box-shadow: 0 0 0 1.5px var(--cyan), 0 0 10px rgba(0, 229, 255, 0.55);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.8);
  padding: 1px 5px;
}

.date-cell.is-muted .dom { opacity: 0.38; }

/* ---------- Thick glowing gauges ---------- */

.gauge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.gauge {
  position: relative;
  flex: 1;
  max-width: 96px;
}

.gauge svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.65)); }

.gauge-track {
  fill: none;
  stroke: rgba(0, 229, 255, 0.12);
  stroke-width: 7;
}

.gauge-track.thick { stroke-width: 9; }

.gauge-arc {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 9;
  stroke-linecap: butt;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-dasharray: 200;
  stroke-dashoffset: 40;
}

.gauge-clock {
  flex: 1.35;
  max-width: 132px;
}

.gauge-clock .gauge-arc,
.gauge-clock .gauge-track { stroke-width: 11; }

.gauge-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.gauge-face strong {
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-weight: 600;
  font-size: 11px;
  color: var(--cyan-hot);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.7);
  line-height: 1;
}

.gauge-clock .gauge-face strong {
  font-size: 16px;
  letter-spacing: 0.06em;
}

.gauge-clock .gauge-face span {
  font-family: "Rajdhani", sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--cyan);
  margin-top: 2px;
  opacity: 0.8;
}

.gauge-face span {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(0, 229, 255, 0.7);
  margin-top: 2px;
}

/* ---------- Weather ---------- */

.weather-panel { padding: 2px 0 0; }

.weather-now {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weather-temp {
  display: flex;
  align-items: flex-start;
  color: var(--cyan-hot);
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.55);
  flex-shrink: 0;
}

.temp-value {
  font-family: "Orbitron", sans-serif;
  font-weight: 600;
  font-size: 34px;
  line-height: 0.9;
}

.temp-unit {
  font-family: "Rajdhani", sans-serif;
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
  margin-left: 1px;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

.weather-icon {
  width: 42px;
  height: 42px;
  color: var(--cyan);
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.55));
  flex-shrink: 0;
}
.weather-icon svg { width: 100%; height: 100%; display: block; }

.weather-meta { min-width: 0; flex: 1; }

.weather-place {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.weather-cond {
  font-size: 13px;
  font-weight: 500;
  color: rgba(200, 245, 255, 0.9);
}

.weather-stats, .weather-sun {
  display: flex;
  gap: 10px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(0, 229, 255, 0.7);
}

.forecast {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 229, 255, 0.15);
}

.forecast-day { flex: 1; text-align: center; }

.forecast-day .dow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0, 229, 255, 0.55);
}

.forecast-day .icon {
  width: 22px;
  height: 22px;
  margin: 3px auto 1px;
  color: var(--cyan);
  filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.45));
}
.forecast-day .icon svg { width: 100%; height: 100%; display: block; }

.forecast-day .temps {
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  font-size: 11px;
  color: var(--cyan-hot);
}
.forecast-day .temps em { font-style: normal; color: rgba(0, 229, 255, 0.45); font-weight: 500; }
.forecast-day.is-today .dow { color: var(--cyan-hot); }

/* ---------- Reactor ---------- */

.core-stack {
  position: relative;
  width: var(--reactor-size);
  height: var(--reactor-size);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: visible;
}

.reactor-btn {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  outline: none;
  z-index: 3;
  pointer-events: auto;
  overflow: visible;
}

.reactor-btn:focus-visible { box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.4); }

.reactor-svg-wrap { position: relative; z-index: 3; width: 100%; height: 100%; overflow: visible; }
.reactor-svg-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }

.reactive-halo {
  position: absolute;
  left: 50%; top: 50%;
  width: 100%; height: 100%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  transform: translate(-50%, -50%) scale(calc(1.02 + var(--mic-level) * 0.1));
  box-shadow: 0 0 28px 8px rgba(0, 229, 255, calc(0.08 + var(--mic-level) * 0.4));
  opacity: 0;
  transition: opacity 0.35s ease;
}

#spin-a, #spin-b, #spin-c, #core-orb, #rings-inner {
  transform-box: view-box;
  transform-origin: 250px 250px;
}

.state-idle #spin-a { animation: spin-cw 48s linear infinite; }
.state-idle #spin-b { animation: spin-ccw 72s linear infinite; }
.state-idle #spin-c { animation: spin-cw 110s linear infinite; }
.state-idle #core-orb { animation: orb-idle 3.6s ease-in-out infinite; }

.state-listening .reactive-halo { opacity: 1; }
.state-listening #spin-a { animation: spin-cw 5.5s linear infinite; }
.state-listening #spin-b { animation: spin-ccw 7.5s linear infinite; }
.state-listening #spin-c { animation: spin-cw 11s linear infinite; }
.state-listening #rings-inner { animation: spin-ccw 16s linear infinite; }
.state-listening #core-orb { transform: scale(calc(1 + var(--mic-level) * 0.06)); }

.state-speaking #spin-a { animation: spin-cw 14s linear infinite; }
.state-speaking #spin-b { animation: spin-ccw 18s linear infinite; }
.state-speaking #core-orb {
  transform: scale(calc(0.98 + var(--audio-level) * 0.1));
  filter: brightness(calc(1 + var(--audio-level) * 0.5));
}

.state-thinking #spin-a { animation: spin-cw 12s linear infinite; }
.state-thinking #spin-b { animation: spin-ccw 16s linear infinite; }

@keyframes spin-cw  { to { transform: rotate(360deg); } }
@keyframes spin-ccw { to { transform: rotate(-360deg); } }
@keyframes orb-idle {
  0%, 100% { opacity: 0.92; }
  50%      { opacity: 1; }
}

html[data-icon] #reactor-labels { display: none; }

/* ---------- Clock readout / status ---------- */

.clock-readout { text-align: center; margin-top: 2px; }
.clock-date {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(0, 229, 255, 0.7);
}

.status-block { margin-top: 4px; min-height: 2.2em; text-align: center; max-width: 22rem; }

.status {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  text-indent: 0.42em;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.45);
}

.state-listening .status { animation: status-soft 1.6s ease-in-out infinite; }
.state-speaking .status { color: var(--cyan-hot); }

@keyframes status-soft { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }

.line {
  margin-top: 4px;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(200, 245, 255, 0.85);
}
.line[hidden] { display: none; }

.diag {
  margin: 6px auto 0;
  max-width: 20rem;
  font-weight: 600;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(160, 235, 255, 0.7);
}
.diag[hidden] { display: none; }
.diag[data-level="warn"] { color: #ffc861; text-shadow: 0 0 8px rgba(255, 190, 80, 0.35); }
.diag[data-level="error"] { color: #ff6b7a; text-shadow: 0 0 8px rgba(255, 90, 110, 0.4); }
html[data-icon] .diag, html[data-preview] .diag { display: none; }

/* ---------- News ---------- */

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.panel-sub { letter-spacing: 0.14em; color: rgba(0, 229, 255, 0.5); }

.news-list { list-style: none; display: flex; flex-direction: column; gap: 5px; overflow: hidden; }

.news-list li {
  padding-left: 10px;
  position: relative;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  color: rgba(190, 240, 255, 0.88);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 4px; height: 4px;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

.news-list li time {
  display: block;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(0, 229, 255, 0.45);
  margin-top: 1px;
  text-transform: uppercase;
}

.news-empty { color: rgba(0, 229, 255, 0.45); font-size: 11px; }
.news-empty::before { display: none; }

.world-clocks { display: flex; justify-content: flex-start; gap: 16px; }

.world-clock { text-align: left; }
.world-clock .wc-name {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(0, 229, 255, 0.5);
}
.world-clock .wc-time {
  display: block;
  font-family: "Orbitron", sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

/* ---------- Activity graphs ---------- */

.hud-graphs { display: flex; flex-direction: column; gap: 3px; padding-top: 2px; }

.graph-block { min-width: 0; }

.graph-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0, 229, 255, 0.55);
}

.graph-canvas { width: 100%; height: 28px; display: block; }

/* ---------- Portrait packing ---------- */

@media (orientation: portrait) {
  .news-list li:nth-child(n+4) { display: none; }
  .date-cell:nth-child(n+12) { display: none; }
  .weather-stats { display: none; }
}

/* ---------- Landscape ---------- */

@media (orientation: landscape) and (min-aspect-ratio: 1.15) {
  :root { --reactor-size: min(52vh, 230px); --hud-pad: 16px; }

  .hud {
    grid-template-columns: minmax(210px, 1fr) minmax(240px, 1.1fr) minmax(210px, 1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "top top top"
      "left center right"
      "graphs graphs graphs";
    gap: 6px 14px;
    padding: calc(var(--safe-top) + 6px) 20px calc(var(--safe-bottom) + 8px);
  }

  .col-left, .col-right { max-height: none; }
  .gauge-row { flex-wrap: wrap; }
  .gauge-clock { flex-basis: 46%; max-width: 140px; }
  .date-cell:nth-child(n+12) { display: block; }
  .news-list li:nth-child(n+4) { display: -webkit-box; }
  .news-list li:nth-child(n+6) { display: none; }
  .weather-stats { display: flex; }
  .clock-date { display: none; }
  .hud-graphs { flex-direction: row; gap: 16px; }
  .graph-canvas { height: 26px; }
  .status { font-size: 10px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  :root { --reactor-size: min(44vh, 188px); }
  .temp-value { font-size: 28px; }
  .gauge-clock .gauge-face strong { font-size: 14px; }
  .forecast-day .icon { width: 18px; height: 18px; }
}

/* ---------- Preview chrome ---------- */

.ios-status, .home-indicator { display: none; }

html[data-preview] { --safe-top: 54px; --safe-bottom: 34px; }

html[data-preview] .ios-status {
  display: flex;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 8;
  height: 54px;
  padding: 14px 28px 0;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  color: #fff;
  font-family: "Outfit", "SF Pro Display", sans-serif;
  font-weight: 500;
  font-size: 15px;
}

html[data-preview] .ios-status .time { width: 64px; text-align: left; padding-top: 2px; }
html[data-preview] .ios-status .island {
  position: absolute; left: 50%; top: 11px; transform: translateX(-50%);
  width: 120px; height: 34px; background: #000; border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
}
html[data-preview] .ios-status .sys {
  width: 72px; display: flex; justify-content: flex-end; gap: 6px; padding-top: 4px; align-items: center;
}
html[data-preview] .home-indicator {
  display: block; position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  width: 128px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.85);
  z-index: 8; pointer-events: none;
}

@media (orientation: landscape) {
  html[data-preview] { --safe-top: 22px; --safe-bottom: 20px; }
  html[data-preview] .ios-status { height: 22px; padding: 4px 24px 0; font-size: 12px; }
  html[data-preview] .ios-status .island { display: none; }
  html[data-preview] .home-indicator { width: 110px; height: 4px; bottom: 5px; }
}

html[data-icon] .hud-top,
html[data-icon] .col-left,
html[data-icon] .col-right,
html[data-icon] .clock-readout,
html[data-icon] .status-block,
html[data-icon] .hud-graphs,
html[data-icon] .vignette,
html[data-icon] .grain,
html[data-icon] .hud-wash,
html[data-icon] .ios-status,
html[data-icon] .home-indicator,
html[data-icon] #hud-bg { display: none !important; }

html[data-icon] #app { background: #02080e; }
html[data-icon] .hud {
  display: grid; place-items: center; padding: 0;
  grid-template-areas: "center"; grid-template-rows: 1fr; grid-template-columns: 1fr;
}
html[data-icon] .col-center { width: 100%; height: 100%; }
html[data-icon] .core-stack { width: 82%; height: 82%; }

@media (prefers-reduced-motion: reduce) {
  #spin-a, #spin-b, #spin-c, #rings-inner, #core-orb, .state-listening .status {
    animation: none !important;
  }
}


/* ---------- Voice mode toggle ---------- */

.mode-btn {
  position: absolute;
  right: -10px;
  bottom: 2px;
  z-index: 3;
  padding: 5px 12px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.06);
  color: rgba(0, 229, 255, 0.8);
  font: 600 9px/1 "Rajdhani", sans-serif;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
  cursor: pointer;
}
.mode-btn[aria-pressed="false"] { color: rgba(180, 245, 255, 0.55); border-color: rgba(180, 245, 255, 0.2); background: transparent; }
html[data-icon] .mode-btn, html[data-preview] .mode-btn { display: none; }

/* ---------- Access gate ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(1, 6, 10, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 24px;
}
.gate[hidden] { display: none; }
.gate-card {
  width: min(320px, 100%);
  padding: 26px 22px 18px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 14px;
  background: rgba(2, 16, 24, 0.85);
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.12), inset 0 0 24px rgba(0, 229, 255, 0.05);
  text-align: center;
  display: grid;
  gap: 12px;
}
.gate-title {
  font: 600 20px/1 "Orbitron", sans-serif;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.5);
}
.gate-sub { font: 500 11px/1.3 "Rajdhani", sans-serif; letter-spacing: 0.28em; text-transform: uppercase; color: rgba(180, 245, 255, 0.7); }
.gate-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.4);
  background: rgba(0, 0, 0, 0.5);
  color: #e8fdff;
  font: 500 16px/1.2 "Outfit", sans-serif; /* 16px stops iOS zooming */
  letter-spacing: 0.08em;
  text-align: center;
  outline: none;
}
.gate-card input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15); }
.gate-card button {
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #19e9ff, #00b8cc);
  color: #00161c;
  font: 700 12px/1 "Rajdhani", sans-serif;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
}
.gate-card button:disabled { opacity: 0.6; }
.gate-error { min-height: 1.2em; font: 500 12px/1.3 "Outfit", sans-serif; color: #ff8a8a; letter-spacing: 0.02em; text-transform: none; }


/* ---------- Voice recognition ---------- */

.voices-btn {
  position: absolute;
  left: -10px;
  bottom: 2px;
  z-index: 3;
  padding: 5px 12px;
  border: 1px solid rgba(180, 245, 255, 0.2);
  border-radius: 999px;
  background: transparent;
  color: rgba(180, 245, 255, 0.55);
  font: 600 9px/1 "Rajdhani", sans-serif;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
  cursor: pointer;
}
.voices-btn[data-on="1"] { color: var(--cyan); border-color: rgba(0, 229, 255, 0.35); background: rgba(0, 229, 255, 0.06); }
html[data-icon] .voices-btn, html[data-preview] .voices-btn { display: none; }

.who {
  margin-top: 3px;
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  text-transform: uppercase;
  color: rgba(160, 235, 255, 0.6);
}
.who::before { content: '◉ '; color: var(--cyan); }
.who[data-person="carmen"]::before { color: #ff8fd8; }
.who[hidden] { display: none; }

.who-ask { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.who-ask[hidden] { display: none; }
.who-ask button, .voices button {
  padding: 8px 16px;
  border: 1px solid rgba(0, 229, 255, 0.4);
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.08);
  color: var(--cyan);
  font-family: inherit;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}
.voices button:disabled { opacity: 0.5; }
.voices button.danger { border-color: rgba(255, 107, 122, 0.45); color: #ff8b96; background: rgba(255, 107, 122, 0.06); }

.voices {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 10, 16, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.voices[hidden] { display: none; }
.voices-card {
  width: min(420px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 18px 18px 20px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 16px;
  background: rgba(4, 22, 32, 0.92);
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.12);
  color: rgba(210, 248, 255, 0.9);
}
.voices-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.voices .voices-close { padding: 4px 10px; font-size: 12px; }
.voices-note { font-size: 12px; line-height: 1.45; color: rgba(190, 240, 255, 0.75); margin: 0 0 12px; }
.voices-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(0, 229, 255, 0.12); }
.voices-who { display: flex; flex-direction: column; gap: 3px; }
.voices-who strong { font-size: 14px; letter-spacing: 0.08em; }
.voices-who .ok { font-size: 11px; color: #7dffc4; }
.voices-who .none { font-size: 11px; color: rgba(190, 240, 255, 0.5); }
.voices-actions { display: flex; gap: 8px; }
.voices-sens { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid rgba(0, 229, 255, 0.12); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.voices-sens .seg { display: flex; gap: 4px; }
.voices-sens .seg button { padding: 6px 9px; font-size: 9px; background: transparent; border-color: rgba(180, 245, 255, 0.2); color: rgba(180, 245, 255, 0.6); }
.voices-sens .seg button[aria-pressed="true"] { background: rgba(0, 229, 255, 0.14); border-color: rgba(0, 229, 255, 0.5); color: var(--cyan); }
.voices-test { width: 100%; margin-top: 6px; }
.voices-result { min-height: 1.3em; margin: 10px 0 0; font-size: 12px; color: #ffd27a; text-align: center; }
.voices-step { font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--cyan); margin: 6px 0; }
.voices-phrase { font-size: 17px; line-height: 1.4; margin: 6px 0 12px; color: #fff; }
.voices-bar { height: 4px; border-radius: 2px; background: rgba(0, 229, 255, 0.12); overflow: hidden; margin-bottom: 12px; }
.voices-bar span { display: block; height: 100%; width: 0; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.voices .voices-rec { width: 100%; padding: 12px; font-size: 13px; }
.voices .voices-cancel { margin-top: 10px; background: transparent; border-color: rgba(180, 245, 255, 0.2); color: rgba(180, 245, 255, 0.6); }
.voices-title { margin: 0; font-size: 18px !important; }

/* ---------- Floating panels (in-app picture-in-picture) ---------- */
.fp-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.fp {
  position: fixed;
  display: flex; flex-direction: column;
  pointer-events: auto;
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 16px;
  background: rgba(3, 18, 27, 0.9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(0, 229, 255, 0.14);
  color: rgba(210, 248, 255, 0.92);
  font-family: "Rajdhani", "Outfit", "SF Pro Display", sans-serif;
  overflow: hidden;
  opacity: 0; transform: scale(0.94);
  transition: opacity 0.18s ease, transform 0.18s ease;
  -webkit-user-select: none; user-select: none;
}
.fp.fp-in { opacity: 1; transform: none; }
.fp.fp-out { opacity: 0; transform: scale(0.94); }
.fp.fp-dragging { transition: none; box-shadow: 0 14px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 229, 255, 0.25); }
.fp-bar {
  display: flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 4px 6px 4px 12px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.14);
  touch-action: none; cursor: grab;
}
.fp-dragging .fp-bar { cursor: grabbing; }
.fp-grip { width: 18px; height: 10px; border-top: 2px solid rgba(0,229,255,.45); border-bottom: 2px solid rgba(0,229,255,.45); flex: none; }
.fp-title { flex: 1; min-width: 0; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cyan-hot); }
.fp-btn {
  min-width: 34px; height: 32px; padding: 0 8px;
  border: 1px solid rgba(0, 229, 255, 0.28); border-radius: 9px;
  background: rgba(0, 229, 255, 0.06); color: var(--cyan-hot);
  font: inherit; font-size: 15px; line-height: 1; cursor: pointer;
  touch-action: manipulation;
}
.fp-btn:active { background: rgba(0, 229, 255, 0.2); }
.fp-close { color: #ff9aa4; border-color: rgba(255, 120, 135, 0.35); }
.fp-body { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.fp-resize {
  position: absolute; right: 0; bottom: 0; width: 28px; height: 28px; touch-action: none; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 55%, rgba(0,229,255,.5) 55%, rgba(0,229,255,.5) 62%, transparent 62%, transparent 72%, rgba(0,229,255,.5) 72%, rgba(0,229,255,.5) 79%, transparent 79%);
}

/* weather */
.wx { padding: 10px 12px 14px; }
.wx-msg { font-size: 13px; opacity: .8; padding: 10px 0; }
.wx-now { display: flex; align-items: center; gap: 10px; }
.wx-icon { font-size: 38px; line-height: 1; }
.wx-temp { font-size: 46px; font-weight: 600; color: var(--cyan-hot); line-height: 1; }
.wx-temp small { font-size: 16px; opacity: .7; margin-left: 2px; }
.wx-meta { font-size: 12px; line-height: 1.35; min-width: 0; }
.wx-place { font-weight: 600; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cyan-hot); }
.wx-sub { margin: 10px 0 4px; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; opacity: .65; }
.wx-hours { display: flex; gap: 4px; overflow-x: auto; list-style: none; padding-bottom: 6px; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
.wx-hours li { flex: none; width: 46px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; background: rgba(0,229,255,.05); font-size: 12px; }
.wx-hours .i { font-size: 18px; }
.wx-hours .t { font-weight: 600; }
.wx-hours .p { font-size: 10px; color: #7fc8ff; min-height: 12px; }
.wx-days { list-style: none; margin-top: 6px; }
.wx-days li { display: grid; grid-template-columns: 1fr 26px 38px 30px 40px 30px; align-items: center; gap: 4px; padding: 5px 4px; font-size: 13px; border-top: 1px solid rgba(0,229,255,.08); }
.wx-days li.sel { background: rgba(0,229,255,.1); border-radius: 8px; }
.wx-days .pr { font-size: 11px; color: #7fc8ff; text-align: right; }
.wx-days .lo { opacity: .65; text-align: right; }
.wx-days .bar { height: 4px; border-radius: 2px; background: linear-gradient(90deg, #4fc3ff, #ffcf5a); opacity: .7; }

/* youtube */
.yt { display: flex; flex-direction: column; height: 100%; }
.yt-frame { position: relative; flex: 1; min-height: 0; background: #000; }
.yt-frame iframe, .yt-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 4px 10px; border-radius: 10px; background: rgba(0,0,0,.7); font-size: 12px; pointer-events: none; white-space: nowrap; }
.yt-ctl { display: flex; align-items: center; gap: 6px; padding: 6px 30px 6px 8px; }
.yt-title { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: none; }
.yt-pip { font-size: 10px; opacity: .55; padding: 0 10px 6px; text-transform: none; }

/* spotify */
.sp { padding: 10px 12px 12px; text-transform: none; }
.sp-msg { font-size: 14px; margin-bottom: 6px; }
.sp-small { font-size: 11px; opacity: .65; }
.sp-err { font-size: 12px; color: #ffb3ba; padding: 0 12px 10px; text-transform: none; }
.sp-connect { margin: 6px 0 8px; padding: 10px 16px; border: 0; border-radius: 22px; background: #1ed760; color: #04110a; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.sp-card { display: flex; gap: 12px; align-items: flex-start; }
.sp-art { width: 84px; height: 84px; flex: none; border-radius: 10px; object-fit: cover; background: rgba(0,229,255,.08); }
.sp-info { flex: 1; min-width: 0; }
.sp-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cyan-hot); }
.sp-artist { font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-prog { height: 3px; margin: 6px 0 3px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; }
.sp-prog span { display: block; height: 100%; background: #1ed760; }
.sp-ctl { display: flex; gap: 6px; margin-top: 6px; }
.sp-dev { font-size: 11px; }
.sp-vol { width: 100%; margin-top: 6px; accent-color: #1ed760; }
.sp-devs { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sp-devs button { width: 100%; text-align: left; padding: 8px 10px; border: 1px solid rgba(0,229,255,.25); border-radius: 10px; background: rgba(0,229,255,.05); color: inherit; font: inherit; font-size: 13px; }
.hud .weather-panel { pointer-events: auto; cursor: pointer; }
.fp.fp-shown { transition: none; opacity: 1; transform: none; }
