/* HARVY HUD theme: deep space, a living core, amber accent. Fonts are served from this origin (CSP: font-src 'self'). */
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("/plex-arabic-400.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("/plex-arabic-600.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("/plex-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("/plex-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193; }
@font-face { font-family: "Rajdhani"; font-weight: 600; font-display: swap; src: url("/rajdhani-600.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 700; font-display: swap; src: url("/rajdhani-700.woff2") format("woff2"); }

:root {
  --bg: #05080D; --panel: #0A1119; --text: #E6F6FF; --muted: #8FA3B8; --chip-text: #CFF6FF;
  --accent: #38E1FF; --amber: #FFB547; --green: #3DF5A0; --danger: #FF6B6B;
  --line: rgba(56, 225, 255, 0.18); --line-strong: rgba(56, 225, 255, 0.4);
  --tint: rgba(56, 225, 255, 0.06); --me: #13202C;
  --glow: 0 0 18px rgba(56, 225, 255, 0.45);
  --tech: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --orb: #38E1FF; /* the orb's colour right now, kept up to date by orb.js */
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background-color: var(--bg); color: var(--text);
  background-image: radial-gradient(ellipse at 50% 30%, #0A1222, var(--bg) 70%);
  font: 16px/1.7 "Plex Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Deep space behind everything (space.js) */
#space { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(5, 8, 13, 0.7);
}
.brand { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.brand-name { font: 700 22px var(--tech); letter-spacing: 7px; padding-left: 7px; color: var(--accent); text-shadow: 0 0 12px rgba(56, 225, 255, 0.35); }
.brand-state { display: flex; align-items: center; gap: 6px; font: 600 11px var(--tech); letter-spacing: 2px; color: var(--muted); margin-top: 3px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: var(--green); animation: pulse 2.6s ease-in-out infinite; }
.dot.err { background: var(--danger); }
.dot.busy { background: var(--accent); animation: pulse .9s infinite; }
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.icon-btn {
  width: 44px; height: 44px; padding: 0; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(56, 225, 255, 0.28); background: var(--tint); color: var(--accent);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: var(--line-strong); }
/* Mute: the speaker gets a cross and turns amber while HARVY answers in writing only. */
#mute-btn .off, #mute-btn.on .sound { display: none; }
#mute-btn.on .off { display: inline; }
#mute-btn.on { color: var(--amber); border-color: rgba(255, 181, 71, 0.55); background: rgba(255, 181, 71, 0.08); }
/* Five header buttons on a phone: a little smaller, so the name keeps its line. */
@media (max-width: 420px) {
  header { padding-inline: 10px; }
  .icon-btn { width: 40px; height: 40px; }
  .brand-name { font-size: 20px; letter-spacing: 5px; padding-left: 5px; }
  .brand-state { white-space: nowrap; letter-spacing: 1px; }
}
@media (max-width: 350px) {
  .icon-btn { width: 36px; height: 36px; }
  .brand-name { font-size: 18px; letter-spacing: 3px; padding-left: 3px; }
  .brand-state { display: none; }
}

/* Layout. Wide screens: the chat on the right, HARVY's desktop (his core, skills and what's running) in the
   middle, the day at a glance on the left. Phones: two screens, the desktop (with the day under it) and the
   chat, switched from the bar under the header. */
#shell { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
#chat-pane { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.rail { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 600px; align-self: center; padding: 0 16px 20px; }
.views { display: flex; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: rgba(5, 8, 13, 0.7); }
.views button { flex: 1; min-height: 40px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-color: rgba(56, 225, 255, 0.2); background: transparent; color: var(--muted); font-size: 14px; }
.views button[aria-pressed="true"] { border-color: var(--accent); background: rgba(56, 225, 255, 0.14); color: var(--text); }
.unread { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.unread[hidden] { display: none; }
@media (max-width: 1099px) {
  body:not(.chat-view) #chat-pane, body.chat-view #desk, body.chat-view #rail-end, .wide-only { display: none; }
  body.chat-view #shell { overflow: hidden; }
}
.muted { color: var(--muted); font-size: 13px; margin: 0; }
.card { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(9, 15, 24, 0.78); text-align: start; }
.card h2 { margin: 0; font: 700 13px var(--tech); letter-spacing: 2px; color: var(--muted); }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card-head span { font-size: 12px; color: var(--muted); }
@media (min-width: 1100px) {
  /* In a right-to-left page the first column is the right one. */
  #shell { display: grid; grid-template-columns: clamp(360px, 30vw, 440px) minmax(0, 1fr) 290px; grid-template-rows: minmax(0, 1fr); grid-template-areas: "chat desk rail"; overflow: hidden; }
  #chat-pane { grid-area: chat; }
  #desk { grid-area: desk; min-height: 0; overflow-y: auto; border-inline: 1px solid var(--line); padding-block: 24px; }
  /* Centred when it fits, scrolled from the top when it doesn't. */
  #desk > :first-child { margin-top: auto; }
  #desk > :last-child { margin-bottom: auto; }
  #desk { gap: 10px; }
  #desk .core { --core: min(320px, 36vh); }
  #rail-end { grid-area: rail; align-self: stretch; max-width: none; padding: 16px; overflow-y: auto; }
  .views { display: none; }
}

/* HARVY's desktop: his core, his state, a heads-up, his skills and what's running */
#desk { flex: none; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 16px 14px; text-align: center; }
#desk h1 { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.4; }
#desk > p { margin: -8px 0 0; color: var(--muted); font-size: 14px; }
#desk > .card, #desk > .headsup { max-width: 600px; }
/* The sphere fills about two thirds of its box; the rest is room for its branches, so the text can come closer. */
#desk .core { margin-block: calc(var(--core) * -0.06) calc(var(--core) * -0.1); }

/* The core: HARVY's orb (orb.js), a beating sphere of light whose colour follows the weather and the mood. */
.core { --core: min(260px, 62vw, 34vh); position: relative; flex: none; width: var(--core); aspect-ratio: 1; }
/* The canvas spills past its box so the orb's branches of light have room to grow out. */
.core canvas, .orb canvas { position: absolute; inset: -30%; width: 160%; height: 160%; pointer-events: none; }
.orb-caption { margin: -2px 0 0; font-size: 12px; color: var(--muted); }
.orb-caption b { font-weight: 600; color: var(--orb); }
.core-label { font: 600 12px var(--tech); letter-spacing: 2px; color: var(--orb); }

.states { display: flex; gap: 6px; }
.states span { min-height: 30px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; font-size: 12px; border: 1px solid rgba(56, 225, 255, 0.2); color: var(--muted); }
.states span.on { border-color: var(--accent); background: rgba(56, 225, 255, 0.14); color: var(--text); }

.headsup { width: 100%; display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255, 181, 71, 0.45); background: rgba(255, 181, 71, 0.07); text-align: start; }
.headsup[hidden] { display: none; }
.headsup > svg { width: 22px; height: 22px; flex: none; margin-top: 2px; color: var(--amber); }
.headsup-body { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.6; }
button.amber { min-height: 36px; border: 0; background: var(--amber); color: #1A1206; font-weight: 600; font-size: 13px; }
button.amber-ghost { min-height: 36px; border: 1px solid rgba(255, 181, 71, 0.45); background: transparent; color: #FFD9A0; font-size: 13px; }

.skills { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rail .skills { justify-content: flex-start; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(56, 225, 255, 0.28); background: rgba(56, 225, 255, 0.06); color: var(--chip-text); font-size: 13px; }
.chip:hover:not(:disabled) { border-color: var(--line-strong); }

/* Background jobs: a running one has a moving bar; a finished one a full green (or red) bar. */
.jobs { display: flex; flex-direction: column; gap: 10px; }
.job { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.job-head { display: flex; justify-content: space-between; gap: 8px; }
.job-head b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-head span { flex: none; font-size: 12px; color: var(--accent); }
.job.done .job-head span { color: var(--green); }
.job.failed .job-head span { color: var(--danger); }
.bar { position: relative; height: 6px; border-radius: 3px; background: rgba(56, 225, 255, 0.12); overflow: hidden; }
.bar i { position: absolute; inset: 0; border-radius: 3px; background: var(--accent); box-shadow: 0 0 8px rgba(56, 225, 255, 0.6); }
.job.running .bar i { inset: 0 auto 0 0; width: 35%; animation: slide 1.6s ease-in-out infinite; }
.job.done .bar i { background: var(--green); box-shadow: none; }
.job.failed .bar i { background: var(--danger); box-shadow: none; }
.job small { color: var(--muted); font-size: 12px; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

.channels { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.channels span { display: inline-flex; align-items: center; gap: 5px; }
.channels i { width: 7px; height: 7px; border-radius: 50%; background: #5B6B7C; }
.channels i.on { background: var(--green); box-shadow: 0 0 6px var(--green); }

.list { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.list .item { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.list .item .at { flex: none; font: 600 13px var(--tech); letter-spacing: 1px; color: var(--accent); direction: ltr; }
.list .item .text { flex: 1; }
.list .goal { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.list .goal:last-child { border-bottom: 0; padding-bottom: 0; }
.list .goal small { color: var(--muted); font-size: 12px; }
.list .num { font: 600 14px var(--tech); direction: ltr; }

/* Conversation */
main { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
main:empty::before { content: "المحادثة هنا. اكتب لهارفي من تحت، أو دوس مهارة من سطح المكتب."; margin: auto; max-width: 28ch; text-align: center; color: var(--muted); font-size: 14px; }
.msg { max-width: 86%; padding: 12px 16px; white-space: pre-wrap; word-wrap: break-word; font-size: 15px; position: relative; }
.msg.me { align-self: flex-start; background: var(--me); border: 1px solid rgba(230, 246, 255, 0.08); border-radius: 16px 16px 4px 16px; }
.msg.bot { align-self: flex-end; background: var(--tint); border: 1px solid rgba(56, 225, 255, 0.35); border-radius: 4px 16px 16px 16px; }
.msg.bot::before, .msg.bot::after { content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none; }
.msg.bot::before { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.msg.bot::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.msg .lane { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.msg.err { align-self: center; color: var(--danger); background: none; border: 0; font-size: 14px; }
.msg.thinking { display: flex; align-items: center; gap: 8px; border-style: dashed; border-color: var(--line-strong); }
.msg.thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.msg.thinking i:nth-child(2) { animation-delay: .2s; }
.msg.thinking i:nth-child(3) { animation-delay: .4s; }
.msg.thinking span { font: 600 12px var(--tech); letter-spacing: 2px; color: var(--muted); }
.msg.thinking::before, .msg.thinking::after { display: none; }
.action { align-self: flex-end; width: min(88%, 520px); display: flex; flex-direction: column; gap: 10px; border: 1px solid rgba(255, 181, 71, 0.5); background: rgba(255, 181, 71, 0.07); border-radius: 16px; padding: 12px 14px; font-size: 14px; }
.action-title { display: flex; align-items: center; gap: 8px; font: 700 13px var(--tech); letter-spacing: 2px; color: var(--amber); }
.action-title svg { width: 16px; height: 16px; }
.action .row { margin-top: 0; }
.action .row button { flex: 1; min-height: 44px; font-size: 15px; }
.plugin-facts { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; opacity: 0.9; }
.plugin details summary { cursor: pointer; font-size: 13px; color: var(--amber); }
.plugin pre { max-height: 260px; overflow: auto; margin: 8px 0 0; padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.35); font: 12px/1.45 ui-monospace, monospace; white-space: pre; }

/* Panels: conversations, settings, memory */
.panel { padding: 16px; background: var(--panel); border-top: 1px solid var(--line-strong); max-height: 60vh; overflow-y: auto; }
.panel h2 { margin: 0 0 8px; font: 700 18px var(--tech); letter-spacing: 1px; color: var(--accent); }
.panel p { color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.row.tight { margin-top: 0; gap: 6px; }
.row.spread { justify-content: space-between; margin: 0 0 8px; }
.row.spread h2 { margin: 0; }
input[type=text], input[type=password] {
  flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 14px; outline: none;
}
input[type=text]:focus, input[type=password]:focus { border-color: var(--accent); }
#token-input { width: 100%; }
button { font: inherit; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--tint); color: var(--text); padding: 8px 14px; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; box-shadow: var(--glow); }
code { font-size: 13px; color: var(--amber); }
.facts { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow-y: auto; }
.facts li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts li small { display: block; color: var(--muted); font-size: 12px; }
.facts li button { flex: none; padding: 4px 10px; font-size: 13px; }
.facts .empty { color: var(--muted); }
.facts li.closed > div { opacity: .55; text-decoration: line-through; text-decoration-color: var(--muted); }
.facts li.chat { cursor: pointer; }
.facts li.chat.current { color: var(--accent); font-weight: 600; }

/* Composer */
footer { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: rgba(5, 8, 13, 0.8); border-top: 1px solid var(--line); }
#composer { display: flex; gap: 10px; align-items: center; }
.field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 6px 0 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(56, 225, 255, 0.05); }
.field:focus-within { border-color: var(--accent); }
.prompt { font: 700 14px var(--tech); color: var(--accent); }
.field input[type=text] { border: 0; background: transparent; padding: 0; height: 100%; border-radius: 0; font-size: 16px; }
.mic { width: 44px; height: 44px; padding: 0; flex: none; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.mic svg { width: 20px; height: 20px; }
.mic.listening { color: var(--bg); background: var(--danger); animation: pulse 1s infinite; }
#send { width: 52px; height: 52px; padding: 0; flex: none; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; }
#send svg { width: 22px; height: 22px; stroke-width: 2.2; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; min-height: 1em; text-align: center; }
.hint a { color: var(--accent); font-weight: 700; }

/* Conversation mode: a full screen "voice link" whose orb is HARVY's core */
#talk {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(26px + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 38%, rgba(56, 225, 255, 0.14), rgba(5, 8, 13, 0) 60%);
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--orb) 16%, transparent), rgba(5, 8, 13, 0) 60%);
  visibility: visible;
}
#talk[hidden] { display: none; }
body.talking footer { display: none; }
/* While talking, only the voice screen shows, over the open sky. */
body.talking header, body.talking .views, body.talking #shell { visibility: hidden; }
.talk-top { width: 100%; max-width: 560px; display: flex; align-items: center; justify-content: space-between; }
.talk-title { font: 700 15px var(--tech); letter-spacing: 4px; color: var(--muted); }
.talk-lang { color: var(--amber); border-color: rgba(255, 181, 71, 0.45); background: rgba(255, 181, 71, 0.07); font-weight: 600; font-size: 16px; }
.orb { position: relative; flex: none; width: min(300px, 76vw, 42vh); aspect-ratio: 1; margin-top: auto; padding: 0; border: 0; border-radius: 50%; background: none; }
.orb > span { position: absolute; border-radius: 50%; }
.orb .ripple { inset: 4%; border: 2px solid var(--orb); opacity: 0; }
.orb.listening .ripple { animation: ripple 2.4s ease-out infinite; }
.orb.listening .ripple.late { animation-delay: 1.2s; }
@keyframes ripple { 0% { transform: scale(.7); opacity: .6; } 100% { transform: scale(1.1); opacity: 0; } }
.talk-phase { margin-top: 18px; font: 700 14px var(--tech); letter-spacing: 4px; color: var(--orb); }
.talk-state { max-width: 34ch; min-height: 1.6em; text-align: center; font-size: 20px; line-height: 1.6; font-weight: 600; }
.talk-tip { max-width: 36ch; margin: 0 0 auto; text-align: center; font-size: 14px; line-height: 1.6; color: var(--muted); }
.talk-actions { width: 100%; max-width: 560px; display: flex; gap: 10px; }
.talk-actions button { flex: 1; min-height: 52px; border-radius: 14px; font-size: 15px; }
#talk-mute { color: #CFF6FF; }
#talk-mute.on { border-color: var(--amber); color: var(--amber); }
button.danger { border: 0; background: var(--danger); color: #1A0505; font-weight: 600; }

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

/* Hologram: a design HARVY showed, rotatable and editable by hand */
.holo-slot { align-self: stretch; }
.holo {
  position: relative; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 75%, rgba(56, 225, 255, 0.12), transparent 65%), rgba(5, 12, 20, 0.92);
  box-shadow: inset 0 0 40px rgba(56, 225, 255, 0.08);
}
.holo.full { position: fixed; inset: env(safe-area-inset-top) 0 0 0; z-index: 50; border-radius: 0; display: flex; flex-direction: column; }
body.holo-open { overflow: hidden; }
.holo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.holo-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.holo-title b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.holo-tag { font: 700 12px var(--tech); letter-spacing: 2px; color: var(--accent); direction: ltr; }
.holo-tools { display: flex; gap: 6px; flex: none; }
.holo-btn { width: 36px; height: 36px; padding: 0; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--tint); color: var(--accent); font-size: 17px; line-height: 1; }
.holo-btn.on { background: rgba(56, 225, 255, 0.2); box-shadow: var(--glow); }
.holo-stage { position: relative; height: min(340px, 52vh); touch-action: none; cursor: grab; }
.holo.full .holo-stage { flex: 1; height: auto; }
.holo-stage canvas { display: block; width: 100%; height: 100%; }
.holo-stage:active { cursor: grabbing; }
.holo-scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(56, 225, 255, 0.04) 0 1px, transparent 1px 4px);
}
.holo-scan::after {
  content: ""; position: absolute; left: 0; right: 0; height: 30%;
  background: linear-gradient(180deg, transparent, rgba(56, 225, 255, 0.07), transparent);
  animation: holo-sweep 4.5s linear infinite;
}
@keyframes holo-sweep { from { top: -30%; } to { top: 100%; } }
.holo-label {
  position: absolute; transform: translate(-50%, -150%); pointer-events: none; white-space: nowrap;
  font: 600 13px var(--tech); letter-spacing: 1px; color: #fff; padding: 2px 8px; border-radius: 6px;
  background: rgba(5, 8, 13, 0.75); border: 1px solid var(--amber);
}
.holo-fallback { padding: 40px 16px; text-align: center; color: var(--muted); }
.holo-parts { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px 4px; }
.holo-part { flex: none; min-height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: transparent; color: var(--chip-text); font-size: 13px; }
.holo-part[data-color="amber"] { border-color: rgba(255, 181, 71, 0.6); }
.holo-part[data-color="green"] { border-color: rgba(61, 245, 160, 0.6); }
.holo-part[data-color="red"] { border-color: rgba(255, 107, 107, 0.6); }
.holo-part.on { background: rgba(56, 225, 255, 0.18); color: #fff; box-shadow: var(--glow); }
.holo-editor { padding: 6px 12px 4px; display: grid; gap: 8px; }
.holo.full .holo-editor { max-height: 38vh; overflow-y: auto; }
.holo-editor-head { display: flex; gap: 8px; align-items: baseline; }
.holo-shape { font: 600 12px var(--tech); letter-spacing: 1px; color: var(--muted); }
.holo-group { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.holo-group-title { font-size: 12px; color: var(--muted); }
.holo-field { display: grid; grid-template-columns: 76px 1fr 84px; align-items: center; gap: 8px; font-size: 13px; min-height: 36px; }
.holo-field input[type="range"] { width: 100%; accent-color: var(--accent); }
.holo-field input[type="number"] { width: 100%; min-height: 32px; padding: 2px 6px; font: 14px var(--tech); color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; }
.holo-notes { margin: 6px 12px 0; padding: 8px 10px; white-space: pre-wrap; font-size: 13px; color: var(--muted); border-inline-start: 2px solid var(--amber); }
.holo-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px 12px; }
.holo-status { flex: 1 1 180px; font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .holo-scan::after { animation: none; } }

/* Photos attached to the next message, and photos sent in the chat */
.attached { display: flex; gap: 8px; padding: 0 0 8px; overflow-x: auto; }
.attached[hidden] { display: none; }
.thumb { position: relative; flex: none; width: 56px; height: 56px; padding: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-strong); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb::after { content: "×"; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; line-height: 18px; border-radius: 50%; background: rgba(5, 8, 13, 0.8); color: var(--text); font-size: 14px; }
.msg-photos { align-self: flex-start; display: flex; gap: 6px; flex-wrap: wrap; max-width: 86%; }
.msg-photos img { max-width: 180px; max-height: 180px; border-radius: 12px; border: 1px solid var(--line-strong); object-fit: cover; }
.meter { height: 6px; margin: 4px 0 8px; border-radius: 3px; background: var(--line-strong); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }
.meter span.warn { background: var(--danger); }

/* AI Team Meeting (meeting.js): a dark conference-call grid. */
#meeting {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; gap: 10px;
  background: radial-gradient(ellipse at 50% 0%, #0B1424, var(--bg) 75%);
  padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 12px) calc(env(safe-area-inset-bottom) + 10px) calc(env(safe-area-inset-left) + 12px);
}
#meeting[hidden] { display: none; }
.mt-top { display: flex; align-items: center; gap: 10px; }
.mt-title { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mt-sub { font: 600 11px var(--tech); letter-spacing: 1.5px; color: var(--muted); }
.mt-live { color: var(--danger); }
.mt-timer { font: 700 20px var(--tech); letter-spacing: 2px; color: var(--accent); }
#mt-speaker .off, #mt-speaker[aria-pressed="true"] .off { display: none; }
#mt-speaker[aria-pressed="false"] .off { display: inline; }
#mt-speaker[aria-pressed="false"] .sound { display: none; }
.mt-grid {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 8px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
@media (max-width: 520px) {
  .mt-grid { grid-template-columns: repeat(2, 1fr); }
  .mt-card { min-height: 0; padding: 10px 6px; }
  .mt-avatar { width: 40px; height: 40px; font-size: 20px; }
  .mt-role span, .mt-role-sep { display: none; }
  .mt-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
.mt-card {
  position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 12px 10px;
  background: rgba(10, 17, 25, 0.85); display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 4px; transition: border-color .2s, box-shadow .2s; min-height: 132px; overflow: hidden;
}
.mt-card > * { flex-shrink: 0; }
.mt-grid { grid-auto-rows: max-content; }
.mt-avatar {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 24px;
  background: color-mix(in srgb, var(--c) 18%, transparent); border: 2px solid var(--c);
}
.mt-name { font: 700 15px var(--tech); letter-spacing: 1.5px; color: var(--c); }
.mt-role { font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--tint); color: var(--chip-text); }
.mt-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }
.mt-state { position: absolute; top: 8px; inset-inline-start: 8px; font: 600 10px var(--tech); letter-spacing: 1px; color: var(--muted); }
.mt-card.leader { border-color: rgba(255, 181, 71, 0.5); }
.mt-card.thinking { border-color: var(--amber); animation: mt-pulse 1.2s ease-in-out infinite; }
.mt-card.thinking .mt-state { color: var(--amber); }
.mt-card.speaking { border-color: var(--green); box-shadow: 0 0 0 2px var(--green), 0 0 22px rgba(61, 245, 160, 0.55); }
.mt-card.speaking .mt-state { color: var(--green); }
@keyframes mt-pulse { 50% { box-shadow: 0 0 0 2px rgba(255, 181, 71, 0.6), 0 0 18px rgba(255, 181, 71, 0.45); } }
@media (prefers-reduced-motion: reduce) { .mt-card.thinking { animation: none; box-shadow: 0 0 0 2px var(--amber); } }
.mt-screen { font-size: 12px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 6px 10px; }
.mt-caption {
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: rgba(5, 8, 13, 0.85);
  min-height: 44px; display: flex; gap: 8px; align-items: baseline; overflow: hidden;
}
.mt-cap-who { font: 700 13px var(--tech); letter-spacing: 1px; white-space: nowrap; }
.mt-cap-text { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-drawer { max-height: 38vh; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--panel); }
.mt-drawer[hidden] { display: none; }
.mt-log { overflow-y: auto; flex: 1; font-size: 13px; }
.mt-log p { margin: 0 0 6px; }
.mt-log b { font-family: var(--tech); letter-spacing: 1px; }
.mt-form { display: flex; gap: 6px; }
.mt-form input { flex: 1; min-width: 0; }
.mt-dock { display: flex; justify-content: center; gap: 10px; }
.mt-ctl {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 8px 10px;
  border-radius: 14px; border: 1px solid var(--line); background: rgba(10, 17, 25, 0.9); color: var(--text); font-size: 11px;
}
.mt-ctl svg { width: 22px; height: 22px; }
.mt-ctl[aria-pressed="true"] { border-color: var(--green); color: var(--green); }
.mt-ctl:disabled { opacity: .5; }
.mt-end { background: var(--danger); border-color: var(--danger); color: #fff; }
