/* Oddo AI — styled to match the oddo.cloud homepage (homepage/home.css): ivory/navy/gold, system type. */

:root {
  color-scheme: light dark;
  --bg: #f4f0e6;
  --bg-2: #ebe4d3;
  --fg: #10204a;
  --fg-muted: #5a6180;
  --line: rgba(16, 32, 74, 0.12);
  --card: rgba(255, 255, 255, 0.6);
  --card-solid: #fbf9f4;
  --accent: #c99f2a;
  --accent-ink: #0b1a3d;
  --accent-soft: rgba(201, 159, 42, 0.18);
  --eyebrow: #9a7a1b;
  --gold: #d6ab3c;
  --gold-light: #f6dd8a;
  --navy: #0b1f5c;
  --ok: #2f6b45;
  --ok-soft: #e4efe6;
  --warn: #8a5a12;
  --warn-soft: #f6ecd2;
  --danger: #a4382b;
  --danger-soft: #f8e9e6;
  --shadow: 0 18px 50px rgba(16, 32, 74, 0.16);
  /* legacy names used by older rules */
  --ink: var(--fg);
  --muted: var(--fg-muted);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070d1f;
    --bg-2: #0d1736;
    --fg: #f3eedd;
    --fg-muted: #a7acc2;
    --line: rgba(243, 238, 221, 0.12);
    --card: rgba(255, 255, 255, 0.05);
    --card-solid: #0f1a3a;
    --accent: #e2b93b;
    --accent-ink: #0b1a3d;
    --accent-soft: rgba(226, 185, 59, 0.18);
    --eyebrow: #e2b93b;
    --gold: #e2b93b;
    --gold-light: #ffe9a6;
    --navy: #122a74;
    --ok: #9ad1a8;
    --ok-soft: rgba(95, 166, 110, 0.18);
    --warn: #f0c870;
    --warn-soft: rgba(226, 185, 59, 0.14);
    --danger: #f0a0a0;
    --danger-soft: rgba(217, 83, 79, 0.16);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; max-width: 100%; overflow-x: hidden; }
body {
  min-height: 100svh;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 40%);
  color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; border: 0; cursor: pointer; color: inherit; background: none; }
.hidden { display: none !important; }

/* ---------- Header (same as the homepage) ---------- */
.site-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: calc(12px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left));
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 10px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
  background: var(--card); border: 1px solid transparent;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand-mark { width: 26px; height: 26px; border-radius: 50%; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.brand-mark.small { width: 22px; height: 22px; margin-right: 8px; }
.pill {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--eyebrow); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; margin-left: 10px;
}
.nav-link, .ghost {
  font-size: 14px; font-weight: 500; text-decoration: none; color: var(--fg-muted);
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: color .2s, border-color .2s;
}
.nav-link:hover, .ghost:hover { color: var(--fg); border-color: var(--accent); }

/* ---------- Layout ---------- */
.shell { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px 40px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}

/* ---------- Login / setup card ---------- */
.login-card { width: min(440px, 100%); padding: 40px 36px 32px; text-align: center; }
.login-card .shield { width: 112px; height: 112px; margin: 0 auto 18px; display: block; filter: drop-shadow(0 18px 30px rgba(16,32,74,.3)); }
.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--eyebrow); }
h1, h2 { margin: 0 0 8px; letter-spacing: -0.03em; line-height: 1.05; font-weight: 700; }
h1 { font-size: clamp(32px, 6vw, 40px); }
h2 { font-size: 26px; }
.muted, .fine-print { color: var(--fg-muted); }
.muted { margin: 0; }
.fine-print { font-size: 12px; margin: 18px 0 0; }
.center { text-align: center; }

form { display: grid; gap: 14px; margin-top: 24px; text-align: left; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--fg-muted); }
input, textarea, select {
  font: inherit; font-size: 16px; color: var(--fg);
  border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px; outline: none;
  background: var(--card-solid);
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 14px 24px; font-weight: 600; font-size: 16px;
  box-shadow: var(--shadow); transition: transform .2s ease, filter .2s ease;
}
.primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.small-primary { padding: 9px 16px; font-size: 14px; box-shadow: none; }
#loginError, #setupStatus { margin: 12px 0 0; min-height: 1.2em; font-size: 14px; color: var(--danger); }

