/* JARVIS mobile - HUD edition.
   Built for an iPhone held in one hand: everything tappable is at least 44px,
   the talk button is a big arc reactor that gets pressed without looking, and
   the whole screen changes colour with what JARVIS is doing
   (body[data-state] = ready / listening / uploading / thinking / speaking / error). */

:root {
  --bg:        #02060c;
  --bg-2:      rgba(10, 24, 38, .72);
  --bg-3:      rgba(16, 38, 58, .78);
  --line:      rgba(var(--brand-rgb), .16);
  --line-2:    rgba(var(--brand-rgb), .32);
  --cyan:      #38d6ff;
  --cyan-dim:  #1b6d8a;
  --amber:     #ffb547;
  --red:       #ff5c5c;
  --green:     #3ddc84;
  --orange:    #ff9500;
  --text:      #dcefff;
  --muted:     #7894ad;
  --brand-rgb: 56, 214, 255;
  --tile-a:    rgba(20,48,72,.75);
  --tile-b:    rgba(6,16,28,.8);
  --me-a:      rgba(30,90,130,.75);
  --me-b:      rgba(18,58,90,.75);
  --core-bg:   rgba(4,14,24,.95);
  --field:     rgba(4,12,20,.8);
  --sheet-bg:  #02060c;
  --sheet-glow: rgba(20,60,90,.6);
  --on-brand:  #02121c;
  --primary-a: #5fe0ff;
  --primary-b: #22a9d6;
  --knob:      #cfe6f7;
  --link:      #7dd3fc;
  --body-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --hud-font:  "Orbitron", "SF Pro Display", system-ui, sans-serif;
  --safe-b:    env(safe-area-inset-bottom, 0px);
  --safe-t:    env(safe-area-inset-top, 0px);
}
body { --accent: var(--cyan); --accent-rgb: var(--brand-rgb); }   /* follows JARVIS's state */
body[data-state="listening"] { --accent: var(--green); --accent-rgb: 61, 220, 132; }
body[data-state="uploading"],
body[data-state="thinking"]  { --accent: var(--amber); --accent-rgb: 255, 181, 71; }
body[data-state="error"],
body[data-state="offline"]   { --accent: var(--red);   --accent-rgb: 255, 92, 92; }

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

/* The `hidden` attribute is only display:none by default, so any rule that
   sets display silently un-hides it. This makes hidden mean hidden. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--body-font);
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-t) + 6px) 14px calc(var(--safe-b) + 10px);
  overflow: hidden;
}

svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------ backdrop */
.hud-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hud-grid {
  position: absolute; inset: -40px;
  background-image:
    linear-gradient(rgba(var(--brand-rgb), .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--brand-rgb), .07) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 72%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 72%, #000 20%, transparent 75%);
  animation: gridDrift 24s linear infinite;
}
.hud-glow {
  position: absolute; left: 50%; bottom: 8%; width: 560px; height: 560px; margin-left: -280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), .20) 0%, rgba(var(--accent-rgb), .06) 38%, transparent 68%);
  transition: background .5s;
}
.hud-scan {
  position: absolute; left: 0; right: 0; height: 120px; top: -120px;
  background: linear-gradient(transparent, rgba(var(--brand-rgb), .05), transparent);
  animation: scan 7s linear infinite;
}
@keyframes gridDrift { to { transform: translateY(34px); } }
@keyframes scan { to { top: 110%; } }

