/* Self-hosted fonts: Geist + Geist Mono (variable, SIL OFL 1.1, see fonts/OFL.txt). Latin + Latin Extended subsets. */
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/geist-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/geist-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/geist-mono-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/geist-mono-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* =========================================================
   Talkigami: styles. Tokens mirror the Figma variables.
   ========================================================= */
:root {
  --stone-0:#FFFFFF; --stone-50:#F5F4F0; --stone-100:#ECEAE4; --stone-200:#DDD9D0; --stone-300:#C4BFB4; --stone-400:#A39E93;
  --stone-500:#78736A; --stone-600:#57534C; --stone-700:#3B3833; --stone-800:#2A2825; --stone-850:#1F1E1B; --stone-900:#161513; --stone-950:#0E0D0C;
  --amber-400:#FFB81C; --amber-800:#7A4F00; --green-700:#1E7A47; --green-400:#5BC48A; --red-700:#B3261E; --red-400:#FF7A6B;

  --space-2xs:4px; --space-xs:8px; --space-sm:12px; --space-md:16px; --space-lg:20px; --space-xl:24px; --space-2xl:32px; --space-3xl:48px;
  --radius-sm:8px; --radius-md:14px; --radius-lg:20px; --radius-xl:28px; --radius-full:999px;
  --tap-min:44px; --tap-lg:56px;
  --tabbar-bottom: max(4px, calc(env(safe-area-inset-bottom) - 4px)); /* 16px lower than before (was safe-area + 12px) */
  --tabbar-h: calc(var(--tabbar-bottom) + 72px); /* floating bar 64 + 8 breathing */

  /* logo colours (Talkigami design system: ink, surface-300) */
  --logo-ink:#151515; --logo-flap:#ece9e2;
  --font-sans:"Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:"Geist Mono", ui-monospace, SFMono-Regular, monospace;

  /* motion tokens */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-page: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-instant: 100ms; --dur-quick: 160ms; --dur-base: 280ms; --dur-page: 440ms; --dur-slow: 640ms;

  /* light (Color Light) */
  --bg-canvas:var(--stone-50); --bg-surface:var(--stone-0); --bg-sunken:var(--stone-100); --bg-inverse:var(--stone-950); --bg-accent:var(--amber-400);
  --border:var(--stone-200); --border-strong:var(--stone-300);
  --text:var(--stone-950); --text-2:var(--stone-600); --text-3:var(--stone-500); --text-inverse:var(--stone-50); --text-on-accent:var(--stone-950); --text-accent:var(--amber-800);
  --danger:var(--red-700); --success:var(--green-700);
  --scrim: rgba(14,13,12,.36); --pill:var(--stone-0);
  --shadow-sheet: 0 -12px 40px rgba(14,13,12,.14);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-canvas:var(--stone-950); --bg-surface:var(--stone-900); --bg-sunken:var(--stone-850); --bg-inverse:var(--stone-50);
    --border:var(--stone-800); --border-strong:var(--stone-700);
    --text:var(--stone-50); --text-2:var(--stone-400); --text-3:var(--stone-400); --text-inverse:var(--stone-950); --text-accent:var(--amber-400);
    --danger:var(--red-400); --success:var(--green-400);
    --scrim: rgba(0,0,0,.6); --shadow-sheet: 0 -12px 40px rgba(0,0,0,.5); --pill:var(--stone-700); --logo-ink:#f2f0eb; --logo-flap:#262626;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg-canvas:var(--stone-950); --bg-surface:var(--stone-900); --bg-sunken:var(--stone-850); --bg-inverse:var(--stone-50);
  --border:var(--stone-800); --border-strong:var(--stone-700);
  --text:var(--stone-50); --text-2:var(--stone-400); --text-3:var(--stone-400); --text-inverse:var(--stone-950); --text-accent:var(--amber-400);
  --danger:var(--red-400); --success:var(--green-400);
  --scrim: rgba(0,0,0,.6); --shadow-sheet: 0 -12px 40px rgba(0,0,0,.5); --pill:var(--stone-700); --logo-ink:#f2f0eb; --logo-flap:#262626;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg-canvas); color: var(--text); font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none; transition: background-color var(--dur-base) var(--ease-out);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--bg-accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
[lang="de"] { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { position: relative; height: 100dvh; max-width: 520px; margin: 0 auto; overflow: hidden; background: var(--bg-canvas); }
@media (min-width: 560px) { #app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); } }
#views { position: absolute; inset: 0; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg-canvas); }
.view-ghost { pointer-events: none; }
.view-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0 20px calc(var(--tabbar-h) + 32px); -webkit-overflow-scrolling: touch; scroll-padding-top: 72px; }
.view.has-cta .view-body { padding-bottom: calc(var(--tabbar-h) + 110px); }

/* ---------- type ---------- */
.display { font-size: 34px; line-height: 40px; font-weight: 600; letter-spacing: -.03em; }
.title { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.025em; }
.german { font-size: 28px; line-height: 35px; font-weight: 500; letter-spacing: -.015em; }
.heading { font-size: 18px; line-height: 24px; font-weight: 500; letter-spacing: -.01em; }
.body { font-size: 16px; line-height: 24px; }
.body-strong { font-size: 16px; line-height: 22px; font-weight: 500; letter-spacing: -.005em; }
.label { font-size: 14px; line-height: 20px; font-weight: 500; }
.small { font-size: 14px; line-height: 20px; font-weight: 400; }
.caption { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
.brand-mark { flex: none; display: block; }
.brand-word { font-size: 20px; font-weight: 600; letter-spacing: -.045em; line-height: 1; }
.logo-body { fill: var(--logo-ink); } .logo-flap { fill: var(--logo-flap); }
.brand-mark { width: 22px; height: 28px; }
.brand-mark.lg { width: 29px; height: 36px; }
.wordmark { font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -.04em; }

/* ---------- top bar ---------- */
.topbar { position: relative; z-index: 5; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; background: var(--bg-canvas); transition: box-shadow var(--dur-base) var(--ease-out); }
.topbar.scrolled { box-shadow: 0 1px 0 var(--border); }
.topbar .center { font-size: 14px; font-weight: 500; color: var(--text-2); text-align: center; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0; transform: translateY(4px); transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.topbar .center.always, .topbar.scrolled .center { opacity: 1; transform: none; }
.topbar.home { padding-left: 20px; padding-right: 10px; }
.icon { width: 24px; height: 24px; flex: none; display: block; }
.icon-btn { position: relative; width: 40px; height: 40px; margin: 2px; border-radius: var(--radius-full); display: grid; place-items: center; flex: none; background: var(--bg-sunken); transition: transform var(--dur-instant) var(--ease-out), background-color var(--dur-quick) var(--ease-out); }
.icon-btn::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; } /* 44px hit area */
.icon-btn .icon { width: 20px; height: 20px; stroke-width: 2; }
.icon-btn:active { transform: scale(.9); background: var(--border); }
.spacer { width: var(--tap-min); flex: none; }

/* ---------- buttons ---------- */
.btn { height: 52px; border-radius: var(--radius-full); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; width: 100%; padding: 0 24px; transition: transform 180ms var(--ease-pop), opacity var(--dur-quick) var(--ease-out), background-color var(--dur-base) var(--ease-out), filter var(--dur-quick) var(--ease-out); }
.btn .icon { width: 20px; height: 20px; stroke-width: 2.1; }
.btn:active { transform: scale(.96); filter: brightness(.94); transition-duration: 90ms; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn-primary { background: var(--bg-accent); color: var(--text-on-accent); }
.btn-inverse { background: var(--bg-inverse); color: var(--text-inverse); }
.btn-secondary { background: var(--bg-sunken); color: var(--text); }
.btn.sm { height: var(--tap-min); font-size: 15px; width: auto; padding: 0 20px; }
.btn .icon { transition: transform var(--dur-base) var(--ease-out); }
.btn:hover .icon-arrow, .btn:active .icon-arrow { transform: translateX(3px); }
.btn-hero { justify-content: space-between; padding: 0 8px 0 24px; height: 64px; font-size: 17px; }
.btn-hero .arrow { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(14,13,12,.1); }
.cta-bar { position: absolute; left: 0; right: 0; bottom: var(--tabbar-h); z-index: 4; padding: 20px 20px 16px; background: linear-gradient(to bottom, transparent, var(--bg-canvas) 30%); display: flex; gap: 10px; }

/* ---------- tab bar ---------- */
/* Liquid glass (Apple iOS 26-style): clear frosted body, refraction (Chromium), specular rim,
   inner glow and a glass "droplet" that stretches between tabs. */
.tabbar {
  --glass-tint: rgba(248,247,243,.74); --glass-rim: rgba(255,255,255,.85); --glass-rim-soft: rgba(255,255,255,.25); --drop-tint: rgba(14,13,12,.07);
  --glass-shade: rgba(14,13,12,.10); --drop-rim: rgba(255,255,255,.95);
  position: absolute; left: 16px; right: 16px; bottom: var(--tabbar-bottom); z-index: 6; height: 64px; padding: 6px;
  display: flex; justify-content: space-between; border-radius: 32px; isolation: isolate;
  background: linear-gradient(180deg, var(--glass-tint), color-mix(in srgb, var(--glass-tint) 92%, transparent));
  box-shadow:
    inset 0 1px 0.5px var(--glass-rim),          /* top specular edge */
    inset 0 -1px 1px var(--glass-rim-soft),      /* bottom bounce light */
    inset 0 0 18px rgba(255,255,255,.08),        /* inner glow */
    0 12px 32px var(--glass-shade), 0 2px 6px var(--glass-shade);
  -webkit-backdrop-filter: blur(32px) saturate(180%) brightness(1.04);
          backdrop-filter: blur(32px) saturate(180%) brightness(1.04);
  view-transition-name: tabbar; transition: transform 420ms var(--ease-page), opacity 260ms var(--ease-out); }
/* Refraction: Chromium applies the SVG displacement to the backdrop; other engines ignore this declaration and keep the one above. */
.tabbar { backdrop-filter: url(#liquid-glass) blur(32px) saturate(180%) brightness(1.04); }
/* Specular rim: a 1px gradient ring, brightest at the top-left like light catching curved glass. */
.tabbar::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: linear-gradient(135deg, var(--glass-rim) 0%, transparent 32%, transparent 68%, var(--glass-rim-soft) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tabbar { --glass-tint: rgba(28,27,25,.74); --glass-rim: rgba(255,255,255,.28); --glass-rim-soft: rgba(255,255,255,.08); --glass-shade: rgba(0,0,0,.45); --drop-tint: rgba(255,255,255,.14); --drop-rim: rgba(255,255,255,.35); }
}
:root[data-theme="dark"] .tabbar { --glass-tint: rgba(28,27,25,.74); --glass-rim: rgba(255,255,255,.28); --glass-rim-soft: rgba(255,255,255,.08); --glass-shade: rgba(0,0,0,.45); --drop-tint: rgba(255,255,255,.14); --drop-rim: rgba(255,255,255,.35); }
@media (prefers-reduced-transparency: reduce) { .tabbar { background: var(--bg-surface); backdrop-filter: none; -webkit-backdrop-filter: none; } }
#app.no-tabbar { --tabbar-h: env(safe-area-inset-bottom); }
#app.no-tabbar .tabbar { transform: translateY(calc(100% + 32px)); opacity: 0; pointer-events: none; }

/* The selection droplet: lighter glass with its own rim; JS animates it with squash & stretch. */
.tab-indicator { position: absolute; top: 6px; bottom: 6px; left: 0; border-radius: 26px; opacity: 0; z-index: 0; will-change: transform; transform-origin: left center;
  background: linear-gradient(180deg, var(--drop-tint), color-mix(in srgb, var(--drop-tint) 60%, transparent));
  box-shadow: inset 0 1px 0.5px var(--drop-rim), inset 0 -1px 1px rgba(255,255,255,.2), 0 4px 14px rgba(14,13,12,.10);
  -webkit-backdrop-filter: blur(6px) saturate(160%); backdrop-filter: blur(6px) saturate(160%);
  transition: scale 260ms var(--ease-pop); }
.tabbar:has(.tab:active) .tab-indicator { scale: 1.05; } /* the lens swells under your finger */
.tab { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex: 1; padding-top: 1px; border-radius: 26px; font-size: 11px; font-weight: 600; color: var(--text-2); text-decoration: none; transition: color 360ms var(--ease-out) 80ms, transform 200ms var(--ease-pop); }
.tab:active { transform: scale(.94); }
.tab[aria-current="page"] { color: var(--text); }
.tab .icon { width: 22px; height: 22px; transition: transform 420ms var(--ease-pop), stroke-width 320ms var(--ease-out); }
.tab[aria-current="page"] .icon { stroke-width: 2.2; transform: translateY(-1px) scale(1.08); }
.tab.just-selected .icon { animation: tab-pop 520ms var(--ease-pop); }
@keyframes tab-pop { 0% { transform: scale(.82); } 55% { transform: translateY(-2px) scale(1.16); } 100% { transform: translateY(-1px) scale(1.08); } }
.tab-badge { position: absolute; transform: translate(11px, -11px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bg-accent); color: var(--text-on-accent); font-size: 10px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg-surface); }
.tab-badge[hidden] { display: none; }
.tab-wrap { position: relative; display: grid; place-items: center; }

/* ---------- home ---------- */
.home-body { padding-top: 0; padding-left: 16px; padding-right: 16px; }
/* recents row lines up with the 16px page edge (bleeds to the screen edge so cards can scroll under the fades) */
.home-body .hscroll { margin: 0 -16px; padding: 2px 16px 6px; scroll-padding-inline: 16px; }
.home-body .hscroll::after { flex-basis: 6px; } /* 6px + 10px gap = 16px after the last card */
.home-body .sticky-search { top: 0; margin: 0 -16px; padding: calc(env(safe-area-inset-top) + 16px) 16px 16px;
  background: linear-gradient(to bottom, var(--bg-canvas) 0%, var(--bg-canvas) calc(100% - 22px), color-mix(in srgb, var(--bg-canvas) 70%, transparent) calc(100% - 10px), transparent 100%); }
.home-body #recents-wrap .section-head:first-child { margin-top: 16px; }
.home-body #recents-wrap:empty + #loc-groups > section:first-child .section-head, .home-body #recents-wrap[hidden] + #loc-groups > section:first-child .section-head { margin-top: 16px; }
#recents-wrap[hidden] { display: none; }
.recent.pending { border-style: dashed; border-color: var(--border-strong); }
.recent-top { display: flex; justify-content: space-between; align-items: center; }
.badge-pill { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: var(--bg-accent); color: var(--text-on-accent); }
.mini-steps { display: flex; gap: 3px; margin-top: 10px; }
.mini-steps i { flex: 1; height: 3px; border-radius: 2px; background: var(--border); }
.mini-steps i.on { background: var(--text); }

/* ---------- section heads ---------- */
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 32px 0 12px; }
.link { font-size: 14px; font-weight: 500; color: var(--text-2); min-height: var(--tap-min); display: inline-flex; align-items: center; padding: 0 2px; }

/* ---------- cards ---------- */
.card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
/* Horizontal scroller: cards start 20px in (scroll-padding keeps snapping from pulling them to the edge),
   and fade into 20px gradients at whichever edge has more content. JS toggles .fade-l / .fade-r. */
@property --fade-l { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --fade-r { syntax: '<length>'; inherits: false; initial-value: 0px; }
.hscroll { display: flex; gap: 10px; margin: 0 -20px; padding: 2px 20px 6px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: 20px; scrollbar-width: none;
  --fade-l: 0px; --fade-r: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
  transition: --fade-l 320ms var(--ease-out), --fade-r 320ms var(--ease-out); }
.hscroll.fade-l { --fade-l: 20px; }
.hscroll.fade-r { --fade-r: 20px; }
.hscroll > * { flex: none; }
.hscroll::after { content: ""; flex: 0 0 10px; } /* end inset: 10px + 10px gap = 20px after the last card */
.hscroll::-webkit-scrollbar { display: none; }
.recent { min-width: 216px; padding: 16px; display: flex; flex-direction: column; gap: 18px; scroll-snap-align: start; text-align: left;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: transform 220ms var(--ease-out), opacity 200ms var(--ease-out); }
.recent:active, .recent.pressing { transform: scale(.96); }
.recent.pressing { transition-duration: 300ms; }
.recent.drag-source { opacity: .25; transform: scale(.94); }
.drag-hint { display: flex; align-items: center; gap: 6px; margin: -4px 0 12px; }
.drag-hint .icon { width: 16px; height: 16px; }

/* ---------- drag to delete ---------- */
.drag-ghost { position: fixed; z-index: 90; margin: 0; pointer-events: none; will-change: transform;
  transition: transform 160ms var(--ease-out), box-shadow 240ms var(--ease-out), border-color 200ms var(--ease-out); }
.drag-ghost .small { white-space: nowrap; }
.drag-ghost.lifted { box-shadow: 0 24px 48px rgba(0,0,0,.28), 0 4px 12px rgba(0,0,0,.12); transform: scale(1.05); }
.drag-ghost.armed { border-color: var(--danger); transition: transform 240ms var(--ease-pop), box-shadow 240ms var(--ease-out); }
#app.dragging .tabbar { transform: translateY(calc(100% + 32px)); opacity: 0; pointer-events: none; }

.trash-zone { position: fixed; inset: 0; z-index: 80; pointer-events: none; --p: 0; }
.trash-glow { position: absolute; left: 0; right: 0; bottom: 0; height: 46vh;
  background: linear-gradient(to top, color-mix(in srgb, var(--danger) 62%, transparent) 0%, color-mix(in srgb, var(--danger) 22%, transparent) 45%, transparent 100%);
  opacity: 0; transition: opacity 180ms linear; }
.trash-zone.show .trash-glow { opacity: calc(var(--p) * .9); }
.trash-zone.armed .trash-glow { opacity: 1; }
.trash-bin { position: absolute; left: 50%; bottom: calc(40px + env(safe-area-inset-bottom)); width: 72px; height: 72px; margin-left: -36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg-surface); color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,.2), 0 0 0 1px var(--border);
  transform: translateY(160px) scale(.6); opacity: 0;
  transition: transform 420ms var(--ease-pop), opacity 220ms var(--ease-out), background-color 200ms var(--ease-out), color 200ms var(--ease-out); }
.trash-zone.show .trash-bin { transform: translateY(0) scale(calc(1 + var(--p) * .12)); opacity: 1; }
.trash-zone.armed .trash-bin { transform: scale(1.28); background: var(--danger); color: #fff; box-shadow: 0 12px 34px color-mix(in srgb, var(--danger) 55%, transparent); }
.trash-zone.gulp .trash-bin { animation: bin-gulp 380ms var(--ease-pop); }
.bin-icon { width: 28px; height: 28px; overflow: visible; }
.bin-icon .lid { transform-box: fill-box; transform-origin: 85% 100%; transition: transform 260ms var(--ease-pop); }
.trash-zone.armed .bin-icon .lid { transform: translateY(-2px) rotate(22deg); }
.trash-label { position: absolute; top: -34px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--text-2);
  background: var(--bg-surface); padding: 5px 10px; border-radius: 999px; box-shadow: 0 0 0 1px var(--border); opacity: 0; transition: opacity 200ms var(--ease-out) 120ms; }
.trash-zone.show .trash-label { opacity: 1; }
.trash-zone.armed .trash-label { opacity: 0; transition-delay: 0ms; }
@keyframes bin-gulp { 0% { transform: scale(1.28); } 40% { transform: scale(.88); } 100% { transform: scale(1); } }
.empty-card { padding: 20px; display: flex; gap: 14px; align-items: center; color: var(--text-2); border-style: dashed; background: transparent; }

/* Phrase card */
.phrase-list { display: flex; flex-direction: column; gap: 8px; }
.phrase { position: relative; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 12px 16px 18px; display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; transition: transform var(--dur-instant) var(--ease-out), border-color var(--dur-quick) var(--ease-out); }
.phrase:active { transform: scale(.985); }
.phrase .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
.phrase .txt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.phrase .audio { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
.phrase .de { font-size: 17px; line-height: 23px; font-weight: 500; letter-spacing: -.01em; }
.phrase .intent { color: var(--text-3); margin-bottom: 4px; }
.phrase.emergency { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.phrase.emergency .intent { color: var(--danger); }

/* Audio button with icon swap */
.audio { position: relative; width: var(--tap-min); height: var(--tap-min); border-radius: 50%; display: grid; place-items: center; background: var(--bg-sunken); color: var(--text); flex: none; transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-instant) var(--ease-out); }
.audio:active { transform: scale(.9); }
.audio .icon { width: 20px; height: 20px; grid-area: 1 / 1; transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-quick) var(--ease-out), filter var(--dur-base) var(--ease-out); }
.audio .i-stop { opacity: 0; transform: scale(.4); filter: blur(4px); }
.audio.playing { background: var(--bg-inverse); color: var(--text-inverse); }
.audio.playing .i-play { opacity: 0; transform: scale(.4); filter: blur(4px); }
.audio.playing .i-stop { opacity: 1; transform: none; filter: none; }
.audio.lg { width: 72px; height: 72px; background: var(--bg-accent); color: var(--text-on-accent); }
.audio.lg .icon { width: 28px; height: 28px; }
.audio.lg.playing { background: var(--bg-inverse); color: var(--text-inverse); }
.audio.lg::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--bg-inverse); opacity: 0; pointer-events: none; }
.audio.lg.playing::after { animation: ring 1.4s var(--ease-out) infinite; }
.audio.sm { width: 36px; height: 36px; background: var(--bg-surface); }
.audio.sm .icon { width: 16px; height: 16px; }
/* small (answer) buttons get the same playing style as the regular ones: inverted fill + pause icon */
.audio.sm.playing { background: var(--bg-inverse); color: var(--text-inverse); }
@keyframes ring { from { opacity: .5; transform: scale(1); } to { opacity: 0; transform: scale(1.45); } }

/* Chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 0 20px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { min-height: var(--tap-min); display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: var(--radius-full); border: 1px solid transparent; background: var(--bg-sunken); font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; flex: none; transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), transform var(--dur-instant) var(--ease-out); }
.chip:active { transform: scale(.95); }
.chip .icon { width: 18px; height: 18px; }
.chip[aria-pressed="true"], .chip.selected { background: var(--bg-inverse); color: var(--text-inverse); border-color: var(--bg-inverse); }
.chip.ghost { border-color: var(--border); background: var(--bg-surface); }
.chip.editable { border-style: dashed; }

/* Option card (single choice) */
.options { display: flex; flex-direction: column; gap: 10px; }
.option { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--bg-surface); border: 1px solid var(--border); min-height: 76px; width: 100%; text-align: left; position: relative; transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), transform var(--dur-instant) var(--ease-out); }
.option:active { transform: scale(.98); }
.option .ico { width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--bg-sunken); display: grid; place-items: center; flex: none; transition: background-color var(--dur-base) var(--ease-out); }
.option .txt { flex: 1; min-width: 0; }
.option .sub { display: block; margin-top: 2px; color: var(--text-2); font-size: 14px; line-height: 20px; transition: color var(--dur-base) var(--ease-out); }
.option .radio { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; display: grid; place-items: center; transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out); }
.option .radio .icon { width: 14px; height: 14px; stroke-width: 2.6; opacity: 0; transform: scale(.3) rotate(-35deg); filter: blur(2px); transition: transform var(--dur-base) var(--ease-pop), opacity var(--dur-quick) var(--ease-out), filter var(--dur-base) var(--ease-out); }
.option[aria-checked="true"] { background: var(--bg-inverse); color: var(--text-inverse); border-color: var(--bg-inverse); }
.option[aria-checked="true"] .sub { color: color-mix(in srgb, var(--text-inverse) 70%, transparent); }
.option[aria-checked="true"] .ico { background: color-mix(in srgb, var(--text-inverse) 14%, transparent); }
.option[aria-checked="true"] .radio { background: var(--bg-accent); border-color: var(--bg-accent); color: var(--text-on-accent); }
.option[aria-checked="true"] .radio .icon { opacity: 1; transform: none; filter: none; }
.option .tag { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--bg-accent); color: var(--text-on-accent); margin-left: 8px; vertical-align: 2px; }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-grid .option { flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 26px; min-height: 150px; }
.option-grid .option .radio { position: absolute; top: 16px; right: 16px; }

