:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e6eae4;
  background: #111714;
  font-synthesis: none;
  --muted: #9ba89d;
  --accent: #c1db91;
  --line: #303b32;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; min-height: 48px; border-radius: 999px; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 5px;
}
a { color: var(--accent); }
.app-shell { width: min(900px, 100%); margin: auto; padding: 28px 32px max(24px, env(safe-area-inset-bottom)); }
header { display: flex; align-items: center; justify-content: space-between; }
.brand { font-family: Georgia, serif; font-size: 30px; text-decoration: none; color: #e6eae4; }
.brand-dot { color: var(--accent); }
.text-button { color: var(--muted); border: 0; background: none; padding: 8px 16px; }
.text-button:hover { color: #fff; }
.conversation { text-align: center; padding: 48px 0 34px; }
.eyebrow { font-size: 11px; letter-spacing: .18em; color: var(--accent); font-weight: 650; }
h1 { font-family: Georgia, serif; font-weight: 400; font-size: clamp(32px, 5vw, 46px); letter-spacing: -.035em; margin: 16px 0; }
.intro, .muted { color: var(--muted); font-size: 16px; line-height: 1.6; }
.orb {
  width: 142px; height: 142px; border-radius: 50%; margin: 36px auto 28px;
  display: grid; place-items: center; border: 1px solid #43523c;
  background: radial-gradient(circle at 38% 32%, #6b8355 0%, #344a32 45%, #19271d 75%);
  box-shadow: 0 0 60px #a5c4780d, inset 0 0 25px #bde59a18;
  transition: box-shadow .3s, border-color .3s;
}
.orb span { width: 38px; height: 38px; border-radius: 50%; background: #c1db9166; filter: blur(10px); }
.orb[data-state="listening"] { border-color: #c1db91; box-shadow: 0 0 55px #c1db9120; }
.orb[data-state="speaking"] { animation: breathe 1.8s ease-in-out infinite; }
.orb[data-state="connecting"], .orb[data-state="working"] { animation: breathe 3s ease-in-out infinite; }
.orb[data-state="error"] { border-color: #cd8e77; }
@keyframes breathe { 50% { transform: scale(1.035); box-shadow: 0 0 65px #c1db9127; } }
.status { display: flex; gap: 9px; justify-content: center; align-items: center; font-size: 14px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #708171; }
.status-dot.active { background: var(--accent); box-shadow: 0 0 8px #c1db9155; }
.hint { min-height: 38px; font-size: 13px; line-height: 1.5; color: var(--muted); margin: 12px auto 18px; max-width: 380px; }
.primary { padding: 15px 32px; background: var(--accent); border: 1px solid var(--accent); color: #1d2b17; font-weight: 650; }
.primary:hover:not(:disabled) { background: #cde5a2; }
.greet-option { display: flex; gap: 8px; justify-content: center; align-items: center; min-height: 44px; margin-bottom: 8px; }
.greet-option[hidden] { display: none; }
.voice-controls { display: flex; gap: 10px; justify-content: center; }
.talk-button { color: #1d2b17; background: var(--accent); border: 1px solid var(--accent); padding: 15px 28px; font-weight: 650; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.talk-button[aria-pressed="true"] { background: #e0f0c1; box-shadow: 0 0 0 5px #c1db9120; }
.secondary { color: #d6dfd1; background: #202b22; border: 1px solid #495742; padding: 15px 22px; }
.secondary[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: #33402a; }
.stop-button { display: block; margin: 12px auto 0; font-size: 13px; }
.privacy { font-size: 11px; line-height: 1.7; color: #879488; margin: 22px 0 0; }
.error { color: #f0af97; font-size: 14px; line-height: 1.5; max-width: 470px; margin: 14px auto; }
.setup-notice { color: #ccb787; font-size: 13px; line-height: 1.5; }
audio { max-width: 100%; margin: 14px auto 0; }
.captions { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; }
summary { cursor: pointer; font-size: 13px; color: #c5cec2; }
summary span { float: right; font-size: 9px; letter-spacing: .1em; color: #879488; padding-top: 3px; }
.caption-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding-top: 20px; }
h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.caption-text { font-size: 14px; line-height: 1.65; color: #adb8aa; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow-y: auto; }
footer { display: flex; justify-content: space-between; gap: 16px; color: #839080; font-size: 11px; padding-top: 22px; }
.login-shell { width: min(420px, 100%); padding: 60px 28px; margin: 8vh auto 0; }
.brand-mark { color: var(--accent); font: 48px Georgia, serif; margin-bottom: 36px; }
.login-form { display: grid; gap: 12px; margin-top: 32px; }
label { color: #bac6b7; font-size: 13px; }
input, textarea, select { width: 100%; min-width: 0; border-radius: 12px; border: 1px solid #495742; background: #1b251e; color: #e6eae4; padding: 14px; min-height: 48px; }
textarea { resize: vertical; }
.library { border-bottom: 1px solid var(--line); padding: 24px 0; }
.library-tabs, .search-row, .form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.search-row { margin: 18px 0; }
.search-row input { flex: 1; min-width: 140px; }
.library-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 22px; }
.library-layout > * { min-width: 0; }
.task-text, .run-card .muted { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.run-card { border-top: 1px solid var(--line); padding: 16px 0; font-size: 14px; }
.run-card[data-status="failed"] > strong, .run-card[data-status="interrupted"] > strong { color: #f0af97; }
fieldset { border: 1px solid var(--line); border-radius: 12px; }
fieldset label { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; margin-right: 12px; }
fieldset input, .greet-option input { width: 20px; min-height: 20px; }
.record-form { display: grid; gap: 12px; align-content: start; }
.record-form .muted { margin: 0; font-size: 13px; }
.record-list { display: grid; gap: 8px; max-height: 500px; overflow-y: auto; }
.record-card { display: grid; gap: 8px; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 12px; color: #e6eae4; background: #1b251e; overflow-wrap: anywhere; }
.record-card span { color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.tool-status { color: var(--accent); font-size: 13px; line-height: 1.5; }
.tool-status[data-status="failed"] { color: #f0af97; }
.login-form .primary { margin-top: 8px; }
@media (max-width: 520px) {
  .app-shell { padding: 16px 22px max(20px, env(safe-area-inset-bottom)); }
  .conversation { padding-top: 28px; }
  .orb { width: 120px; height: 120px; margin: 28px auto 24px; }
  .caption-grid { grid-template-columns: 1fr; gap: 8px; }
  .library-layout { grid-template-columns: 1fr; }
  .record-list { max-height: 260px; }
  .voice-controls { flex-wrap: wrap; }
  .library-tabs { gap: 6px; }
  .library-tabs .secondary { padding: 12px 14px; }
  footer { flex-direction: column; gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
