/* Shared visual language for the entry, reading, and account experiences. */
:root {
  --bg: #f7f1e8;
  --bg-accent: #efe4d6;
  --paper: rgba(255,255,255,.88);
  --paper-strong: #fffaf4;
  --ink: #243b5b;
  --muted: #657182;
  --line: #e5d8c9;
  --line-strong: #d7c7b7;
  --accent: #253b5b;
  --accent-strong: #1b2f4c;
  --accent-soft: #f1e7d9;
  --shadow-lg: 0 24px 70px -32px #453a3233;
  --shadow-sm: 0 8px 30px -18px #453a3226;
  --ease-out: cubic-bezier(.2,.8,.2,1);
  color: var(--ink);
  background: var(--bg);
  font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  color-scheme: light;
}
body { color: var(--ink); background: radial-gradient(ellipse at 85% 12%, #f1e5d4 0, transparent 45%), var(--bg); }
::selection { background: #ead4b6; color: #253b5b; }
a, button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, .auth-form input:focus { outline: 3px solid #b67f41; outline-offset: 4px; }
button, .button, .button-secondary, .entry-action { transition: background .25s, border-color .25s, box-shadow .3s, transform .35s var(--ease-out); }
button:active:not(:disabled), .button:active { transform: scale(.98); }
button:disabled { transform: none; }
.eyebrow, .panel-label { color: var(--accent); }
.button-secondary, button:not([class]), .button { background: #f3ebe0; border-color: var(--line); color: var(--ink); }
.button-secondary:hover, .button:hover { background: #e7d9c8; }
.primary-action, #start-live-button, .primary { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 7px 18px #253b5b18; }
.primary-action:hover, #start-live-button:hover, .primary:hover { background: var(--accent-strong); color: white; box-shadow: 0 10px 24px #253b5b28; }
.primary-action.is-recording, #start-live-button.is-recording { background: var(--warn); }
.result-card, .setup-screen, .auth-card, .search-panel, .session-detail, .session-card { background: var(--paper-strong); border-color: var(--line); box-shadow: var(--shadow-sm); }
input, select, textarea, .auth-form input, .stream-box, .metric-chip, .arabic-block { background: #fffdf9; color: var(--ink); border-color: var(--line-strong); border-radius: 14px; }
.pill, .pill.neutral, .status-strip, .stream-box-muted { background: #f3ece2; }
.pill.ok { background: var(--ok-soft, #e2f4e9); color: #24654e; }
.pill.warn, .review-card, .auth-error { background: #fff0e9; color: #9a3b25; }
.arabic-block { border-style: solid; border-inline-start: 3px solid var(--accent); }
.bottom-action-bar { background: #fffaf4ed; border-color: var(--line); }
.app-home { overflow-x: clip; }
.app-home .page-shell { width: min(1200px, calc(100% - 80px)); max-width: 1200px; padding: 26px 0 32px; }
.topbar { padding: 10px 0 24px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; gap: 13px; }
.brand-icon { width: 42px; height: 42px; border-radius: 13px; }
.brand-block { flex: 1; }
.topbar .eyebrow { font-size: 9px; letter-spacing: .12em; margin-bottom: 5px; color: var(--muted); }
.topbar h1 { font-size: 19px; font-weight: 600; letter-spacing: -.04em; }
.account-area { margin-left: auto; gap: 24px; }
.account-area .button-secondary { padding: 10px 19px; border-radius: 12px; font-size: 13px; background: #ffffffb3; }
.nav-history { text-decoration: none; font-size: 13px; color: var(--muted); }
.nav-history:hover { color: var(--accent); }
.entry-screen { display: block; min-height: 0; padding: 0; overflow: visible; }
.hero-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 5vw, 78px); padding: 74px 12px 78px; overflow: clip; }
.home-lead { margin: 0; }
.hero-kicker { display: inline-flex; align-items: center; gap: 9px; color: var(--accent); font-size: 12px; font-weight: 500; margin: 0 0 22px; }
.hero-kicker > span { width: 7px; height: 7px; border-radius: 50%; background: #b98445; box-shadow: 0 0 0 4px #b9844510; }
.entry-screen .home-lead h2 { font-size: clamp(50px, 5.8vw, 78px); font-weight: 500; letter-spacing: -.065em; line-height: 1.06; margin: 0 0 25px; max-width: 640px; }
.home-lead h2 em { color: #a46e35; font-style: normal; }
.hero-description { max-width: 370px; color: var(--muted); font-size: 16px; line-height: 1.8; margin: 0 0 30px; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.entry-action { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; width: auto; min-height: 52px; padding: 15px 20px; border-radius: 13px; gap: 24px; box-shadow: none; }
.entry-action strong { font-size: 14px; font-weight: 500; }
.entry-primary { background: var(--accent); border-color: var(--accent); }
.entry-primary span { color: #f4e5d2; font-size: 22px; line-height: .8; }
.entry-primary:hover { background: var(--accent-strong); transform: translateY(-3px); box-shadow: 0 12px 24px #253b5b25; }
.entry-action.text-entry { background: transparent; border-color: transparent; font-weight: 500; font-size: 13px; padding-inline: 8px; gap: 12px; }
.text-entry:hover { color: var(--accent); background: #efe7dc; }
.home-lead .language-note { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; margin: 24px 0 0; line-height: 1.6; }
.language-symbol { font-size: 13px; color: var(--accent); border-right: 1px solid var(--line-strong); padding-right: 9px; white-space: nowrap; }
.hero-visual { position: relative; isolation: isolate; padding: 44px 8px 44px 0; min-width: 0; }
.visual-halo { position: absolute; inset: -6% -3%; z-index: -2; border-radius: 48% 52% 64% 36%; background: radial-gradient(ellipse at 60% 40%, #e8cfaa 0, #f0dfc8 42%, #f7efe380 65%, transparent 72%); animation: halo-drift 13s ease-in-out infinite alternate; }
.orbit { position: absolute; z-index: -1; width: 108%; height: 82%; left: -4%; top: 7%; border: 1px solid #c8a46f4d; border-radius: 50%; transform: rotate(-30deg); }
.orbit-two { transform: rotate(35deg); width: 95%; height: 105%; top: -5%; left: 2%; border-style: dashed; border-color: #c8a46f33; }
.preview-card { border: 1px solid #ffffff; border-radius: 23px; padding: 24px; background: #fffaf4f2; box-shadow: 0 32px 70px -30px #66503945, 0 1px 4px #243b5b08; transform: rotate(-3deg); animation: card-float 7s ease-in-out infinite; }
.preview-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.preview-brand { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink); font-weight: 500; }
.signal-dot, .tiny-dot { display: inline-block; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: #c28c48; }
.demo-label { font-size: 8px; font-weight: 600; letter-spacing: .1em; color: var(--muted); background: #f3ece2; border-radius: 5px; padding: 5px 7px; }
.waveform { height: 112px; display: flex; align-items: center; justify-content: center; gap: 5px; margin: 20px 0 12px; padding: 0 10px; }
.waveform i { display: block; width: 5px; height: var(--bar-height); border-radius: 6px; background: linear-gradient(#dfb779, #ac7a3c); animation: waveform 1.7s ease-in-out var(--bar-delay) infinite alternate; transform-origin: center; }
.waveform i:nth-child(3n) { opacity: .5; }
.preview-label { display: flex; justify-content: space-between; font-size: 8px; letter-spacing: .14em; font-weight: 600; color: #88745f; }
.preview-caption { padding: 18px 0 20px; border-top: 1px solid #f0e7dc; }
.preview-caption p { font-family: 'Noto Naskh Arabic', 'Traditional Arabic', serif; font-size: clamp(24px, 2.6vw, 34px); color: #253b5b; line-height: 1.8; margin: 12px 0 0; }
.preview-translation { background: #f6efe5; padding: 17px 18px; border-radius: 12px; border: 1px solid #ecdfcd; }
.preview-translation p { margin: 10px 0 0; color: #344967; font-size: 17px; font-weight: 500; line-height: 1.65; }
.preview-footer { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 22px; color: #7d756c; font-size: 9px; }
.tiny-dot { margin-right: 5px; width: 4px; height: 4px; }
.floating-label { position: absolute; bottom: 10px; right: -10px; display: flex; gap: 12px; align-items: center; padding: 15px 20px; border: 1px solid white; border-radius: 14px; background: #fffaf4f2; box-shadow: 0 14px 40px #453a3217; font-size: 12px; font-weight: 600; animation: badge-float 7s ease-in-out infinite; }
.check-symbol { display: grid; place-items: center; width: 31px; height: 34px; background: #f3e7d4; color: #a5793b; border-radius: 10px 10px 15px 15px; }
.floating-label small { display: block; font-size: 9px; color: var(--muted); font-weight: 400; margin-top: 5px; }
button.motion-toggle { position: absolute; bottom: -25px; right: 8px; padding: 5px; min-height: 28px; background: transparent; border: 0; box-shadow: none; color: var(--muted); font-size: 10px; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); padding: 32px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); gap: 26px; }
.feature-strip > div, .feature-strip > a { display: flex; align-items: flex-start; gap: 14px; }
.feature-strip a { color: inherit; text-decoration: none; }
.feature-strip a:hover h3 { color: var(--accent); }
.feature-number { font-size: 10px; line-height: 2; color: #a18159; font-variant-numeric: tabular-nums; }
.feature-strip h3 { margin: 0 0 7px; font-size: 13px; font-weight: 600; }
.feature-strip h3 span { padding-left: 10px; color: var(--accent); }
.feature-strip p { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.7; }
.home-footer { display: flex; justify-content: space-between; gap: 20px; font-size: 10px; color: var(--muted); margin-top: 26px; }
.app-home:has(#home-screen[hidden]) .home-footer { display: none; }
.setup-screen, #text-screen { max-width: 760px; margin: 48px auto 110px; }
.setup-screen { padding: clamp(25px, 5vw, 44px); border-radius: 24px; }
.setup-screen h2 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -.04em; margin: 10px 0 16px; }
.setup-screen .drawer-section { grid-template-columns: 1fr 1fr; gap: 22px; }
.setup-screen .advanced-options { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 22px; }
.setup-screen .control-drawer { backdrop-filter: none; }
.text-intro h2 { font-size: 30px; letter-spacing: -.04em; }
.auth-card { border-radius: 24px; }
.auth-card h1 { line-height: 1.15; letter-spacing: -.045em; }
.auth-brand { font-size: 17px; }
.auth-submit { border-radius: 12px; }
.search-panel, .session-detail { border-radius: 22px; }
.session-card { border-radius: 16px; }
.session-card:hover { background: #faf4ec; transform: translateY(-2px); }
.session-card[aria-current=true] { background: #f4eadd; border-color: #d4ad77; box-shadow: inset 3px 0 var(--accent); }
button[aria-pressed=true] { background: #efe7dc; border-color: #d4ad77; }
.badge, .notice { background: #f1e8dc; color: #6e5943; }
.subtitle, .storage-note, #result-count, .session-meta, .pagination span, .empty-state, .no-results, .passage-time { color: var(--muted); }
.empty-state h2, .no-results strong, .transcript-section h3 { color: var(--ink); }
.detail-header, .transcript-section + .transcript-section { border-color: var(--line); }
.arabic-half, .arabic-panel { background: #f7f1e8; border-color: var(--line); }
.translation-half, .translation-panel { background: #fffaf4; }
.live-half h1, .live-half h2, .language-panel h2 { color: #253b5b; }
.caption-new, .translation-passage:last-child { color: #243b5b; background: #f1e8dc; border-inline-start-color: #d69b57; border-radius: 4px 14px 14px 4px; }
.caption-old, .translation-passage { color: #657182; }
.live-footer, .watch-screen footer { background: #f3ece2; border-color: var(--line); }
.live-footer button, #jump-latest { background: #fffaf4; color: var(--ink); border-color: var(--line-strong); }
#end-session { background: #a43c36; color: white; }
#play-test { background: var(--accent); color: white; }
#check-text-fallback { color: var(--accent); }
body.is-listening .live-dot { background: #c28c48; box-shadow: 0 0 0 4px #c28c4814; }
.watch-header { background: #fffaf4dd; border-color: var(--line); }
.waiting-panel strong { color: var(--ink); }
.waiting-dot { background: var(--accent); animation: waiting-pulse 1.8s ease-in-out infinite; }
dialog { color: var(--ink); border-color: var(--line); background: #fffaf4; box-shadow: 0 30px 100px #253b5b33; }
dialog::backdrop { background: #253b5b60; backdrop-filter: blur(6px); }
.dialog-eyebrow { color: var(--accent); }
.share-link-row input, .share-link-row button, .dialog-actions button { color: var(--ink); border-color: var(--line-strong); }
#home-screen:not([hidden]) .home-lead, #setup-screen:not([hidden]), #text-screen:not([hidden]), .auth-card, .search-panel, .session-detail { animation: enter .65s var(--ease-out) both; }
#home-screen:not([hidden]) .feature-strip { animation: enter .8s .12s var(--ease-out) both; }
@keyframes enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes waveform { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
@keyframes card-float { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(-2deg); } }
@keyframes badge-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@keyframes halo-drift { to { transform: rotate(15deg) scale(1.06); } }
@keyframes waiting-pulse { 50% { box-shadow: 0 0 0 12px #253b5b0c; } }
.motion-paused *, .motion-paused *::before, .motion-paused *::after { animation-play-state: paused !important; }
/* Entry content must remain visible even when decorative motion is paused. */
.motion-paused #home-screen .home-lead, .motion-paused #home-screen .feature-strip, .motion-paused #setup-screen, .motion-paused #text-screen { animation: none !important; }
@media (min-width: 1450px) { .hero-layout { padding-block: 100px; } }
@media (max-width: 1000px) {
  .app-home .page-shell { width: calc(100% - 48px); }
  .hero-layout { gap: 26px; padding: 52px 0 62px; }
  .entry-screen .home-lead h2 { font-size: clamp(44px, 6vw, 64px); }
  .preview-card { padding: 18px; }
  .preview-brand { font-size: 9px; }
  .preview-translation p { font-size: 15px; }
  .account-area { gap: 14px; }
  .waveform { height: 90px; gap: 4px; }
}
@media (max-width: 740px) {
  .app-home .page-shell { width: calc(100% - 36px); padding-top: 16px; }
  .topbar { gap: 10px; padding-bottom: 18px; }
  .topbar h1 { font-size: 16px; }
  .topbar .eyebrow { font-size: 8px; }
  .brand-icon { width: 36px; height: 36px; }
  .nav-history { display: none; }
  .account-area { gap: 5px; }
  .account-area .button-secondary { padding: 10px 12px; font-size: 11px; }
  .hero-layout { grid-template-columns: 1fr; gap: 10px; padding: 42px 4px 52px; }
  .entry-screen .home-lead h2 { font-size: clamp(49px, 10vw, 72px); max-width: 550px; }
  .desktop-break { display: none; }
  .hero-description { max-width: 440px; font-size: 15px; margin-bottom: 24px; }
  .hero-kicker { margin-bottom: 20px; }
  .entry-actions { gap: 12px; }
  .entry-action, .entry-action:not(.entry-primary) { min-height: 50px; padding: 14px 17px; }
  .entry-action.text-entry { padding-inline: 4px; }
  .home-lead .language-note { font-size: 10px; margin-top: 18px; }
  .hero-visual { width: min(440px, 100%); margin: 20px auto 0; padding: 24px 12px 40px; }
  .preview-card { padding: 22px; }
  .preview-caption p { font-size: 29px; }
  .floating-label { right: 0; bottom: 10px; }
  .preview-brand { font-size: 10px; }
  .feature-strip { grid-template-columns: 1fr; gap: 26px; padding: 28px 4px; }
  .feature-strip h3 { font-size: 14px; }
  .feature-strip p { font-size: 12px; }
  .feature-number { min-width: 24px; }
  .home-footer { font-size: 9px; flex-wrap: wrap; gap: 10px; padding-inline: 4px; }
  .setup-screen, #text-screen { margin-top: 28px; }
  .setup-screen .drawer-section { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .topbar h1 { font-size: 13px; }
  .brand-icon { width: 30px; height: 30px; }
  .topbar .eyebrow { font-size: 7px; }
  .account-area .button-secondary { padding: 9px; }
  .preview-card { padding: 17px; }
  .preview-brand { font-size: 8px; }
  .entry-actions { gap: 8px; }
  .entry-action strong { font-size: 13px; }
  .entry-action.text-entry { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .motion-toggle { display: none !important; }
}