/* Location card */
.loc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 440px) { .loc-grid { grid-template-columns: repeat(3, 1fr); } }
.loc { position: relative; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 12px 12px; min-height: 108px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; text-align: left; transition: transform var(--dur-instant) var(--ease-out), background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out); }
.loc:active { transform: scale(.96); }
.loc .name { font-size: 13px; line-height: 17px; font-weight: 500; letter-spacing: -.005em; }
.loc .de-name { display: block; font-size: 11px; line-height: 14px; color: var(--text-3); margin-top: 2px; font-weight: 400; }
.loc.soon .icon { opacity: .5; }
.loc .badge { position: absolute; top: 10px; right: 10px; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--text-3); }
.loc.pressed { background: var(--bg-inverse); color: var(--text-inverse); }
.loc.pressed .de-name { color: inherit; opacity: .7; }

/* Search */
.search { height: 50px; border-radius: var(--radius-full); background: var(--bg-surface); border: 1px solid var(--border); display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px; color: var(--text-3); transition: border-color var(--dur-quick) var(--ease-out); }
.search:focus-within { border-color: var(--border-strong); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--text); height: 100%; }
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search .icon { width: 20px; height: 20px; }
.search .clear { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; opacity: 0; transform: scale(.6); filter: blur(2px); pointer-events: none; transition: all var(--dur-base) var(--ease-out); }
.search.has-value .clear { opacity: 1; transform: none; filter: none; pointer-events: auto; }
/* The fading search band is a home-screen-only header (see .home-body .sticky-search); no other screen uses it. */
.home-body .sticky-search { position: sticky; z-index: 3; }
.no-results { padding: 40px 12px; text-align: center; color: var(--text-2); }

