:root {
  --bg: #0c0d0c;
  --surface: #151614;
  --fg: #f7f4ec;
  --muted: #d8d3c7;
  --subtle: #c3beb2;
  --primary: #e8e4d8;
  --primary-fg: #0c0d0c;
  --border: #2a2b28;
  --gold: #c9a45c;
  --seal: #ff4d45;
  --sans: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --display: "Cormorant Garamond", Palatino, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #070807;
  color: var(--fg);
  font-family: var(--sans);
  min-height: 100dvh;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; transition: all 0.15s ease; }
button:active { transform: scale(0.98); }
::selection { background: var(--gold); color: var(--bg); }

body {
  display: block;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 50% 38%, #1a1c19 0%, #070807 70%);
}

.stage {
  perspective: 1800px;
  perspective-origin: 50% 40%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 48px 7vw 72px;
}

.handset {
  position: relative;
  width: min(100%, 24rem);
  transform: rotateY(-18deg) rotateX(8deg);
  transform-style: preserve-3d;
  filter: drop-shadow(28px 42px 22px rgba(0, 0, 0, 0.55));
}

.phone {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: min(844px, calc(100dvh - 96px));
  background: var(--bg);
  overflow: hidden;
  position: relative;
  border: 12px solid #161816;
  border-right-color: #2c2e2a;
  border-left-color: #101210;
  border-radius: 2.6rem;
  box-shadow:
    inset 0 0 0 1px #3d403b,
    inset 0 0 0 4px #0a0b0a,
    0 0 0 1px #000;
}

.phone::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 108px;
  height: 22px;
  background: #050605;
  border-radius: 999px;
  z-index: 4;
  box-shadow: inset 0 0 0 1px #2a2c28;
}

.phone::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 5;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 26%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, 0.05) 100%);
}

.key {
  position: absolute;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(#3c3e3a, #121312);
  z-index: 2;
}

.key.silent { left: -5px; top: 108px; height: 22px; }
.key.volume { left: -5px; top: 146px; height: 62px; }
.key.power { right: -5px; top: 154px; height: 78px; }

.home-bar {
  height: 18px;
  display: grid;
  place-items: center;
  background: #10110f;
}

.home-bar::before {
  content: "";
  width: 108px;
  height: 4px;
  border-radius: 999px;
  background: #3a3c38;
}

@media (max-width: 719px) {
  .stage { padding: 0; perspective: none; }
  .handset { transform: none; filter: none; width: 100%; }
  .key { display: none; }
  .phone {
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .phone::before, .phone::after, .home-bar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .handset { transform: none; }
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(40px + env(safe-area-inset-top)) 20px 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--subtle);
  position: relative;
  z-index: 1;
}

.beta-badge {
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid var(--seal);
  border-radius: 3px;
  color: var(--seal);
  letter-spacing: 0.12em;
  font-size: 9px;
  font-weight: 500;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.privacy-indicator {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--subtle);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 24px;
  scroll-behavior: smooth;
}

.nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--border);
  background: #10110f;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  border: 0;
  background: transparent;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-item:hover { color: var(--muted); }
.nav-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: stroke 0.15s ease;
}

.nav-item.active { color: var(--fg); }
.nav-item.active svg { stroke: var(--gold); }

.voice {
  display: grid;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
  background: #10110f;
}

.voice-actions { display: flex; gap: 8px; }

.voice-actions button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
}

.voice-actions button:hover { border-color: var(--gold); color: var(--gold); }

.voice.listening #listen {
  border-color: var(--gold);
  color: var(--gold);
  animation: listen-pulse 1.4s ease-in-out infinite;
}

.heard {
  margin: 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.voice.listening .heard { color: var(--fg); }

.voice-type {
  margin: 0;
  color: var(--subtle);
  font-size: 12px;
}

@keyframes listen-pulse {
  50% { box-shadow: 0 0 0 4px rgba(201, 164, 92, 0.28); }
}

@media (prefers-reduced-motion: reduce) {
  .voice.listening #listen { animation: none; }
  button { transition: none; }
  .content { scroll-behavior: auto; }
}

.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--subtle);
}

h2 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.lead, .quiet { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.quiet { color: var(--subtle); }
.status { margin: 12px 0 0; color: var(--gold); font-size: 14px; }

.meter {
  margin-top: 12px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #e8c97a);
  transition: width 0.35s ease;
  border-radius: 3px;
}

.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn.primary:hover { background: #f0ece0; }
.btn.file { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 16px; }

.lens {
  margin-top: 16px;
  max-height: 9.5rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #070807;
}

.lens video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}


.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }

label { display: block; margin-top: 14px; color: var(--muted); font-size: 14px; }

input[type="text"], input[type="search"] {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease;
}
input:focus { border-color: var(--primary); }

.list { margin: 16px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.list li > span { min-width: 0; overflow-wrap: anywhere; }
.list a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.list a:hover { border-bottom-color: var(--gold); color: var(--gold); }

.serial { font-family: var(--mono); font-size: 12px; color: var(--subtle); }
.case-no { margin: 0; font-family: var(--display); font-size: 28px; line-height: 1; }
.drop { border: 0; background: transparent; color: var(--subtle); font-size: 12px; text-decoration: underline; min-height: 44px; }
.drop:hover { color: var(--seal); }

.empty {
  padding: 32px 0;
  text-align: center;
  color: var(--subtle);
}
.empty svg { width: 32px; height: 32px; margin-bottom: 8px; stroke: var(--subtle); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