/* --------------------------------------------------------------- top bar */
.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 2px 0 10px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-word {
  font-family: var(--hud-font); font-weight: 800; font-size: 16px; letter-spacing: .24em;
  color: var(--cyan); text-shadow: 0 0 14px rgba(var(--brand-rgb), .55);
}
.reactor-mini {
  position: relative; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), .6), inset 0 0 8px rgba(var(--accent-rgb), .5);
  transition: border-color .3s, box-shadow .3s;
}
.reactor-mini::before {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  border: 2px dashed rgba(var(--accent-rgb), .8); animation: spin 6s linear infinite;
}
.reactor-mini i {
  position: absolute; inset: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.bar-right { display: flex; align-items: center; gap: 5px; flex: none; }

.chips {
  display: flex; align-items: center; gap: 7px; padding: 0 9px; height: 32px;
  border: 1px solid var(--line); border-radius: 17px; background: var(--bg-2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.conn { display: flex; align-items: center; gap: 5px; font: 700 9.5px/1 var(--hud-font); letter-spacing: .08em;
        color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.conn[data-up="1"] #connText, .conn[data-up="0"] > b { display: none; }
.conn b { font-weight: 700; }
.conn i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); transition: background .2s; }
.conn[data-up="1"] i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.conn[data-up="0"] i { background: var(--red);   box-shadow: 0 0 8px var(--red); }

.icon-btn {
  position: relative; width: 38px; height: 38px; padding: 8px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; color: var(--cyan);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.icon-btn svg { width: 100%; height: 100%; }
.icon-btn:active { border-color: var(--cyan); box-shadow: 0 0 14px rgba(var(--brand-rgb), .35); }
.icon-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%;
            background: var(--green); box-shadow: 0 0 8px var(--green); }

/* ------------------------------------------------------------ live tiles */
main { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.tiles { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 7px; margin-bottom: 8px; }
.tile {
  position: relative; overflow: hidden; min-width: 0; height: 70px; padding: 8px 8px 7px;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 1px;
  text-align: left; color: var(--text);
  background: linear-gradient(160deg, var(--tile-a), var(--tile-b));
  border: 1px solid var(--line); border-radius: 14px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color .2s, transform .08s;
}
.tile::after {                  /* HUD corner notch */
  content: ""; position: absolute; top: 0; right: 0; width: 14px; height: 14px;
  border-top: 2px solid var(--cyan); border-right: 2px solid var(--cyan);
  border-top-right-radius: 14px; opacity: .7;
}
.tile:active { transform: scale(.96); border-color: var(--cyan); }
.tile-ico { position: absolute; top: 6px; left: 8px; font-size: 18px; filter: saturate(.8); }
.tile-k { font: 700 8.5px/1.2 var(--hud-font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tile-v { max-width: 100%; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile[data-level="good"] .tile-v { color: var(--green); }
.tile[data-level="warn"] .tile-v { color: var(--amber); }
.tile[data-level="bad"]  .tile-v { color: var(--red); }
.tile[data-level="bad"]  { border-color: rgba(255,92,92,.5); }
.tile-cam .tile-img {
  position: absolute; inset: 0; background: #000 center / cover no-repeat;
  opacity: .8; transition: background-image .3s;
}
.tile-cam .tile-img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(transparent 25%, rgba(2,6,12,.92));
}
.tile-cam .tile-k, .tile-cam .tile-v { position: relative; }
.tile-cam .tile-k { color: #bfe9ff; }
.tile.alarm { border-color: var(--red); animation: byPulse 1s infinite; }
.tile.alarm::after { border-color: var(--red); }

/* ---------------------------------------------------------------- state */
.state {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px 7px 12px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color .3s;
}
.state-dot { flex: none; width: 9px; height: 9px; border-radius: 50%;
             background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.state-text { flex: 1; min-width: 0; }
.state-label { font: 700 12px/1.3 var(--hud-font); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.state-sub   { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.state[data-state="listening"], .state[data-state="thinking"] { border-color: rgba(var(--accent-rgb), .45); }
.state[data-state="listening"] .state-dot,
.state[data-state="thinking"] .state-dot,
.state[data-state="uploading"] .state-dot { animation: pulse 1s infinite; }
.state[data-state="error"] { border-color: rgba(255,92,92,.45); }

.chip-btn {
  flex: none; height: 32px; padding: 0 12px; border-radius: 16px; font-size: 12px; font-weight: 700;
  background: rgba(255,92,92,.1); border: 1px solid rgba(255,92,92,.4); color: #ffb3b3;
}
.chip-btn:disabled { display: none; }

@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ transcript */
.log {
  flex: 1; min-height: 60px; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 8px;
  -webkit-mask-image: linear-gradient(transparent 0, #000 14px, #000 calc(100% - 8px), transparent);
          mask-image: linear-gradient(transparent 0, #000 14px, #000 calc(100% - 8px), transparent);
}
.msg {
  position: relative; padding: 9px 12px; border-radius: 14px; max-width: 86%;
  font-size: 15px; word-wrap: break-word; white-space: pre-wrap;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: msgIn .28s ease-out;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg.me   { align-self: flex-end; background: linear-gradient(135deg, var(--me-a), var(--me-b));
            border: 1px solid rgba(var(--brand-rgb), .35); border-bottom-right-radius: 4px; }
.msg.j    { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--line);
            border-left: 2px solid var(--cyan); border-bottom-left-radius: 4px; }
.msg.err  { align-self: flex-start; background: rgba(42,15,18,.8); border: 1px solid #5c2126; color: #ffc9c9; }
.msg-btn {
  display: block; margin-top: 8px; width: 100%; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--line-2); background: rgba(var(--brand-rgb), .1);
  color: inherit; font: inherit; font-weight: 600; cursor: pointer;
}
.msg small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 4px; letter-spacing: .03em; }
.msg.alert { border-color: var(--red); border-left-color: var(--red); background: rgba(42,13,18,.85); color: #ffd6d6; font-weight: 600; }
.msg-camera-img {
  display: block; margin-top: 8px; width: 100%; border-radius: 10px;
  border: 1px solid var(--line); cursor: zoom-in;
}
.msg-report-link {
  display: inline-block; margin-top: 8px; color: var(--link); text-decoration: none;
  font-weight: 600; font-size: 14px;
}
.msg-report-link:hover { text-decoration: underline; }

/* -------------------------------------------------------------- composer */
.composer { display: flex; gap: 8px; padding: 2px 0 8px; }
.composer input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px;
  color: var(--text); font-size: 16px;   /* 16px stops iOS zooming on focus */
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.composer input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12); }
.send-btn {
  flex: none; width: 44px; height: 44px; padding: 11px; border-radius: 50%;
  background: rgba(var(--brand-rgb), .14); border: 1px solid var(--line-2); color: var(--cyan);
}
.send-btn svg { width: 100%; height: 100%; stroke-width: 2.4; }
/* Fast answering mode toggle */
.fast-btn {
  flex: none; height: 44px; padding: 0 12px; border-radius: 22px; display: inline-flex;
  align-items: center; gap: 4px; font-size: 14px; font-weight: 600; letter-spacing: .03em;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--dim, #8aa3b3);
  transition: background .2s, color .2s, box-shadow .2s, border-color .2s;
}
.fast-btn[aria-pressed="true"] {
  color: #ffd84a; border-color: rgba(255, 216, 74, .7); background: rgba(255, 216, 74, .12);
  box-shadow: 0 0 12px rgba(255, 216, 74, .35), inset 0 0 8px rgba(255, 216, 74, .15);
}
@media (max-width: 360px) { .fast-btn span { display: none; } }
.send-btn:active { background: rgba(var(--brand-rgb), .3); }

/* ------------------------------------------------- the arc-reactor button */
.controls { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.core-row { width: 100%; display: flex; align-items: center; justify-content: space-between; }

.side-btn {
  width: 64px; height: 64px; border-radius: 50%; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--cyan);
  font: 700 8.5px/1 var(--hud-font); letter-spacing: .1em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.side-btn svg { width: 24px; height: 24px; }
.side-btn:active { border-color: var(--cyan); box-shadow: 0 0 16px rgba(var(--brand-rgb), .35); }
.side-btn:disabled { opacity: .35; }

.ptt {
  position: relative; width: 176px; height: 176px; padding: 0; border-radius: 50%;
  border: none; background: none; color: var(--accent);
  touch-action: none;                 /* no scroll-steal while holding */
  user-select: none; -webkit-user-select: none;
  transition: transform .1s, color .3s;
}
.ptt-rings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ptt-rings circle { transform-origin: 100px 100px; transition: stroke .3s; stroke: var(--accent); }
.r-ticks { stroke-width: 6; stroke-dasharray: 1.5 7.3; opacity: .55; animation: spin 40s linear infinite; }
.r-arc   { stroke-width: 3; }
.r-arc.a1 { stroke-dasharray: 120 44 40 60 70 194; opacity: .9; animation: spin 12s linear infinite;
            filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), .8)); }
.r-arc.a2 { stroke-width: 1.5; stroke-dasharray: 10 6; opacity: .5; animation: spin 18s linear infinite reverse; }
.r-thin  { stroke-width: 1; opacity: .35; }
.ptt-core {
  position: absolute; inset: 38px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: radial-gradient(circle at 50% 40%, rgba(var(--accent-rgb), .28), var(--core-bg) 70%);
  border: 1.5px solid rgba(var(--accent-rgb), .7);
  box-shadow: 0 0 34px rgba(var(--accent-rgb), .35), inset 0 0 24px rgba(var(--accent-rgb), .25);
  transition: box-shadow .3s, border-color .3s, background .3s;
}
.ptt-mic { width: 34px; height: 34px; stroke-width: 1.9; filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), .9)); }
.ptt-text { font: 800 9px/1.1 var(--hud-font); letter-spacing: .18em; }

/* holding it */
.ptt.live { transform: scale(.95); }
.ptt.live .ptt-core { box-shadow: 0 0 60px rgba(var(--accent-rgb), .6), inset 0 0 34px rgba(var(--accent-rgb), .45);
                      animation: corePulse .9s ease-in-out infinite; }
.ptt.live .r-arc.a1 { animation-duration: 2.4s; }
.ptt.live .r-ticks  { animation-duration: 8s; }
/* waiting for JARVIS */
body[data-state="thinking"] .r-arc.a1, body[data-state="uploading"] .r-arc.a1 { animation-duration: 1.2s; }
body[data-state="thinking"] .r-arc.a2, body[data-state="uploading"] .r-arc.a2 { animation-duration: 2s; }
body[data-state="thinking"] .ptt-core { animation: corePulse 1.4s ease-in-out infinite; }
/* talking */
body[data-state="speaking"] .ptt-core { animation: speak .5s ease-in-out infinite alternate; }
body[data-state="speaking"] .r-arc.a1 { animation-duration: 4s; }
.ptt.busy { opacity: .75; }
@keyframes corePulse { 50% { transform: scale(1.05); } }
@keyframes speak { from { box-shadow: 0 0 26px rgba(var(--accent-rgb), .3), inset 0 0 20px rgba(var(--accent-rgb), .2); }
                   to   { box-shadow: 0 0 62px rgba(var(--accent-rgb), .65), inset 0 0 36px rgba(var(--accent-rgb), .5); } }

/* ------------------------------------------------------- mode toggles */
.row { display: flex; gap: 8px; width: 100%; }
.toggles { display: flex; gap: 8px; width: 100%; }
.pill {
  flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 21px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.pill > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.pill:disabled { opacity: .5; }
.handsfree .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.handsfree[data-on="1"] { border-color: var(--green); color: var(--green); background: rgba(61,220,132,.08); }
.handsfree[data-on="1"] .dot { background: var(--green); box-shadow: 0 0 10px var(--green); animation: breathe 2s ease-in-out infinite; }
.handsfree[data-armed="1"] { border-color: var(--cyan); color: var(--cyan); }
.handsfree[data-armed="1"] .dot { background: var(--cyan); box-shadow: 0 0 14px var(--cyan); animation: none; }
@keyframes breathe { 0%,100% { opacity: .35 } 50% { opacity: 1 } }

.mini {
  flex: 1; min-height: 44px; padding: 0 14px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); font-size: 14px; font-weight: 600;
}
.mini:active { border-color: var(--cyan); }
.mini:disabled { opacity: .35; }
.mini.danger { color: #ffb3b3; border-color: rgba(255,92,92,.35); }
.mini.primary { color: var(--on-brand); background: linear-gradient(135deg, var(--primary-a), var(--primary-b)); border-color: transparent;
                font-weight: 800; box-shadow: 0 0 20px rgba(var(--brand-rgb), .35); }
.mini.wide { width: 100%; margin-top: 10px; }

/* ---------------------------------------------------------------- sheets */
.sheet {
  position: fixed; inset: 0; z-index: 20; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: radial-gradient(700px 400px at 50% -5%, var(--sheet-glow), transparent 70%), var(--sheet-bg);
  padding: calc(var(--safe-t) + 12px) 16px calc(var(--safe-b) + 24px);
  animation: sheetIn .26s cubic-bezier(.2,.8,.2,1);
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px); } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.sheet h2 { margin: 0; font: 800 17px/1.2 var(--hud-font); letter-spacing: .14em; text-transform: uppercase;
            color: var(--cyan); text-shadow: 0 0 12px rgba(var(--brand-rgb), .45); }
.sheet-x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2);
           background: var(--bg-2); color: var(--cyan); font-size: 15px; }
.sheet .note { font-size: 13px; color: var(--muted); }
.card { padding: 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.card > .mini.wide:first-child { margin-top: 0; }

.field { display: block; margin-bottom: 14px; }
.card .field:last-child { margin-bottom: 0; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input[type="url"], .field input[type="password"], .field input[type="text"] {
  width: 100%; height: 46px; padding: 0 12px; font-size: 16px;
  background: var(--field); border: 1px solid var(--line); border-radius: 12px; color: var(--text);
}
.field small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.field.checkbox { display: flex; align-items: center; gap: 12px; }
.field.checkbox span { color: var(--text); font-size: 14.5px; margin: 0; }

/* checkboxes look like iOS switches, in JARVIS colours */
.field.checkbox input, .switch input {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0;
  position: relative; width: 46px; height: 28px; border-radius: 14px;
  background: rgba(120,148,173,.25); border: 1px solid var(--line); transition: background .2s;
}
.field.checkbox input::after, .switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--knob); transition: transform .2s;
}
.field.checkbox input:checked, .switch input:checked { background: var(--cyan-dim); border-color: var(--cyan); }
.field.checkbox input:checked::after, .switch input:checked::after { transform: translateX(18px); background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.switch input:disabled { opacity: .4; }

.switches { padding: 4px 12px; }
.switch { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.switch:last-child { border-bottom: none; }
.switch .sw-ico { font-size: 20px; width: 26px; text-align: center; }
.switch .sw-text { flex: 1; min-width: 0; }
.switch .sw-text b { display: block; font-size: 14.5px; }
.switch .sw-text small { display: block; font-size: 12px; color: var(--muted); }

/* the pairing code wants to be big, monospaced and hard to mistype */
.field input.bigcode {
  height: 64px; font-size: 32px; letter-spacing: .32em; text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--cyan);
}

.report {
  margin-top: 14px; padding: 12px; font-size: 12px; line-height: 1.5;
  background: var(--field); border: 1px solid var(--line); border-radius: 12px;
  white-space: pre-wrap; word-break: break-word; color: var(--muted);
  max-height: 46vh; overflow: auto;
}
.report:empty { display: none; }

/* ---------------------------------------------------------------- backyard */
.by-live, .cam-frame { position: relative; border-radius: 14px; overflow: hidden; background: #000;
           border: 1px solid var(--line-2); box-shadow: 0 0 30px rgba(var(--brand-rgb), .12); }
.by-live { aspect-ratio: 16 / 9; }
.by-live img { width: 100%; height: 100%; object-fit: contain; display: block; }
.by-badge { position: absolute; top: 8px; left: 8px; font: 700 10px/1 var(--hud-font); letter-spacing: .12em;
            padding: 5px 8px; border-radius: 6px; background: rgba(0,0,0,.6); color: var(--muted); z-index: 2; }
.by-badge.live { color: var(--green); }
.by-badge.live::before { content: "\25CF  "; animation: pulse 1.2s infinite; }
.by-corner { position: absolute; width: 16px; height: 16px; border: 0 solid var(--cyan); opacity: .8; pointer-events: none; }
.by-corner.tl { top: 6px; left: 6px; border-top-width: 2px; border-left-width: 2px; }
.by-corner.tr { top: 6px; right: 6px; border-top-width: 2px; border-right-width: 2px; }
.by-corner.bl { bottom: 6px; left: 6px; border-bottom-width: 2px; border-left-width: 2px; }
.by-corner.br { bottom: 6px; right: 6px; border-bottom-width: 2px; border-right-width: 2px; }
.by-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.by-grid a.mini { text-align: center; text-decoration: none; display: flex; font-size: 13px;
                  align-items: center; justify-content: center; }
.by-pad { display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(3, 46px);
          gap: 6px; justify-content: center; margin: 12px 0 8px; }
.by-pad [data-dir="up"] { grid-column: 2; grid-row: 1; }
.by-pad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.by-pad .by-pos { grid-column: 2; grid-row: 2; display: flex; align-items: center; justify-content: center;
          font-size: 10px; color: var(--muted); text-align: center; }
.by-pad [data-dir="right"] { grid-column: 3; grid-row: 2; }
.by-pad [data-dir="down"] { grid-column: 2; grid-row: 3; }
.by-dir { background: var(--bg-2); color: var(--cyan); border: 1px solid var(--line); border-radius: 12px;
          font-size: 18px; touch-action: none; user-select: none; -webkit-user-select: none; }
.by-dir:active, .by-dir.held { border-color: var(--cyan); background: rgba(var(--brand-rgb), .15); box-shadow: 0 0 14px rgba(var(--brand-rgb), .3); }
#byTrack.on, #byAlarm.on { border-color: var(--green); color: var(--green); background: rgba(61,220,132,.08); }
.icon-btn.alarm { color: var(--red); border-color: var(--red); animation: byPulse 1s infinite; }
@keyframes byPulse { 50% { box-shadow: 0 0 0 6px rgba(255,92,92,.25); } }

/* ----------------------------------------------------------- meter/camera */
.meter {
  margin-top: 14px; height: 14px; border-radius: 7px;
  background: var(--bg-2); border: 1px solid var(--line); overflow: hidden;
}
.meter i { display: block; height: 100%; width: 0%; background: var(--green); transition: width .05s; }
.meter-label { font-size: 12px; color: var(--muted); margin-top: 5px; }

.cam-frame { margin-bottom: 12px; }
.camera video { display: block; width: 100%; aspect-ratio: 3/4; object-fit: cover; background: #000; }
.camera input[type="text"] {
  width: 100%; height: 46px; padding: 0 12px; margin-bottom: 10px; font-size: 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; color: var(--text);
}

/* ---------------------------------------------------- embarrassment mode */
.coach[data-on="1"] { border-color: var(--orange); color: var(--orange); background: rgba(255,149,0,.08); }
.coach[data-on="1"] .dot { background: var(--orange); box-shadow: 0 0 10px var(--orange); }
.coach-card { width: 100%; padding: 14px; border: 1px solid var(--orange); border-radius: 14px;
              background: rgba(40,22,0,.75); box-shadow: 0 0 24px rgba(255,149,0,.15); }
.coach-say { font-size: 21px; line-height: 1.35; font-weight: 700; margin-bottom: 10px; min-height: 2.6em; }
.coach-say.flash { animation: coachflash .8s ease-out; }
@keyframes coachflash { from { color: #ffd60a; } to { color: inherit; } }
.coach-meter { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; margin: 0 0 8px; }
.coach-meter > div { height: 100%; width: 0; background: #5fd4ff; transition: width .1s linear; }
.coach-heard { white-space: pre-line; font-size: 14px; opacity: .75; margin-bottom: 10px; max-height: 7.5em; overflow: hidden; }
.coach-card .mini.wide { margin-top: 0; }

/* ------------------------------------------------------------ boot intro */
.boot {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg); pointer-events: none; animation: bootOut .5s ease-in 1.3s forwards;
}
.boot svg { width: 150px; height: 150px; }
.boot circle { stroke: var(--cyan); stroke-width: 2; transform-origin: 100px 100px;
               filter: drop-shadow(0 0 6px var(--cyan)); stroke-dasharray: 520; stroke-dashoffset: 520;
               animation: draw 1s ease-out forwards; }
.boot circle:nth-child(2) { stroke-width: 1.2; animation-delay: .15s; stroke-dasharray: 30 10; }
.boot circle:nth-child(3) { stroke-width: 3; animation-delay: .3s; }
.boot-word { margin-top: 14px; font: 800 22px/1 var(--hud-font); letter-spacing: .5em; padding-left: .5em;
             color: var(--cyan); text-shadow: 0 0 16px var(--cyan); animation: fadeUp .6s .35s both; }
.boot-sub { margin-top: 8px; font: 600 10px/1 var(--hud-font); letter-spacing: .4em; color: var(--muted);
            text-transform: uppercase; animation: fadeUp .6s .55s both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes bootOut { to { opacity: 0; visibility: hidden; } }

/* ------------------------------------------------------ small screens */
@media (max-height: 700px) {
  .ptt { width: 148px; height: 148px; }
  .ptt-core { inset: 32px; }
  .ptt-mic { width: 28px; height: 28px; }
  .tile { height: 60px; }
  .tile-ico { font-size: 15px; }
  .side-btn { width: 56px; height: 56px; }
}
@media (max-width: 360px) {
  .brand-word { font-size: 14px; letter-spacing: .22em; }
  .chips { gap: 6px; padding: 0 8px; }
}

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

/* =========================================================================
 * ACCOUNTS - shared bits (brand button, quick asks, who's-using screen)
 * ========================================================================= */
.brand { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; min-width: 0; }
.brand-badge {
  flex: none; white-space: nowrap;
  font: 800 8px/1 var(--hud-font); letter-spacing: .14em; padding: 4px 6px; border-radius: 6px;
  color: var(--on-brand); background: var(--cyan); box-shadow: 0 0 10px rgba(var(--brand-rgb), .5);
}
.fx { position: absolute; inset: 0; width: 100%; height: 100%; }

.quick { display: flex; gap: 7px; overflow-x: auto; padding: 0 1px 6px; margin: 0 -14px 0 0; padding-right: 14px;
         scrollbar-width: none; -webkit-overflow-scrolling: touch; flex: none; }
.quick::-webkit-scrollbar { display: none; }
.q-chip {
  flex: none; height: 34px; padding: 0 13px; border-radius: 17px; white-space: nowrap;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text);
  font: 700 13px/1 var(--body-font);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.q-chip:active { transform: scale(.95); border-color: var(--cyan); }

.who {
  position: fixed; inset: 0; z-index: 40; overflow-y: auto; display: flex; justify-content: center;
  background: radial-gradient(800px 500px at 50% 0%, #10263a, transparent 70%), #03070d; color: #e6f3ff;
  padding: calc(var(--safe-t) + 30px) 20px calc(var(--safe-b) + 24px);
  animation: sheetIn .3s ease-out;
}
.who-inner { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; }
.who-logo .reactor-mini { display: block; flex: none; width: 44px; height: 44px; border-color: #38d6ff; transform: none; border-radius: 50%; }
.who-logo .reactor-mini i { inset: 13px; background: #38d6ff; box-shadow: 0 0 14px #38d6ff; }
.who-title { font: 800 18px/1.3 var(--hud-font, sans-serif); letter-spacing: .12em; text-transform: uppercase;
             color: #38d6ff; text-align: center; margin: 16px 0 22px; text-shadow: 0 0 14px rgba(56,214,255,.5); }
.who-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.who-card {
  position: relative; height: 118px; border-radius: 20px; border: 1px solid rgba(255,255,255,.12);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: #fff; font: 800 15px/1 "Nunito", sans-serif; letter-spacing: .02em; overflow: hidden;
  background: var(--card-bg); box-shadow: 0 8px 30px rgba(0,0,0,.35);
  transition: transform .1s;
}
.who-card:active { transform: scale(.96); }
.who-card .who-emo { font-size: 38px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
.who-card small { font: 600 11px/1 "Nunito", sans-serif; opacity: .75; }
.who-card[data-id="guest"] { grid-column: 1 / -1; height: 70px; flex-direction: row; gap: 12px; }
.who-card[data-id="guest"] .who-emo { font-size: 26px; }
.who-card[data-id="lucas"]  { --card-bg: linear-gradient(145deg, #0b3a5a, #3a1d6e); }
.who-card[data-id="mum"]    { --card-bg: linear-gradient(145deg, #f3a683, #e0765a); }
.who-card[data-id="dad"]    { --card-bg: linear-gradient(145deg, #2a2412, #0d0c08); border-color: rgba(212,175,55,.6); color: #f4d77a; }
.who-card[data-id="sister"] { --card-bg: linear-gradient(145deg, #f7a8d8, #a98bff 60%, #8fd3ff); }
.who-card[data-id="guest"]  { --card-bg: linear-gradient(145deg, #13324a, #07131f); }
.who-pass { width: 100%; display: flex; flex-direction: column; align-items: center; }
.who-avatar { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
              font-size: 50px; background: var(--card-bg); box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.who-name { margin-top: 12px; font: 800 22px/1.2 "Nunito", sans-serif; }
.who-hint { margin: 6px 0 16px; font-size: 13.5px; color: #9fb6c9; text-align: center; min-height: 1.2em; }
.who-pass input {
  width: 100%; height: 52px; margin-bottom: 10px; padding: 0 16px; border-radius: 14px; text-align: center;
  font-size: 20px; letter-spacing: .12em; color: #fff; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
}
.who-pass input:focus { outline: none; border-color: #38d6ff; }
.who-err { min-height: 1.3em; color: #ff8a8a; font-size: 14px; font-weight: 700; }
.who-pass .mini { color: #e6f3ff; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); }
.who-pass .mini.primary { color: #02121c; background: linear-gradient(135deg, #5fe0ff, #22a9d6); }
.who-pass.shake { animation: shake .35s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }

.account-row { display: flex; align-items: center; gap: 12px; }
.account-emoji { font-size: 30px; }
.account-text { flex: 1; min-width: 0; }
.account-text b { display: block; font-size: 16px; }
.account-text small { color: var(--muted); font-size: 12px; }
.account-row .chip-btn { color: var(--cyan); background: rgba(var(--brand-rgb), .1); border-color: var(--line-2); }
.chip-btn:not(#btnCancel):disabled { display: inline-block; opacity: .4; }
.mem { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.mem-title { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.mem-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.mem-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mem-item span { flex: 1; }
.mem-item button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--muted); }
.mem-empty { font-size: 13px; color: var(--muted); font-style: italic; }
.admin { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.admin select { flex: 1; height: 44px; border-radius: 12px; background: var(--field); color: var(--text); border: 1px solid var(--line); padding: 0 10px; font-size: 15px; }

/* =========================================================================
 * LUCAS - "Mark II": neon cyan + violet, hex grid, live particle network
 * ========================================================================= */
body[data-profile="lucas"] {
  --violet: #a06bff;
  --me-a: rgba(90,50,170,.8); --me-b: rgba(40,30,110,.8);
  --tile-a: rgba(26,30,80,.72); --tile-b: rgba(6,12,30,.85);
  --line-2: rgba(160,107,255,.4);
  --primary-a: #6ee6ff; --primary-b: #9b6bff;
}
body[data-profile="lucas"] .hud-grid {
  background-image:
    radial-gradient(circle, rgba(160,107,255,.22) 1.2px, transparent 1.6px),
    linear-gradient(60deg, transparent 49.3%, rgba(56,214,255,.06) 50%, transparent 50.7%),
    linear-gradient(-60deg, transparent 49.3%, rgba(56,214,255,.06) 50%, transparent 50.7%);
  background-size: 30px 52px, 30px 52px, 30px 52px;
}
body[data-profile="lucas"] .hud-glow {
  background: conic-gradient(from 0deg, rgba(56,214,255,.16), rgba(160,107,255,.2), rgba(56,214,255,.16));
  filter: blur(40px); animation: spin 14s linear infinite;
}
body[data-profile="lucas"] .brand-word { animation: glitch 6s infinite; }
body[data-profile="lucas"] .brand-badge { background: linear-gradient(90deg, #38d6ff, #a06bff); color: #fff; }
body[data-profile="lucas"] .tile { border-image: linear-gradient(135deg, rgba(56,214,255,.5), rgba(160,107,255,.5)) 1; border-radius: 14px; }
body[data-profile="lucas"] .tile { border: 1px solid rgba(160,107,255,.35); }
body[data-profile="lucas"] .tile::after { border-color: var(--violet); }
body[data-profile="lucas"] .msg.j { border-left-color: var(--violet); }
body[data-profile="lucas"] .r-arc.a2 { stroke: var(--violet); opacity: .8; }
body[data-profile="lucas"] .r-thin { stroke: var(--violet); opacity: .6; stroke-dasharray: 2 4; }
body[data-profile="lucas"] .ptt-core { border-image: none;
  box-shadow: 0 0 34px rgba(var(--accent-rgb), .35), 0 0 60px rgba(160,107,255,.25), inset 0 0 24px rgba(var(--accent-rgb), .25); }
body[data-profile="lucas"] .q-chip { border-color: rgba(160,107,255,.45); }
@keyframes glitch {
  0%, 92%, 100% { text-shadow: 0 0 14px rgba(56,214,255,.55); transform: none; }
  93% { text-shadow: -2px 0 #ff2bd6, 2px 0 #38d6ff; transform: translateX(1px) skewX(-8deg); }
  95% { text-shadow: 2px 0 #ff2bd6, -2px 0 #a06bff; transform: translateX(-1px); }
  97% { text-shadow: -1px 0 #a06bff, 1px 0 #38d6ff; transform: none; }
}
/* protocols */
body.party { animation: party 6s linear infinite; }
@keyframes party { to { filter: hue-rotate(360deg); } }
.party-ov { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.party-floor {
  position: absolute; left: -20%; right: -20%; bottom: -10%; height: 55%;
  background:
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(56,214,255,.5) 38px 40px),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(160,107,255,.5) 38px 40px);
  transform: perspective(320px) rotateX(64deg); transform-origin: bottom center;
  animation: floorRun .5s linear infinite, party 4s linear infinite; opacity: .5;
}
@keyframes floorRun { to { background-position: 0 40px, 40px 0; } }
.party-lights { position: absolute; inset: 0; }
.party-lights i {
  position: absolute; top: -30%; left: 50%; width: 40vw; height: 160vh; transform-origin: top center;
  mix-blend-mode: screen; filter: blur(6px); opacity: .5;
  clip-path: polygon(48% 0, 52% 0, 100% 100%, 0 100%);
}
.party-lights i:nth-child(1) { background: linear-gradient(#ff2bd6, transparent 70%); animation: sweep 3.1s ease-in-out infinite; }
.party-lights i:nth-child(2) { background: linear-gradient(#38d6ff, transparent 70%); animation: sweep 2.4s ease-in-out infinite reverse; }
.party-lights i:nth-child(3) { background: linear-gradient(#ffd23f, transparent 70%); animation: sweep 3.7s ease-in-out infinite; }
.party-lights i:nth-child(4) { background: linear-gradient(#3ddc84, transparent 70%); animation: sweep 2.8s ease-in-out infinite reverse; }
.party-lights i:nth-child(5) { background: linear-gradient(#a06bff, transparent 70%); animation: sweep 3.3s ease-in-out infinite; }
@keyframes sweep { 0%,100% { transform: translateX(-50%) rotate(-32deg); } 50% { transform: translateX(-50%) rotate(32deg); } }
.party-emoji { position: absolute; inset: 0; }
.party-emoji span { position: absolute; top: -8%; animation: emojiFall linear forwards; }
@keyframes emojiFall { to { transform: translateY(112vh) rotate(320deg); opacity: .2; } }
.party-title {
  position: absolute; top: 16%; left: 0; right: 0; text-align: center;
  font: 800 26px/1.2 var(--hud-font, sans-serif); letter-spacing: .14em; color: #fff;
  text-shadow: 0 0 18px #ff2bd6, 0 0 34px #38d6ff; animation: partyPop .5s ease-out, party 2s linear infinite;
}
@keyframes partyPop { from { transform: scale(.4); opacity: 0; } }
@keyframes partyFade { to { opacity: 0; } }
.ptt.beat { transform: scale(1.06); }
.ptt.beat .ptt-core { box-shadow: 0 0 70px rgba(var(--accent-rgb), .8), inset 0 0 40px rgba(var(--accent-rgb), .6); }
body.stealth .hud-bg, body.stealth .tiles, body.stealth .quick { opacity: .15; }
body.stealth { --text: #7f8fa0; }

/* =========================================================================
 * MUM (Lei) - warm kitchen: cream, terracotta and sage, soft and friendly
 * ========================================================================= */
body[data-profile="mum"] {
  --bg: #fbf4ec; --bg-2: rgba(255,255,255,.82); --bg-3: #ffffff;
  --line: rgba(190,110,80,.18); --line-2: rgba(190,110,80,.36);
  --cyan: #d9704a; --cyan-dim: #eaa487; --brand-rgb: 217, 112, 74;
  --green: #4f9a6a; --amber: #d4953a; --red: #d64545;
  --text: #3d2a21; --muted: #92776a;
  --tile-a: #ffffff; --tile-b: #fff7f0;
  --me-a: #f6d5c3; --me-b: #f2c6ae;
  --core-bg: #e97b52; --field: #ffffff;
  --sheet-bg: #fbf4ec; --sheet-glow: rgba(246,200,170,.6);
  --on-brand: #ffffff; --primary-a: #ec8a63; --primary-b: #d4633f;
  --knob: #ffffff; --link: #c0562f;
  --hud-font: "Fraunces", Georgia, serif;
  --body-font: "Nunito", -apple-system, system-ui, sans-serif;
  background: linear-gradient(180deg, #fff8f1, #fbeee2);
}
body[data-profile="mum"] .hud-grid, body[data-profile="mum"] .hud-scan { display: none; }
body[data-profile="mum"] .hud-glow { background: radial-gradient(circle, rgba(247,190,150,.45), rgba(200,225,190,.25) 45%, transparent 70%); }
body[data-profile="mum"] .brand-word { font: 600 italic 22px/1 var(--hud-font); letter-spacing: 0; text-shadow: none; color: #b8532f; }
body[data-profile="mum"] .reactor-mini { border-radius: 50% 50% 50% 8px; transform: rotate(-45deg); box-shadow: none; border-color: #e58d68; }
body[data-profile="mum"] .reactor-mini::before { display: none; }
body[data-profile="mum"] .reactor-mini i { background: #7fb38c; box-shadow: none; }
body[data-profile="mum"] .chips, body[data-profile="mum"] .icon-btn { background: #fff; box-shadow: 0 2px 10px rgba(160,90,60,.1); }
body[data-profile="mum"] .conn { font-family: var(--body-font); letter-spacing: .02em; font-size: 11px; }
body[data-profile="mum"] .tile { box-shadow: 0 4px 14px rgba(160,90,60,.1); color: var(--text); }
body[data-profile="mum"] .tile::after { display: none; }
body[data-profile="mum"] .tile-k { font: 800 10px/1.2 var(--body-font); letter-spacing: .05em; }
body[data-profile="mum"] .tile-cam .tile-k, body[data-profile="mum"] .tile-cam .tile-v { color: #fff; }
body[data-profile="mum"] .tile-cam .tile-img::after { background: linear-gradient(transparent 30%, rgba(70,35,20,.75)); }
body[data-profile="mum"] .state { box-shadow: 0 2px 12px rgba(160,90,60,.08); }
body[data-profile="mum"] .state-label { font: 800 13px/1.3 var(--body-font); letter-spacing: .02em; text-transform: none; }
body[data-profile="mum"] .msg { font-size: 16.5px; box-shadow: 0 2px 10px rgba(160,90,60,.08); }
body[data-profile="mum"] .msg.j { border-left: 3px solid #7fb38c; }
body[data-profile="mum"] .r-ticks, body[data-profile="mum"] .r-arc.a2 { display: none; }
body[data-profile="mum"] .r-arc.a1 { stroke-dasharray: 3 9; stroke-width: 5; filter: none; opacity: .5; }
body[data-profile="mum"] .r-thin { stroke-width: 2; opacity: .3; }
body[data-profile="mum"] .ptt-core { inset: 26px; border: 4px solid #fff; color: #fff;
  background: radial-gradient(circle at 35% 30%, #f7a47f, #de6a44 70%);
  box-shadow: 0 12px 30px rgba(217,112,74,.45), inset 0 -6px 14px rgba(120,40,20,.25); }
body[data-profile="mum"] .ptt { color: #fff; }
body[data-profile="mum"] .ptt-mic { filter: none; }
body[data-profile="mum"] .ptt-text { font: 800 13px/1.1 var(--body-font); letter-spacing: .02em; }
body[data-profile="mum"][data-state="listening"] .ptt-core { background: radial-gradient(circle at 35% 30%, #8fd0a3, #4f9a6a 70%); }
body[data-profile="mum"][data-state="thinking"] .ptt-core { background: radial-gradient(circle at 35% 30%, #f5cf7a, #d4953a 70%); }
body[data-profile="mum"] .side-btn { background: #fff; box-shadow: 0 3px 12px rgba(160,90,60,.12); font-family: var(--body-font); letter-spacing: .02em; font-size: 10.5px; }
body[data-profile="mum"] .pill { background: #fff; }
body[data-profile="mum"] .q-chip { background: #fff; box-shadow: 0 2px 8px rgba(160,90,60,.08); font-size: 14px; height: 38px; border-radius: 19px; }
body[data-profile="mum"] .sheet h2 { text-transform: none; letter-spacing: 0; font: 600 italic 24px/1.2 var(--hud-font); color: #b8532f; text-shadow: none; }
body[data-profile="mum"] .boot { background: #fbf4ec; }
body[data-profile="mum"] .composer input { background: #fff; }

/* =========================================================================
 * DAD (Tong) - executive: black and gold, carbon fibre, radar sweep
 * ========================================================================= */
body[data-profile="dad"] {
  --bg: #050505; --bg-2: rgba(20,17,10,.8); --bg-3: rgba(30,25,14,.85);
  --line: rgba(212,175,55,.2); --line-2: rgba(212,175,55,.45);
  --cyan: #e2bd4f; --cyan-dim: #8a6d1c; --brand-rgb: 226, 189, 79;
  --text: #f5ecd5; --muted: #a8977a;
  --tile-a: rgba(34,28,14,.85); --tile-b: rgba(10,9,6,.92);
  --me-a: rgba(110,85,25,.75); --me-b: rgba(70,52,14,.8);
  --core-bg: #0b0906; --field: rgba(20,17,10,.9);
  --sheet-bg: #070605; --sheet-glow: rgba(120,90,20,.35);
  --on-brand: #1a1204; --primary-a: #f4d77a; --primary-b: #c99a2e;
  --knob: #f5ecd5; --link: #f4d77a;
  --body-font: "Rajdhani", -apple-system, system-ui, sans-serif;
}
body[data-profile="dad"] .hud-grid {
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 2px, transparent 2px 6px),
                    repeating-linear-gradient(-45deg, rgba(0,0,0,.4) 0 2px, transparent 2px 6px);
  background-size: auto; animation: none;
}
body[data-profile="dad"] .hud-scan { background: linear-gradient(transparent, rgba(226,189,79,.06), transparent); }
body[data-profile="dad"] .hud-glow {
  background: conic-gradient(from 0deg, rgba(226,189,79,.28), transparent 18%, transparent 100%);
  animation: spin 5s linear infinite; opacity: .7;
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%); mask-image: radial-gradient(circle, #000 30%, transparent 70%);
}
body[data-profile="dad"] .brand-word {
  background: linear-gradient(180deg, #fff3c4, #e2bd4f 50%, #9c7420); -webkit-background-clip: text; background-clip: text;
  color: transparent; text-shadow: none; filter: drop-shadow(0 0 8px rgba(226,189,79,.4));
}
body[data-profile="dad"] .brand-badge { background: linear-gradient(180deg, #f4d77a, #b88a24); }
body[data-profile="dad"] .msg, body[data-profile="dad"] .q-chip { font-size: 16px; font-weight: 600; }
body[data-profile="dad"] .tile { border-color: rgba(212,175,55,.3);
  background-image: linear-gradient(160deg, var(--tile-a), var(--tile-b)), repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 2px, transparent 2px 5px); }
body[data-profile="dad"] .tile-v { font: 700 14px/1.1 var(--body-font); }
body[data-profile="dad"] .r-ticks { stroke-dasharray: 1 3; stroke-width: 9; opacity: .4; }
body[data-profile="dad"] .r-arc.a1 { stroke-width: 4; stroke-dasharray: 60 20 10 20; }
body[data-profile="dad"] .ptt-core { background: radial-gradient(circle at 50% 35%, rgba(255,230,150,.3), #0b0906 72%);
  border: 2px solid #e2bd4f; box-shadow: 0 0 40px rgba(226,189,79,.35), inset 0 0 30px rgba(226,189,79,.2); }
body[data-profile="dad"] .ptt-text { font-size: 9.5px; }
body[data-profile="dad"] .pill, body[data-profile="dad"] .mini { font-family: var(--body-font); font-size: 15px; }

/* =========================================================================
 * SISTER - dreamy pastel: lilac, pink and sky, glossy orb, sparkles
 * ========================================================================= */
body[data-profile="sister"] {
  --bg: #f4ecff; --bg-2: rgba(255,255,255,.66); --bg-3: rgba(255,255,255,.9);
  --line: rgba(150,100,230,.2); --line-2: rgba(200,90,190,.35);
  --cyan: #a45cf0; --cyan-dim: #d2a8ff; --brand-rgb: 164, 92, 240;
  --pink: #ff5fae; --green: #2fbf8f; --amber: #f29a38;
  --text: #36264f; --muted: #8a78a8;
  --tile-a: rgba(255,255,255,.8); --tile-b: rgba(247,236,255,.8);
  --me-a: #ffc4e4; --me-b: #e3cbff;
  --core-bg: #b77cf6; --field: rgba(255,255,255,.9);
  --sheet-bg: #f6efff; --sheet-glow: rgba(255,190,230,.5);
  --on-brand: #ffffff; --primary-a: #ff7cc0; --primary-b: #a45cf0;
  --knob: #ffffff; --link: #a13fd8;
  --hud-font: "Quicksand", "Nunito", sans-serif;
  --body-font: "Quicksand", "Nunito", -apple-system, system-ui, sans-serif;
  background: linear-gradient(165deg, #ffe6f4 0%, #efe6ff 45%, #dff3ff 100%);
}
body[data-profile="sister"] .hud-grid, body[data-profile="sister"] .hud-scan { display: none; }
body[data-profile="sister"] .hud-glow { background: radial-gradient(circle, rgba(255,150,210,.35), rgba(160,140,255,.25) 45%, transparent 70%); }
body[data-profile="sister"] .brand-word {
  font: 700 21px/1 var(--hud-font); letter-spacing: .06em; text-shadow: none;
  background: linear-gradient(90deg, #ff5fae, #a45cf0, #4fb7ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
body[data-profile="sister"] .brand-badge { background: linear-gradient(90deg, #ff7cc0, #a45cf0); color: #fff; font-size: 10px; }
body[data-profile="sister"] .reactor-mini { border-color: #ff7cc0; box-shadow: 0 0 12px rgba(255,124,192,.6); }
body[data-profile="sister"] .reactor-mini i { background: linear-gradient(135deg, #ff7cc0, #8f7bff); }
body[data-profile="sister"] .conn { font-family: var(--body-font); letter-spacing: .02em; font-size: 11px; }
body[data-profile="sister"] .tile { border-radius: 20px; color: var(--text); box-shadow: 0 6px 18px rgba(150,100,230,.12); }
body[data-profile="sister"] .tile::after { display: none; }
body[data-profile="sister"] .tile-k { font: 700 10px/1.2 var(--body-font); letter-spacing: .04em; }
body[data-profile="sister"] .tile-cam .tile-k, body[data-profile="sister"] .tile-cam .tile-v { color: #fff; }
body[data-profile="sister"] .tile-cam .tile-img::after { background: linear-gradient(transparent 30%, rgba(90,40,120,.7)); }
body[data-profile="sister"] .state { border-radius: 18px; }
body[data-profile="sister"] .state-label { font: 700 13px/1.3 var(--body-font); letter-spacing: .04em; text-transform: none; }
body[data-profile="sister"] .msg { border-radius: 20px; font-weight: 600; }
body[data-profile="sister"] .msg.j { border-left: 0; background: rgba(255,255,255,.85); border-color: rgba(164,92,240,.2); }
body[data-profile="sister"] .r-ticks { stroke: #ff7cc0; stroke-dasharray: .1 12; stroke-width: 6; opacity: .8; }
body[data-profile="sister"] .r-arc.a1 { stroke: url(#none); stroke: #a45cf0; stroke-dasharray: 40 30; opacity: .35; filter: none; }
body[data-profile="sister"] .r-arc.a2, body[data-profile="sister"] .r-thin { display: none; }
body[data-profile="sister"] .ptt { color: #fff; }
body[data-profile="sister"] .ptt-core { inset: 24px; border: 0;
  background: radial-gradient(circle at 32% 26%, rgba(255,255,255,.9) 0 7%, transparent 22%),
              linear-gradient(140deg, #ff8cc8, #b07cff 55%, #6fc3ff);
  box-shadow: 0 14px 34px rgba(164,92,240,.4), inset 0 -8px 18px rgba(80,30,140,.25); }
body[data-profile="sister"][data-state="listening"] .ptt-core { background: radial-gradient(circle at 32% 26%, rgba(255,255,255,.9) 0 7%, transparent 22%), linear-gradient(140deg, #6ff0c2, #2fbf8f); }
body[data-profile="sister"] .ptt-mic { filter: none; }
body[data-profile="sister"] .ptt-text { font: 700 13px/1.1 var(--body-font); letter-spacing: .03em; }
body[data-profile="sister"] .side-btn, body[data-profile="sister"] .pill { background: rgba(255,255,255,.8); }
body[data-profile="sister"] .side-btn { font-family: var(--body-font); letter-spacing: .02em; font-size: 10.5px; }
body[data-profile="sister"] .q-chip { background: rgba(255,255,255,.85); border-color: rgba(255,124,192,.4); font-size: 13.5px; }
body[data-profile="sister"] .sheet h2 { text-transform: none; letter-spacing: .02em; font: 700 22px/1.2 var(--hud-font); text-shadow: none;
  background: linear-gradient(90deg, #ff5fae, #a45cf0); -webkit-background-clip: text; background-clip: text; color: transparent; }
body[data-profile="sister"] .boot { background: #f4ecff; }

body[data-profile="mum"] .lucas-only, body[data-profile="dad"] .lucas-only, body[data-profile="sister"] .lucas-only { display: none; }
html { background: #02060c; }
.reactor-mini { flex: none; }
.brand { display: flex; align-items: center; gap: 8px; }
/* brand with a badge: the badge sits under the word, so it never pushes into the lights */
.brand { display: grid; grid-template-columns: auto auto; grid-auto-rows: auto; column-gap: 9px; row-gap: 2px; align-items: center; justify-items: start; }
.brand .reactor-mini { grid-row: span 2; }
.brand-badge { grid-column: 2; font-size: 6.5px; padding: 2px 5px; border-radius: 4px; letter-spacing: .22em; margin-top: -1px; }
.brand-badge[hidden] + * { display: none; }
body[data-profile="sister"] .brand-badge { font-size: 8px; padding: 1px 6px; }

/* pairing: ask to join / approve */
.join-card .field { margin-bottom: 0; }
.join-wait { margin-top: 14px; text-align: center; }
.join-code { font: 800 34px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .3em; padding-left: .3em;
             color: var(--cyan); text-shadow: 0 0 14px rgba(var(--brand-rgb), .5); animation: pulse 1.6s infinite; }
.pend { padding: 10px; margin-bottom: 10px; border-radius: 12px; border: 1px solid var(--amber); background: rgba(255,181,71,.08); }
.pend b { display: block; font-size: 15px; }
.pend .pend-code { font: 800 22px/1.3 ui-monospace, Menlo, monospace; letter-spacing: .2em; color: var(--amber); }
.pend .row .mini { min-height: 40px; }
.phone-item { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.phone-item:last-child { border-bottom: 0; }
.phone-item span { flex: 1; min-width: 0; }
.phone-item small { display: block; color: var(--muted); font-size: 11.5px; }
.phone-item.off { opacity: .45; }
.phone-item .chip-btn { color: #ffb3b3; }

/* ------------------------------------------------------------ family map */
.share-box { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); padding: 12px; margin-bottom: 12px; }
.share-row { display: flex; align-items: center; gap: 12px; }
.share-txt { flex: 1; min-width: 0; }
.share-txt b { display: block; font-size: 15px; }
.share-txt small { color: var(--muted); font-size: 12.5px; }
#btnShareLoc { flex: none; width: auto; min-width: 84px; }
#btnShareLoc[aria-checked="1"], #btnShareLoc.on { border-color: var(--green); color: var(--green); background: rgba(61,220,132,.08); }
#btnShareLoc.on .dot { background: var(--green); box-shadow: 0 0 10px var(--green); animation: breathe 2s ease-in-out infinite; }
.share-banner { margin-top: 10px; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 600;
                border: 1px solid var(--green); background: rgba(61,220,132,.1); color: var(--green); }
.map-canvas { width: 100%; height: 200px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--field);
              display: block; margin-bottom: 12px; }
.map-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.map-person { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
              border-radius: 12px; background: var(--bg-2); }
.map-person .who-emo { font-size: 22px; }
.map-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.map-person .mp-txt { flex: 1; min-width: 0; }
.map-person .mp-txt b { font-size: 15px; }
.map-person .mp-txt small { display: block; color: var(--muted); font-size: 12px; }
.map-person a { flex: none; font-size: 13px; font-weight: 700; color: var(--cyan); text-decoration: none;
                padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; }
.map-empty { color: var(--muted); font-size: 14px; font-style: italic; text-align: center; padding: 20px 0; }

/* ------------------------------------------------------------------ focus */
#tileFocus::after { border-color: var(--amber); }
.focus-banner { margin: 0 0 8px; padding: 9px 12px; border-radius: 12px; font-size: 13px; font-weight: 700;
                border: 1px solid var(--amber); background: rgba(255,181,71,.1); color: var(--amber); }
.focus-hero { display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 10px; border-radius: 16px;
              border: 1px solid var(--line-2); background: var(--bg-2); }
.focus-ring { width: 54px; height: 54px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 24px;
              border: 2px solid var(--muted); }
.focus-hero[data-on="1"] .focus-ring { border-color: var(--amber); box-shadow: 0 0 18px rgba(255,181,71,.45); }
.focus-hero[data-on="lock"] .focus-ring { border-color: var(--red); box-shadow: 0 0 18px rgba(255,92,92,.45); }
.focus-hero-txt { flex: 1; min-width: 0; }
.focus-hero-txt b { display: block; font-size: 18px; }
.focus-hero-txt small { color: var(--muted); font-size: 13px; }
.focus-kids { gap: 8px; margin-bottom: 8px; }
.focus-kids .chip-btn, #btnBgSetup { color: var(--text); background: var(--field); border-color: var(--line-2); }
.focus-kids .chip-btn.on { border-color: var(--cyan); color: var(--cyan); background: rgba(var(--brand-rgb), .1); }
.focus-pc { font-size: 12.5px; color: var(--amber); margin: 0 2px 12px; }
.focus-pc[data-ok="1"] { color: var(--green); }
.focus-rules { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.focus-rule { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); }
.focus-rule .fr-txt { flex: 1; min-width: 0; }
.focus-rule b { display: block; font-size: 15px; }
.focus-rule b::first-letter { text-transform: uppercase; }
.focus-rule small { color: var(--muted); font-size: 12px; }
.focus-rule .mini { width: auto; flex: none; }
.focus-add .row { gap: 8px; align-items: center; margin-top: 8px; }
.focus-add input[type=time], .focus-add select, #focusPin, #placeName { flex: 1; min-width: 0; padding: 10px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: inherit; }
.focus-add .to { color: var(--muted); }
.day-chips { display: flex; gap: 6px; }
.day-chips button { flex: 1; padding: 9px 0; border-radius: 10px; border: 1px solid var(--line); background: transparent;
                    color: var(--muted); font-weight: 700; }
.day-chips button.on { border-color: var(--cyan); color: var(--cyan); background: rgba(var(--brand-rgb), .1); }
.focus-lists { margin-top: 12px; }
.focus-lists summary { cursor: pointer; color: var(--cyan); font-weight: 700; margin-bottom: 8px; }
.focus-lists textarea { width: 100%; padding: 8px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--field);
                        color: var(--text); font: 13px/1.4 var(--body-font); }
.focus-msg { min-height: 20px; margin: 4px 2px 10px; font-size: 14px; font-weight: 600; color: var(--green); }
.focus-msg[data-bad="1"] { color: var(--amber); }
/* family map additions */
.bg-card .chip-btn { flex: none; }
.bg-steps { margin-top: 10px; font-size: 13.5px; }
.bg-steps ol { padding-left: 20px; margin: 0 0 10px; }
.bg-steps li { margin-bottom: 8px; }
.bg-field { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.bg-field span { width: 70px; flex: none; color: var(--muted); font-size: 12px; }
.bg-field code { flex: 1; min-width: 0; overflow-wrap: anywhere; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line-2);
                 background: var(--field); color: var(--cyan); font-size: 12.5px; cursor: copy; }
.bg-field code[data-copied="1"]::after { content: "  copied"; color: var(--green); font-family: var(--body-font); }
.place-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.place-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; }
.place-chip button { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 0 2px; }
.focus-now .mini { padding-left: 4px; padding-right: 4px; white-space: nowrap; font-size: 14px; }

/* ---- lockdown mode ---- */
.lockdown-btn { border-color: rgba(255,60,60,.55) !important; color: #ff9a9a !important; }
.lockdown-btn .dot { background: #ff3b30; box-shadow: 0 0 8px #ff3b30; }
.lockdown-btn.on { background: rgba(255,0,0,.28) !important; color: #fff !important; animation: byPulse 1s infinite; }
.lockdown-overlay { position: fixed; inset: 0; z-index: 100; background: #120000; }
.lockdown-overlay iframe { width: 100%; height: 100%; border: 0; display: block; }
.lockdown-hide { position: absolute; top: calc(var(--safe-t) + 18px); left: 10px; z-index: 101; width: 34px; height: 34px;
                 border-radius: 50%; border: 1px solid rgba(255,80,80,.6); background: rgba(40,0,0,.85); color: #fff; font-size: 14px; }

/* ---- embarrassment mode v2: its own screen ---- */
.coach-sheet { --sheet-glow: rgba(255,149,0,.16); }
.coach-sheet h2 { color: var(--orange); text-shadow: 0 0 12px rgba(255,149,0,.45); }
.cm-rec { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font: 700 11px/1 var(--hud-font);
          letter-spacing: .12em; color: #ff6b6b; }
.cm-rec i { width: 9px; height: 9px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 8px #ff3b30; animation: cmBlink 1.2s infinite; }
@keyframes cmBlink { 50% { opacity: .25; } }
.cm-big { font-size: 17px; padding: 16px; }
.cm-say { font-size: 24px; line-height: 1.32; font-weight: 800; min-height: 3.3em; padding: 14px; margin-bottom: 10px;
          border: 1px solid var(--orange); border-radius: 16px; background: rgba(255,149,0,.07); }
.cm-say.flash { animation: coachflash .8s ease-out; }
.cm-meter { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; margin: 12px 0 6px; }
.cm-meter > div { height: 100%; width: 0; background: #5fd4ff; transition: width .1s linear; }
.cm-status { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.cm-busy { color: var(--amber); }
.cm-people { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cm-chip { font-size: 12px; font-weight: 700; padding: 3px 9px; border: 1px solid; border-radius: 999px; }
.cm-log { max-height: 42vh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 10px; margin-bottom: 10px;
          border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.25);
          font: 13.5px/1.4 ui-monospace, "SF Mono", Menlo, monospace; }
.cm-log-full { max-height: none; }
.cm-line { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.04); overflow-wrap: anywhere; }
.cm-line.mine { opacity: .8; }
.cm-line .cm-t { color: var(--muted); font-size: 11px; margin-right: 6px; }
.cm-line b { margin-right: 6px; }
.cm-empty { color: var(--muted); padding: 6px 0; }
.cm-actions { flex-wrap: wrap; }
.cm-actions .mini { flex: 1 1 auto; }
.cm-warn, .cm-warn-btn { color: var(--amber); }
.cm-read { font-style: italic; font-size: 15px; margin: 4px 0 6px; }
.cm-voice { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cm-voice b { flex: 1 1 auto; }
.cm-dot { width: 10px; height: 10px; border-radius: 50%; }
.cm-me.on { border-color: var(--green); color: var(--green); }
.cm-h { font: 700 12px/1.3 var(--hud-font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; }
.cm-summary { white-space: pre-line; font-size: 15px; line-height: 1.45; }
#cmSumAudio { width: 100%; margin: 4px 0 6px; }
.cm-dl { display: block; text-align: center; text-decoration: none; box-sizing: border-box; padding: 10px; }
.cm-sess { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; padding: 11px 12px; margin-bottom: 8px;
           border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); color: var(--text); font-size: 14px; }
.cm-sess i { font-style: normal; font-weight: 700; }
.coach-card { cursor: pointer; }

/* talk through the camera */
.by-talk { display: flex; gap: 8px; margin-top: 10px; align-items: stretch; }
.by-talk .talk-btn { flex: 1; padding: 14px 10px; font-weight: 700; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; touch-action: none; }
.by-talk select { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.18); border-radius: 12px;
  padding: 0 8px; font: inherit; font-size: 13px; }
.talk-btn.rec { background: #ff3b30 !important; color: #fff !important; border-color: #ff3b30 !important;
  box-shadow: 0 0 18px rgba(255,59,48,.6); animation: talkpulse .9s ease-in-out infinite; }
@keyframes talkpulse { 50% { box-shadow: 0 0 4px rgba(255,59,48,.3); } }

/* Settings > Lockdown */
.lockdown-card .row { display: flex; gap: 8px; align-items: stretch; }
.lockdown-card select { flex: 1; min-width: 0; background: transparent; color: inherit; font: inherit; font-size: 13px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 0 10px; }
.lockdown-card select option { background: #0b1520; color: #e6f6ff; }

/* high alert: the button flashes while the siren is sounding */
.lockdown-btn.trip { background: #ff2a2a !important; color: #fff !important; animation: ldtrip .6s steps(2) infinite; }
@keyframes ldtrip { 50% { background: #5a0000; } }

#byListen.on { background: #12415e; color: #fff; border-color: #5fd4ff; }


/* ------------------------------------------------ MK3: version badge + what's new */
.mk-badge {
  flex: none; cursor: pointer; white-space: nowrap; margin-left: -2px;
  font: 800 10px/1 var(--hud-font); letter-spacing: .16em; padding: 5px 7px 4px; border-radius: 7px;
  color: #04121c; background: linear-gradient(135deg, #ffd25e, #ff8a3d);
  box-shadow: 0 0 12px rgba(255, 170, 60, .55); animation: mkpulse 3.2s ease-in-out infinite;
}
.mk-badge.old { background: #6b7684; color: #fff; box-shadow: none; animation: none; }
@keyframes mkpulse { 50% { box-shadow: 0 0 20px rgba(255, 170, 60, .9); } }
.mk-wrap { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 16px;
  background: rgba(2, 8, 16, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: mkfade .25s ease-out; }
@keyframes mkfade { from { opacity: 0; } }
.mk-card { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; border-radius: 18px;
  border: 1px solid rgba(255, 190, 90, .45); background: linear-gradient(180deg, #0b1a2a, #06101b);
  box-shadow: 0 0 40px rgba(255, 160, 60, .25); color: #d9ecff; padding: 18px 18px 14px;
  font: 15px/1.45 var(--body-font, -apple-system, system-ui, sans-serif); animation: mkzoom .3s cubic-bezier(.2,.9,.3,1.2); }
@keyframes mkzoom { from { transform: scale(.85); opacity: 0; } }
.mk-card h2 { margin: 0 0 2px; font: 800 22px/1.1 var(--hud-font); letter-spacing: .12em; color: #ffcf6a; }
.mk-card .mk-sub { color: #8fa9c0; font-size: 13px; margin-bottom: 12px; }
.mk-card h3 { margin: 14px 0 6px; font: 700 12px/1 var(--hud-font); letter-spacing: .16em; color: #7fd8ff; }
.mk-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, .04); margin: 5px 0; }
.mk-row > i { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: #5a6b7c; }
.mk-row.ok > i { background: #3ee08a; box-shadow: 0 0 8px #3ee08a; }
.mk-row.warn > i { background: #ffb347; box-shadow: 0 0 8px #ffb347; }
.mk-row.bad > i { background: #ff5d5d; box-shadow: 0 0 8px #ff5d5d; }
.mk-row b { color: #fff; }
.mk-row small { display: block; color: #8fa9c0; font-size: 12.5px; }
.mk-new { margin: 0; padding-left: 18px; }
.mk-new li { margin: 5px 0; }
.mk-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.mk-btns button { font: 600 14px var(--body-font, system-ui); padding: 9px 16px; border-radius: 10px;
  border: 1px solid rgba(127, 216, 255, .5); background: #0e2a3e; color: #fff; cursor: pointer; }
.mk-btns button.go { background: linear-gradient(135deg, #ffd25e, #ff8a3d); color: #04121c; border: 0; }
/* the MK badge sits right of the word JARVIS (the brand is a grid: ring | word / profile badge) */
.brand > .mk-badge.mk-badge { display: inline-block; grid-column: 3; grid-row: 1; align-self: center; }
