:root {
  color-scheme: light;
  --paper: #f6f4f0;
  --surface: #fffefa;
  --ink: #24221f;
  --muted: #68645e;
  --line: #d9d4cc;
  --focus: #24221f;
  --error: #762e35;
  --radius: 16px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, select, textarea, input { font: inherit; }
button, select, summary, .check-row { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, select, textarea { color: inherit; }
button, select, summary, a.button { min-height: 44px; }
button, select, input { accent-color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .48; }
button:not(:disabled), select:not(:disabled), summary { cursor: pointer; }
.app-shell {
  width: min(100% - 40px, 540px);
  margin-inline: auto;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
.identity { margin: 26px 0 24px; text-align: center; }
.eyebrow { margin: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
h1, h2, p { overflow-wrap: anywhere; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; text-wrap: pretty; }
h1 { margin: 0; font-size: clamp(25px, 6vw, 34px); line-height: 1.2; letter-spacing: -.035em; }
.call-panel { padding-bottom: 16px; }
.portrait-stage { position: relative; width: clamp(180px, 33svh, 300px); max-width: 78%; aspect-ratio: 1; margin: 0 auto; }
.portrait { position: relative; display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: contain; background: #fff; }
.portrait-halo { position: absolute; inset: -8px; border: 2px solid var(--ink); border-radius: 50%; opacity: var(--halo-opacity, .12); transform: scale(var(--halo-scale, 1)); transition: transform 160ms ease-out, opacity 160ms ease-out; }
[data-phase="active"] .portrait-stage { outline: 1px solid var(--line); outline-offset: 13px; border-radius: 50%; }
.session-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.connection { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.status-dot { width: 6px; height: 6px; flex: 0 0 6px; border: 1px solid currentColor; border-radius: 50%; }
[data-phase="active"] .status-dot { background: var(--ink); border-color: var(--ink); }
.elapsed { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; font-size: 15px; white-space: nowrap; }
.conversation-state { margin: 26px 0 20px; text-align: center; }
.conversation-state h2 { font-size: 25px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -.025em; }
.conversation-state p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 auto; min-height: 39px; max-width: 42ch; }
.voice-row { display: grid; grid-template-columns: 1fr minmax(120px, 48%); gap: 16px; align-items: center; }
.voice-row label, .field-label { font-size: 14px; font-weight: 600; }
select { width: 100%; min-width: 0; min-height: 48px; padding: 10px 34px 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 16px; }
.tariff-line { display: flex; justify-content: space-between; flex-wrap: wrap; column-gap: 12px; row-gap: 6px; font-size: 12px; line-height: 1.5; margin: 12px 0 0; color: var(--muted); }
.tap-consent { margin: 10px 4px 0; font-size: 12px; line-height: 1.5; text-align: center; color: var(--muted); }
#native-status { margin: 12px 4px; text-align: center; }
#native-open[aria-disabled="true"] { cursor: not-allowed; opacity: .48; }
.voice-settings > summary { justify-content: center; gap: 12px; padding-block: 10px; font-size: 12px; color: var(--muted); }
.voice-settings .voice-row { padding-bottom: 12px; }
#tariff-display { font-weight: 600; color: var(--ink); }
.check-row { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 14px 0; font-size: 13px; line-height: 1.55; cursor: pointer; }
.check-row input { width: 20px; height: 20px; flex: 0 0 20px; margin: 1px 0 0; }
.check-row span { min-width: 0; }
.button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-width: 0; min-height: 60px; padding: 16px; border: 1px solid transparent; border-radius: var(--radius); font-size: 15px; font-weight: 600; line-height: 1.35; text-align: center; text-decoration: none; transition: background-color 120ms ease, border-color 120ms ease; }
.button span { min-width: 0; overflow-wrap: anywhere; }
.button svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.primary { background: var(--ink); color: var(--surface); }
.secondary { background: var(--surface); border-color: var(--line); }
.end-call { background: #39302d; color: var(--surface); }
.live-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.live-controls .button { flex-direction: column; min-height: 86px; font-size: 13px; padding-inline: 10px; }
.live-controls .button svg { width: 24px; height: 24px; flex-basis: 24px; }
#mute[aria-pressed="true"] { background: #e6e1d7; border-color: var(--ink); }
.mute-slash { display: none; }
#mute[aria-pressed="true"] .mute-slash { display: block; }
.resume-button { margin: 0 0 12px; }
.text-button { min-height: 44px; width: auto; padding: 10px 0; background: transparent; text-decoration: underline; text-underline-offset: 4px; font-size: 13px; }
.notice { margin: 16px 0 0; color: var(--error); font-size: 13px; line-height: 1.6; }
.privacy { margin: 6px 0 20px; font-size: 12px; line-height: 1.65; color: var(--muted); }
.transcript { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; font-size: 14px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 20px; font-weight: 400; margin-left: 0; }
details[open] > summary::after { content: "-"; }
.count { font-size: 11px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.detail-note, .empty-state { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty-state { padding: 12px 0; }
.transcript-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.transcript-list li { padding: 0 8px 20px 0; }
.transcript-list .speaker { display: block; margin-bottom: 5px; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.transcript-list p { font-size: 14px; line-height: 1.65; margin: 0; white-space: pre-wrap; }
.after-call { margin-top: 32px; }
.section-heading h2 { font-size: 27px; margin: 0 0 14px; letter-spacing: -.025em; }
.field-label { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 20px 0 10px; }
.optional { color: var(--muted); font-size: 12px; font-weight: 400; }
textarea { display: block; width: 100%; min-height: 132px; resize: vertical; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 14px; font-size: 16px; line-height: 1.6; }
textarea::placeholder { color: var(--muted); opacity: 1; }
.character-count { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: right; }
.save-status { font-size: 13px; line-height: 1.6; margin: 12px 0 0; }
.save-status[data-error="true"] { color: var(--error); }
footer { color: var(--muted); font-size: 11px; line-height: 1.6; padding-top: 28px; }
@media (hover: hover) {
  .primary:not(:disabled):hover, .end-call:hover { background: #48433d; }
  .secondary:not(:disabled):hover { border-color: var(--ink); }
  summary:hover { color: #000; }
}
@media (min-width: 700px) {
  .app-shell { padding-top: 30px; }
  .identity { margin-top: 30px; }
}
@media (max-width: 380px) {
  .app-shell { width: calc(100% - 32px); }
  .conversation-state h2 { font-size: 23px; }
  .count { font-size: 10px; }
}
@media (max-height: 640px) {
  .identity { margin-block: 18px; }
  .portrait-stage { width: 180px; }
  [data-suspended="true"] .portrait-stage { width: 148px; }
  .conversation-state { margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .portrait-halo { transform: none !important; }
}
