@font-face {
  font-family: 'Orbitron';
  src: url('/fonts/orbitron.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --bg: #020a0e;
  --panel: linear-gradient(180deg, rgba(7, 26, 34, 0.86), rgba(3, 14, 20, 0.86));
  --panel-solid: rgba(4, 18, 25, 0.92);
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --purple: #a855f7;
  --yellow: #fde047;
  --green: #4ade80;
  --orange: #fb923c;
  --text: #d3eef3;
  --muted: #6d929b;
  --danger: #fb7185;
  --line: rgba(34, 211, 238, 0.2);
  --line-strong: rgba(34, 211, 238, 0.55);
  --radius: 16px;
  --radius-small: 10px;
  --glow-cyan: 0 0 4px rgba(34, 211, 238, 0.9), 0 0 16px rgba(34, 211, 238, 0.45);
  --glow-purple: 0 0 4px rgba(168, 85, 247, 0.9), 0 0 18px rgba(168, 85, 247, 0.5);
  --glow-yellow: 0 0 4px rgba(253, 224, 71, 0.85), 0 0 14px rgba(253, 224, 71, 0.4);
  --hud: 'Orbitron', 'Eurostile', 'Bank Gothic', ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgba(34, 211, 238, 0.1), transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(20, 184, 166, 0.08), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 0%, rgba(59, 130, 246, 0.08), transparent 70%),
    var(--bg);
}

/* HUD grid and scan lines */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 85%);
}

body::after {
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
}

header,
main {
  position: relative;
  z-index: 1;
}

a {
  color: var(--cyan);
}

