@font-face {
  font-family: Manrope;
  src: url('/static/fonts/manrope-latin-wght-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
:root {
  --table: #f5f4ef;
  --paper: #fdfcf8;
  --ink: #243d36;
  --supporting-ink: #53655e;
  --quiet-ink: #697871;
  --conversation: #205c50;
  --conversation-soft: #e6ede6;
  --recording: #a63628;
  --approval: #307b35;
  --error-paper: #fae9e3;
  --edge: rgba(36, 61, 54, .13);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  font-family: Manrope, ui-sans-serif, sans-serif;
  color: var(--ink);
  background: var(--table);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, a, audio { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible, audio:focus-visible { outline: 3px solid var(--conversation); outline-offset: 4px; }
button:active:not(:disabled) { transform: scale(.98); }
button { transition: transform 160ms var(--ease), opacity 160ms var(--ease); }
p { margin: 0; text-wrap: pretty; }
h1 { text-wrap: balance; }
[hidden] { display: none !important; }
.icon-definitions { position: absolute; width: 0; height: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; padding: 12px; background: var(--paper); z-index: 10; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.language-screen { min-height: 100svh; max-width: 680px; margin: auto; padding: var(--space-8) var(--space-6); display: flex; flex-direction: column; }
.brand { display: flex; gap: var(--space-3); align-items: center; font-size: 24px; line-height: 32px; font-weight: 600; }
.brand [data-logout] { margin-left: auto; }
.login-screen { max-width: 480px; }
.login-form { display: grid; gap: var(--space-3); margin-top: var(--space-8); }
.login-form label { font-size: 14px; line-height: 20px; font-weight: 600; }
.login-form input { width: 100%; min-height: 48px; padding: var(--space-3); border: 1px solid var(--edge); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; }
.login-form input:focus-visible { outline: 3px solid var(--conversation); outline-offset: 4px; }
.login-form input + label { margin-top: var(--space-3); }
.login-form .prepare-button { margin-top: var(--space-3); }
.language-intro { margin-top: var(--space-12); }
.eyebrow { color: var(--conversation); font-size: 14px; line-height: 20px; font-weight: 600; }
h1 { font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -.04em; margin: var(--space-4) 0; }
.language-intro > p:last-child { font-size: 16px; line-height: 24px; color: var(--supporting-ink); }
.language-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin: var(--space-8) 0 var(--space-6); }
.language-card { background: var(--paper); border: 1px solid var(--edge); border-radius: 16px; min-height: 96px; padding: var(--space-6) var(--space-4); color: var(--ink); font-size: 24px; line-height: 32px; font-weight: 600; }
.language-card:hover { background: var(--conversation-soft); }
.setup-status { font-size: 14px; line-height: 20px; color: var(--quiet-ink); }
.setup-status[data-ready="false"] { color: var(--recording); }
.translation-setup { display: grid; gap: var(--space-3); margin-top: var(--space-6); padding: var(--space-4); background: var(--paper); border: 1px solid var(--edge); border-radius: 16px; }
.prepare-button { justify-self: start; min-height: 48px; padding: var(--space-2) var(--space-3); border: 0; border-radius: 8px; background: var(--conversation); color: var(--paper); font-size: 16px; line-height: 24px; font-weight: 600; }
.prepare-button:hover:not(:disabled) { background: var(--ink); }
.preparation-note { font-size: 12px; line-height: 16px; color: var(--quiet-ink); }
.translation-setup[aria-busy="true"] .prepare-button { opacity: .65; }
.text-button { background: transparent; border: 0; border-radius: 8px; padding: var(--space-3); min-height: 48px; color: var(--supporting-ink); font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { background: var(--conversation-soft); color: var(--ink); }
#check-connection { align-self: flex-start; margin-top: var(--space-2); }
.attribution { margin-top: auto; padding-top: var(--space-8); font-size: 12px; line-height: 16px; color: var(--quiet-ink); }
.attribution a { color: inherit; }
.conversation-screen { height: 100svh; height: 100dvh; min-height: 480px; max-width: 680px; margin: auto; display: grid; grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr); padding: max(var(--space-4), env(safe-area-inset-top)) var(--space-4) max(var(--space-4), env(safe-area-inset-bottom)); gap: var(--space-3); }
.speaker-zone { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); min-height: 0; }
.citizen-zone { transform: rotate(180deg); justify-content: flex-end; }
.speaker-language { font-size: 18px; line-height: 28px; font-weight: 600; display: flex; gap: var(--space-2); align-items: baseline; }
.speaker-language small { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--quiet-ink); }
.mic-button { width: 80px; height: 80px; flex-shrink: 0; border: 0; border-radius: 9999px; background: var(--conversation); color: var(--paper); display: grid; place-items: center; }
.mic-button:hover:not(:disabled) { background: var(--ink); }
.speaker-actions { display: flex; justify-content: center; gap: var(--space-4); flex-shrink: 0; }
.approve-button { background: var(--approval); }
.mic-icon { width: 40px; height: 40px; fill: currentColor; }
.stop-icon { display: none; width: 24px; height: 24px; border-radius: 4px; background: currentColor; }
.mic-button[aria-pressed="true"] { background: var(--recording); }
.mic-button[aria-pressed="true"] .mic-icon { display: none; }
.mic-button[aria-pressed="true"] .stop-icon { display: block; }
.speaker-hint { color: var(--supporting-ink); font-size: 14px; line-height: 20px; text-align: center; }
.utterance { width: 100%; max-width: 100%; min-height: 0; overflow-y: auto; background: var(--paper); border-radius: 12px; padding: var(--space-3) var(--space-4); font-size: 18px; line-height: 28px; overflow-wrap: anywhere; flex: 1; }
.speaker-zone .utterance { margin-bottom: auto; }
.employee-zone:not(:has(.utterance:not([hidden]))) { justify-content: flex-end; }
.conversation-center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.conversation-status { display: grid; justify-items: center; gap: var(--space-2); }
#status { font-size: 16px; line-height: 24px; font-weight: 600; }
.status-detail { color: var(--quiet-ink); font-size: 12px; line-height: 16px; max-width: 40ch; }
.activity { display: flex; gap: var(--space-1); height: 24px; align-items: center; }
.activity i { display: block; height: 16px; width: 4px; background: var(--conversation); border-radius: 2px; animation: listening 900ms var(--ease) infinite alternate; }
.activity i:nth-child(2), .activity i:nth-child(4) { animation-delay: 150ms; }
.activity i:nth-child(3) { animation-delay: 300ms; }
@keyframes listening { from { transform: scaleY(.35); opacity: .4; } to { transform: scaleY(1); opacity: 1; } }
.error { background: var(--error-paper); color: var(--recording); border-radius: 8px; padding: var(--space-3); font-size: 14px; line-height: 20px; }
audio { width: 100%; max-width: 320px; height: 40px; }
audio.citizen-facing { transform: rotate(180deg); }
@media (max-height: 700px) {
  .conversation-screen { gap: var(--space-2); }
  .mic-button { width: 64px; height: 64px; }
  .mic-icon { width: 32px; height: 32px; }
  .speaker-zone { gap: var(--space-1); }
  .utterance { font-size: 16px; line-height: 24px; padding: var(--space-2) var(--space-3); }
  .language-intro { margin-top: var(--space-8); }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  .activity i { animation: none; }
}
