/* ===========================================================================
   MIKEMETR // sci-fi surveillance console styling
   Pure CSS. No frameworks. Neon-on-black, scanlines, the works.
   =========================================================================== */

:root {
  --bg:        #03060c;
  --bg-panel:  rgba(8, 18, 30, 0.72);
  --grid-line: rgba(0, 229, 255, 0.07);
  --cyan:      #2ff3ff;
  --cyan-dim:  #1aa7b8;
  --magenta:   #ff2d78;
  --green:     #2bff9b;
  --amber:     #ffc24b;
  --text:      #cfeefb;
  --text-dim:  #5f7d93;
  --border:    rgba(47, 243, 255, 0.22);
  --glow-cyan: 0 0 8px rgba(47, 243, 255, 0.55);
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", "Fira Code", Menlo,
          Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(0, 90, 120, 0.25), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(120, 0, 70, 0.18), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* faint global grid backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px clamp(12px, 3vw, 32px) 40px;
}

/* ---------------- top bar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(10, 24, 38, 0.9), rgba(6, 14, 24, 0.7));
  box-shadow: var(--glow-cyan), inset 0 0 24px rgba(0, 229, 255, 0.06);
  margin-bottom: 18px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.logo {
  font-size: 38px;
  color: var(--cyan);
  text-shadow: 0 0 14px var(--cyan);
  animation: spin 9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.brand-text h1 {
  margin: 0;
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: 0.32em;
  color: #eafdff;
  text-shadow: 0 0 10px var(--cyan), 0 0 28px rgba(47, 243, 255, 0.45);
}
.subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  letter-spacing: 0.28em;
  color: var(--text-dim);
}

.topbar-right { text-align: right; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: 0.2em; color: var(--text-dim); }
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 8px var(--amber);
}
.status.online .status-dot { background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.8s ease-in-out infinite; }
.status.offline .status-dot { background: var(--magenta); box-shadow: 0 0 10px var(--magenta); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.sysclock {
  font-size: 22px;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  font-variant-numeric: tabular-nums;
}

/* glitch title flourish */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  width: 100%; overflow: hidden; opacity: 0.5;
}
.glitch::before { color: var(--magenta); transform: translate(1.5px, 0); clip-path: inset(0 0 55% 0); animation: gl 4s infinite linear alternate; }
.glitch::after  { color: var(--cyan);    transform: translate(-1.5px, 0); clip-path: inset(55% 0 0 0); animation: gl 3.3s infinite linear alternate-reverse; }
@keyframes gl { 0%{transform:translate(0,0);} 92%{transform:translate(0,0);} 94%{transform:translate(2px,-1px);} 96%{transform:translate(-2px,1px);} 100%{transform:translate(0,0);} }

/* ---------------- layout grid ---------------- */
.grid {
  display: grid;
  grid-template-columns: 1.05fr 1.5fr 1.05fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "gauge clock log"
    "hist  clock log"
    "seg   seg   seg"
    "heat  heat  heat";
  gap: 16px;
}

/* ---------------- panels ---------------- */
.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
  box-shadow: inset 0 0 30px rgba(0, 120, 160, 0.05), 0 0 0 1px rgba(0,0,0,0.3);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  letter-spacing: 0.24em;
  color: var(--cyan);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(47, 243, 255, 0.08), transparent);
  text-shadow: 0 0 6px rgba(47, 243, 255, 0.4);
}
.tag {
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--magenta);
  color: var(--magenta);
  border-radius: 3px;
  letter-spacing: 0.18em;
  text-shadow: 0 0 6px rgba(255, 45, 120, 0.5);
}
.panel-body { padding: 14px; flex: 1; min-height: 0; }