/* Header bar */
.hud-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: calc(10px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 10px
    max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(2, 12, 17, 0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 24px rgba(34, 211, 238, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-name {
  font-family: var(--hud);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.28em;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

.brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud-readouts {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: center;
  gap: 26px;
  min-width: 0;
}

.readout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
}

.readout .icon {
  width: 15px;
  height: 15px;
  color: var(--cyan);
}

.readout.ok,
.readout.ok .icon {
  color: var(--green);
}

.readout-value {
  color: var(--yellow);
}

.hud-clock {
  display: grid;
  justify-items: end;
  margin-left: auto;
  line-height: 1.15;
}

.hud-readouts:not([hidden]) + .hud-clock {
  margin-left: 0;
}

.clock-time {
  font-family: var(--hud);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

.clock-date {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hud-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--cyan);
  text-decoration: none;
  background: rgba(34, 211, 238, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.nav-btn .icon {
  width: 19px;
  height: 19px;
}

.nav-btn:hover,
.nav-btn:focus-visible {
  color: #fff;
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
  outline: none;
}

.nav-btn[aria-current='page'] {
  color: var(--yellow);
  border-color: rgba(253, 224, 71, 0.55);
  box-shadow: 0 0 12px rgba(253, 224, 71, 0.2);
}

.nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .hud-readouts .readout:not(#readout-weather) {
    display: none;
  }
}

@media (max-width: 760px) {
  .hud-header {
    gap: 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .hud-readouts,
  .brand-sub,
  .clock-date {
    display: none;
  }

  .hud-clock {
    margin-left: auto;
  }
}

@media (max-width: 520px) {
  .brand {
    gap: 10px;
  }

  .brand-name {
    font-size: 13px;
    letter-spacing: 0.16em;
  }

  .clock-time {
    font-size: 15px;
  }

  .hud-nav {
    gap: 6px;
  }

  .nav-btn {
    width: 34px;
    height: 34px;
  }

  .reactor {
    --size: 28px;
  }
}

/* Arc reactor logo */
.reactor {
  --size: 40px;
  position: relative;
  display: inline-block;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: radial-gradient(circle, #f0fdff 0 14%, var(--cyan) 22%, rgba(34, 211, 238, 0.15) 46%, transparent 62%);
  box-shadow: var(--glow-cyan), inset 0 0 10px rgba(34, 211, 238, 0.6);
  border: 2px solid rgba(34, 211, 238, 0.85);
  animation: pulse 3.2s ease-in-out infinite;
}

.reactor::before,
.reactor::after {
  content: '';
  position: absolute;
  border-radius: 50%;
}

.reactor::before {
  inset: -7px;
  border: 2px dashed rgba(168, 85, 247, 0.8);
  box-shadow: var(--glow-purple);
  animation: spin 14s linear infinite;
}

.reactor::after {
  inset: 5px;
  border: 1px solid rgba(240, 253, 255, 0.55);
  border-left-color: transparent;
  border-right-color: transparent;
  animation: spin 4s linear infinite reverse;
}

.reactor.large {
  --size: 96px;
  margin: 8px auto 28px;
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 6px rgba(34, 211, 238, 1), 0 0 30px rgba(34, 211, 238, 0.7), inset 0 0 14px rgba(34, 211, 238, 0.8);
  }
}

/* Layout */
.hud-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.hud-main.narrow {
  max-width: 600px;
}

.hud-status {
  margin: 0 0 20px;
  font-family: var(--hud);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--yellow);
  text-shadow: var(--glow-yellow);
}

.hud-status .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: var(--glow-yellow);
  animation: blink 2s steps(2, start) infinite;
}

@keyframes blink {
  to {
    opacity: 0.25;
  }
}

.grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 860px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

/* Panels */
.panel {
  position: relative;
  margin-bottom: 20px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 30px rgba(34, 211, 238, 0.05);
  backdrop-filter: blur(8px);
}

.panel-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-head h2 .icon {
  flex: none;
  width: 18px;
  height: 18px;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
}

.live::before {
  content: '';
  animation: blink 2s steps(2, start) infinite;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--hud);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

h1 {
  font-size: 20px;
}

h2 {
  font-size: 14px;
}

h3 {
  font-size: 12px;
  margin: 18px 0 10px;
  color: var(--purple);
  text-shadow: var(--glow-purple);
}

p {
  line-height: 1.55;
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--danger);
  text-shadow: 0 0 10px rgba(251, 113, 133, 0.4);
}

.success {
  color: var(--yellow);
}

/* Forms */
.row {
  display: flex;
  gap: 10px;
}

.form-grid {
  display: grid;
  gap: 10px;
}

@media (min-width: 640px) {
  .form-grid.cols {
    grid-template-columns: 1fr 1fr;
  }
}

label.field {
  display: grid;
  gap: 6px;
  font-family: var(--hud);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  font-family: var(--body);
  font-size: 16px;
  letter-spacing: normal;
  text-transform: none;
}

input:not([type='checkbox']),
select {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(2, 8, 22, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.row input:not([type='checkbox']) {
  flex: 1;
}

input:focus,
select:focus {
  border-color: var(--purple);
  box-shadow: var(--glow-purple);
}

.reveal-wrap {
  position: relative;
  display: block;
}

.reveal-wrap input:not([type='checkbox']) {
  padding-right: 76px;
}

.reveal-wrap button.reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 6px 10px;
  font-size: 9px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.06);
  border-color: var(--line);
}

.reveal-wrap button.reveal[aria-pressed='true'] {
  color: var(--yellow);
  border-color: var(--yellow);
  text-shadow: var(--glow-yellow);
}

input::placeholder {
  color: #4a5a7e;
}

select {
  width: auto;
}

button {
  cursor: pointer;
  padding: 12px 18px;
  font-family: var(--hud);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  transition: box-shadow 0.2s, color 0.2s, border-color 0.2s;
}

button:hover,
button:focus-visible {
  color: #fff;
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
  outline: none;
}

button.primary {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.45);
}

button.primary:hover {
  box-shadow: 0 0 22px rgba(168, 85, 247, 0.8);
}

button.danger {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.5);
}

button.small {
  padding: 6px 10px;
  font-size: 9px;
}

button.link {
  padding: 0;
  border: 0;
  background: none;
}

button.link:hover {
  color: var(--yellow);
  box-shadow: none;
  text-shadow: var(--glow-yellow);
}

button.icon {
  padding: 4px 12px;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
}

button.icon:hover {
  color: var(--danger);
  box-shadow: none;
}

/* Lists */
.items {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.items:empty {
  display: none;
}

.items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 4px 4px;
  border-bottom: 1px solid rgba(34, 211, 238, 0.12);
}

.items label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  cursor: pointer;
}

.items li span {
  font-size: 17px;
  color: var(--text);
}

.items li.done span {
  color: var(--muted);
  text-decoration: line-through;
}

