/* AETHER app: instrument-panel dark by default, quiet light theme for daytime. */
:root {
  --bg: #f3f6f6; --panel: #ffffff; --ink: #142023; --muted: #5d6e72; --line: #d7e1e2;
  --accent: #0b8a8f; --accent-ink: #ffffff; --accent-soft: #dff1f1;
  --warn: #b45f06; --warn-soft: #fdf0dc; --bad: #b42318; --bad-soft: #fde8e6; --ok: #1d7a46;
  --radius: 12px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1416; --panel: #121e21; --ink: #e3eeef; --muted: #8fa3a7; --line: #22343a;
    --accent: #38c6cc; --accent-ink: #04191b; --accent-soft: #10343a;
    --warn: #f0a14a; --warn-soft: #3a2a14; --bad: #ff7b6e; --bad-soft: #3d1a17; --ok: #5fd08f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); line-height: 1.25; margin: 0; text-wrap: balance; }
h2 { font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--display); font-weight: 700; letter-spacing: .14em; display: flex; align-items: center; gap: 10px; }
.orb-mini { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #bff6f8, var(--accent) 55%, #064247);
  box-shadow: 0 0 10px var(--accent); }
.status { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); margin-right: 5px; }
.dot.on { background: var(--ok); }

.view { max-width: 760px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) 110px max(16px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 22px; outline: none; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 5; }
.tabs a { text-align: center; padding: 12px 4px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 500; }
.tabs a.active { color: var(--accent); box-shadow: inset 0 2px 0 var(--accent); }

.section { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); font-size: 13.5px; }
.title { font-weight: 600; overflow-wrap: anywhere; }
.pill { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.urgent { background: var(--bad-soft); color: var(--bad); }
.pill.important { background: var(--warn-soft); color: var(--warn); }
.task { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: transparent; cursor: pointer; margin-top: 2px; }
.check:hover { border-color: var(--accent); }
.empty { color: var(--muted); font-size: 14px; padding: 6px 2px; }

.btn { border: 1px solid var(--line); background: var(--panel); padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:focus-visible, .tabs a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(49px + env(safe-area-inset-bottom, 0px)); background: var(--bg);
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); border-top: 1px solid var(--line); }
.composer form { max-width: 760px; margin: 0 auto; display: flex; gap: 8px; }
.mic.rec { background: var(--bad); color: #fff; border-color: var(--bad); }

/* talk mode orb */
.orb-wrap { display: grid; place-items: center; padding: 28px 0; gap: 14px; }
.orb { width: 170px; height: 170px; border-radius: 50%; border: none; cursor: pointer;
  background: radial-gradient(circle at 36% 32%, #d9fbfc 0%, #57d7dc 22%, #0b8a8f 55%, #052b2e 100%);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 60%, transparent), inset 0 0 30px rgba(0,0,0,.35); transition: transform .2s; }
.orb.listening { animation: pulse 1.2s ease-in-out infinite; }
.orb.speaking { animation: pulse .6s ease-in-out infinite; filter: saturate(1.4); }
@keyframes pulse { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .orb.listening, .orb.speaking { animation: none; } }

.lock { min-height: 100%; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
.lock .card { max-width: 420px; width: 100%; gap: 14px; padding: 22px; }
.lock h1 { font-size: 24px; letter-spacing: .12em; }
.code-input { font-size: 22px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.shot { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(70px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; max-width: calc(100% - 32px); font-size: 14px; }
.codes { font-family: ui-monospace, monospace; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
table.simple { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.simple td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.scroll-x { overflow-x: auto; }
.card.row { flex-direction: row; align-items: center; }
.vrow { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.vrow label { flex: 1 1 auto; min-width: 0; flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.vrow .btn { flex: 0 0 auto; }
