/* ─────────────────────────────────────────────────────────────
   Speakup — Figma Design System (v1.0)
   Built for stroke survivors with expressive aphasia.
   Theme: "Hlas bez bariér" - Centered Huge Emojis & High Contrast
   ───────────────────────────────────────────────────────────── */

@import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&display=swap");

:root {
  /* Brand farby */
  --brand-primary: #10B981;
  --brand-dark: #047857;
  
  /* Layout farby (Light Mode) */
  --bg: #F9FAFB;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --text-primary: #111827;
  --text-secondary: #667085;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;

  --topbar-bg: #FFFFFF;

  /* PLNÉ FARBY PRE KATEGÓRIE */
  --positive: #059669; /* Súhlas - Zelená */
  --negative: #DC2626; /* Nesúhlas - Červená */
  --request: #EA580C;  /* Žiadosť - Sýta Oranžová (Signalizuje akciu/výzvu) */
  --emotion: #7A3FA0;  /* Pocit - Fialová */

  /* Anchor tlačidlá na spodu */
  --anchor-yes: #059669;
  --anchor-yes-dark: #047857;
  --anchor-no: #DC2626;
  --anchor-no-dark: #B91C1C;

  /* Focus a Mic stavy */
  --focus-ring: #FBBF24;
  --mic-idle: #9CA3AF;
  --mic-active: #10B981;

  --font-display: "Atkinson Hyperlegible", Arial, sans-serif;
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-full: 999px;
}

.theme-dark {
  --bg: #0B101B;
  --surface: #18212F;
  --surface-raised: #1F2937;
  --text-primary: #F9FAFB;
  --text-secondary: #CBD5E1;
  --border: #334155;
  --border-strong: #4B5563;

  --topbar-bg: #18212F;

  --positive: #059669;
  --negative: #DC2626;
  --request: #EA580C;
  --emotion: #7A3FA0;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 4px solid var(--focus-ring);
  outline-offset: 3px;
}

.hidden { display: none !important; }

/* ============ TOP BAR ============ */
.topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  height: 88px;
  display: flex;
  align-items: center;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 44px;
  height: 44px;
  color: var(--brand-primary);
  flex-shrink: 0;
  display: block;
}

.brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mic-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  flex: 0 1 auto;
  justify-content: center;
  transition: all 0.2s ease;
}

.mic-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--mic-idle);
  flex-shrink: 0;
  position: relative;
}

.mic-status.listening {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.theme-dark .mic-status.listening {
  background: #12382f;
  border-color: #286b58;
  color: #a7f3d0;
}

.mic-status.listening .mic-dot {
  background: var(--mic-active);
}

.mic-status.listening .mic-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--mic-active);
  border-radius: inherit;
  animation: pulse 1.8s ease-out infinite;
}

.mic-status.thinking .mic-dot {
  background: var(--request);
  animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.9; }
  75%, 100% { transform: scale(1.4); opacity: 0; }
}

.mic-label {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.icon-btn {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
}

.icon { width: 24px; height: 24px; }

.lock-btn { font-size: 20px; }

.lang-switch {
  display: inline-flex;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.lang-option {
  min-width: 64px;
  padding: 8px 18px;
  font-weight: 700;
  background: var(--surface);
  color: var(--text-primary);
}

.lang-option + .lang-option { border-left: 1px solid var(--border); }

.lang-option.active {
  background: var(--brand-primary);
  color: #FFFFFF;
}

.offline-banner {
  background: var(--negative);
  color: #FFFFFF;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  padding: 8px;
}

/* ============ MAIN / TILE GRID ============ */
.main-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.listening-hint {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 12px;
  padding: 0 16px;
  text-align: center;
  overflow: hidden;
  cursor: pointer;
}

.listening-hint:hover .listening-hint-text {
  color: var(--brand-primary);
}

.listening-hint-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  font-style: italic;
  display: block;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
  direction: rtl;
  text-align: center;
  unicode-bidi: plaintext;
  transition: color 0.15s ease;
}

.tile-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  min-height: min(60vh, 520px);
}

/* PLNÉ KARTY S OBROVSKÝM EMOJI V STREDE */
.tile {
  --tone: var(--positive);
  position: relative;
  border-radius: var(--radius-lg);
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 22px;
  text-align: center;
  color: #FFFFFF;
  background-color: var(--tone);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  overflow: hidden;
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.tile:active, .tile.speaking {
  transform: scale(0.98);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.3);
}