/* Steps */
.steps-wrap { padding: 2px 20px 0; display: flex; flex-direction: column; gap: 10px; flex: none; }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; position: relative; }
.steps i::after { content: ""; position: absolute; inset: 0; background: var(--bg-inverse); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-slow) var(--ease-out); }
.steps i.on::after { transform: scaleX(1); }
.steps-meta { display: flex; justify-content: space-between; }

/* Segmented / tabs with sliding pill */
.seg { position: relative; display: flex; background: var(--bg-sunken); border-radius: var(--radius-full); padding: 4px; gap: 0; }
.seg .pill { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: var(--radius-full); background: var(--pill); box-shadow: 0 1px 2px rgba(0,0,0,.08); opacity: 0; transition: transform 360ms var(--ease-out), width 360ms var(--ease-out); }
.seg button { position: relative; z-index: 1; flex: 1; min-height: 40px; border-radius: var(--radius-full); font-size: 14px; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; transition: color var(--dur-base) var(--ease-out); white-space: nowrap; }
.seg button[aria-selected="true"], .seg button[aria-checked="true"] { color: var(--text); }
.seg button .count { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
/* Phrase list: the stage tabs live in a pinned, full-width band that continues the top bar's background
   (no divider between them), with 16px below the tabs that fades out so cards scroll away smoothly. */
.stage-bar { position: sticky; top: 0; z-index: 3; margin: 12px -20px 0; padding: 6px 20px 16px;
  background: linear-gradient(to bottom, var(--bg-canvas) 0%, var(--bg-canvas) calc(100% - 20px), color-mix(in srgb, var(--bg-canvas) 70%, transparent) calc(100% - 9px), transparent 100%); }
.view[data-view="phrases"] .topbar.scrolled { box-shadow: none; }
.seg.wrap4 button { font-size: 13px; }

/* Hint, tip, banners */
.hint { display: flex; gap: 12px; padding: 16px; border-radius: var(--radius-lg); background: var(--bg-sunken); }
.hint .icon, .tip .icon { width: 20px; height: 20px; color: var(--text-accent); margin-top: 1px; }
.tip { display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-md); background: var(--bg-sunken); margin-top: 16px; }
.banner .icon { width: 20px; height: 20px; color: var(--text-accent); }