input[type='checkbox'] {
  appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(2, 8, 22, 0.9);
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s;
}

input[type='checkbox']:hover {
  box-shadow: var(--glow-cyan);
}

input[type='checkbox'] {
  display: grid;
  place-content: center;
}

input[type='checkbox']::after {
  content: '';
  width: 6px;
  height: 11px;
  margin-top: -3px;
  border: solid var(--bg);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s;
}

input[type='checkbox']:checked {
  background: var(--yellow);
  border-color: var(--yellow);
  box-shadow: var(--glow-yellow);
}

input[type='checkbox']:checked::after {
  transform: rotate(45deg) scale(1);
}

.ghost {
  margin-top: 14px;
}

.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-link {
  font-family: var(--hud);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  text-decoration: none;
}

.panel-link:hover {
  color: var(--yellow);
  text-shadow: var(--glow-yellow);
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

a.summary-tile {
  display: grid;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

a.summary-tile .value {
  margin-top: 0;
}

a.summary-tile:hover,
a.summary-tile:focus-visible {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

/* Admin */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.tile {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 14, 20, 0.7);
}

.tile .label {
  font-family: var(--hud);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.tile .value {
  margin-top: 8px;
  font-family: var(--hud);
  font-size: 18px;
  color: var(--yellow);
  text-shadow: var(--glow-yellow);
  overflow-wrap: anywhere;
}

.tile .value.small {
  white-space: pre-line;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.05em;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  padding: 8px 10px;
  font-family: var(--hud);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--purple);
  border-bottom: 1px solid rgba(168, 85, 247, 0.4);
}

td {
  padding: 10px;
  vertical-align: top;
  border-bottom: 1px solid rgba(34, 211, 238, 0.1);
}

td .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--hud);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.badge.admin {
  color: var(--yellow);
}

.badge.member {
  color: var(--cyan);
}

.badge.off {
  color: var(--danger);
}

.speech {
  color: var(--yellow);
}

.key-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--yellow);
  border-radius: 12px;
  box-shadow: var(--glow-yellow);
  background: rgba(30, 24, 2, 0.35);
}

.key-box code {
  display: block;
  margin: 10px 0;
  padding: 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--yellow);
  background: rgba(0, 0, 0, 0.5);
  overflow-wrap: anywhere;
}

.key-box ol {
  margin: 10px 0 0;
  padding-left: 20px;
  line-height: 1.7;
}

.key-box ol code {
  display: inline;
  margin: 0;
  padding: 1px 5px;
}

.pair-box {
  text-align: center;
}

.pair-box img {
  display: block;
  width: 220px;
  height: 220px;
  margin: 12px auto;
  border-radius: 8px;
  image-rendering: pixelated;
}

.pair-box code {
  font-size: 22px;
  letter-spacing: 0.12em;
}

.trainer {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(2, 8, 22, 0.7);
}

.trainer h3 {
  margin-top: 0;
}

.trainer .actions {
  margin-top: 12px;
}

.phrase {
  margin: 14px 0;
  font-size: clamp(20px, 3vw, 30px);
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

.phrase-note {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--yellow);
}

.meter {
  height: 6px;
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
}

.meter-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transition: width 80ms linear;
}

label.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 60em;
  line-height: 1.5;
  color: var(--text);
}

#voice-select {
  flex: 1;
  min-width: 0;
}

.speed {
  margin-top: 18px;
}

.speed-label {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-family: var(--hud);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.speed-label output {
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--yellow);
  text-shadow: var(--glow-yellow);
}

.speed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 13px;
}

input[type='range'] {
  flex: 1;
  min-width: 0;
  height: 6px;
  padding: 0;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.25), rgba(168, 85, 247, 0.45));
  cursor: pointer;
}

input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: var(--bg);
  box-shadow: var(--glow-cyan);
}

input[type='range']::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: var(--bg);
  box-shadow: var(--glow-cyan);
}

input[type='range']:focus {
  box-shadow: none;
}

input[type='range']:focus-visible::-webkit-slider-thumb {
  border-color: var(--yellow);
}

/* Home dashboard */
.dash {
  display: grid;
  grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  grid-template-areas: 'left main';
  align-items: start;
  gap: 20px;
  max-width: 1600px;
  min-height: calc(100vh - 66px);
  margin: 0 auto;
  padding: 20px max(20px, env(safe-area-inset-right)) 24px max(20px, env(safe-area-inset-left));
}