.apple-button {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 26px; min-height: 50px;
  padding: 13px 22px; border-radius: 999px; background: #000; color: #fff; font-weight: 600; font-size: 16px;
  text-decoration: none; letter-spacing: .01em; box-shadow: var(--shadow); transition: transform .2s ease, filter .2s ease;
}
.apple-button:hover { transform: translateY(-1px); filter: brightness(1.15); }
.apple-button:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.apple-logo { width: 18px; height: 18px; fill: currentColor; flex: 0 0 auto; }
@media (prefers-color-scheme: dark) { .apple-button { background: #fff; color: #000; } .apple-button:hover { filter: brightness(.95); } }
.notice { margin: 16px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-size: 14px; line-height: 1.45; text-align: left; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.divider { display: flex; align-items: center; gap: 12px; margin-top: 22px; color: var(--fg-muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.apple-button + .divider + form, .divider + form { margin-top: 14px; }
.login-card > a { display: inline-block; margin-top: 14px; font-size: 14px; color: var(--fg-muted); }

/* ---------- App shell ---------- */
.app { width: min(1200px, 100%); height: min(840px, calc(100svh - 48px)); display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 64px; flex: none; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.topbar > div { display: flex; align-items: center; font-weight: 600; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px 1fr; }

.sidebar { background: rgba(16,32,74,.03); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; }
@media (prefers-color-scheme: dark) { .sidebar { background: rgba(0,0,0,.18); } }
.room, a.room { display: block; text-align: left; padding: 11px 14px; border-radius: 999px; color: var(--fg-muted); text-decoration: none; font: inherit; font-size: 15px; font-weight: 500; transition: background .15s, color .15s; }
.room.active, .room:hover { background: var(--accent-soft); color: var(--fg); }
.room.active { font-weight: 600; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; display: flex; gap: 10px; align-items: center; }
.sidebar-footer small { display: block; color: var(--fg-muted); font-size: 12px; margin-top: 2px; }
.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 70%); color: var(--accent-ink); font-weight: 700; font-size: 14px;
}

.conversation { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 26px clamp(16px, 5%, 56px) 18px; }
.conversation > * { min-width: 0; max-width: 100%; flex-shrink: 0; }
.conversation-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.conversation-head h2 { margin: 0; }
.status { color: var(--ok); font-size: 12px; font-weight: 600; white-space: nowrap; padding-top: 6px; }
.status i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; }

/* Messages: AI on the left in a frosted card, you on the right in gold (same as the homepage thread). */
.messages { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 22px 2px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; }
.message { display: flex; gap: 10px; max-width: 86%; align-items: flex-end; }
.message > div { padding: 11px 15px; border-radius: 18px; border-bottom-left-radius: 6px; background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.message p { margin: 0; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 15.5px; }
.message small { display: block; color: var(--fg-muted); font-size: 11px; margin-top: 4px; }
.message .avatar { width: 30px; height: 30px; font-size: 12px; }
.message.koita .avatar { background: url("/shield-256.png") center / cover no-repeat; color: transparent; font-size: 0; }
.message:not(.koita) { align-self: flex-end; flex-direction: row-reverse; }
.message:not(.koita) > div { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 18px; border-bottom-right-radius: 6px; }
.message:not(.koita) small { color: rgba(11,26,61,.65); }
.messages h3 { margin: 14px 0 4px; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--eyebrow); }
.messages .muted { font-size: 14px; }

/* Voice state strip */
.voice-state { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--fg-muted); font-size: 14px; margin-bottom: 10px; }
.voice-state .orb { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 70%); opacity: .55; flex: 0 0 auto; transition: opacity .2s; }
.voice-state.listening { color: var(--danger); border-color: var(--danger-soft); }
.voice-state.listening .orb { background: #d9534f; opacity: 1; animation: pulse 1.1s ease-in-out infinite; }
.voice-state.thinking { color: var(--warn); }
.voice-state.thinking .orb { opacity: 1; animation: spin 1.4s linear infinite; border-radius: 40% 60% 55% 45%; }
.voice-state.speaking { color: var(--ok); }
.voice-state.speaking .orb { background: radial-gradient(circle at 35% 30%, #cdebd3, #5fa66e 70%); opacity: 1; animation: pulse .7s ease-in-out infinite; }
.voice-state .stop { margin-left: auto; background: var(--fg); color: var(--bg); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 13px; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .75; } 50% { transform: scale(1.5); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Composer: pill, gold send, round mic (same as the homepage) */
.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 18px; border-radius: 26px;
  border: 1px solid var(--line); background: var(--card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow);
  transition: border-color .2s;
}
.composer:focus-within { border-color: var(--accent); }
.composer textarea { flex: 1; min-width: 0; border: 0; background: transparent; resize: none; padding: 10px 0; font-size: 16px; line-height: 1.4; max-height: 160px; }
.composer textarea:focus { box-shadow: none; }
.composer-actions { display: flex; gap: 8px; align-items: center; }
.circle { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; }
.mic { font-size: 20px; transition: background .2s, transform .2s; }
.mic.active { background: #d9534f; color: #fff; transform: scale(1.08); animation: ring 1.2s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(217,83,79,.45); } 100% { box-shadow: 0 0 0 14px rgba(217,83,79,0); } }
.send { padding: 11px 18px; box-shadow: none; }
#voiceStatus { margin: 8px 0 0; font-size: 13px; color: var(--fg-muted); min-height: 1em; }

.voice-options { margin-top: 8px; color: var(--fg-muted); font-size: 13px; }
.voice-options summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.voice-options label { display: flex; align-items: center; gap: 8px; font-weight: 500; padding: 6px 0; color: var(--fg-muted); }
#readAloud, #handsFree { width: 18px; height: 18px; padding: 0; accent-color: var(--accent); }
#voiceSettings { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 0; }
#voiceSettings select { max-width: 100%; min-width: 0; flex: 1 1 180px; padding: 10px 12px; }
#voiceHelp { flex-basis: 100%; color: var(--fg-muted); }

/* Family members */
.member-list { display: grid; gap: 12px; max-width: 760px; }
.member-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.member-row > div { display: grid; gap: 4px; min-width: 0; }
.member-row strong { font-size: 15px; }
.member-row small { color: var(--fg-muted); font-size: 12px; overflow-wrap: anywhere; }
.member-row input { padding: 9px 12px; flex: 1 1 160px; min-width: 0; }
.member-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--eyebrow); margin-right: 6px; }
.badge.apple { background: #000; color: #fff; }
.badge.owner { background: var(--accent); color: var(--accent-ink); }
.danger { background: transparent; color: var(--danger); padding: 8px 10px; font-weight: 600; border-radius: 999px; }
.danger:hover { background: var(--danger-soft); }

/* ---------- Phones ---------- */
@media (max-width: 720px) {
  html, body { height: auto; min-height: 100%; overflow-y: auto; }
  .shell { display: block; min-height: 100svh; padding: 8px 10px max(24px, env(safe-area-inset-bottom)); }
  .login-card { margin: 16px auto; padding: 30px 22px 26px; }
  .app { width: 100%; height: auto; min-height: calc(100svh - 24px); overflow: visible; border-radius: 20px; }
  .workspace { display: block; }
  .topbar { padding: 0 14px; }
  .sidebar { flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .sidebar .room, .sidebar a.room { padding: 8px 12px; font-size: 13px; }
  .sidebar-footer { display: none; }
  .conversation { padding: 18px 14px; }
  .messages { flex: none; overflow: visible; min-height: 120px; padding: 16px 0; }
  .message { max-width: 94%; }
  .composer { flex-wrap: wrap; border-radius: 22px; }
  .composer textarea { flex: 1 1 160px; }
  .composer-actions { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .voice-state .orb, .mic.active { animation: none; }
  .primary, .apple-button, .room { transition: none; }
}

.fine-print a { color: var(--fg-muted); text-decoration: underline; text-underline-offset: 3px; }
.fine-print a:hover { color: var(--fg); }

/* =====================================================================================
   Liquid glass (2026-11-17): translucent layers with blur, saturation and a catch-light,
   over soft colour fields so the glass has something to refract. Solid fallbacks below.
   ===================================================================================== */
:root { --glass: rgba(255, 255, 255, 0.42); --glass-strong: rgba(255, 255, 255, 0.6); --glass-line: rgba(255, 255, 255, 0.65); --glass-edge: rgba(16, 32, 74, 0.1); --glass-blur: 22px; --sheen: linear-gradient(135deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.08) 38%, rgba(255,255,255,0) 60%); }
@media (prefers-color-scheme: dark) { :root { --glass: rgba(20, 32, 70, 0.42); --glass-strong: rgba(24, 38, 82, 0.62); --glass-line: rgba(255, 255, 255, 0.16); --glass-edge: rgba(0, 0, 0, 0.35); --sheen: linear-gradient(135deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.03) 40%, rgba(255,255,255,0) 60%); } }
body { background: var(--bg); background-image: radial-gradient(900px 600px at 8% 0%, rgba(214,171,60,.28), transparent 60%), radial-gradient(800px 600px at 100% 20%, rgba(11,31,92,.22), transparent 60%), radial-gradient(700px 500px at 50% 110%, rgba(226,185,59,.18), transparent 60%), linear-gradient(180deg, var(--bg-2), var(--bg) 45%); background-attachment: fixed; }
@media (prefers-color-scheme: dark) { body { background-image: radial-gradient(900px 600px at 8% 0%, rgba(226,185,59,.16), transparent 60%), radial-gradient(800px 600px at 100% 20%, rgba(80,120,255,.18), transparent 60%), radial-gradient(700px 500px at 50% 110%, rgba(226,185,59,.12), transparent 60%), linear-gradient(180deg, var(--bg-2), var(--bg) 45%); } }
.card, .composer, .voice-state, .member-row, .message > div, .settings, .chat-menu, .ghost, .nav-link, .brand {
  background: var(--glass); border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-line), 0 10px 30px rgba(16,32,74,.10);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5); backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
}
.card { position: relative; box-shadow: inset 0 1px 0 var(--glass-line), var(--shadow); }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--sheen); pointer-events: none; }
.app::before { z-index: 0; }
.app > * { position: relative; z-index: 1; }
.message > div { -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); }
.message:not(.koita) > div { background: linear-gradient(135deg, var(--gold-light), var(--accent) 60%); border: 1px solid rgba(255,255,255,.5); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 8px 20px rgba(201,159,42,.25); }
.message .avatar { box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.message.koita .avatar { background: url("/shield-256.png") center / cover no-repeat; color: transparent; font-size: 0; }
.primary { background: linear-gradient(135deg, var(--gold-light) 0%, var(--accent) 55%, #b98d1f 100%); border: 1px solid rgba(255,255,255,.55); box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 10px 24px rgba(201,159,42,.3); }
.ghost { color: var(--fg); }
.topbar { border-bottom: 1px solid var(--glass-edge); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border-radius: 50%; }
.icon-button svg { width: 20px; height: 20px; fill: currentColor; }
.workspace { grid-template-columns: 260px 1fr; }
.sidebar { background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0)); border-right: 1px solid var(--glass-edge); gap: 4px; }
@media (prefers-color-scheme: dark) { .sidebar { background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,0)); } }
.new-chat { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--fg); background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-line); margin-bottom: 6px; }
.new-chat .plus { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; line-height: 1; }
.chat-list { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.chat-row { position: relative; display: flex; align-items: center; gap: 2px; border-radius: 999px; }
.chat-row .chat-open { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
.chat-row.active .chat-open { background: var(--glass-strong); color: var(--fg); font-weight: 600; box-shadow: inset 0 1px 0 var(--glass-line); }
.chat-more { flex: none; width: 30px; height: 30px; border-radius: 50%; color: var(--fg-muted); opacity: 0; font-weight: 700; letter-spacing: .05em; transition: opacity .15s; }
.chat-row:hover .chat-more, .chat-row.active .chat-more, .chat-row.menu-open .chat-more { opacity: 1; }
.chat-menu { position: absolute; right: 2px; top: calc(100% + 4px); z-index: 5; min-width: 150px; padding: 6px; border-radius: 16px; display: grid; gap: 2px; }
.chat-menu-item { text-align: left; padding: 9px 12px; border-radius: 12px; font-size: 14px; font-weight: 500; color: var(--fg); }
.chat-menu-item:hover { background: var(--accent-soft); }
.chat-menu-item.danger { color: var(--danger); }
.sidebar-section { border-top: 1px solid var(--glass-edge); margin-top: 8px; padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-footer { border-top-color: var(--glass-edge); }
/* Orb in the chat header */
.conversation-head { align-items: center; }
.orb-button { flex: none; width: 84px; height: 84px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: none; transition: transform .2s ease; }
.orb-button:hover { transform: scale(1.04); }
.orb-button:active { transform: scale(.97); }
.orb-button:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.orb-button canvas { width: 84px; height: 84px; display: block; }
.voice-state { margin-bottom: 10px; }
.voice-state .orb { display: none; }
.voice-state::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); opacity: .6; flex: 0 0 auto; }
.voice-state.listening::before { background: #e0735f; opacity: 1; animation: pulse 1.1s ease-in-out infinite; }
.voice-state.thinking::before { background: #8cc8ff; opacity: 1; animation: pulse 1.4s ease-in-out infinite; }
.voice-state.speaking::before { background: var(--gold-light); opacity: 1; animation: pulse .7s ease-in-out infinite; }
.composer { border-radius: 28px; }
.circle { background: var(--glass-strong); box-shadow: inset 0 1px 0 var(--glass-line); border: 1px solid var(--glass-edge); }
.mic.active { background: #e0735f; color: #fff; }
/* Settings sheet */
.settings { width: min(520px, calc(100vw - 32px)); max-height: min(80svh, 720px); margin: auto; padding: 22px 22px 18px; border-radius: 28px; color: var(--fg); overflow: auto; }
.settings::backdrop { background: rgba(7, 13, 31, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.settings:not([open]) { display: none; }
.settings-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.settings-head h2 { margin: 0; font-size: 22px; }
.settings-group { padding: 14px 0; border-top: 1px solid var(--glass-edge); }
.settings-group h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--eyebrow); }
.settings .switch { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-weight: 500; font-size: 15px; color: var(--fg); }
.settings .switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: rgba(120,130,160,.35); position: relative; flex: none; transition: background .2s; margin: 0; }
.settings .switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .2s; }
.settings .switch input:checked { background: var(--accent); }
.settings .switch input:checked::after { transform: translateX(18px); }
.settings #voiceSettings { display: grid; gap: 8px; padding: 8px 0 0; }
.settings #voiceSettings > label { font-size: 13px; }
.settings .voice-row { display: flex; gap: 8px; align-items: center; }
.settings .voice-row select { flex: 1; min-width: 0; background: var(--glass-strong); }
.settings #voiceHelp { color: var(--fg-muted); font-size: 12px; }
.settings .muted { margin: 0 0 10px; font-size: 14px; }
.settings #linkApple { display: inline-block; text-decoration: none; }
.settings .fine-print { margin-top: 14px; }
/* Family activity cards and member rows */
.activity-chat { padding: 12px 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-line); max-width: 760px; }
.activity-chat h4 { margin: 0 0 8px; font-size: 13px; color: var(--fg-muted); font-weight: 600; }
.activity-chat p { margin: 6px 0; font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.activity-chat p.asked { font-weight: 600; }
.role-select { padding: 8px 12px; border-radius: 999px; font-size: 14px; background: var(--glass-strong); }
.badge.owner { background: linear-gradient(135deg, var(--gold-light), var(--accent)); }
/* Phones: chats scroll sideways in the compact sidebar row */
@media (max-width: 720px) {
  :root { --glass-blur: 14px; }
  body { background-attachment: scroll; }
  .sidebar { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "new chats" "links links"; align-items: center; gap: 6px 8px; padding: 10px 12px; }
  .new-chat { grid-area: new; margin: 0; padding: 8px 12px; font-size: 13px; }
  .new-chat .plus { width: 18px; height: 18px; font-size: 13px; }
  .chat-list { grid-area: chats; flex-direction: row; overflow-x: auto; overflow-y: hidden; margin: 0; padding: 2px 0; gap: 6px; -webkit-overflow-scrolling: touch; }
  .chat-row { flex: none; max-width: 60vw; }
  .chat-row .chat-open { padding: 8px 12px; font-size: 13px; }
  .chat-more { width: 26px; height: 26px; }
  .chat-menu { right: auto; left: 0; }
  .sidebar-section { grid-area: links; flex-direction: row; flex-wrap: wrap; border-top: 0; margin: 0; padding: 0; gap: 4px; }
  .sidebar-section .room { padding: 6px 10px; font-size: 13px; }
  .orb-button, .orb-button canvas { width: 64px; height: 64px; }
  .settings { width: calc(100vw - 20px); max-height: 85svh; border-radius: 24px; padding: 18px 16px 14px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255,255,255,.88); --glass-strong: rgba(255,255,255,.96); }
  @media (prefers-color-scheme: dark) { :root { --glass: rgba(20,32,70,.92); --glass-strong: rgba(24,38,82,.98); } }
}
@media (prefers-reduced-motion: reduce) { .voice-state::before, .orb-button { animation: none; transition: none; } }
/* Phone top bar: keep brand, gear and sign-out on one line */
@media (max-width: 720px) {
  .topbar { height: 56px; gap: 8px; }
  .topbar > div { min-width: 0; }
  .topbar .brand { padding: 6px 10px 6px 8px; font-size: 14px; white-space: nowrap; }
  .topbar .pill { display: none; }
  .topbar-actions { flex: none; }
  .topbar #logout { white-space: nowrap; padding: 8px 12px; font-size: 13px; }
  .icon-button { width: 36px; height: 36px; }
}
/* Switches: the generic input rule adds padding and a border; strip them so the knob sits inside the track */
.settings .switch input { padding: 0; border: 0; box-shadow: none; width: 46px; height: 28px; min-width: 46px; border-radius: 999px; overflow: visible; }
.settings .switch input:focus { box-shadow: 0 0 0 3px var(--accent-soft); border: 0; }
.settings .switch span { flex: 1; }
/* Kid mode (set by the Mac shell via oddoBridge.setKidMode): chat only, no way out of the page */
.kid-mode .sidebar-section, .kid-mode #logout, .kid-mode .settings #linkApple { display: none !important; }
.kid-mode .brand { pointer-events: none; }
/* Invites (Family members tab) and the join page */
.invite-form { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; max-width: 760px; margin: 0 0 12px; }
.invite-form input { padding: 11px 14px; }
.invite-link { display: grid; gap: 8px; padding: 14px 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-line); max-width: 760px; margin: 0 0 14px; }
.invite-link code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; color: var(--fg); }
.invite-link .member-actions { justify-content: flex-start; }
#joinDone { display: grid; gap: 14px; margin-top: 18px; }
#joinDone .primary { text-decoration: none; }
#joinStatus { margin: 12px 0 0; min-height: 1.2em; font-size: 14px; color: var(--danger); }
@media (max-width: 720px) { .invite-form { grid-template-columns: 1fr 1fr; } .invite-form input { grid-column: 1 / -1; } }
/* Selects: draw our own chevron inside the pill (the native arrow can sit outside a rounded control) */
.role-select, .settings .voice-row select, .invite-form select {
  -webkit-appearance: none; appearance: none;
  padding: 9px 38px 9px 14px; border-radius: 999px; line-height: 1.3; min-width: 110px; cursor: pointer;
  background-color: var(--glass-strong);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' fill='none' stroke='%235a6180' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 14px 14px;
}
@media (prefers-color-scheme: dark) { .role-select, .settings .voice-row select, .invite-form select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' fill='none' stroke='%23a7acc2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>"); } }
.settings .voice-row select { border-radius: 14px; }
/* More see-through glass (2026-11-17): thinner fills, a touch more blur, stronger edge light */
:root { --glass: rgba(255, 255, 255, 0.22); --glass-strong: rgba(255, 255, 255, 0.4); --glass-line: rgba(255, 255, 255, 0.75); --glass-blur: 26px; }
@media (prefers-color-scheme: dark) { :root { --glass: rgba(20, 32, 70, 0.26); --glass-strong: rgba(24, 38, 82, 0.44); --glass-line: rgba(255, 255, 255, 0.2); } }
.card { background: var(--glass); }
.message > div { background: rgba(255,255,255,0.3); }
@media (prefers-color-scheme: dark) { .message > div { background: rgba(20,32,70,0.32); } }
.sidebar { background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,0)); }
@media (prefers-color-scheme: dark) { .sidebar { background: linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,0)); } }
input, textarea, select { background: var(--glass-strong); }
.composer textarea { background: transparent; }
@media (max-width: 720px) { :root { --glass-blur: 16px; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255,255,255,.86); --glass-strong: rgba(255,255,255,.95); }
  @media (prefers-color-scheme: dark) { :root { --glass: rgba(20,32,70,.9); --glass-strong: rgba(24,38,82,.97); } }
}

/* Agent choice (parents): which assistant answers this chat */
.agent-pick { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--fg-muted); }
.agent-pick select { padding: 6px 32px 6px 12px; font-size: 13px; min-width: 0; border-radius: 999px; -webkit-appearance: none; appearance: none; background-color: var(--glass-strong); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' fill='none' stroke='%235a6180' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px; }
.agent-badge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); vertical-align: middle; }