/* Detail */
.pron { font-family: var(--font-mono); font-size: 14px; line-height: 21px; color: var(--text-2); }
.reply { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.answer { display: flex; gap: 10px; align-items: center; padding: 10px 10px 10px 12px; border-radius: var(--radius-md); background: var(--bg-sunken); }
.answer > .icon { width: 18px; height: 18px; color: var(--text-3); align-self: flex-start; margin-top: 2px; }
.answer .txt { flex: 1; min-width: 0; }
.detail-nav { display: flex; gap: 10px; width: 100%; }
.detail-nav .btn { flex: 1; }
.variant-chip { font-size: 13px; }

/* Sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; transition: opacity var(--dur-page) var(--ease-page); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 520px; margin: 0 auto; max-height: 88dvh; overflow-y: auto; background: var(--bg-canvas); border-radius: 28px 28px 0 0; padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-sheet); transform: translateY(105%); transition: transform var(--dur-page) var(--ease-page); touch-action: pan-y; }
.sheet.open { transform: none; }
.sheet-backdrop.open { opacity: 1; }
.sheet .grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 4px auto 14px; }
.sheet h2 { margin-bottom: 4px; }
.sheet .group { margin-top: 20px; }
.sheet .group > .caption { display: block; margin-bottom: 10px; color: var(--text-2); }
.sheet .preview { margin-top: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.sheet .actions { margin-top: 24px; }

/* Toast */
/* Toast, styled after shadcn/ui's Toast (Base UI variant): a card with rounded-2xl corners, 1px border,
   popover background, shadow-lg, 16px padding, 12px gap; status icon · title (14px/500) · outline action
   (size sm) · ghost close button. Slides up from below, slides back down on exit. */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 64px); z-index: 60; max-width: 384px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 16px;
  border-radius: 16px; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  opacity: 0; transform: translateY(150%); pointer-events: none;
  transition: transform 450ms cubic-bezier(0.22, 1, 0.36, 1), opacity 250ms cubic-bezier(0.22, 1, 0.36, 1); }
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
/* screens without the bottom nav keep the toast clear of the bottom buttons (e.g. Next phrase) */
#app.no-tabbar ~ .toast { bottom: calc(env(safe-area-inset-bottom) + 88px); }
.toast-icon { flex: none; display: grid; place-items: center; color: var(--text); }
.toast-icon .icon { width: 16px; height: 16px; stroke-width: 2; }
.toast-icon.danger { color: var(--danger); }
.toast-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.toast-title { font-size: 14px; line-height: 20px; font-weight: 500; }
.toast-desc { font-size: 14px; line-height: 20px; color: var(--text-2); }
/* outline button, size sm */
.toast-action { flex: none; height: 32px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg-canvas);
  color: var(--text); font-size: 13px; font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: background-color var(--dur-quick) var(--ease-out); }