.dash-left {
  grid-area: left;
}

.dash-main {
  grid-area: main;
  min-width: 0;
}

.dash-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0 20px;
}

/* Home: one card per family member with what MackBot remembers */
.family {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.family-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 14, 20, 0.6);
}

.family-card h3 {
  margin: 0 0 4px;
  font-family: var(--hud);
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.family-card > p {
  margin: 0 0 8px;
}

.family-devices {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.family-devices .icon {
  width: 14px;
  height: 14px;
  color: var(--cyan);
}

.family-rows {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  margin: 10px 0 0;
  font-size: 14px;
}

.family-rows dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  line-height: 20px;
  text-transform: uppercase;
  color: var(--muted);
}

.family-rows dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Home: short feeds (coming up, devices, recent requests, messages) */
.feed {
  display: grid;
  gap: 2px;
}

.feed-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.feed-row:last-child {
  border-bottom: 0;
}

.feed-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.feed-main .muted {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-side {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* Home: local time and weather */
.local-time {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--hud);
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

.big-time {
  font-size: 46px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

.big-seconds {
  font-size: 18px;
  color: var(--muted);
  text-shadow: none;
}

.local-date {
  margin: 6px 0 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.weather {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.weather-icon .icon {
  width: 44px;
  height: 44px;
  color: var(--yellow);
  filter: drop-shadow(0 0 6px rgba(253, 224, 71, 0.5));
}

.weather-temp {
  font-family: var(--hud);
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  color: var(--yellow);
  text-shadow: var(--glow-yellow);
}

.weather-words {
  min-width: 0;
  font-size: 14px;
}

.weather-conditions {
  color: var(--text);
}

.weather-conditions::first-letter {
  text-transform: uppercase;
}

.weather-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.weather-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 14, 20, 0.6);
}

.weather-stat .icon {
  grid-row: span 2;
  width: 18px;
  height: 18px;
  color: var(--cyan);
}

.weather-stat .label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.weather-stat .value {
  font-family: var(--hud);
  font-size: 14px;
  color: var(--text);
}

.small-print {
  font-size: 13px;
}

.dash .summary {
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (max-width: 1100px) {
  .dash {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'left'
      'main';
  }

  .dash-left {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0 20px;
  }
}

@media (max-width: 760px) {
  .dash {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 14px;
  }

  .big-time {
    font-size: 40px;
  }
}

/* Sign-in */
.auth-panel {
  margin-top: 6vh;
  text-align: left;
}

.auth-title {
  text-align: center;
  margin-bottom: 6px;
}

.auth-sub {
  text-align: center;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  cursor: pointer;
}

/* ===== Command center: sidebar, top bar, status bar and glowing panels ===== */
:root {
  --bg: #020812;
  --panel: linear-gradient(160deg, rgba(10, 34, 56, 0.78), rgba(3, 14, 28, 0.88));
  --line: rgba(56, 189, 248, 0.22);
  --line-strong: rgba(56, 189, 248, 0.6);
  --side-width: 236px;
}

body {
  background:
    radial-gradient(ellipse 60% 45% at 55% 30%, rgba(14, 165, 233, 0.13), transparent 70%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(59, 130, 246, 0.1), transparent 70%),
    radial-gradient(ellipse 45% 35% at 0% 0%, rgba(34, 211, 238, 0.08), transparent 70%),
    var(--bg);
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--side-width) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    'side top'
    'side main'
    'bar bar';
  gap: 14px;
  min-height: 100vh;
  padding: 14px max(14px, env(safe-area-inset-right)) 14px max(14px, env(safe-area-inset-left));
}

.shell > main {
  grid-area: main;
  min-width: 0;
}

.shell .dash {
  display: block;
}

.shell .hud-main,
.shell .dash {
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.shell .hud-main.narrow {
  max-width: 720px;
}

/* Corner brackets shared by the frame and the panels */
.panel,
.side,
.topbar,
.statusbar {
  --corner: rgba(103, 232, 249, 0.75);
  background-image:
    linear-gradient(var(--corner), var(--corner)), linear-gradient(var(--corner), var(--corner)),
    linear-gradient(var(--corner), var(--corner)), linear-gradient(var(--corner), var(--corner)),
    var(--panel);
  background-size: 14px 1.5px, 1.5px 14px, 14px 1.5px, 1.5px 14px, auto;
  background-position: top left, top left, bottom right, bottom right, center;
  background-repeat: no-repeat;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow:
    inset 0 0 24px rgba(56, 189, 248, 0.06),
    0 0 0 1px rgba(2, 8, 18, 0.6),
    0 0 22px rgba(14, 165, 233, 0.08);
}

.panel {
  margin-bottom: 14px;
  padding: 16px 18px;
}

.panel-head {
  margin-bottom: 14px;
}

.panel-head h2 {
  font-family: var(--hud);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #a5f3fc;
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.45);
}

.panel-head h2 .icon {
  width: 16px;
  height: 16px;
  color: var(--cyan);
}

/* Sidebar */
.side {
  grid-area: side;
  position: sticky;
  top: 14px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(100vh - 28px - 72px);
  padding: 16px 12px;
  overflow-y: auto;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.side-brand .brand-name {
  font-size: 18px;
  letter-spacing: 0.26em;
}

.side-brand .brand-sub {
  font-size: 9px;
  letter-spacing: 0.28em;
}

.side-nav,
.side-group {
  display: grid;
  gap: 4px;
}

.side-group {
  margin-top: 10px;
}

.side-label {
  padding: 0 10px 4px;
  font-family: var(--hud);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.side-nav a,
.side-out {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: #b9dfe8;
  font: 500 14px var(--body);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.side-nav a .icon,
.side-out .icon {
  flex: none;
  width: 18px;
  height: 18px;
  color: #7dd3fc;
}

.side-nav a:hover,
.side-out:hover {
  background: rgba(56, 189, 248, 0.08);
  color: #e0f7fb;
}

.side-nav a[aria-current='page'] {
  border-color: var(--line-strong);
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.2), rgba(34, 211, 238, 0.04));
  color: #ecfeff;
  box-shadow: inset 3px 0 0 var(--cyan), 0 0 18px rgba(34, 211, 238, 0.15);
}

.side-nav a[aria-current='page'] .icon {
  color: var(--cyan);
  filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.8));
}

.side-card {
  margin-top: auto;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(3, 16, 30, 0.7);
}

.side-card .side-label {
  padding: 0 0 10px;
  display: block;
}

.side-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.side-out {
  width: 100%;
  border-color: var(--line);
}

/* Top bar */
.topbar {
  grid-area: top;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 16px;
}

.status-pill {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(3, 16, 30, 0.8);
  font-family: var(--hud);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #b9dfe8;
}

.status-pill b {
  font-weight: 600;
  color: var(--green);
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.status-pill.warn b,
.warn {
  color: var(--yellow) !important;
}

.status-pill.warn .dot {
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow);
}

.topbar .hud-clock {
  justify-items: center;
  margin: 0;
  text-align: center;
}

.topbar .clock-date {
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #9cc7d1;
}

.topbar .clock-time {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #e0fbff;
  text-shadow: 0 0 6px rgba(34, 211, 238, 0.9), 0 0 24px rgba(34, 211, 238, 0.45);
}

.user-chip {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(3, 16, 30, 0.8);
}

.user-text {
  display: grid;
  line-height: 1.2;
  text-align: right;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
}

.user-role {
  font-size: 11px;
  color: var(--cyan);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(34, 211, 238, 0.35), rgba(3, 16, 30, 0.9));
}

.avatar .icon {
  width: 16px;
  height: 16px;
  color: #cffafe;
}

/* Status bar */
.statusbar {
  grid-area: bar;
  position: sticky;
  bottom: 0;
  z-index: 5;
  --panel: linear-gradient(160deg, rgba(8, 28, 48, 0.97), rgba(3, 12, 24, 0.98));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(3, 16, 30, 0.75);
}

.stat > .icon,
#status-weather-icon .icon {
  width: 18px;
  height: 18px;
  color: #7dd3fc;
}

#status-weather-icon .icon {
  color: var(--yellow);
}

