:root {
  color-scheme: dark;
  --bg: #06100e;
  --surface: rgba(17, 35, 31, 0.78);
  --surface-strong: #10231f;
  --line: rgba(153, 246, 215, 0.13);
  --text: #effcf7;
  --muted: #8daaa1;
  --accent: #72f0c4;
  --accent-strong: #26c992;
  --danger: #ff7d8c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(38, 201, 146, 0.18), transparent 38%),
    linear-gradient(180deg, #071512 0%, var(--bg) 60%, #030807 100%);
  color: var(--text);
}

body {
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; }
button { touch-action: manipulation; }
.hidden { display: none !important; }

.view {
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    max(24px, env(safe-area-inset-top))
    max(22px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
}

.login-view {
  display: grid;
  place-items: center;
}

.login-card {
  width: 100%;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(10, 27, 23, 0.76);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(22px);
}

.mini-mark {
  width: 52px;
  height: 52px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 9px;
  margin-bottom: 28px;
  border: 1px solid rgba(114, 240, 196, 0.35);
  border-radius: 18px;
}

.mini-mark span {
  border-radius: 99px;
  background: var(--accent);
}

.mini-mark span:last-child {
  opacity: 0.36;
  transform: translateY(7px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(36px, 10vw, 54px); line-height: 1; letter-spacing: -0.05em; }
.muted, .privacy-note { color: var(--muted); }

form { margin-top: 30px; }
label {
  display: block;
  margin-bottom: 8px;
  color: #cce2da;
  font-size: 13px;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
}

input:focus { border-color: rgba(114, 240, 196, 0.7); box-shadow: 0 0 0 3px rgba(114, 240, 196, 0.08); }

.primary {
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  color: #042019;
  background: linear-gradient(135deg, #8cf7d2, #3edca7);
  font-weight: 780;
  box-shadow: 0 14px 38px rgba(38, 201, 146, 0.2);
}

.primary:active { transform: translateY(1px) scale(0.99); }
.primary:disabled { color: #739088; background: #1b3931; box-shadow: none; }
.wide { width: 100%; margin-top: 16px; }
.error { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }

.app-view { padding-bottom: max(30px, env(safe-area-inset-bottom)); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 { font-size: 34px; }
.icon-button {
  width: 44px;
  height: 44px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 46px 0 32px;
  text-align: center;
}

.orb {
  position: relative;
  width: 214px;
  height: 214px;
  display: grid;
  place-items: center;
}

.orb-core {
  position: relative;
  z-index: 2;
  width: 126px;
  height: 126px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(157, 255, 222, 0.45);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255,255,255,0.82), rgba(114,240,196,0.6) 8%, transparent 26%),
    radial-gradient(circle, rgba(44,208,155,0.74), rgba(7,42,34,0.92) 67%);
  box-shadow: inset 0 0 32px rgba(118, 255, 208, 0.18), 0 0 54px rgba(38, 201, 146, 0.18);
  transition: all 300ms ease;
}

.orb-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #eafff8;
  box-shadow: 0 0 24px var(--accent);
}

.orb-ring {
  position: absolute;
  border: 1px solid rgba(114, 240, 196, 0.2);
  border-radius: 50%;
}

.ring-one { inset: 18px; }
.ring-two { inset: 0; border-style: dashed; opacity: 0.54; }

.orb[data-state="listening"] .ring-two,
.orb[data-state="awake"] .ring-two { animation: rotate 9s linear infinite; }

.orb[data-state="recording"] .orb-core,
.orb[data-state="awake"] .orb-core {
  transform: scale(1.06);
  box-shadow: inset 0 0 36px rgba(255,255,255,.15), 0 0 76px rgba(82, 255, 193, .42);
  animation: pulse 1.2s ease-in-out infinite;
}

.orb[data-state="thinking"] .ring-one { animation: rotate 1.2s linear infinite; border-color: rgba(255,255,255,.55); }
.orb[data-state="speaking"] .orb-core { animation: speak .55s ease-in-out infinite alternate; }
.orb[data-state="error"] .orb-core { border-color: rgba(255,125,140,.65); box-shadow: 0 0 54px rgba(255, 80, 105, .2); }

.phase { margin: 18px 0 5px; font-weight: 720; font-size: 18px; }
.instruction { min-height: 24px; margin-bottom: 21px; color: var(--muted); font-size: 14px; }
.listen-button { min-width: 174px; padding: 0 22px; }
.mic-icon { margin-right: 9px; font-size: 10px; }

.transcript-card, .device-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  backdrop-filter: blur(18px);
}

.transcript-card { min-height: 142px; padding: 20px; }
.card-heading { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .14em; }
#transcript { margin: 22px 0 0; color: #cfe8df; line-height: 1.5; }
.reply { margin: 8px 0 0; color: var(--accent); line-height: 1.5; }

.device-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 18px 20px;
}

.device-copy { display: flex; align-items: center; gap: 14px; }
.device-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--accent); background: rgba(114,240,196,.08); }
.device-card h2 { margin-bottom: 4px; font-size: 16px; }
.device-card p { margin: 0; color: var(--muted); font-size: 12px; }

.toggle {
  position: relative;
  width: 58px;
  height: 34px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #19322c;
}

.toggle span {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #789087;
  transition: transform 200ms ease, background 200ms ease;
}

.toggle[aria-checked="true"] { background: rgba(38,201,146,.3); }
.toggle[aria-checked="true"] span { transform: translateX(24px); background: var(--accent); box-shadow: 0 0 16px rgba(114,240,196,.5); }
.toggle:disabled { opacity: .5; }

.privacy-note { margin: 18px 4px 0; text-align: center; font-size: 11px; }

@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(.98); } }
@keyframes speak { from { transform: scale(.98); } to { transform: scale(1.06); } }

@media (min-width: 520px) {
  .hero { padding-top: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