.toast-action:hover, .toast-action:active { background: var(--bg-sunken); }
/* ghost icon button, size icon-sm, with a larger hit area */
.toast-close { position: relative; flex: none; width: 32px; height: 32px; margin: -6px -6px -6px 0; border-radius: 10px; display: grid; place-items: center;
  color: var(--text-2); transition: color var(--dur-quick) var(--ease-out), background-color var(--dur-quick) var(--ease-out); }
.toast-close::after { content: ""; position: absolute; inset: -6px; }
.toast-close:hover, .toast-close:active { color: var(--text); background: var(--bg-sunken); }
.toast-close .icon { width: 16px; height: 16px; }

/* Bookmark icon swap */
.save-btn .icon { grid-area: 1 / 1; transition: transform var(--dur-base) var(--ease-pop), opacity var(--dur-quick) var(--ease-out), filter var(--dur-base) var(--ease-out); }
.save-btn .i-on { opacity: 0; transform: scale(.4); filter: blur(3px); }
.save-btn[aria-pressed="true"] .i-off { opacity: 0; transform: scale(.4); filter: blur(3px); }
.save-btn[aria-pressed="true"] .i-on { opacity: 1; transform: none; filter: none; color: var(--text); }

/* Empty state */
/* Empty states sit in the exact vertical middle of the screen (the .view fills the viewport). */
.empty { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); z-index: 1;
  text-align: center; padding: 0 32px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .ring { width: 72px; height: 72px; border-radius: 50%; background: var(--bg-sunken); display: grid; place-items: center; margin-bottom: 8px; }