.stat-text {
  display: grid;
  line-height: 1.25;
  font-size: 12px;
  white-space: nowrap;
}

.stat-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stat .ok {
  color: var(--green);
}

.statusbar-wave {
  flex: 1;
  height: 24px;
  min-width: 40px;
  background:
    radial-gradient(circle, rgba(34, 211, 238, 0.85) 1.2px, transparent 1.6px) 0 50% / 12px 12px repeat-x;
  mask-image: linear-gradient(90deg, transparent, black 25%, black 75%, transparent);
  opacity: 0.6;
}

/* Dashboard */
.cc .error {
  margin-top: 0;
}

.cc-top {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr) minmax(260px, 340px);
  gap: 14px;
  margin-bottom: 14px;
}

.cc-top > .panel {
  margin: 0;
}

.cc-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 14px;
}

.cc-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 0 14px;
}

.core-list {
  display: grid;
  gap: 8px;
}

.core-tile {
  --tone: var(--cyan);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(3, 16, 30, 0.7);
}

.core-tile.purple { --tone: var(--purple); }
.core-tile.green { --tone: var(--green); }
.core-tile.blue { --tone: #60a5fa; }
.core-tile.yellow { --tone: var(--yellow); }
.core-tile.warn { --tone: var(--orange); }

.core-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--tone) 50%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--tone) 12%, transparent);
  color: var(--tone);
}