/* ---------------- gauge ---------------- */
.gauge-body { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-wrap { position: relative; width: 100%; max-width: 230px; aspect-ratio: 1 / 1; }
.gauge-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gauge-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge-value {
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 700;
  color: var(--green);
  text-shadow: 0 0 16px rgba(43, 255, 155, 0.65);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.gauge-unit { font-size: 13px; color: var(--text-dim); letter-spacing: 0.2em; margin-top: 4px; }
.gauge-caption {
  margin-top: 12px; font-size: 13px; letter-spacing: 0.16em;
  color: var(--amber); text-align: center; text-shadow: 0 0 6px rgba(255,194,75,0.4);
  min-height: 1.2em;
}

/* ---------------- radial clock ---------------- */
.clock-body { display: flex; flex-direction: column; gap: 10px; }
.clock-wrap { position: relative; width: 100%; aspect-ratio: 1 / 1; margin: 0 auto; flex: 1; min-height: 0; }
.clock-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.clock-wrap canvas:active { cursor: grabbing; }
/* feeding-imminent alarm overlay on the clock */
.clock-alarm {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;                /* never blocks dragging the hand */
  border-radius: 50%;
  z-index: 5;
}
.clock-alarm.active {
  display: flex;
  background: radial-gradient(circle at center, rgba(255, 46, 46, 0.20), transparent 65%);
  animation: alarmflash 0.66s ease-in-out infinite;
}
.alarm-mark {
  font-size: clamp(72px, 22vw, 156px);
  font-weight: 900; line-height: 0.9;
  color: #ff2e2e;
  text-shadow: 0 0 24px #ff2e2e, 0 0 64px rgba(255, 46, 46, 0.85);
}
.alarm-text {
  margin-top: 8px;
  font-size: clamp(12px, 2.4vw, 18px); font-weight: 700; letter-spacing: 0.34em;
  color: #ff6a6a; text-shadow: 0 0 14px rgba(255, 46, 46, 0.9);
}
@keyframes alarmflash { 0%, 100% { opacity: 1; } 50% { opacity: 0.1; } }

/* "clear to game" tick - same overlay as the alarm but green and NOT flashing */
.clock-gaming {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;                /* clicks pass through to dismiss */
  border-radius: 50%;
  z-index: 5;
}
.clock-gaming.active {
  display: flex;
  background: radial-gradient(circle at center, rgba(43, 255, 155, 0.18), transparent 65%);
}
.gaming-mark {
  font-size: clamp(72px, 22vw, 156px);
  font-weight: 900; line-height: 0.9;
  color: #2bff9b;
  text-shadow: 0 0 24px #2bff9b, 0 0 64px rgba(43, 255, 155, 0.8);
}
.gaming-text {
  margin-top: 8px;
  font-size: clamp(12px, 2.4vw, 18px); font-weight: 700; letter-spacing: 0.34em;
  color: #7dffc4; text-shadow: 0 0 14px rgba(43, 255, 155, 0.9);
}

/* "GYMCELLING" - purple X when the hand is inside a gym block (static) */
.clock-gym {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
  border-radius: 50%;
  z-index: 5;
}
.clock-gym.active {
  display: flex;
  background: radial-gradient(circle at center, rgba(177, 92, 255, 0.20), transparent 65%);
}
.gym-mark {
  font-size: clamp(72px, 22vw, 156px);
  font-weight: 900; line-height: 0.9;
  color: #b15cff;
  text-shadow: 0 0 24px #b15cff, 0 0 64px rgba(177, 92, 255, 0.8);
}
.gym-text {
  margin-top: 8px;
  font-size: clamp(12px, 2.4vw, 18px); font-weight: 700; letter-spacing: 0.34em;
  color: #cda4ff; text-shadow: 0 0 14px rgba(177, 92, 255, 0.9);
}

/* the whole clock panel pulses red while the alarm is live */
.panel.alarm-panel {
  border-color: rgba(255, 46, 46, 0.85);
  animation: panelalarm 0.66s ease-in-out infinite;
}
@keyframes panelalarm {
  0%, 100% { box-shadow: inset 0 0 44px rgba(255, 46, 46, 0.4), 0 0 26px rgba(255, 46, 46, 0.75); }
  50% { box-shadow: inset 0 0 30px rgba(255, 46, 46, 0.12), 0 0 6px rgba(255, 46, 46, 0.3); }
}

/* gauge / likelihood index: flashes in ANTI-PHASE with the clock alarm above
   (peaks at 50% of the cycle, where the clock is at its dimmest) */
.panel.alarm-panel-alt {
  border-color: rgba(255, 46, 46, 0.85);
  animation: panelalarm-alt 0.66s ease-in-out infinite;
}
@keyframes panelalarm-alt {
  0%, 100% { box-shadow: inset 0 0 30px rgba(255, 46, 46, 0.12), 0 0 6px rgba(255, 46, 46, 0.3); }
  50% { box-shadow: inset 0 0 44px rgba(255, 46, 46, 0.4), 0 0 26px rgba(255, 46, 46, 0.75); }
}
.panel.alarm-panel-alt .gauge-value {
  color: #ff2e2e !important;
  animation: gaugeflash 0.66s ease-in-out infinite;
}
@keyframes gaugeflash {
  0%, 100% { opacity: 0.18; text-shadow: none; }
  50% { opacity: 1; text-shadow: 0 0 18px #ff2e2e, 0 0 44px rgba(255, 46, 46, 0.8); }
}

.clock-legend {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  font-size: 12px; letter-spacing: 0.12em; color: var(--text-dim);
}
.clock-legend i.sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.sw-density { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.sw-event   { background: var(--magenta); box-shadow: 0 0 6px var(--magenta); border-radius: 50%; }
.sw-now     { background: var(--green); box-shadow: 0 0 6px var(--green); }
.sw-peak    { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.sw-likely  { background: #ff3b3b; box-shadow: 0 0 6px #ff3b3b; }
.sw-gaming  { width: 16px; height: 5px; border-radius: 3px; background: var(--green); box-shadow: 0 0 6px var(--green); }
.sw-gym     { width: 16px; height: 5px; border-radius: 3px; background: #b15cff; box-shadow: 0 0 6px #b15cff; }
.clock-model { text-align: center; font-size: 12px; letter-spacing: 0.1em; color: var(--text-dim); }
.clock-probe { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.probe-label { font-size: 12px; letter-spacing: 0.08em; color: var(--text-dim); }
.probe-label.probing { color: var(--amber); text-shadow: 0 0 6px rgba(255, 194, 75, 0.45); }
.reset-now {
  cursor: pointer; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  padding: 6px 11px; border-radius: 5px; white-space: nowrap;
  color: var(--green); background: rgba(43, 255, 155, 0.08); border: 1px solid var(--green);
  transition: background 0.15s ease, box-shadow 0.2s ease, transform 0.08s ease;
}
.reset-now:hover:not(:disabled) { background: rgba(43, 255, 155, 0.18); box-shadow: 0 0 10px rgba(43, 255, 155, 0.4); }
.reset-now:active:not(:disabled) { transform: translateY(1px); }
.reset-now:disabled { opacity: 0.3; cursor: default; color: var(--text-dim); border-color: var(--border); background: transparent; }

/* ---------------- histogram ---------------- */
.hist-body { display: flex; }
.hist-wrap { position: relative; width: 100%; height: 100%; min-height: 180px; }
.hist-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------------- event log + control ---------------- */
.log-body { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.control { display: flex; flex-direction: column; gap: 8px; }
#note-input {
  width: 100%;
  background: rgba(0, 20, 30, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 9px 10px;
  border-radius: 5px;
  outline: none;
}
#note-input:focus { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
#note-input::placeholder { color: var(--text-dim); }
#log-btn {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.16em;
  padding: 11px 12px;
  color: #02141a;
  font-weight: 700;
  background: linear-gradient(180deg, var(--cyan), var(--cyan-dim));
  border: none;
  border-radius: 5px;
  box-shadow: 0 0 14px rgba(47, 243, 255, 0.5);
  transition: transform 0.08s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
#log-btn:hover { box-shadow: 0 0 22px rgba(47, 243, 255, 0.85); filter: brightness(1.1); }
#log-btn:active { transform: translateY(1px) scale(0.99); }
#log-btn.flash { animation: btnflash 0.5s ease; }
@keyframes btnflash { 0% { background: var(--green); } 100% {} }

.log-row { display: flex; gap: 8px; }
.log-row > button { flex: 1; }
#gym-btn {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.12em;
  padding: 11px 12px;
  color: #160a23;
  font-weight: 700;
  background: linear-gradient(180deg, #b15cff, #7d3fbf);
  border: none;
  border-radius: 5px;
  box-shadow: 0 0 14px rgba(177, 92, 255, 0.5);
  transition: transform 0.08s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
#gym-btn:hover { box-shadow: 0 0 22px rgba(177, 92, 255, 0.85); filter: brightness(1.1); }
#gym-btn:active { transform: translateY(1px) scale(0.99); }
#gym-btn.flash { animation: btnflash 0.5s ease; }
#hist-kind {
  background: rgba(0, 20, 30, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 8px 6px;
  border-radius: 5px;
  outline: none;
  color-scheme: dark;
}
#hist-kind:focus { border-color: var(--cyan); box-shadow: var(--glow-cyan); }

.control-sep {
  text-align: center; font-size: 12px; letter-spacing: 0.14em;
  color: var(--text-dim); margin: 4px 0 2px;
}
.hist-row { display: flex; gap: 8px; }
#hist-datetime {
  flex: 1; min-width: 0;
  background: rgba(0, 20, 30, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 8px 9px;
  border-radius: 5px;
  outline: none;
  color-scheme: dark;            /* dark-themed native date picker */
}
#hist-datetime:focus { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
#hist-btn {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 8px 16px;
  color: var(--magenta);
  background: rgba(255, 45, 120, 0.08);
  border: 1px solid var(--magenta);
  border-radius: 5px;
  transition: background 0.15s ease, box-shadow 0.2s ease, transform 0.08s ease;
}
#hist-btn:hover { background: rgba(255, 45, 120, 0.18); box-shadow: 0 0 12px rgba(255, 45, 120, 0.45); }
#hist-btn:active { transform: translateY(1px); }
.hist-msg { font-size: 13px; min-height: 1.3em; letter-spacing: 0.03em; }
.hist-msg.err { color: var(--magenta); text-shadow: 0 0 6px rgba(255, 45, 120, 0.4); }
.hist-msg.ok  { color: var(--green); text-shadow: 0 0 6px rgba(43, 255, 155, 0.4); }

.event-log {
  list-style: none; margin: 0; padding: 0;
  overflow-y: auto; flex: 1; min-height: 120px; max-height: 360px;
  border-top: 1px solid var(--border); padding-top: 8px;
}
.event-log li {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  padding: 6px 6px; border-bottom: 1px dashed rgba(47,243,255,0.1);
  font-size: 14px;
}
.event-log li .ev-when { color: var(--text); }
.event-log li .ev-ago  { color: var(--text-dim); font-size: 13px; white-space: nowrap; }
.event-log li .ev-note { color: var(--amber); font-style: italic; }
.event-log li.new { animation: rowin 0.6s ease; }
@keyframes rowin { from { background: rgba(43,255,155,0.25); } to { background: transparent; } }
.event-empty { color: var(--text-dim); font-style: italic; }
.event-log::-webkit-scrollbar { width: 8px; }
.event-log::-webkit-scrollbar-thumb { background: rgba(47,243,255,0.25); border-radius: 4px; }

/* ---------------- heatmap ---------------- */
.heat-body { display: flex; flex-direction: column; gap: 10px; overflow-x: auto; }
.heatmap {
  display: grid;
  grid-template-columns: 38px repeat(24, 1fr);
  grid-auto-rows: 22px;
  gap: 3px;
  min-width: 620px;
}
.heat-cell { border-radius: 2px; background: rgba(47,243,255,0.04); position: relative; }
.heat-rowlabel, .heat-collabel {
  font-size: 11px; color: var(--text-dim); letter-spacing: 0.08em;
  display: flex; align-items: center; justify-content: center;
}
.heat-rowlabel { justify-content: flex-end; padding-right: 6px; }
.heat-scale { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.heat-grad {
  display: inline-block; width: 140px; height: 10px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(47,243,255,0.06), var(--cyan) 70%, #ffffff);
  box-shadow: 0 0 8px rgba(47,243,255,0.3);
}

/* ---------------- predictability by segment ---------------- */
.seg-body { display: flex; }
.segments {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}
.seg-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  background: rgba(0, 20, 30, 0.4);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.seg-card.empty { opacity: 0.45; }
.seg-top { display: flex; justify-content: space-between; align-items: baseline; }
.seg-name { font-size: 15px; letter-spacing: 0.12em; color: var(--text); }
.seg-range { font-size: 11px; color: var(--text-dim); letter-spacing: 0.08em; }
.seg-pct {
  font-size: 26px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.seg-track {
  height: 8px; border-radius: 4px;
  background: rgba(47, 243, 255, 0.08);
  overflow: hidden;
}
.seg-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.seg-meta { font-size: 12px; color: var(--text-dim); letter-spacing: 0.06em; }

/* ---------------- readout strip ---------------- */
.readouts {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.readout {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--bg-panel);
  box-shadow: inset 0 0 18px rgba(0,120,160,0.05);
}
.readout.hot { border-color: var(--magenta); box-shadow: 0 0 14px rgba(255,45,120,0.25), inset 0 0 18px rgba(255,45,120,0.06); }
.r-label { font-size: 11px; letter-spacing: 0.16em; color: var(--text-dim); margin-bottom: 6px; }
.r-value { font-size: 20px; color: var(--cyan); text-shadow: var(--glow-cyan); font-variant-numeric: tabular-nums; }
.readout.hot .r-value { color: var(--magenta); text-shadow: 0 0 8px rgba(255,45,120,0.6); }

/* ---------------- footer ---------------- */
.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 18px; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px; letter-spacing: 0.16em; color: var(--text-dim);
}
/* project motto / mission statement */
.motto {
  flex: 1; text-align: center;
  color: var(--cyan); letter-spacing: 0.22em;
  text-shadow: 0 0 8px rgba(47, 243, 255, 0.35);
}

/* ---------------- manufacturer mark (beside brand) ---------------- */
.mfr {
  align-self: flex-end;
  display: flex; flex-direction: row; align-items: flex-end; gap: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  text-decoration: none; color: var(--text-dim);
  opacity: 0.78; transition: opacity 0.2s ease;
}
.mfr:hover { opacity: 1; }
.mfr-label { font-size: 13px; letter-spacing: 0.28em; }
.mfr-logo {
  height: 28px; width: auto; display: block;
  filter: drop-shadow(0 0 6px rgba(47, 243, 255, 0.25));
}

/* ---------------- overlays ---------------- */
.scanlines {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0, 20, 30, 0.18) 3px);
  mix-blend-mode: overlay;
  opacity: 0.6;
}
.vignette {
  position: fixed; inset: 0; z-index: 49; pointer-events: none;
  box-shadow: inset 0 0 220px rgba(0,0,0,0.9);
}

/* ---------------- responsive ---------------- */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "clock clock"
      "gauge hist"
      "log   log"
      "seg   seg"
      "heat  heat";
  }
  .readouts { grid-template-columns: repeat(4, 1fr); }
  .segments { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .grid {
    grid-template-columns: 1fr;
    grid-template-areas: "clock" "gauge" "hist" "log" "seg" "heat";
  }
  .readouts { grid-template-columns: repeat(2, 1fr); }
  .segments { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar-right { align-items: flex-start; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .logo, .status.online .status-dot, .glitch::before, .glitch::after { animation: none; }
  /* keep the alarm visible (static) instead of strobing */
  .clock-alarm.active, .panel.alarm-panel,
  .panel.alarm-panel-alt, .panel.alarm-panel-alt .gauge-value { animation: none; }
}

/* ---------------- access gate ---------------- */
.hidden { display: none !important; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 12, 0.92);
  backdrop-filter: blur(3px);
}
.auth-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(92vw, 360px);
  padding: 26px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
  box-shadow: var(--glow-cyan), inset 0 0 24px rgba(0, 229, 255, 0.06);
}
.auth-title {
  color: var(--magenta);
  font-size: 14px;
  letter-spacing: 0.18em;
  text-shadow: 0 0 10px rgba(255, 45, 120, 0.5);
}
.auth-sub { color: var(--text-dim); font-size: 12px; letter-spacing: 0.06em; margin: 0; }
.auth-box input {
  background: rgba(0, 20, 30, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 9px 10px;
  border-radius: 5px;
  outline: none;
}
.auth-box input:focus { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.auth-box input::placeholder { color: var(--text-dim); }
#auth-btn {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.16em;
  padding: 11px 12px;
  color: #02141a;
  font-weight: 700;
  background: linear-gradient(180deg, var(--cyan), var(--cyan-dim));
  border: none;
  border-radius: 5px;
  box-shadow: 0 0 14px rgba(47, 243, 255, 0.5);
  transition: box-shadow 0.2s ease, filter 0.2s ease;
}
#auth-btn:hover { box-shadow: 0 0 22px rgba(47, 243, 255, 0.85); filter: brightness(1.1); }
.auth-msg { font-size: 13px; min-height: 1.3em; color: var(--magenta); text-shadow: 0 0 6px rgba(255, 45, 120, 0.4); }