/* ---------- entrance animations ---------- */
.stagger > * { animation: rise var(--dur-base) var(--ease-out) backwards; animation-delay: calc(min(var(--i, 0), 12) * 32ms + 40ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.reveal .line { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.reveal .line > span { display: inline-block; animation: line-up var(--dur-slow) var(--ease-out) both; animation-delay: calc(var(--l, 0) * 70ms + 60ms); }
@keyframes line-up { from { transform: translateY(105%); } to { transform: none; } }
.fade-in { animation: fade-in var(--dur-base) var(--ease-out) both; animation-delay: var(--d, 0ms); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- splash (minimal: logo, wordmark, tagline, a fine progress line) ----------
   Only opacity and transform animate (GPU-composited); no letter-spacing, blur, 3D or scale on text,
   which cause re-layout and shimmer. */
.splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px;
  background: var(--bg-canvas); transition: opacity 520ms cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 520ms; }
.splash.hide { opacity: 0; visibility: hidden; }
.splash > * { will-change: opacity, transform; backface-visibility: hidden; }
.splash-stage { width: 40px; height: 50px; }
.splash-mark { display: block; width: 40px; height: 50px; overflow: visible; }
.splash-mark .logo-body, .splash-mark .logo-flap { opacity: 0; transform-box: fill-box; }
.splash-mark .logo-body { fill: #FFB81C; animation: splash-rise 700ms cubic-bezier(0.22, 1, 0.36, 1) 120ms forwards; }
.splash-mark .logo-flap { fill: #E39600; transform-origin: 100% 0%; animation: splash-flap 600ms cubic-bezier(0.22, 1, 0.36, 1) 520ms forwards; }
.splash-word { margin-top: 20px; font-size: 32px; font-weight: 600; letter-spacing: -.04em; line-height: 1.15;
  opacity: 0; animation: splash-rise 760ms cubic-bezier(0.22, 1, 0.36, 1) 420ms forwards; }
.splash-word span { display: inline; } /* letters stay one text run: no per-letter jitter */
.splash-tag { margin-top: 10px; font-size: 14px; line-height: 20px; letter-spacing: .01em; color: var(--text-2); text-align: center;
  opacity: 0; animation: splash-rise 760ms cubic-bezier(0.22, 1, 0.36, 1) 720ms forwards; }
.splash-load { margin-top: 32px; width: 120px; height: 3px; border-radius: 2px; background: var(--border); overflow: hidden;
  opacity: 0; animation: splash-fade 600ms ease 900ms forwards; }
.splash-load i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--text); transform: scaleX(0); transform-origin: left center; will-change: transform;
  animation: splash-progress 3800ms cubic-bezier(0.3, 0.6, 0.35, 1) 200ms forwards; }
@keyframes splash-progress { from { transform: scaleX(0); } to { transform: scaleX(.92); } }
@keyframes splash-rise { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes splash-flap { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes splash-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- view transitions ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur-page); animation-timing-function: var(--ease-page); mix-blend-mode: normal; }
html[data-nav="forward"]::view-transition-old(root) { animation-name: page-out-left; }
html[data-nav="forward"]::view-transition-new(root) { animation-name: page-in-right; box-shadow: -16px 0 40px rgba(0,0,0,.12); }
html[data-nav="back"]::view-transition-old(root) { animation-name: page-out-right; z-index: 2; box-shadow: -16px 0 40px rgba(0,0,0,.12); }
html[data-nav="back"]::view-transition-new(root) { animation-name: page-in-left; }
html[data-nav="fade"]::view-transition-old(root) { animation: fade-out var(--dur-quick) var(--ease-out) both; }
html[data-nav="fade"]::view-transition-new(root) { animation: fade-up var(--dur-base) var(--ease-out) both 40ms; }
::view-transition-group(hero) { animation-duration: var(--dur-page); animation-timing-function: var(--ease-page); }
::view-transition-old(hero), ::view-transition-new(hero) { height: 100%; width: auto; object-fit: none; object-position: left top; overflow: clip; }
::view-transition-group(tabbar) { animation: none; }
@keyframes page-in-right { from { transform: translateX(100%); } }
@keyframes page-out-left { to { transform: translateX(-28%); opacity: .4; } }
@keyframes page-out-right { to { transform: translateX(100%); } }
@keyframes page-in-left { from { transform: translateX(-28%); opacity: .4; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- translator ("Say it your way") ---------- */
.translate-entry { width: 100%; margin-top: 16px; display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 14px; text-align: left;
  border-radius: var(--radius-lg); background: var(--bg-surface); border: 1px dashed var(--border-strong);
  transition: transform 160ms var(--ease-pop), border-color var(--dur-base) var(--ease-out); }
.translate-entry:active { transform: scale(.98); }
.te-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-accent); color: var(--text-on-accent); flex: none; }
.te-icon .icon { width: 22px; height: 22px; stroke-width: 2; }
.te-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.te-chev { color: var(--text-3); width: 20px; height: 20px; }

.composer { position: relative; margin-top: 18px; border-radius: 22px; background: var(--bg-surface); border: 1px solid var(--border);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.composer:focus-within { border-color: var(--border-strong); }
.composer.listening { border-color: var(--bg-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bg-accent) 18%, transparent); }
.composer textarea { display: block; width: 100%; min-height: 76px; resize: none; border: 0; outline: 0; background: transparent; color: var(--text);
  font: 400 17px/24px var(--font-sans); padding: 16px 64px 16px 16px; }
.composer textarea::placeholder { color: var(--text-3); }
.mic-btn { position: absolute; right: 10px; bottom: 10px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-sunken); color: var(--text); transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base), transform 180ms var(--ease-pop); }
.mic-btn .icon { width: 22px; height: 22px; stroke-width: 2; }
.mic-btn:active { transform: scale(.9); }
.mic-btn.on { background: var(--bg-accent); color: var(--text-on-accent); }
.mic-btn.on::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--bg-accent); animation: ring 1.2s var(--ease-out) infinite; }
.listening { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--text-accent); }
.listening[hidden] { display: none; }
.eq { display: inline-flex; gap: 3px; align-items: center; height: 16px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: currentColor; animation: eq 900ms ease-in-out infinite; transform-origin: center; }
.eq i:nth-child(2) { animation-delay: -300ms; } .eq i:nth-child(3) { animation-delay: -600ms; } .eq i:nth-child(4) { animation-delay: -150ms; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

.tr-result { margin-top: 14px; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.tr-head { display: flex; justify-content: space-between; align-items: center; }
.tr-provider { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.tr-provider .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.tr-de { font-size: 22px; line-height: 29px; font-weight: 600; letter-spacing: -.01em; min-height: 29px; transition: color var(--dur-base) var(--ease-out); }
.tr-result[data-state="empty"] .tr-de { color: var(--text-3); font-weight: 500; font-size: 18px; }
.tr-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.tr-row .pron { flex: 1; min-width: 0; }
.tr-row .audio[disabled] { opacity: .35; }
.tr-error { color: var(--danger); }
.tr-error[hidden] { display: none; }
/* shimmer while translating */
.tr-result[data-state="loading"]::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--text) 7%, transparent) 50%, transparent 80%);
  animation: tr-shimmer 1.1s var(--ease-in-out) infinite; }