.core-icon .icon {
  width: 17px;
  height: 17px;
  filter: drop-shadow(0 0 3px var(--tone));
}

.core-text {
  display: grid;
  line-height: 1.3;
  min-width: 0;
}

.core-label {
  font-size: 13px;
  font-weight: 600;
}

.core-value {
  font-size: 12px;
  color: var(--tone);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.core-hero {
  display: grid;
  place-items: center;
  min-height: 380px;
  overflow: hidden;
  padding: 0;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.22), transparent 55%),
    var(--panel);
}

.core-orb,
.core-rings,
.core-title {
  grid-area: 1 / 1;
}

.core-orb {
  width: 100%;
  height: 100%;
  min-height: 380px;
}

.core-rings {
  position: relative;
  width: min(92%, 620px);
  aspect-ratio: 2.4;
  pointer-events: none;
}

.core-rings i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(103, 232, 249, 0.35);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.2);
  transform: rotate(-8deg);
}

.core-rings i:nth-child(2) {
  inset: 12% 6%;
  transform: rotate(12deg);
  border-color: rgba(96, 165, 250, 0.3);
}

.core-rings i:nth-child(3) {
  inset: -10% 14%;
  transform: rotate(-20deg);
  border-style: dashed;
  border-color: rgba(103, 232, 249, 0.18);
  animation: spin 60s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(340deg);
  }
}

.core-title {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 36px 70px;
  text-align: center;
  pointer-events: none;
  background: radial-gradient(ellipse closest-side, rgba(2, 8, 18, 0.78), rgba(2, 8, 18, 0.4) 60%, transparent);
}

.core-name {
  font-family: var(--hud);
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ecfeff;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.95), 0 0 30px rgba(34, 211, 238, 0.6);
}

.core-sub {
  font-family: var(--hud);
  font-size: 12px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: #a5f3fc;
}

.core-greeting {
  margin-top: 6px;
  font-size: 13px;
  color: #9cc7d1;
}

.live-feed .feed {
  max-height: 330px;
  overflow-y: auto;
}

.feed-row {
  border-color: var(--line);
}

.family-card,
.summary-tile {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(3, 16, 30, 0.7);
}

@media (max-width: 1280px) {
  .cc-top {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  }

  .live-feed {
    grid-column: 1 / -1;
  }

  .cc-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'side'
      'top'
      'main'
      'bar';
  }

  .side {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  .side-brand {
    border: 0;
    padding-bottom: 4px;
  }

  .side-nav {
    display: flex;
    flex-wrap: wrap;
    flex: 1 1 100%;
  }

  .side-group {
    display: contents;
  }

  .side-group .side-label,
  .side-card {
    display: none;
  }

  .side-out {
    width: auto;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar .hud-clock {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .cc-top,
  .cc-three,
  .cc-two {
    grid-template-columns: minmax(0, 1fr);
  }

  .core-hero,
  .core-orb {
    min-height: 300px;
  }

  .statusbar {
    position: static;
    flex-wrap: wrap;
  }

  .statusbar-wave {
    display: none;
  }
}