.tile-positive { --tone: var(--positive); }
.tile-negative { --tone: var(--negative); }
.tile-request { --tone: var(--request); }
.tile-emotion { --tone: var(--emotion); }

.tile-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tile-category {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.92);
}

.tile-speak-icon {
  width: 22px;
  height: 22px;
  color: #FFFFFF;
  opacity: 0.8;
}

/* OBROVSKÉ STREDOVÉ EMOJI (DOMINANTA DLAŽDICE) */
.tile-emoji {
  font-size: clamp(52px, 8vw, 76px);
  line-height: 1;
  margin: 4px 0;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
  user-select: none;
}

.tile-text {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.15;
  color: #FFFFFF;
  max-width: 100%;
  
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ FIXED BOTTOM ANCHOR PANEL ============ */
.anchor-panel {
  position: sticky;
  bottom: 0;
  display: flex;
  width: 100%;
  z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 18px 24px 24px;
  gap: 16px;
  justify-content: center;
}

.theme-dark .anchor-panel {
  background: var(--topbar-bg);
}

.anchor-btn {
  flex: 1;
  max-width: 580px;
  min-height: 76px;
  border-radius: 20px;
  border: none;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.16);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.anchor-yes { background: var(--anchor-yes); }
.anchor-no { background: var(--anchor-no); }

.anchor-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.16);
}

/* ============ SETTINGS MODAL ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
  animation: fade-in 160ms ease-out;
}

@keyframes fade-in { from { opacity: 0; } }

.modal {
  background: var(--surface);
  border-radius: 26px;
  width: 100%;
  max-width: 500px;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0,0,0,0.28);
  animation: modal-in 200ms ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 { 
  font-size: 30px; 
  margin: 0; 
  letter-spacing: -0.03em;
}

.modal-hint {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 24px 0;
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.field-input {
  width: 100%;
  height: 60px;
  padding: 0 16px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 17px;
  font-family: inherit;
  font-weight: 600;
}

select.field-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2310B981' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px 20px;
  padding-right: 48px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select.field-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

select.field-input option {
  background-color: var(--surface);
  color: var(--text-primary);
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
}

.theme-dark .field-input {
  border-color: var(--border-strong);
}

.modal-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding: 16px;
  background: var(--bg);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.field-label-inline { margin: 0; }

.switch {
  width: 44px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  border: none;
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.switch[aria-checked="true"] { background: var(--brand-primary); }

.switch-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform 0.2s ease;
}

.switch[aria-checked="true"] .switch-knob { transform: translateX(20px); }

.modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn-primary, .btn-secondary {
  flex: 1;
  min-height: 56px;
  border-radius: 15px;
  font-size: 17px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: background-color 0.15s;
}

.btn-primary {
  background: var(--brand-primary);
  color: #FFFFFF;
}

.btn-primary:hover { background: var(--brand-dark); }

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover { background: var(--bg); }

.modal-status {
  margin-top: 16px;
  font-size: 14px;
  text-align: center;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ============ TRANSCRIPT FULL-SCREEN BUBBLE FOR DEDKO ============ */
.transcript-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 16, 27, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 16px;
  animation: fade-in 150ms ease-out;
}

.transcript-modal {
  background: var(--surface);
  border: 3px solid var(--brand-primary);
  border-radius: 28px;
  width: 100%;
  max-width: 720px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.transcript-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.transcript-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.transcript-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.transcript-full-text {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0;
  word-break: break-word;
}

.transcript-modal-footer {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.btn-close-big {
  width: 100%;
  min-height: 64px;
  font-size: 22px;
  border-radius: 18px;
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 140px;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg);
  padding: 14px 24px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 700;
  z-index: 60;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* ============ RESPONSIVE ============ */
.app-root {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 100dvh;
}

@media (max-width: 640px) {
  .topbar { height: auto; min-height: 64px; padding: 8px 0; }
  .topbar-inner { padding: 0 12px; gap: 8px; flex-wrap: nowrap; }
  .topbar-actions { gap: 8px; }
  .icon-btn { width: 44px; height: 44px; border-radius: 12px; }
  .brand-name { font-size: 20px; }
  .brand-mark { width: 38px; height: 38px; font-size: 14px; }
  
  .mic-status { padding: 6px; }
  .mic-status span:last-child { display: none; }
  
  .main-content { padding: 16px; }
  .tile-grid { gap: 10px; min-height: auto; }
  
  .tile { min-width: 0; padding: 14px 16px 16px; border-radius: 18px; min-height: 140px;}
  .tile-emoji { font-size: 48px; }
  .tile-text { font-size: 20px; margin-top: 4px; overflow-wrap: anywhere; }
  .tile-speak-icon { width: 18px; height: 18px; }
  
  .anchor-panel { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); gap: 10px; }
  .anchor-btn { min-height: 64px; font-size: 22px; border-radius: 16px; }
}

/* ============ LANDING GATE ============ */
.landing-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  overflow-y: auto;
  background: #FFFFFF;
  color: #111827;
  transition: opacity 0.4s ease;
}