@keyframes tr-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.btn .icon:first-child { margin-left: -4px; }

/* ---------- top-right action group & sheet close ---------- */
.top-actions { display: flex; align-items: center; gap: 4px; }
.sheet-x { position: absolute; top: 14px; right: 14px; z-index: 3; }
.sheet:has(> .sheet-x) > h2:first-of-type { padding-right: 52px; }

/* ---------- phrase detail as a tall bottom sheet ---------- */
.sheet.sheet-detail { height: 92dvh; max-height: 92dvh; padding: 8px 0 0; display: flex; flex-direction: column; overscroll-behavior: contain; }
.sheet-detail .grabber { flex: none; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 14px 8px 20px; background: var(--bg-canvas); }
.sheet-where { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-body { flex: 1; padding: 6px 20px 24px; }
.sheet-foot { position: sticky; bottom: 0; z-index: 2; padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg-canvas) 26%); }

/* swipe areas: let the browser handle vertical scrolling, we handle horizontal swipes */
.view[data-view="setup"], .sheet-detail { touch-action: pan-y; }

/* ---------- saved: swipe-left actions ---------- */
.swipe-row { position: relative; --p: 0; touch-action: pan-y; }
.swipe-content { position: relative; z-index: 1; will-change: transform; }
.swipe-actions { position: absolute; inset: 0 0 0 auto; width: 100%; display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding-right: 4px; z-index: 0; }
.swipe-btn { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  opacity: var(--p); transform: scale(calc(.6 + var(--p) * .4));
  transition: flex-basis 260ms var(--ease-out), width 260ms var(--ease-out), background-color 200ms; }
