/* Jarvis commits to one look: the orb on near-black, whatever the phone's theme. */
:root {
  --bg: #0b0506; --panel: #160a0b; --panel-2: #1f0f10; --line: rgba(255, 140, 110, .18);
  --ink: #f6ebe7; --muted: #b8968f; --faint: #7d625d; --accent: #ff7a4a; --accent-2: #d8453a;
  --good: #6fd3a2; --warn: #ffb36b;
  --font-body: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: Archivo, "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font-body); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

.app { height: 100%; display: flex; flex-direction: column; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.brand { font-family: var(--font-display); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: 14px; }
.status { flex: 1; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; font-size: 22px; line-height: 1; }

.stage { position: relative; flex: 1 1 auto; min-height: 220px; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.orb-fallback { position: absolute; left: 50%; top: 50%; width: 170px; height: 170px; margin: -85px 0 0 -85px; border-radius: 50%;
  background: radial-gradient(circle at 40% 36%, #ffd9c7 0 5%, #ff7a4a 22%, #c8283c 50%, rgba(90, 15, 42, 0) 72%); animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); } }

.captions { padding: 0 20px; min-height: 96px; max-height: 32vh; overflow-y: auto; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.said { margin: 0; font-size: 14px; color: var(--muted); }
.reply { margin: 0; font-size: clamp(18px, 4.6vw, 22px); line-height: 1.4; text-wrap: balance; }
.acts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.acts li { font-size: 13px; color: var(--good); }
.acts li.warn { color: var(--warn); }
.acts li.proposal { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; color: var(--ink);
  border: 1px solid var(--accent); border-radius: 14px; padding: 10px 12px; font-size: 15px; background: var(--panel); }
.acts li.proposal span { flex: 1 1 100%; }
.acts li.proposal button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 6px 16px; min-height: 36px; }
.acts li.proposal button.primary { background: var(--accent-2); border: 0; color: #fff; font-weight: 600; }
.acts li.confirm-all { display: flex; justify-content: center; }
.acts li.confirm-all button { border: 0; border-radius: 999px; padding: 8px 20px; min-height: 40px; background: var(--accent-2); color: #fff; font-weight: 600; font-size: 15px; }
.usage { display: flex; flex-direction: column; gap: 10px; }
.usage .card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.usage .card b { font-family: var(--font-display); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.usage .line { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.usage .meter { height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.usage .meter i { display: block; height: 100%; background: var(--good); }
.usage .meter i.high { background: var(--warn); }
.usage .card a { color: var(--accent); }
.usage-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 10px; }
.usage-form label { flex: 1 1 140px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.usage-form input { padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 16px; min-width: 0; }
.usage-form button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 8px 16px; min-height: 40px; }
.rate { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--muted); }
.rate button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; min-height: 36px; padding: 4px 14px; font-size: 14px; }
.rate button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.rate input { flex: 1 1 100%; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 16px; }
.rate .why { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; flex: 1 1 100%; }

.controls { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 16px 20px; }
.talk { width: 84px; height: 84px; border-radius: 50%; border: 0; background: radial-gradient(circle at 40% 35%, #ff9b72, var(--accent-2) 60%, #7a1623); color: #fff;
  display: grid; place-items: center; box-shadow: 0 0 0 0 rgba(255, 122, 74, .5), 0 8px 30px -8px rgba(216, 69, 58, .7); transition: transform .15s ease; }
.talk:active { transform: scale(.96); }
.talk.listening { animation: ring 1.2s ease-out infinite; background: radial-gradient(circle at 40% 35%, #ffc2a3, #ff7a4a 60%, #a0281f); }
.talk.busy { opacity: .75; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 122, 74, .55), 0 8px 30px -8px rgba(216, 69, 58, .7); } 100% { box-shadow: 0 0 0 22px rgba(255, 122, 74, 0), 0 8px 30px -8px rgba(216, 69, 58, .7); } }
.talk-label { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 14px; font-size: 14px; }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.typebox { display: flex; gap: 8px; width: 100%; max-width: 560px; }
.typebox input, .voice-search input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 16px; }
.primary { border: 0; border-radius: 999px; padding: 0 18px; background: var(--accent-2); color: #fff; font-weight: 600; min-height: 44px; }

.sheet { position: fixed; inset: 0; z-index: 10; background: var(--bg); display: flex; flex-direction: column;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-family: var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 16px 24px; display: flex; flex-direction: column; gap: 22px; max-width: 640px; width: 100%; margin: 0 auto; }
.sheet h2 { font-family: var(--font-display); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.sheet section p { margin: 0 0 8px; font-size: 14px; }
.voice-search { display: flex; gap: 8px; margin-bottom: 8px; }
.voice-search button, .list button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.list li { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-size: 14px; }
.list li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list li.on { border-color: var(--accent); }
.list li.warn-row { border-color: var(--warn); }
.list li a.chip { color: var(--ink); text-decoration: none; }
.list li .secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; user-select: all; }
.problems:empty { display: none; }
.problems { border: 1px solid var(--warn); color: var(--warn); border-radius: 12px; padding: 10px 12px; font-size: 14px; }

.login { display: grid; place-items: center; padding: 24px 16px; min-height: 100%; }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.login-mark { width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 40% 36%, #ffd9c7 0 5%, #ff7a4a 22%, #c8283c 50%, rgba(90, 15, 42, 0) 72%); margin-bottom: 8px; }
.login h1 { margin: 0; font-family: var(--font-display); letter-spacing: .14em; text-transform: uppercase; font-size: 22px; }
.login form { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 18px; text-align: left; }
.login label { font-size: 13px; color: var(--muted); }
.login input { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 16px; }
.err { color: var(--warn); min-height: 1.4em; margin: 0; font-size: 14px; }