.landing-gate.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.gate-pitch {
  order: -1;
  flex: 1 1 50%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px;
  overflow-y: auto;
  background: #F3F4F6;
  border-right: 1px solid #E5E7EB;
}

.pdf-fullscreen-btn {
  display: block;
  margin: 24px 16px 16px 16px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: #059669;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .pdf-fullscreen-btn:hover {
    background: #D1FAE5;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.15);
  }
}

.pdf-fullscreen-btn:focus-visible {
  outline: 3px solid #34D399;
  outline-offset: 2px;
}

.pitch-viewer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.pitch-status {
  margin: 0;
  padding: 24px 16px;
  font-size: 15px;
  color: #6B7280;
  text-align: center;
}

.pitch-pages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.pitch-page {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.12);
}

.gate-pitch-jump {
  display: none;
  align-self: center;
  margin-top: 4px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 700;
  color: #059669;
  text-decoration: none;
  border: 2px solid #059669;
  border-radius: 999px;
}

.gate-pitch-jump:focus-visible {
  outline: 3px solid #34D399;
  outline-offset: 2px;
}

.gate-login {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.gate-pin {
  width: 100%;
  max-width: 380px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid #E5E7EB;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-pin-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.gate-pin-input {
  width: 100%;
  padding: 14px;
  font: inherit;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-align: center;
  color: #111827;
  background: #FFFFFF;
  border: 2px solid #D1D5DB;
  border-radius: 12px;
}

.gate-pin-input::placeholder {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: normal;
  color: #9CA3AF;
}

.gate-pin-input:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}

.gate-pin-submit {
  padding: 14px;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  color: #059669;
  background: #FFFFFF;
  border: 2px solid #059669;
  border-radius: 12px;
  cursor: pointer;
}

.gate-pin-submit:hover {
  background: #ECFDF5;
}

.gate-pin-submit:focus-visible {
  outline: 3px solid #34D399;
  outline-offset: 2px;
}

.gate-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #059669;
  margin-bottom: 8px;
}

.gate-brand-mark {
  width: 36px;
  height: 36px;
}

.gate-brand-name {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.gate-title {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  margin: 0;
}

.gate-welcome {
  font-size: 16px;
  line-height: 1.5;
  color: #4B5563;
  margin: 0 0 12px;
}

.gate-label {
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  margin-top: 4px;
}

.gate-input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: #111827;
  background: #FFFFFF;
  border: 1px solid #D1D5DB;
  border-radius: 10px;
}

.gate-input:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}

.gate-password-wrap {
  position: relative;
}

.gate-password-wrap .gate-input {
  padding-right: 48px;
}

.gate-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: #6B7280;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.gate-password-toggle:hover {
  color: #059669;
}

.gate-password-toggle:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
}

.gate-password-toggle svg {
  width: 20px;
  height: 20px;
}

.gate-error {
  font-size: 14px;
  color: #DC2626;
  margin: 4px 0 0;
}

.gate-submit {
  margin-top: 8px;
  padding: 14px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  color: #FFFFFF;
  background: #059669;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.gate-submit:hover {
  background: #047857;
}

.gate-submit:focus-visible {
  outline: 3px solid #34D399;
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .landing-gate {
    flex-direction: column;
    min-height: 100dvh;
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .gate-login {
    order: 0;
    flex: none;
    width: 100%;
    padding: calc(32px + env(safe-area-inset-top)) 20px 24px;
  }

  .gate-pitch {
    order: 0;
    flex: none;
    width: 100%;
    overflow-y: visible;
    padding: 24px 16px 24px;
    border-right: 0;
    border-top: 1px solid #E5E7EB;
  }

  .gate-pitch-jump {
    display: inline-block;
  }

  /* 16px prevents iOS Safari from zooming into the field on focus */
  .gate-input {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mic-status.listening .mic-dot::after,
  .mic-status.thinking .mic-dot {
    animation: none;
  }
  * { transition: none !important; animation: none !important; }
}