.swipe-btn .icon { width: 22px; height: 22px; stroke-width: 2; }
.swipe-btn.go { background: var(--bg-inverse); color: var(--text-inverse); }
.swipe-btn.del { background: var(--danger); color: #fff; }
.swipe-btn:active { filter: brightness(.9); }
/* full swipe: delete takes over the whole row */
.swipe-row.full .swipe-btn.go { width: 0; opacity: 0; margin-left: -8px; overflow: hidden; }
.swipe-row.full .swipe-btn.del { width: calc(100% - 4px); height: calc(100% - 8px); max-height: 96px; border-radius: 20px; opacity: 1; transform: none; }

/* arriving from Saved → Situation: briefly highlight the phrase */
.phrase.flash { animation: flash 1.5s var(--ease-out); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 2px var(--bg-accent); } 100% { box-shadow: 0 0 0 2px transparent; } }

/* re-render without replaying entrance animations (after delete/undo) */
.no-anim, .no-anim > *, .no-anim .line > span { animation: none !important; }

/* live voice picker (Settings) */
.voice-select { position: relative; display: block; }
.voice-select select { width: 100%; height: 46px; appearance: none; -webkit-appearance: none; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg-sunken); color: var(--text); font: 500 14px/1 var(--font-sans); padding: 0 40px 0 14px; }
.voice-select .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; pointer-events: none; color: var(--text-2); }

/* select-style button that opens a bottom sheet */
.select-btn { width: 100%; height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px;
  border-radius: 14px; background: var(--bg-sunken); color: var(--text); font: 500 14px/1 var(--font-sans); text-align: left;
  transition: transform 160ms var(--ease-pop), background-color var(--dur-base); }
.select-btn:active { transform: scale(.98); }
.select-btn span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-btn .icon { width: 18px; height: 18px; color: var(--text-2); }

/* list of options in a sheet, checkmark on the right for the selected one */
.list-options { margin-top: 18px; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--bg-surface); border: 1px solid var(--border); }
.list-option { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; text-align: left; width: 100%;
  transition: background-color var(--dur-quick) var(--ease-out); }
.list-option + .list-option { border-top: 1px solid var(--border); }
.list-option:active { background: var(--bg-sunken); }
.lo-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lo-check { width: 24px; height: 24px; display: grid; place-items: center; color: var(--text); flex: none; }
.lo-check .icon { width: 20px; height: 20px; stroke-width: 2.4; opacity: 0; transform: scale(.4) rotate(-30deg); filter: blur(2px);
  transition: opacity var(--dur-quick) var(--ease-out), transform var(--dur-base) var(--ease-pop), filter var(--dur-base) var(--ease-out); }
.list-option[aria-checked="true"] .lo-check .icon { opacity: 1; transform: none; filter: none; }

/* "Slow" chip while it's playing: amber text + icon, soft amber tint.
   Dark: amber-400 on a dark surface. Light: amber-800 on a pale tint (both well above 4.5:1). */
.chip[data-action="play-slow"][aria-pressed="true"],
.chip[data-action="play-slow"].playing {
  color: var(--text-accent);
  background: color-mix(in srgb, var(--bg-accent) 14%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--text-accent) 55%, transparent);
}
.chip[data-action="play-slow"].playing .icon { animation: slow-bob 1.6s ease-in-out infinite; }
@keyframes slow-bob { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(2px); } }

/* "Request" link buttons (open the request page outside the app) */
.request-btn { flex: none; text-decoration: none; gap: 6px; }
.request-btn .icon { width: 15px; height: 15px; stroke-width: 2.2; }
.no-results .request-btn { margin-top: 16px; }

/* About card: smaller logo + "Read more" link (opens the website outside the app) */
.brand-mark.sm { width: 17px; height: 21px; margin-top: 1px; }
.read-more { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; min-height: 32px; font-size: 14px; font-weight: 500; color: var(--text);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.read-more:hover, .read-more:active { text-decoration-color: currentColor; }
.read-more .icon { width: 14px; height: 14px; stroke-width: 2.2; }
