:root {
  --bg: #0b1020;
  --bg2: #141b33;
  --ink: #efe6d2;
  --muted: #9aa3b8;
  --gold: #e2ab4a;
  --card: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.1);
}

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

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(120% 80% at 50% 30%, var(--bg2), var(--bg) 70%);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 0;
}
.name { font-size: 20px; font-weight: 600; letter-spacing: 0.04em; }
.role { font-size: 12px; color: var(--muted); letter-spacing: 0.18em; text-transform: uppercase; }

button.icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  display: grid; place-items: center;
  padding: 0;
}
button.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#mute svg path:first-child { fill: currentColor; }
#mute .cross { display: none; }
#mute[aria-pressed="true"] .cross { display: inline; }
#mute[aria-pressed="true"] .waves { display: none; }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 18px 12px;
  overflow-y: auto;
}

#orb {
  width: min(78vw, 360px);
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  background: none;
  border-radius: 50%;
  touch-action: manipulation;
  flex: none;
}
#canvas { width: 100%; height: 100%; display: block; }

#status {
  margin-top: 2px;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.06em;
  min-height: 1.45em;
}
body[data-state="listening"] #status { color: var(--gold); }

#caption {
  margin-top: 12px;
  max-width: 34em;
  text-align: center;
  font-size: 18px;
  min-height: 1.45em;
  white-space: pre-wrap;
}

#cards { width: 100%; max-width: 34em; margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.card-text { white-space: pre-wrap; font-size: 15px; }
.card-row { display: flex; gap: 8px; margin-top: 10px; }
.card-row button {
  flex: 1;
  border: 1px solid var(--line);
  background: rgba(226, 171, 74, 0.14);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 15px;
}
.card-row button:first-child { background: var(--gold); color: #1a1406; border-color: transparent; font-weight: 600; }
.card-row button:disabled { opacity: 0.5; }

#log { width: 100%; max-width: 34em; margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.line { font-size: 14px; color: var(--muted); white-space: pre-wrap; }
.line b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.line.note { font-style: italic; }

footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 12px;
}
#typeform { flex: 1; display: flex; gap: 8px; }
#typeform[hidden] { display: none; }
#typed {
  flex: 1;
  min-width: 0;
  border-radius: 21px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 10px 14px;
  font-size: 16px;
}
#typeform button {
  border: 0;
  border-radius: 21px;
  padding: 0 16px;
  background: var(--gold);
  color: #1a1406;
  font-weight: 600;
}
