/* Readby Design System — Moonlit Dreams Theme */

:root {
  /* Moonlit Dreams Palette */
  --primary: #F5D76E;
  --primary-light: rgba(245,215,110,0.15);
  --secondary: #C4B5E0;
  --secondary-light: #D4C8ED;
  --bg-dark: #0F0C29;
  --bg-mid: #1B1464;
  --bg-end: #24243E;
  --bg-light: #F0EBF4;
  --surface: rgba(255,255,255,0.08);
  --surface-solid: #1B1464;
  --surface-light: #F0EBF4;
  --accent: #F5D76E;
  --accent-hover: #F7E08A;
  --success: #7DFFC2;
  --error: #FF6B6B;
  --error-light: rgba(255,107,107,0.15);
  --info: #C4B5E0;
  --text-light: #F0EBF4;
  --text-muted: #7B6FA3;
  --text-dark: #1B1464;
  --text-dark-muted: #5B4E8A;
  --card-bg: rgba(255,255,255,0.08);
  --glass-border: rgba(196,181,224,0.12);
  --glass-blur: blur(10px);
  --glow-primary: 0 0 20px rgba(245,215,110,0.3);
  --glow-primary-strong: 0 0 30px rgba(245,215,110,0.5);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-light: 0 2px 12px rgba(0, 0, 0, 0.2);
  --transition: all 0.3s ease;
  --font: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Comfortaa', cursive;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Ensure all interactive elements inherit the font family */
button, input, select, textarea, a {
  font-family: inherit;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 50%, var(--bg-end) 100%);
  background-attachment: fixed;
  color: var(--text-light);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /* iOS safe area insets (notch, Dynamic Island) — bottom handled by .bottom-nav */
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ===== Screen-reader only text ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Skip to content link ===== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--secondary);
  color: var(--text-dark);
  padding: 8px 16px;
  z-index: 10000;
  font-weight: 700;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* ===== Focus styles for accessibility ===== */
:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[role="radio"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

/* ===== Splash Screen ===== */
.splash-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 100vh;
  background: radial-gradient(120% 90% at 50% 22%, #3a3f6e 0%, #1A1F3A 55%, #12162b 100%);
  animation: fadeIn 0.5s ease;
  position: relative;
  overflow: hidden;
}

.splash-screen::before {
  content: '';
  position: absolute;
  top: 18%; left: 50%;
  transform: translateX(-50%);
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(245,196,94,0.16) 0%, transparent 70%);
  pointer-events: none;
}

/* Starfield */
.splash-stars { position: absolute; inset: 0; pointer-events: none; }
.splash-stars i {
  position: absolute;
  background: #cdd3f0;
  border-radius: 50%;
  opacity: 0.7;
  animation: splashTwinkle 3s infinite ease-in-out;
}
@keyframes splashTwinkle {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.95; }
}

/* Glowing crescent moon */
.splash-moon {
  display: block;
  margin: 0 auto 20px;
  filter: drop-shadow(0 0 20px rgba(245,196,94,0.55));
  animation: splashFloat 3.2s ease-in-out infinite;
}
@keyframes splashFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .splash-moon, .splash-stars i { animation: none; }
}

.splash-content {
  text-align: center;
  animation: slideUp 0.8s ease;
  position: relative;
  z-index: 1;
}

.splash-icon {
  font-size: 80px;
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(245,215,110,0.5));
}

.splash-title {
  font-size: 42px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  text-shadow: 0 0 30px rgba(245,215,110,0.3);
}

.splash-subtitle {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 32px;
}

.splash-loader {
  width: 200px;
  height: 4px;
  background: rgba(196,181,224,0.15);
  border-radius: 4px;
  margin: 0 auto;
  overflow: hidden;
}

.splash-loader-bar {
  width: 40%;
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  animation: loading 1.5s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(245,215,110,0.4);
}

/* ===== Auth Screens ===== */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  background: linear-gradient(180deg, #0F0C29 0%, #1B1464 50%, #24243E 100%);
  padding: 24px;
  overflow-y: auto;
}

.auth-card {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  animation: slideUp 0.5s ease;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .auth-icon {
  font-size: 56px;
  margin-bottom: 12px;
}

.auth-header h1 {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary);
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Form Elements ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(15,12,41,0.6);
  border: 1.5px solid rgba(196,181,224,0.2);
  border-radius: var(--radius-md);
  color: var(--text-light);
  font-family: var(--font);
  font-size: 16px;
  transition: var(--transition);
  outline: none;
  min-height: 48px;
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-input:focus {
  border-color: var(--secondary);
  background: rgba(15,12,41,0.8);
  box-shadow: 0 0 10px rgba(196,181,224,0.15);
}

.form-input.error {
  border-color: var(--error);
}

.form-error {
  font-size: 13px;
  color: var(--error);
  margin-top: 6px;
  display: none;
}

.form-error.visible {
  display: block;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  min-height: 48px;
  text-decoration: none;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: #1B1464;
  width: 100%;
  font-family: var(--font-heading);
  font-weight: 700;
  box-shadow: var(--glow-primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--glow-primary-strong);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  width: 100%;
  font-family: var(--font-heading);
}

.btn-secondary:hover {
  background: rgba(245,215,110,0.1);
}

.btn-text {
  background: none;
  border: none;
  color: var(--secondary);
  font-weight: 600;
  padding: 8px;
  cursor: pointer;
  min-height: 48px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-text:hover {
  color: var(--secondary-light);
}

/* ===== Alert Messages ===== */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
  animation: fadeIn 0.3s ease;
}

.alert.visible {
  display: block;
}

.alert-error {
  background: rgba(224, 85, 85, 0.15);
  color: var(--error);
  border: 1px solid rgba(224, 85, 85, 0.3);
}

.alert-success {
  background: rgba(123, 196, 127, 0.15);
  color: var(--success);
  border: 1px solid rgba(123, 196, 127, 0.3);
}

/* ===== Auth Links (Forgot Password etc.) ===== */
.auth-links {
  text-align: right;
  margin-top: -8px;
  margin-bottom: 16px;
}

.forgot-password-link {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 0;
}

.forgot-password-link:hover {
  color: var(--secondary-light);
  text-decoration: underline;
}

/* ===== Auth Footer ===== */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-footer p {
  font-size: 14px;
  color: var(--text-muted);
}

.auth-footer a,
.auth-footer button {
  color: var(--secondary);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 4px;
}

.auth-footer a:hover,
.auth-footer button:hover {
  color: var(--secondary-light);
  text-decoration: underline;
}

/* ===== Social Login ===== */
.social-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
}

.social-divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.social-divider-text {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  white-space: nowrap;
}

.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn-social:active {
  transform: scale(0.98);
}

.btn-social .social-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Apple: black bg, white text (Apple HIG) */
.btn-apple {
  background: #000000;
  color: #FFFFFF;
}

.btn-apple:active {
  background: #222222;
}

/* Google: white bg, dark text (Google branding) */
.btn-google {
  background: #FFFFFF;
  color: #1F1F1F;
}

.btn-google:active {
  background: #E8E8E8;
}

.btn-social:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Onboarding ===== */
.onboarding-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  background: linear-gradient(180deg, #0F0C29 0%, #1B1464 50%, #24243E 100%);
  padding: 24px;
  overflow-y: auto;
}

.onboarding-card {
  text-align: center;
  max-width: 480px;
  width: 100%;
  animation: slideUp 0.5s ease;
}

.onboarding-icon {
  font-size: 100px;
  margin-bottom: 24px;
}

.onboarding-title {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary);
  margin-bottom: 16px;
}

.onboarding-text {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 40px;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.onboarding-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.onboarding-dot.active {
  background: var(--secondary);
  width: 28px;
  border-radius: 5px;
}

.onboarding-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.onboarding-actions .btn {
  min-width: 140px;
  width: auto;
}

/* ===== Main App Layout ===== */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.app-header {
  background: rgba(15,12,41,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  z-index: 100;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.app-header-logo {
  font-size: 24px;
  filter: drop-shadow(0 0 8px rgba(245,215,110,0.5));
}

.app-header-title {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-light);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== Notification Bell & Panel ===== */
.notification-bell {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  border-radius: 50%;
  width: 48px;
  height: 48px;
}

.notification-bell:hover {
  color: var(--primary);
  background: rgba(245,215,110,0.1);
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--error);
  color: white;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid rgba(15,12,41,0.8);
}

.notification-panel {
  /* Closed by default, opened by .is-open. Never toggled with an inline
     display: an inline style outranks this rule and would drop the panel back
     to block layout, which is exactly how the footer went missing. */
  display: none;
  position: fixed;
  top: 60px;
  right: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 480px;
  flex-direction: column;
  background: rgba(27,20,100,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 200;
  overflow: hidden;
  animation: slideUp 0.2s ease;
}

.notification-panel.is-open { display: flex; }

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.notification-panel-header h3 {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary);
}

.notification-panel-actions { display: flex; align-items: center; gap: 2px; }

.notification-panel-icon {
  background: none;
  border: none;
  color: rgba(240,235,244,0.7);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.notification-panel-icon:hover { color: var(--text-light); background: rgba(255,255,255,0.07); }

.notification-panel-list {
  overflow-y: auto;
  /* 0 0 auto, not 1 1 auto: with a list of items the panel is capped by
     max-height and this scrolls; when it's empty there is no free space to
     grow into and the panel simply shrinks to fit. */
  flex: 0 1 auto;
  min-height: 0;
  padding: 6px 0;
}
/* An empty feed needs no list padding on top of the empty state's own. A class
   rather than :has(), which needs iOS 15.4 while the app still targets 15.0 —
   layout shouldn't depend on a selector some users don't have. */
.notification-panel-list.is-empty { padding: 0; }

.notification-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 20px;
  transition: var(--transition);
  min-height: 48px;
}
/* Only rows that actually go somewhere invite a tap. */
.notification-item.notification-tappable { cursor: pointer; }

.notification-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.notification-item[data-recording-id]:hover {
  background: rgba(245, 196, 94, 0.1);
}

.notification-unread {
  background: rgba(245, 196, 94, 0.05);
  border-left: 3px solid var(--secondary);
}

/* Read items used to be dimmed wholesale to 0.7, which dragged body text to
   about 2.3:1 against the panel. Read state is now carried by the left bar
   alone, so an older notification is still legible. */
.notification-read {
  border-left: 3px solid transparent;
}
.notification-read .notification-title { color: rgba(240,235,244,0.82); }

.notification-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2px;
}

.notification-body {
  font-size: 13px;
  color: rgba(240,235,244,0.78);
  line-height: 1.4;
  margin-bottom: 4px;
}

.notification-time {
  font-size: 12px;
  color: rgba(240,235,244,0.6);
}

.notification-empty {
  text-align: center;
  padding: 22px 24px 24px;
}
.notification-empty-icon { font-size: 26px; margin-bottom: 8px; line-height: 1; }
.notification-empty-title { font-size: 15px; color: var(--text-light, #F0EBF4); margin: 0 0 3px; font-weight: 600; }
.notification-empty-sub { font-size: 13px; color: rgba(240,235,244,0.7); margin: 0; line-height: 1.4; max-width: 260px; margin-left: auto; margin-right: auto; }

.app-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 24px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* No bottom nav: content must clear the home-indicator safe area itself.
   Higher specificity so it holds across the phone/tablet padding overrides. */
.app-layout .app-content-nonav {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(15,12,41,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(196,181,224,0.1);
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  flex-shrink: 0;
  z-index: 100;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  cursor: pointer;
  transition: var(--transition);
  background: none;
  border: none;
  font-family: var(--font);
  color: var(--text-muted);
  text-decoration: none;
  min-height: 48px;
  min-width: 48px;
  position: relative;
}

.bottom-nav-item:hover {
  color: var(--text-light);
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(245,215,110,0.5);
}

.bottom-nav-icon {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.bottom-nav-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.bottom-nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Record FAB - raised golden circle button */
.nav-record {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-top: -28px;
  box-shadow: 0 0 24px rgba(245, 215, 110, 0.4);
  cursor: pointer;
  border: 3px solid rgba(15, 12, 41, 0.8);
  transition: all 0.3s;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-record:hover {
  box-shadow: 0 0 36px rgba(245, 215, 110, 0.6);
}

.nav-record.active {
  box-shadow: 0 0 32px rgba(245, 215, 110, 0.6);
}

/* ===== Home / Library ===== */
/* Legacy .library-tabs removed — now uses .pill-tabs */

.library-tab-panel {
  animation: fadeIn 0.3s ease;
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ===== Library Loading ===== */
.library-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 16px;
}

/* ===== Loading Indicator (API operations) ===== */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 16px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  position: relative;
}

.loading-spinner-circle {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(196,181,224,0.2);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: var(--text-muted);
  font-size: 15px;
  font-family: var(--font-primary);
  margin: 0;
  animation: fadeIn 0.3s ease;
}

/* Inline loading spinner for buttons/actions */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading .spinner {
  margin-right: 8px;
  vertical-align: middle;
}

/* ===== Book Cards (By Book tab) ===== */
.book-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.book-card {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.book-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(196,181,224,0.25);
}

.book-card-cover {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 10px;
}

.book-card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card-cover-placeholder {
  font-size: 48px;
  opacity: 0.5;
}

/* Title-card placeholder for cover-less books (see coverPlaceholder() in
   components.js). Fills its parent; the parent defines the shape/rounding. Hue
   comes from --tc-h so each title gets a consistent, distinct color. */
.cover-titlecard {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 12% 12%;
  text-align: center;
  background: linear-gradient(150deg,
    hsl(var(--tc-h, 260), 45%, 44%),
    hsl(calc(var(--tc-h, 260) + 34), 48%, 28%));
}
.cover-titlecard-label {
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  font-size: clamp(11px, 4.4vw, 22px);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.book-card-info {
  padding: 0;
}

.book-card-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-author {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-card-meta {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

/* ===== Book Detail Screen ===== */
.book-detail-screen {
  padding: 0 16px 24px;
}

.book-recordings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.book-recordings-head h3 { margin: 0; }
.book-record-btn {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  flex-shrink: 0;
}
.book-record-btn svg { flex-shrink: 0; }
.rec-sync-badge {
  color: var(--primary, #F5D76E);
  font-weight: 600;
}
.rec-sync-badge.rec-sync-failed { color: #E88; }
.upgrade-toast-btn {
  background: var(--primary, #F5D76E);
  color: #1A1F3A;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  flex-shrink: 0;
  cursor: pointer;
}

/* ===== Settings v2 — grouped cards ===== */
.set-profile-card { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 22px; }
.set-profile-info { flex: 1; min-width: 0; }
.set-profile-name { margin: 0; font-size: 18px; font-weight: 600; font-family: var(--font-heading, 'Comfortaa', sans-serif); color: var(--text-light, #F0EBF4); }
.set-profile-meta { margin: 3px 0 0; font-size: 13px; color: var(--text-muted, #7B6FA3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-edit-btn { flex-shrink: 0; background: none; border: none; color: var(--primary, #F5D76E); font-size: 14px; font-weight: 600; cursor: pointer; padding: 6px 8px; }

.set-groups { display: flex; flex-direction: column; gap: 20px; }
.set-label { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted, #7B6FA3); margin: 0 0 8px 6px; }
.set-card { background: var(--card-bg, rgba(255,255,255,0.06)); border-radius: 16px; overflow: hidden; }
.set-card-pad { padding: 14px 16px; }

.set-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 52px; }
.set-card > .set-row + .set-row { border-top: 0.5px solid rgba(255,255,255,0.07); }
.set-row-icon { width: 32px; height: 32px; border-radius: 9px; background: rgba(196,181,224,0.16); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.set-row-label { flex: 1; min-width: 0; font-size: 15px; color: var(--text-light, #F0EBF4); display: flex; flex-direction: column; }
.set-row-sub { font-size: 12px; color: var(--text-muted, #7B6FA3); margin-top: 2px; font-weight: 400; }
.set-row-value { font-size: 14px; color: var(--text-muted, #7B6FA3); display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.set-chevron { color: var(--text-muted, #7B6FA3); font-size: 22px; line-height: 1; opacity: .6; flex-shrink: 0; }
/* Count badge on a settings row (e.g. feedback waiting on the user's answer) */
.set-row-dot { flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--primary, #F5D76E); color: #1A1F3A; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.set-row.tappable { cursor: pointer; transition: background .15s ease; }
.set-row.tappable:active { background: rgba(255,255,255,0.05); }

.set-storage-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.set-storage-row .set-row-label { font-size: 14px; flex-direction: row; }

.set-account { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 4px; }

/* Keep the legacy expiry row consistent inside the plan card */
.set-card .settings-group-row { padding: 13px 16px; border-top: 0.5px solid rgba(255,255,255,0.07); display: flex; align-items: center; justify-content: space-between; }

/* ===== My feedback — what happened to what you sent ===== */
/* Only ever seen on a first-ever open: with a cache the list paints instantly. */
.mf-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 48px 24px; color: var(--text-muted, #7B6FA3); }
.mf-loading .loading-spinner-circle { width: 36px; height: 36px; }
.mf-status-note { font-size: 12px; color: var(--text-muted, #7B6FA3); margin: 0 4px 12px; }
.mf-list { display: flex; flex-direction: column; gap: 12px; }
.mf-card { background: var(--card-bg, rgba(255,255,255,0.06)); border-radius: 16px; padding: 14px 16px; }
/* Still on the phone, not on the server yet — dashed, so it reads as in-transit
   without shouting about a problem the user doesn't have. */
.mf-card-outbox { border: 1px dashed rgba(255,255,255,0.18); }
.mf-card-head { display: flex; align-items: flex-start; gap: 10px; }
/* Clamped: a queued card shows the user's own message, which can run long, and
   the card is an index entry rather than the message itself. */
.mf-card-title { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text-light, #F0EBF4); font-family: var(--font-heading, 'Comfortaa', sans-serif); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mf-card-meta { margin: 6px 0 0; font-size: 12px; color: var(--text-muted, #7B6FA3); }

.mf-badge { flex-shrink: 0; font-size: 11px; font-weight: 700; letter-spacing: .2px; padding: 4px 9px; border-radius: 999px; white-space: nowrap; background: rgba(196,181,224,0.16); color: var(--secondary, #C4B5E0); }
.mf-badge-needs_info { background: rgba(245,215,110,0.18); color: var(--primary, #F5D76E); }
.mf-badge-fix_on_the_way { background: rgba(196,181,224,0.2); color: var(--secondary, #C4B5E0); }
.mf-badge-shipped { background: rgba(125,255,194,0.16); color: var(--success, #7DFFC2); }
.mf-badge-closed { background: rgba(255,255,255,0.07); color: var(--text-muted, #7B6FA3); }
.mf-badge-sending,
.mf-badge-queued { background: rgba(255,255,255,0.07); color: var(--text-muted, #7B6FA3); }
.mf-badge-failed { background: rgba(255,107,107,0.16); color: #E88; }

/* Shipped only: the whole journey, as a small reward for having told us. */
.mf-timeline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; }
.mf-tl-step { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted, #7B6FA3); }
.mf-tl-step + .mf-tl-step::before { content: "›"; margin-right: 4px; opacity: .5; }
.mf-tl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--secondary, #C4B5E0); opacity: .5; flex-shrink: 0; }
.mf-tl-now { color: var(--success, #7DFFC2); font-weight: 600; }
.mf-tl-now .mf-tl-dot { background: var(--success, #7DFFC2); opacity: 1; }
.mf-tl-version { color: var(--text-muted, #7B6FA3); font-weight: 400; }

/* A question we asked. The only state where the user has to do something, so
   it's the loudest thing on the card. */
.mf-question { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(245,215,110,0.08); border: 1px solid rgba(245,215,110,0.2); }
.mf-question-label { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--primary, #F5D76E); }
.mf-question-text { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-light, #F0EBF4); }
.mf-reply-btn { margin-top: 10px; background: var(--primary, #F5D76E); color: #1A1F3A; border: none; border-radius: 10px; padding: 9px 18px; font-size: 14px; font-weight: 700; cursor: pointer; }
.mf-reply-btn:active { opacity: .85; }
.mf-reply-btn:disabled { opacity: .6; cursor: default; }
.mf-note { margin: 10px 0 0; font-size: 13px; color: var(--text-muted, #7B6FA3); line-height: 1.5; }
.mf-note-failed { color: #E88; }

/* ===== Book detail — list-first ===== */
.bookc-topbar { display: flex; align-items: center; gap: 10px; padding: 4px 0 16px; }
.bookc-topbar .btn-back { flex-shrink: 0; }
.bookc-cover-mini { width: 34px; height: 46px; border-radius: 6px; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg,#C4B5E0,#8f79bd); font-size: 16px; }
.bookc-cover-mini img { width: 100%; height: 100%; object-fit: cover; }
.bookc-cover-mini .book-detail-cover-placeholder { font-size: 16px; background: none; width: auto; height: auto; }
.bookc-titlewrap { flex: 1; min-width: 0; }
.bookc-title { margin: 0; font-size: 17px; font-weight: 600; font-family: var(--font-heading, 'Comfortaa', sans-serif); color: var(--text-light, #F0EBF4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bookc-author { margin: 1px 0 0; font-size: 12px; color: var(--text-muted, #7B6FA3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bookc-menu-wrap { position: relative; flex-shrink: 0; }
.bookc-menu-btn { background: none; border: none; color: var(--secondary, #C4B5E0); padding: 6px; cursor: pointer; display: flex; }
.bookc-menu { position: absolute; top: 40px; right: 0; z-index: 60; min-width: 158px; background: #1A152E; border: 0.5px solid rgba(255,255,255,0.12); border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.bookc-menu[hidden] { display: none; }
.bookc-menu-item { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text-light, #F0EBF4); font-size: 14px; padding: 13px 16px; cursor: pointer; }
.bookc-menu-item + .bookc-menu-item { border-top: 0.5px solid rgba(255,255,255,0.07); }
.bookc-menu-item:active { background: rgba(255,255,255,0.05); }
.bookc-menu-danger { color: #E88; }
.bookc-rec-label { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted, #7B6FA3); margin: 2px 0 10px 2px; }
.bookc-newrec { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; padding: 14px; border: 1px dashed rgba(255,255,255,0.22); border-radius: 14px; color: var(--primary, #F5D76E); font-size: 14px; font-weight: 500; text-decoration: none; }
.bookc-newrec:active { background: rgba(255,255,255,0.04); }
.bookc-newrec-plus { font-size: 20px; font-weight: 300; line-height: 1; }
.bookc-empty { text-align: center; color: var(--text-muted, #7B6FA3); font-size: 14px; padding: 14px 0; }
.book-recording-card .book-recording-info { flex: 1 1 auto; min-width: 0; }
.book-rec-play { margin-left: auto; color: var(--primary, #F5D76E); display: flex; align-items: center; flex-shrink: 0; padding-left: 8px; }
.book-rec-locked { color: var(--text-muted, #7B6FA3); }
.np-locked { text-align: center; padding: 6px 10px; }
.np-locked-title { font-family: var(--font-heading, 'Comfortaa', sans-serif); font-size: 16px; font-weight: 600; color: #fff; }
.np-locked-sub { font-size: 13px; color: var(--text-muted, #7B6FA3); margin: 6px 0 14px; line-height: 1.5; }
.np-locked-btn { width: auto; display: inline-flex; padding: 12px 24px; }

/* "Cancel anytime" reassurance captions */
.paywall-reassure { text-align: center; font-size: 12px; color: var(--text-muted, #7B6FA3); margin: 10px 0 0; }
.paywall-reassure::before { content: "✓ "; color: var(--primary, #F5D76E); font-weight: 700; }
.set-plan-note { font-size: 12px; color: var(--text-muted, #7B6FA3); margin: 8px 4px 0; }

/* Change-cover action sheet */
.cover-sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; align-items: flex-end; }
.cover-sheet { width: 100%; background: #1A152E; border-top-left-radius: 20px; border-top-right-radius: 20px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); }
.cover-sheet-title { text-align: center; font-size: 12px; color: var(--text-muted, #7B6FA3); padding: 8px 0 10px; }
.cover-sheet-item { display: block; width: 100%; text-align: center; background: rgba(255,255,255,0.06); border: none; color: var(--text-light, #F0EBF4); font-size: 15px; padding: 15px; border-radius: 12px; margin-bottom: 8px; cursor: pointer; }
.cover-sheet-item:active { background: rgba(255,255,255,0.1); }
.cover-sheet-danger { color: #E88; }
.cover-sheet-cancel { font-weight: 600; margin-top: 4px; }

/* Merge-book picker */
.merge-sheet { max-height: 74vh; display: flex; flex-direction: column; }
.merge-list { overflow-y: auto; max-height: 54vh; margin-bottom: 8px; }
.merge-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: rgba(255,255,255,0.06); border: none; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; color: var(--text-light, #F0EBF4); }
.merge-item:active { background: rgba(255,255,255,0.1); }
.merge-cover { width: 38px; height: 50px; border-radius: 6px; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg,#C4B5E0,#8f79bd); font-size: 18px; }
.merge-cover img { width: 100%; height: 100%; object-fit: cover; }
.merge-info { display: flex; flex-direction: column; min-width: 0; }
.merge-info .mt { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.merge-info .ma { font-size: 12px; color: var(--text-muted, #7B6FA3); }

/* ===== Your Plan page ===== */
.plan-hero { background: linear-gradient(135deg, rgba(245,215,110,0.18), rgba(196,181,224,0.12)); border: 0.5px solid rgba(245,215,110,0.35); border-radius: 16px; padding: 16px; margin-bottom: 20px; }
.plan-hero-row { display: flex; justify-content: space-between; align-items: center; }
.plan-hero-label { font-size: 12px; color: var(--primary, #F5D76E); font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.plan-badge { font-size: 11px; background: rgba(159,225,203,0.2); color: #9FE1CB; padding: 3px 10px; border-radius: 10px; }
.plan-hero-name { font-size: 22px; font-weight: 600; font-family: var(--font-heading, 'Comfortaa', sans-serif); margin-top: 6px; color: var(--text-light, #F0EBF4); }
.plan-hero-sub { font-size: 12px; color: #B9A8D8; margin-top: 2px; }
.plan-save-badge { font-size: 10px; background: var(--primary, #F5D76E); color: #1A1F3A; font-weight: 700; padding: 3px 8px; border-radius: 8px; flex-shrink: 0; }
.plan-reassure { text-align: center; font-size: 12px; color: var(--text-muted, #7B6FA3); margin: 20px 0 0; }
.plan-reassure::before { content: "✓ "; color: var(--primary, #F5D76E); font-weight: 700; }
.plan-legal { text-align: center; font-size: 11px; color: var(--text-muted, #7B6FA3); margin-top: 10px; display: flex; gap: 8px; justify-content: center; }
.plan-legal a { color: var(--secondary, #C4B5E0); text-decoration: none; }

.book-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--primary);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 4px;
  min-height: 48px;
  transition: var(--transition);
}

.back-btn:hover {
  color: var(--secondary-light);
}

.back-btn svg {
  width: 20px;
  height: 20px;
}

.edit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,215,110,0.12);
  border: 1px solid rgba(245,215,110,0.3);
  color: var(--primary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-height: 48px;
}

.edit-btn:hover {
  background: rgba(245, 196, 94, 0.2);
  border-color: var(--secondary);
}

.edit-btn svg {
  width: 16px;
  height: 16px;
}

.book-detail-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.delete-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(224, 85, 85, 0.12);
  border: 1px solid rgba(224, 85, 85, 0.3);
  color: var(--error);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-height: 48px;
}

.delete-btn:hover {
  background: rgba(224, 85, 85, 0.25);
  border-color: var(--error);
}

.delete-btn svg {
  width: 16px;
  height: 16px;
}

.book-detail-info {
  text-align: center;
  margin-bottom: 32px;
}

.book-detail-cover {
  width: 160px;
  height: 200px;
  margin: 0 auto 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.book-detail-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-detail-cover-placeholder {
  font-size: 64px;
}

.book-detail-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
}

.book-detail-author {
  font-size: 15px;
  color: var(--text-muted);
}

.book-edit-form {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.book-edit-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.book-edit-actions .btn {
  flex: 1;
}

.book-detail-recordings h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 12px;
}

.book-recordings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.book-recording-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.book-recording-card:hover {
  background: var(--primary-light);
}

.book-recording-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #C4B5E0, #7B6FA3);
  flex-shrink: 0;
}

.rec-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rec-avatar-placeholder {
  font-size: 14px;
  font-weight: 700;
  color: #F0EBF4;
}

.book-recording-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2px;
}

.book-recording-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.book-no-recordings {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}

.book-no-recordings p {
  margin-bottom: 12px;
}

.book-detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  gap: 16px;
}

.book-detail-loading .loading-spinner-circle {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(196,181,224,0.2);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

/* ===== Reader Cards (By Reader tab) ===== */
.reader-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reader-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-light);
}

.reader-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.reader-card-avatar {
  flex-shrink: 0;
}

.reader-card-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.reader-card-avatar-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C4B5E0, #7B6FA3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-light);
  box-shadow: 0 0 14px rgba(196,181,224,0.4);
  border: 2px solid rgba(245,215,110,0.3);
}

.reader-card-info {
  flex: 1;
  min-width: 0;
}

.reader-card-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2px;
}

.reader-card-relation {
  font-size: 13px;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 2px;
}

.reader-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Reader Detail View (filtered by reader) ===== */
.reader-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-family: inherit;
  min-height: 48px;
  min-width: 48px;
}

.reader-back-btn:hover {
  background: var(--surface);
  color: var(--text-light);
}

.reader-back-btn:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

.reader-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.reader-detail-avatar {
  flex-shrink: 0;
}

.reader-detail-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2px;
}

.reader-detail-relation {
  font-size: 13px;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 2px;
}

.reader-detail-count {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Recording Cards (Recent tab) ===== */
.recording-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Date group headers for Recent tab */
.recording-date-group {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 4px 4px;
  margin-top: 4px;
}

.recording-date-group:first-child {
  margin-top: 0;
  padding-top: 0;
}

.recording-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
}

.recording-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.recording-card-cover {
  flex-shrink: 0;
  width: 50px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
}

.recording-card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recording-card-cover-placeholder {
  font-size: 28px;
  opacity: 0.5;
}

.recording-card-info {
  flex: 1;
  min-width: 0;
}

.recording-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recording-card-reader {
  font-size: 13px;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recording-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Now Playing Indicator ===== */
.recording-card.now-playing {
  border: 2px solid var(--primary);
  position: relative;
}

.recording-card.now-playing-active {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(245,215,110,0.3);
}

.now-playing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.now-playing-indicator.playing {
  color: var(--secondary);
  background: rgba(245, 196, 94, 0.15);
}

.now-playing-indicator.paused {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
}

.now-playing-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.now-playing-bar {
  display: inline-block;
  width: 3px;
  background: currentColor;
  border-radius: 1px;
  transform-origin: bottom;
}

/* Animated bars when playing */
.now-playing-indicator.playing .now-playing-bar:nth-child(1) {
  animation: nowPlayingBar 0.8s ease-in-out infinite alternate;
  height: 4px;
}
.now-playing-indicator.playing .now-playing-bar:nth-child(2) {
  animation: nowPlayingBar 0.8s ease-in-out 0.2s infinite alternate;
  height: 8px;
}
.now-playing-indicator.playing .now-playing-bar:nth-child(3) {
  animation: nowPlayingBar 0.8s ease-in-out 0.4s infinite alternate;
  height: 6px;
}

/* Static bars when paused */
.now-playing-indicator.paused .now-playing-bar:nth-child(1) {
  height: 4px;
}
.now-playing-indicator.paused .now-playing-bar:nth-child(2) {
  height: 6px;
}
.now-playing-indicator.paused .now-playing-bar:nth-child(3) {
  height: 4px;
}

@keyframes nowPlayingBar {
  0% { height: 3px; }
  100% { height: 12px; }
}

.now-playing-label {
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* ===== User Avatar ===== */
.user-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C4B5E0, #7B6FA3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #F0EBF4;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(196,181,224,0.4);
  border: 2px solid rgba(245,215,110,0.3);
  text-decoration: none;
}
.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Unified Page Title ===== */
.page-title-block {
  margin-bottom: 16px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2px;
}

.page-title .moon-glow {
  filter: drop-shadow(0 0 6px rgba(245,215,110,0.5));
}

.page-title .sparkle {
  color: var(--secondary);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== Pill Tabs ===== */
.pill-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.pill-tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(196,181,224,0.1);
  color: var(--text-muted);
  min-height: 36px;
}

.pill-tab.active {
  background: rgba(245,215,110,0.15);
  color: var(--primary);
  border-color: rgba(245,215,110,0.3);
}

.pill-tab:hover:not(.active) {
  color: var(--text-light);
}

/* ===== Home FAB ===== */
.home-fab {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 400;
  color: var(--bg-mid);
  cursor: pointer;
  box-shadow: 0 0 24px rgba(245,215,110,0.5);
  z-index: 15;
  text-decoration: none;
  transition: all 0.3s;
}

.home-fab:hover {
  box-shadow: 0 0 36px rgba(245,215,110,0.6);
  transform: scale(1.05);
}

/* ===== Loading Spinner ===== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes loading {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(150%); }
  100% { transform: translateX(400%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .auth-card {
    padding: 32px 24px;
  }

  .splash-title {
    font-size: 36px;
  }

  .onboarding-title {
    font-size: 26px;
  }

  .onboarding-icon {
    font-size: 72px;
  }
}

/* ===== Password Strength ===== */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.password-strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.password-strength-bar.weak { background: var(--error); }
.password-strength-bar.medium { background: var(--secondary); }
.password-strength-bar.strong { background: var(--success); }

.password-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ===== Screen Header (Back button + Title) ===== */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.screen-title {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-light);
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  width: 36px;
  height: 36px;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
}

/* ===== Add Book Screen ===== */
.add-book-screen {
  animation: fadeIn 0.3s ease;
}

.add-book-options {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.add-book-option {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  color: var(--text-muted);
}

.add-book-option:hover:not(:disabled) {
  border-color: rgba(196,181,224,0.25);
  color: var(--text-light);
}

.add-book-option.active {
  border-color: rgba(245,215,110,0.3);
  color: var(--primary);
  background: rgba(245,215,110,0.08);
}

.add-book-option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.add-book-option-icon {
  font-size: 18px;
}

.add-book-option-label {
  font-size: 13px;
  font-weight: 600;
}

/* Compact form overrides for add-book */
.add-book-screen .form-group {
  margin-bottom: 12px;
}
.add-book-screen .form-group label {
  font-size: 11px;
  margin-bottom: 5px;
}
.add-book-screen .form-input {
  padding: 10px 14px;
  min-height: 40px;
  font-size: 15px;
}

.add-book-form {
  animation: slideUp 0.3s ease;
}

/* ISBN Scan Section */
.isbn-scan-section {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  animation: slideUp 0.3s ease;
}

.isbn-input-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}

.isbn-input-row {
  display: flex;
  gap: 8px;
}

.isbn-input-row .form-input {
  flex: 1;
  min-width: 0;
}

.isbn-lookup-btn {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px !important;
  font-size: 14px !important;
  flex-shrink: 0;
  width: auto !important;
}

.isbn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.isbn-result {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.isbn-result-content {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.isbn-result-cover {
  flex-shrink: 0;
  width: 80px;
  height: 110px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.isbn-result-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.isbn-result-cover-placeholder {
  font-size: 32px;
  opacity: 0.5;
}

.isbn-result-info {
  flex: 1;
  min-width: 0;
}

.isbn-result-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
  line-height: 1.3;
}

.isbn-result-author {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.isbn-result-isbn {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.7;
  font-family: monospace;
}

.isbn-use-btn {
  width: 100%;
}

/* Cover Preview Section */
.cover-preview-section {
  margin-bottom: 16px;
}

.cover-preview-section label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}

.cover-preview {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.cover-preview-img {
  width: 80px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.cover-remove-btn {
  font-size: 13px;
  color: var(--error);
  padding: 4px 0;
}

.cover-remove-btn:hover {
  text-decoration: underline;
}

/* Cover Photo Upload Area */
.cover-upload-area {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.cover-upload-area:hover {
  border-color: var(--secondary);
}

.cover-upload-prompt {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  position: relative;
}

.cover-upload-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.cover-upload-text {
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 1px;
}

.cover-upload-hint {
  color: var(--text-muted);
  font-size: 11px;
}

.cover-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.cover-upload-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.cover-upload-preview .cover-preview-img {
  width: 100px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

.cover-preview-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cover-change-btn {
  font-size: 14px;
  color: var(--secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  min-height: 48px;
  display: flex;
  align-items: center;
  font-family: inherit;
}

.cover-change-btn:hover {
  text-decoration: underline;
}

.cover-upload-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== Record Screen ===== */
.record-screen {
  animation: fadeIn 0.3s ease;
}

.record-instruction {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 16px;
}

.record-empty {
  padding: 20px 0;
}

/* Tier Usage Strip */
.tier-usage-strip {
  margin-bottom: 14px;
}
.tier-usage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.tier-usage-dots {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--primary);
  opacity: 0.8;
}
.tier-upgrade-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.tier-upgrade-link:hover {
  opacity: 1;
}
.tier-usage-track {
  height: 2px;
  background: rgba(196,181,224,0.12);
  border-radius: 1px;
  overflow: hidden;
}
.tier-usage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 1px;
  transition: width 0.4s ease;
  box-shadow: 0 0 6px rgba(245,215,110,0.3);
}

/* Book Selection List */
.book-select-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.book-select-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
}

.book-select-item:hover {
  border-color: rgba(245,215,110,0.3);
  transform: translateY(-1px);
}

.book-select-cover {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
}

.book-select-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-select-cover-placeholder {
  font-size: 24px;
  opacity: 0.5;
}

.book-select-info {
  flex: 1;
  min-width: 0;
}

.book-select-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2px;
}

.book-select-author {
  font-size: 13px;
  color: var(--text-muted);
}

/* Recording UI */
.recording-ui {
  text-align: center;
  padding: 20px 0;
}

.recording-book-info {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 32px;
  text-align: left;
}

.recording-book-cover {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
}

.recording-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recording-book-cover-placeholder {
  font-size: 32px;
  opacity: 0.5;
}

.recording-book-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
}

.recording-book-author {
  font-size: 14px;
  color: var(--text-muted);
}

.recording-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.recording-timer {
  font-size: 48px;
  font-weight: 700;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  transition: color 0.3s ease;
}

.recording-timer-max {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
}

.recording-timer.timer-warning {
  color: var(--secondary);
}

.recording-timer.timer-critical {
  color: var(--error);
  animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.recording-time-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
  margin-top: 4px;
  padding: 6px 14px;
  background: rgba(245, 196, 94, 0.12);
  border-radius: 20px;
}

.recording-time-warning.time-warning-critical {
  color: var(--error);
  background: rgba(224, 85, 85, 0.15);
  animation: timer-pulse 1s ease-in-out infinite;
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 16px;
  background: rgba(201, 68, 50, 0.1);
  border-radius: 20px;
}

.recording-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  animation: recording-dot-pulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(201, 68, 50, 0.6);
  flex-shrink: 0;
}

@keyframes recording-dot-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 8px rgba(201, 68, 50, 0.6);
  }
  50% {
    transform: scale(1.3);
    opacity: 0.7;
    box-shadow: 0 0 16px rgba(201, 68, 50, 0.9), 0 0 32px rgba(201, 68, 50, 0.3);
  }
}

.recording-dot.paused {
  background: var(--secondary);
  animation: none;
  box-shadow: 0 0 6px rgba(245, 196, 94, 0.4);
}

.recording-buttons {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
}

.btn-record {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: white;
  box-shadow: 0 4px 20px rgba(201, 68, 50, 0.4);
}

.btn-record:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(201, 68, 50, 0.5);
}

.btn-record-action {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-light);
}

.btn-record-action:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.btn-record-stop {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--error);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: white;
}

.btn-record-stop:hover {
  transform: scale(1.05);
  background: var(--error);
}

/* Page Turn Section */
/* "Record / Tap to start" label under the round button, and the one-time
   first-time guide. Both belong to the idle state and are hidden on record. */
.record-cta-label {
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
  margin-top: 12px;
  line-height: 1.25;
}
.record-cta-label span {
  display: block;
  font-family: var(--font);
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
}
.record-guide {
  width: 100%;
  max-width: 340px;
  margin: 22px auto 0;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  text-align: left;
}
.record-guide-h {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 10px;
}
.record-tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-light);
  margin-bottom: 9px;
}
.record-tip:last-child { margin-bottom: 0; }
.record-tip .rt-i { flex-shrink: 0; font-size: 15px; line-height: 1.3; }
.record-tip .rt-muted { color: var(--text-muted); }
.record-tip .rt-opt {
  color: var(--secondary);
  font-weight: 700;
}
.record-tip b { color: var(--secondary); font-weight: 700; }

.page-turn-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 320px;
}

.btn-page-turn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--surface);
  border: 2px solid var(--secondary);
  border-radius: var(--radius-md);
  color: var(--secondary);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  min-height: 52px;
  width: 100%;
}

.btn-page-turn:hover {
  background: rgba(245, 196, 94, 0.12);
  transform: translateY(-1px);
}

.btn-page-turn:active {
  transform: scale(0.97);
}

.btn-page-turn.page-turn-pulse {
  background: rgba(245, 196, 94, 0.2);
  border-color: var(--secondary-light);
  transform: scale(1.02);
}

.btn-page-turn svg {
  fill: currentColor;
}

.page-turn-counter {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.page-turn-feedback {
  position: relative;
}

.page-turn-badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(245, 196, 94, 0.15);
  color: var(--secondary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
}

.page-turn-feedback.page-turn-animate .page-turn-badge {
  animation: pageTurnFade 1.5s ease forwards;
}

@keyframes pageTurnFade {
  0% { opacity: 0; transform: translateY(5px); }
  15% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* Preview Markers */
.preview-markers {
  font-size: 14px;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 8px;
}

/* Preview Screen */
.preview-screen {
  animation: fadeIn 0.3s ease;
}

.preview-player {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.preview-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 8px;
}

.preview-duration {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.preview-player audio {
  border-radius: var(--radius-sm);
}

.preview-actions {
  display: flex;
  flex-direction: column;
}

/* ===== Playback Screen ===== */
.playback-screen {
  animation: fadeIn 0.3s ease;
}

.playback-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}

.playback-cover {
  width: 240px;
  height: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  margin-bottom: 32px;
}

.playback-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playback-cover-placeholder {
  font-size: 80px;
  opacity: 0.5;
}

.playback-info {
  text-align: center;
  margin-bottom: 32px;
}

.playback-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 6px;
}

.playback-reader {
  font-size: 15px;
  color: var(--secondary);
  font-weight: 600;
}

/* Progress / Scrub bar */
.playback-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 24px;
}

.playback-time {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: center;
}

.playback-scrub-container {
  flex: 1;
  position: relative;
  height: 32px;
  display: flex;
  align-items: center;
}

.playback-scrub-track {
  position: absolute;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  pointer-events: none;
}

.playback-scrub-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.playback-scrub-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(245,215,110,0.4);
  pointer-events: none;
  transition: left 0.1s linear;
  /* Above the page-turn ticks, so the playhead is never drawn over. */
  z-index: 4;
}

/* Page-turn ticks on the scrub bar.
   These are <button>s, so padding/border/appearance MUST be reset — a bare
   6x6 button inherits the UA's default padding and renders as a squashed
   oval, which is what this used to look like.
   The element itself is a 16px-wide invisible hit target; the visible tick is
   the 2px ::after. It sits above .playback-scrub-input (the transparent range
   that captures scrub drags), otherwise taps never reach it. */
.playback-marker-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 22px;
  padding: 0;
  border: none;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  z-index: 3;
}

.playback-marker-dot::after {
  content: '';
  display: block;
  width: 2px;
  height: 12px;
  border-radius: 1px;
  /* Translucent black notches the bar in both states: it reads as a gap in
     the gold fill and a gap in the grey track, over any background. */
  background: rgba(0, 0, 0, 0.55);
  transition: height 0.12s ease, background 0.12s ease;
}

.playback-marker-dot:active::after,
.playback-marker-dot:focus-visible::after {
  height: 16px;
  background: var(--primary);
}

.playback-scrub-input {
  position: absolute;
  width: 100%;
  height: 32px;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 24px;
}

.playback-btn-main {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: white;
  box-shadow: 0 4px 20px rgba(201, 68, 50, 0.4);
}

.playback-btn-main:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(201, 68, 50, 0.5);
}

.playback-btn-main svg {
  fill: white;
}

/* Playback Speed Controls */
.playback-speed-section {
  margin-top: 16px;
  text-align: center;
}

.playback-speed-buttons {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.speed-btn {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.speed-btn:hover {
  border-color: var(--secondary);
  color: var(--text-light);
}

.speed-btn.active {
  background: var(--secondary);
  color: var(--bg-dark);
  border-color: var(--secondary);
  font-weight: 700;
}

.playback-speed-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 0;
}

/* Display Mode Switcher */
.playback-display-mode-switcher {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.display-mode-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.display-mode-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.05);
}

.display-mode-btn.active {
  border-color: var(--secondary);
  color: var(--secondary);
  background: rgba(245, 196, 94, 0.1);
}

.display-mode-btn svg {
  fill: currentColor;
}

/* Display Container with smooth transitions */
.playback-display-container {
  min-height: 0;
  transition: opacity 0.2s ease, min-height 0.3s ease;
  opacity: 1;
}

.playback-display-container.transitioning {
  opacity: 0;
}

/* When minimal mode is active, container collapses smoothly */
.playback-display-container:empty {
  min-height: 0;
  margin-bottom: 0;
}

.playback-display-container:not(:empty) {
  margin-bottom: 0;
}

/* Reader photo initials fallback */
.playback-reader-initials {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.playback-initials-text {
  font-size: 72px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font);
}

/* ===== Sleep Timer ===== */
.sleep-timer-section {
  margin-top: 20px;
}

.sleep-timer-btn {
  color: var(--text-muted);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  min-height: 48px;
}

.sleep-timer-btn:hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.05);
}

.sleep-timer-btn.sleep-timer-active {
  color: var(--secondary);
  border-color: var(--secondary);
  background: rgba(245, 196, 94, 0.1);
}

.sleep-timer-countdown {
  font-size: 12px;
  color: var(--secondary);
  margin-top: 6px;
  font-weight: 600;
}

.sleep-timer-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ===== Ambience Mixer ===== */
.ambience-mixer-section {
  margin-top: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ambience-mixer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ambience-mixer-icon {
  font-size: 18px;
}

.ambience-mixer-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
}

.ambience-track-selector {
  margin-bottom: 16px;
}

.ambience-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-light);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  min-height: 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23999'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.ambience-select:focus {
  outline: none;
  border-color: var(--secondary);
}

.ambience-select option {
  background: var(--bg-card);
  color: var(--text-light);
}

.ambience-volume-mixer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.volume-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.volume-label {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 100px;
  white-space: nowrap;
}

.volume-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--secondary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 196, 94, 0.3);
}

.volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--secondary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(245, 196, 94, 0.3);
}

.narration-volume-slider::-webkit-slider-thumb {
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(201, 68, 50, 0.3);
}

.narration-volume-slider::-moz-range-thumb {
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(201, 68, 50, 0.3);
}

.volume-value {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ambience-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  min-height: 48px;
}

.ambience-save-btn:hover {
  color: var(--secondary);
  border-color: var(--secondary);
  background: rgba(245, 196, 94, 0.05);
}

/* ===== Family Screen ===== */
/* Family header now uses .page-title-block pattern */

/* Family Sections */
.family-section {
  margin-bottom: 24px;
}

.family-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 13px;
}

/* Family Card */
.family-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.family-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: var(--transition);
  animation: fadeIn 0.3s ease;
}

.family-card:hover {
  box-shadow: var(--shadow-light);
}

.family-card.pending-invite {
  border-left: 3px solid var(--secondary);
}

.family-card.sent-invite {
  opacity: 0.8;
}

.family-card-avatar {
  flex-shrink: 0;
}

.family-avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C4B5E0, #7B6FA3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #F0EBF4;
}

.family-avatar-circle.connected-avatar {
  background: var(--primary-light);
  color: var(--success);
}

.family-avatar-circle.sent-avatar {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.family-avatar-circle.declined-avatar {
  background: rgba(229, 111, 111, 0.15);
  color: var(--error);
}

.family-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.family-card-info {
  flex: 1;
  min-width: 0;
}

.family-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.family-card-relation {
  font-size: 13px;
  color: var(--secondary);
  font-weight: 600;
}

.family-card-email {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.family-card-status {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.status-connected {
  color: var(--success);
}

.status-pending {
  color: var(--secondary);
}

.status-declined {
  color: var(--error, #E56F6F);
}

.declined-avatar {
  background: var(--error, #E56F6F) !important;
  opacity: 0.7;
}

.declined-invite {
  opacity: 0.75;
}

.family-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-accept {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-accept:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(123, 196, 127, 0.4);
}

.btn-decline {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(224, 85, 85, 0.15);
  color: var(--error);
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-decline:hover {
  background: rgba(224, 85, 85, 0.3);
}

.btn-remove {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-remove:hover {
  background: rgba(224, 85, 85, 0.15);
  color: var(--error);
}

/* Family Invite Modal */
.family-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.family-modal {
  background: rgba(27,20,100,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s ease;
  overflow: hidden;
}

.family-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.family-modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary);
}

.family-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: var(--transition);
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.family-modal-close:hover {
  color: var(--text-light);
}

.family-modal-body {
  padding: 16px 24px;
}

.family-modal-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.family-modal-actions {
  display: flex;
  gap: 12px;
  padding: 0 24px 24px;
}

.family-modal-actions .btn {
  flex: 1;
}

/* ===== Milestones Section ===== */
.milestones-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.milestones-empty {
  text-align: center;
  padding: 24px 16px;
}

.milestones-empty-text {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.milestone-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(245,215,110,0.15);
  transition: var(--transition);
}

.milestone-card:hover {
  border-color: rgba(245,215,110,0.3);
  box-shadow: 0 4px 12px rgba(245,215,110,0.1);
}

.milestone-avatar {
  flex-shrink: 0;
}

.milestone-info {
  flex: 1;
  min-width: 0;
}

.milestone-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.milestone-relation {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.milestone-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.milestone-stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.milestone-stat-number {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.milestone-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.milestone-stat-divider {
  color: var(--text-muted);
  font-size: 16px;
}

.milestone-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  background: rgba(245, 196, 94, 0.15);
  color: var(--secondary);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Settings Screen */
.settings-header {
  margin-bottom: 24px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Grouped glass card container */
.settings-group {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 2px 14px;
}

.settings-group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  cursor: pointer;
  transition: var(--transition);
}

.settings-group-row + .settings-group-row {
  border-top: 1px solid rgba(196, 181, 224, 0.1);
}

.settings-group-row:hover {
  opacity: 0.85;
}

/* Legacy .settings-item kept for modals that still use it */
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
}

.settings-item:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(196,181,224,0.2);
}

.settings-item-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
}

.settings-item-value {
  font-size: 14px;
  color: var(--text-muted);
}

/* Pill tab selectors (quality) */
.settings-pill-tabs {
  display: flex;
  gap: 6px;
}

.settings-pill {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.settings-pill:hover {
  background: rgba(255, 255, 255, 0.1);
}

.settings-pill.active {
  background: rgba(245, 215, 110, 0.15);
  color: var(--primary);
}

/* Sign Out outline button */
.settings-signout-btn {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 14px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 12px;
}

.settings-signout-btn:hover {
  background: rgba(245, 215, 110, 0.08);
}

/* Delete Account text link */
.settings-delete-link {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
  transition: var(--transition);
}

.settings-delete-link:hover {
  color: var(--error);
}

/* Version footer */
.settings-version {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 16px;
  opacity: 0.6;
}

.settings-danger {
  color: var(--error);
}

/* ===== Profile Setup Screen ===== */
.profile-setup-card {
  max-width: 480px;
}

.profile-back-row {
  margin-bottom: 8px;
  text-align: left;
}

.avatar-upload-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}

.avatar-upload {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  outline: none;
}

.avatar-upload:focus .avatar-upload-preview {
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(245, 196, 94, 0.15);
}

.avatar-upload-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 3px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: var(--transition);
}

.avatar-upload:hover .avatar-upload-preview {
  border-color: var(--secondary);
  background: rgba(255, 255, 255, 0.12);
}

.avatar-upload-placeholder {
  font-size: 36px;
}

.avatar-upload-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-label {
  font-size: 13px;
  color: var(--secondary);
  font-weight: 600;
}

/* Relation Grid */
.relation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.relation-chip {
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.relation-chip:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.1);
}

.relation-chip.active {
  border-color: rgba(245,215,110,0.3);
  color: var(--primary);
  background: rgba(245,215,110,0.1);
}

/* ===== Settings Profile Card ===== */
.settings-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.settings-avatar {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C4B5E0, #7B6FA3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.settings-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-avatar-initials {
  font-size: 24px;
  font-weight: 700;
  color: #F0EBF4;
}

.settings-profile-info {
  flex: 1;
  min-width: 0;
}

.settings-profile-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-profile-relation {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-profile-email {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  padding-left: 2px;
}

@media (max-width: 480px) {
  .relation-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .relation-chip {
    padding: 10px 6px;
    font-size: 13px;
  }

  .avatar-upload-preview {
    width: 80px;
    height: 80px;
  }
}

/* ======================== */
/* Sync Status Badges       */
/* ======================== */

.sync-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.sync-status-badge.sync-pending {
  background: rgba(245, 196, 94, 0.2);
  color: var(--secondary);
}

.sync-status-badge.sync-uploading {
  background: rgba(123, 159, 224, 0.2);
  color: var(--info);
  animation: syncPulse 1.5s ease-in-out infinite;
}

.sync-status-badge.sync-failed {
  background: rgba(229, 111, 111, 0.2);
  color: var(--error);
}

.sync-status-badge.sync-synced {
  background: rgba(123, 196, 127, 0.2);
  color: var(--success);
}

@keyframes syncPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Offline indicator banner */
.offline-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(245, 196, 94, 0.15);
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid rgba(245, 196, 94, 0.3);
}

.offline-banner.hidden {
  display: none;
}

/* Paywall / Upgrade Prompt */
.paywall-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
  max-width: 420px;
  margin: 0 auto;
}

.paywall-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.paywall-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 12px;
}

.paywall-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 28px;
}

.paywall-plans {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-bottom: 8px;
}

.paywall-plan {
  flex: 1;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: var(--transition);
}

.paywall-plan:hover {
  border-color: rgba(245,215,110,0.3);
}

.paywall-plan-featured {
  border-color: rgba(245,215,110,0.4);
  background: rgba(245,215,110,0.08);
}

.paywall-plan-badge {
  position: absolute;
  top: -10px;
  background: var(--secondary);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.paywall-plan-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  margin-top: 4px;
}

.paywall-plan-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--secondary);
}

.paywall-plan-savings {
  font-size: 11px;
  color: var(--success);
  font-weight: 600;
}

/* ===== Recording Mode Toggle ===== */
.record-mode-toggle {
  display: flex;
  gap: 12px;
  justify-content: center;
  max-width: 400px;
  margin: 0 auto;
}

.record-mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  position: relative;
}

.record-mode-btn:hover:not(.mode-locked) {
  border-color: rgba(196,181,224,0.25);
  color: var(--text-light);
}

.record-mode-btn.active {
  border-color: rgba(245,215,110,0.3);
  color: var(--primary);
  background: rgba(245,215,110,0.08);
}

.record-mode-btn.mode-locked {
  opacity: 0.6;
  cursor: pointer;
}

.record-mode-btn svg {
  fill: currentColor;
}

.mode-premium-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--secondary);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 10px;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ===== Recording Quality Selector ===== */
.record-quality-selector {
  display: flex;
  gap: 12px;
  justify-content: center;
  max-width: 400px;
  margin: 0 auto;
}

.record-quality-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 12px;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  color: var(--text-muted);
}

.record-quality-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-light);
}

.record-quality-btn.active {
  border-color: var(--secondary);
  color: var(--secondary);
  background: rgba(245, 196, 94, 0.08);
}

.record-quality-btn .quality-label {
  font-size: 15px;
  font-weight: 700;
}

.record-quality-btn .quality-desc {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.7;
}

/* ===== Recording Type Badge ===== */
.recording-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.recording-type-badge.type-audio {
  background: rgba(123, 196, 127, 0.15);
  color: var(--success);
}

.recording-type-badge.type-video {
  background: rgba(123, 159, 224, 0.15);
  color: var(--info);
}

/* ===== Video Preview Container ===== */
.video-preview-container {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto 20px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

.video-preview-element {
  width: 100%;
  display: block;
  border-radius: var(--radius-lg);
  transform: scaleX(-1); /* Mirror the front camera */
}

.video-recording-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(224, 85, 85, 0.85);
  color: white;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  z-index: 10;
}

.video-recording-badge .recording-dot {
  width: 8px;
  height: 8px;
  background: white;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  animation: video-badge-dot-pulse 1.2s ease-in-out infinite;
}

@keyframes video-badge-dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* ===== Video Compression Status ===== */
.compression-status {
  margin: 12px 0;
  padding: 12px 16px;
  background: rgba(245, 196, 94, 0.08);
  border: 1px solid rgba(245, 196, 94, 0.2);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-muted);
}

.compression-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--secondary);
}

.compression-complete {
  color: var(--success, #4ade80);
  font-weight: 600;
}

.spinner-small {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(245, 196, 94, 0.3);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== Ambience Library ===== */
.ambience-screen .screen-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.ambience-premium-banner {
  background: rgba(245, 196, 94, 0.08);
  border: 1px solid rgba(245, 196, 94, 0.2);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  text-align: center;
}

.ambience-premium-banner span {
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
}

.ambience-premium-banner p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 6px 0 12px;
}

.ambience-premium-banner .btn-small {
  padding: 8px 20px;
  font-size: 13px;
}

.ambience-categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
}

.ambience-category-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  min-height: 48px;
}

.ambience-category-tab:hover {
  color: var(--text-light);
  background: var(--primary-light);
}

.ambience-category-tab.active {
  background: rgba(245, 196, 94, 0.12);
  color: var(--secondary);
  border-color: var(--secondary);
}

.ambience-cat-icon {
  font-size: 16px;
}

.ambience-track-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ambience-track-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
}

.ambience-track-card:hover {
  background: var(--primary-light);
}

.ambience-track-card.playing {
  border-color: var(--secondary);
  background: rgba(245, 196, 94, 0.06);
}

.ambience-track-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.ambience-track-info {
  flex: 1;
  min-width: 0;
}

.ambience-track-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0;
}

.ambience-track-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.ambience-preview-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 196, 94, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.ambience-preview-btn:hover {
  background: rgba(245, 196, 94, 0.2);
  transform: scale(1.1);
}

.ambience-preview-btn.playing {
  background: var(--secondary);
  color: var(--primary);
  animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 196, 94, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(245, 196, 94, 0); }
}

/* ===== Full Paywall Screen ===== */
.paywall-screen {
  flex: 1;
  min-height: 0;
  background: var(--background);
  display: flex;
  flex-direction: column;
  position: relative;
  /* Scroll the WHOLE screen as one column. Previously the body scrolled but the
     pricing/CTA/disclaimer lived in a pinned, non-scrolling footer — on a short
     screen (iPhone 13 mini) that footer overflowed and the disclaimer at its
     bottom was unreachable. One scroll region guarantees everything is. */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.paywall-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
}

.paywall-close-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-light);
}

.paywall-body {
  /* Natural height so it flows within the single screen scroll (see
     .paywall-screen). justify-content:center used to clip the top of tall
     content in a flex scroll container. */
  flex: 0 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.paywall-header {
  text-align: center;
  padding: 16px 0 12px;
}

.paywall-hero-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.paywall-hero-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-light);
  margin-bottom: 4px;
  font-family: var(--font-heading);
}

.paywall-hero-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Premium perks list */
.paywall-perks {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 8px;
}

.paywall-perk {
  display: flex;
  align-items: center;
  gap: 12px;
}

.perk-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(245, 215, 110, 0.1);
  font-size: 15px;
  flex-shrink: 0;
}

.perk-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.3;
}
.perk-text strong {
  color: var(--text-light);
  font-weight: 600;
}

/* Bottom pinned section: pricing + CTA */
.paywall-bottom {
  flex-shrink: 0;
  padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent 0%, rgba(15,12,41,0.95) 20%);
}

.paywall-plan-cards {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.paywall-plan-card {
  flex: 1;
  background: var(--card-bg);
  border: 1.5px solid rgba(196,181,224,0.12);
  border-radius: 14px;
  padding: 12px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.paywall-plan-card:hover {
  border-color: rgba(245, 196, 94, 0.4);
}

.paywall-plan-card.selected {
  border-color: var(--secondary);
  background: rgba(245, 196, 94, 0.08);
}

.paywall-plan-card-featured {
  border-color: var(--secondary);
}

.paywall-plan-card-badge {
  position: absolute;
  top: -9px;
  background: var(--secondary);
  color: var(--bg-mid);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

.paywall-plan-card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  margin-top: 2px;
}

.paywall-plan-card-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.1;
}

.paywall-plan-card-period {
  font-size: 11px;
  color: var(--text-muted);
}

.paywall-plan-card-savings {
  font-size: 10px;
  color: var(--success);
  font-weight: 700;
}

.paywall-subscribe-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.paywall-footer-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.paywall-restore-btn {
  font-size: 12px;
}

.paywall-terms {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
}

.paywall-disclosure {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  opacity: 0.8;
  margin: 12px 16px 8px;
  text-align: center;
}

.paywall-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.paywall-legal-link {
  font-size: 12px;
  color: var(--secondary, #F5C45E);
  text-decoration: underline;
  cursor: pointer;
}

.paywall-legal-sep {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.6;
}

/* Premium Status (already subscribed) */
.paywall-premium-status {
  margin: 24px 16px;
  text-align: center;
}

.premium-status-card {
  background: var(--surface);
  border: 2px solid var(--secondary);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 16px;
}

.premium-status-tier {
  font-size: 20px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 4px;
}

.premium-status-expires {
  font-size: 14px;
  color: var(--text-muted);
}

.premium-status-features {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 360px;
  margin: 0 auto;
}

/* Settings badges */
.settings-item-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
}

.settings-badge-premium {
  background: rgba(123, 196, 127, 0.2);
  color: var(--success);
}

.settings-badge-upgrade {
  background: rgba(245, 196, 94, 0.2);
  color: var(--secondary);
}

/* Alert info style */
.alert-info {
  background: rgba(45, 53, 97, 0.5);
  color: var(--text-light);
  border: 1px solid rgba(245, 196, 94, 0.3);
}

/* Button success variant */
.btn-success {
  background: var(--success) !important;
  color: white !important;
}

/* Parental Gate Modal */
.parental-gate-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
}

.parental-gate-modal {
  background: rgba(27,20,100,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.parental-gate-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.parental-gate-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 8px;
}

.parental-gate-description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.parental-gate-question {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 16px;
}

.parental-gate-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.parental-gate-option {
  background: var(--background);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.parental-gate-option:hover {
  border-color: var(--secondary);
}

.parental-gate-cancel {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
  font-family: var(--font-family);
}

.parental-gate-cancel:hover {
  color: var(--text-light);
}

.parental-gate-error {
  color: var(--error);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* ===== Settings Toggle Switch ===== */
.settings-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.settings-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  transition: var(--transition);
}

.settings-toggle-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: var(--transition);
}

.settings-toggle input:checked + .settings-toggle-slider {
  background-color: var(--primary);
}

.settings-toggle input:checked + .settings-toggle-slider::before {
  transform: translateX(16px);
}

.settings-toggle-item {
  cursor: default;
}

/* ===== Settings Quality Options ===== */
.settings-quality-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-quality-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
}

.settings-quality-option:hover {
  border-color: rgba(196,181,224,0.25);
}

.settings-quality-option.active {
  border-color: rgba(245,215,110,0.3);
  background: rgba(245,215,110,0.06);
}

.settings-quality-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.settings-quality-info {
  flex: 1;
  min-width: 0;
}

.settings-quality-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2px;
}

.settings-quality-desc {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.settings-quality-check {
  font-size: 18px;
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

/* ===== Settings Storage ===== */
/* Storage info is now inside .settings-group - keep for backwards compat */
.settings-storage-info {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.settings-storage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.settings-storage-row + .settings-storage-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-clear-cache-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--secondary);
}

.settings-clear-cache-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(196, 181, 224, 0.25);
}

/* ===== Settings Section Spacing ===== */
.settings-screen .settings-section {
  margin-bottom: 24px;
}

.settings-screen .settings-section:last-child {
  margin-bottom: 0;
}

/* ===== Push Notification Toast ===== */
/* Sits BELOW the app header, not on top of it. It used to be pinned to the top
   of the window at z-index 10000, which put it straight over the logo, the
   notification bell, its own unread badge, and the user's avatar — with the
   close button landing on the avatar. Covering the bell to announce something
   the bell is already announcing was the worst of it. */
.push-notification-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 62px);
  left: 50%;
  transform: translateX(-50%) translateY(-140px);
  z-index: 90;
  background: rgba(38, 32, 74, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(245, 215, 110, 0.42);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  width: calc(100% - 32px);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
  opacity: 0;
}

.push-notification-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.push-notification-toast.hide {
  transform: translateX(-50%) translateY(-140px);
  opacity: 0;
}

.push-toast-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
}
.push-toast-avatar-initials {
  background: var(--primary, #F5D76E);
  color: var(--bg-mid, #1B1464);
  font-size: 14px;
  font-weight: 700;
}

.push-toast-action {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary, #F5D76E);
  padding: 4px 2px;
}

.push-toast-content {
  flex: 1;
  min-width: 0;
}

/* Title reads as the title: same hierarchy as the feed, where it is white and
   heavier than the body. It was previously the yellow accent at the same size
   as the body, which inverted the emphasis. */
.push-toast-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light, #F0F0F5);
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* One line. The title carries the message ("Mom recorded a story"); this is the
   supporting detail, and long book titles like "That's Not My Lamb… (Usborne
   Touchy-Feely Books)" turned the banner into a three-line slab. Tapping opens
   the story, where the full title is right there. */
.push-toast-body {
  font-size: 12px;
  color: rgba(240,240,245,0.72);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Was 18px of glyph plus 4px of padding — a 26px target on a control people
   reach for in a hurry. 44px is the documented minimum on both platforms. */
.push-toast-close {
  background: none;
  border: none;
  color: rgba(240,240,245,0.6);
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  width: 40px;
  height: 40px;
  margin: -6px -6px -6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.push-toast-close:hover {
  color: var(--text-light, #F0F0F5);
}

/* ===== Storage Warning ===== */
.storage-warning-banner {
  background: rgba(245, 196, 94, 0.15);
  border: 1px solid var(--secondary, #F5C45E);
  border-radius: var(--radius-sm, 12px);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.storage-warning-banner.critical {
  background: rgba(224, 85, 85, 0.15);
  border-color: var(--error, #E56F6F);
}

.storage-warning-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.storage-warning-text {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.4;
}

.storage-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin: 4px 0;
}

.storage-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.storage-bar-fill.warning {
  background: var(--secondary, #F5C45E);
}

.storage-bar-fill.critical {
  background: var(--error, #E56F6F);
}

/* ===== Success Toast ===== */
.success-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 10000;
  background: var(--success, #7BC47F);
  color: #1a1a2e;
  border-radius: var(--radius-sm, 12px);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 320px;
}

.success-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.success-toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

/* ===== Error Toast ===== */
.error-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 10000;
  background: var(--error, #E56F6F);
  color: #fff;
  border-radius: var(--radius-sm, 12px);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 380px;
}

.error-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.error-toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.error-toast-message {
  flex: 1;
  line-height: 1.3;
}

.error-toast-retry {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.error-toast-retry:hover {
  background: rgba(255, 255, 255, 0.4);
}

.error-toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
  line-height: 1;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-toast-close:hover {
  color: #fff;
}

/* Save retry section in record preview */
.save-retry-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(229, 111, 111, 0.1);
  border: 1px solid rgba(229, 111, 111, 0.3);
  border-radius: var(--radius-sm, 12px);
  margin-top: 12px;
}

.save-retry-section .retry-message {
  flex: 1;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.save-retry-section .btn-retry {
  background: var(--accent, #E8B86D);
  color: var(--bg-dark, #1a1a2e);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.save-retry-section .btn-retry:hover {
  background: var(--accent-hover, #D4A85C);
}

.save-retry-section .btn-retry:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Download for Offline - Progress Bar */
.download-progress {
  margin: 8px auto;
  max-width: 280px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface, #252A4A);
  padding: 8px 12px;
}

.download-progress-bar {
  height: 4px;
  background: var(--secondary, #F5C45E);
  border-radius: 2px;
  width: 0%;
  transition: width 0.4s ease;
  margin-bottom: 6px;
}

.download-progress-text {
  font-size: 12px;
  color: var(--text-muted, #A0A5C0);
}

.playback-download-btn {
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.playback-download-btn:hover {
  opacity: 0.8;
}

/* ========================================== */
/* RESPONSIVE: Phone Layout (375px & below)   */
/* Feature #61 - One-handed phone operation   */
/* ========================================== */

/* Safe area support for modern phones with notches/home indicators */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 414px) {
  /* ---- Global adjustments for phones ---- */
  .app-content {
    padding: 16px 12px 24px;
  }

  /* Ensure all interactive elements meet 48dp minimum touch target */
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-text,
  .library-tab,
  .book-select-item,
  .add-book-option,
  .speed-btn,
  .display-mode-btn,
  .btn-record-action,
  .btn-record-stop,
  .btn-page-turn,
  .back-btn,
  .btn-back,
  .edit-btn,
  .settings-item,
  .notification-item,
  .notification-bell,
  .sleep-timer-btn {
    min-height: 48px;
    min-width: 48px;
  }

  /* ---- Header ---- */
  .app-header {
    padding: 8px 12px;
  }

  .user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  /* ---- Bottom Nav ---- */
  .bottom-nav {
    padding: 6px 0 8px;
  }

  .bottom-nav-item {
    padding: 10px 4px;
    min-height: 48px;
  }

  .bottom-nav-icon {
    width: 26px;
    height: 26px;
  }

  .bottom-nav-icon svg {
    width: 26px;
    height: 26px;
  }

  .bottom-nav-label {
    font-size: 10px;
  }

  /* ---- Auth Screens ---- */
  .auth-card {
    padding: 24px 16px;
  }

  .auth-header h1 {
    font-size: 24px;
  }

  .auth-header p {
    font-size: 14px;
  }

  /* ---- Home/Library ---- */
  .pill-tab {
    padding: 7px 12px;
    font-size: 12px;
  }

  /* Book grid: keep 2 columns on phones */
  .book-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .book-card-cover {
    height: 100px;
  }

  /* ---- Recording Screen ---- */
  .recording-timer {
    font-size: 40px;
  }

  .recording-controls {
    gap: 12px;
  }

  .recording-buttons {
    gap: 16px;
  }

  .btn-record {
    width: 64px;
    height: 64px;
  }

  .btn-record-action {
    width: 52px;
    height: 52px;
  }

  .btn-record-stop {
    width: 52px;
    height: 52px;
  }

  .page-turn-section {
    max-width: 100%;
    padding: 12px;
  }

  .btn-page-turn {
    padding: 14px 20px;
    min-height: 52px;
    font-size: 15px;
  }

  /* ---- Playback Screen ---- */
  .playback-cover {
    width: 200px;
    height: 200px;
  }

  .playback-title {
    font-size: 20px;
  }

  .playback-btn-main {
    width: 64px;
    height: 64px;
  }

  /* Speed buttons wrap and stay touchable */
  .playback-speed-buttons {
    gap: 4px;
    flex-wrap: wrap;
  }

  .speed-btn {
    padding: 8px 10px;
    font-size: 12px;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Display mode buttons: ensure touch-friendly */
  .display-mode-btn {
    width: 48px;
    height: 48px;
  }

  /* Ambience mixer */
  .ambience-mixer {
    padding: 12px;
  }

  /* ---- Settings Screen ---- */
  .settings-section {
    margin-bottom: 16px;
  }

  .settings-item {
    padding: 14px 12px;
    min-height: 52px;
  }

  .settings-profile-card {
    padding: 12px;
  }

  .settings-profile-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  /* Quality options */
  .quality-option {
    padding: 12px;
    min-height: 52px;
  }

  /* Toggle switches - ensure touchable */
  .toggle-switch {
    min-width: 48px;
    min-height: 28px;
  }

  /* ---- Family Screen ---- */
  .family-member-card {
    padding: 12px;
  }

  .milestone-card {
    padding: 12px;
  }

  /* ---- Book Detail Screen ---- */
  .book-detail-screen {
    padding: 0 12px 24px;
  }

  .book-detail-cover {
    height: 180px;
  }

  /* ---- Add Book Screen ---- */
  .add-book-options {
    flex-direction: column;
    gap: 8px;
  }

  .add-book-option {
    flex-direction: row;
    padding: 14px 16px;
    min-height: 56px;
    gap: 12px;
  }

  .add-book-option-icon {
    font-size: 24px;
  }

  .add-book-option-label {
    font-size: 14px;
  }

  /* ---- Onboarding ---- */
  .onboarding-icon {
    font-size: 64px;
  }

  .onboarding-title {
    font-size: 24px;
  }

  .onboarding-text {
    font-size: 15px;
    line-height: 1.5;
  }

  .onboarding-actions {
    gap: 12px;
  }

  /* ---- Modals ---- */
  .modal-content {
    margin: 16px;
    padding: 20px 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }

  /* ---- Preview Screen ---- */
  .preview-player {
    padding: 16px;
  }

  .preview-title {
    font-size: 16px;
  }

  /* ---- Paywall ---- */
  .paywall-plans {
    gap: 10px;
  }

  .paywall-plan {
    padding: 12px;
  }

  /* ---- Success Toast position above bottom nav ---- */
  .success-toast {
    bottom: 100px;
    max-width: calc(100vw - 32px);
  }

  /* ---- Error Toast position above bottom nav ---- */
  .error-toast {
    bottom: 100px;
    max-width: calc(100vw - 32px);
  }

  /* Prevent any horizontal overflow */
  body {
    overflow-x: hidden;
  }

  #app {
    overflow-x: hidden;
    max-width: 100vw;
  }
}

/* Extra-small phones (320px, e.g., iPhone SE 1st gen) */
@media (max-width: 360px) {
  .app-content {
    padding: 12px 8px 24px;
  }

  .auth-card {
    padding: 20px 12px;
  }

  .auth-header h1 {
    font-size: 22px;
  }

  .recording-timer {
    font-size: 36px;
  }

  .playback-cover {
    width: 180px;
    height: 180px;
  }

  .playback-title {
    font-size: 18px;
  }

  .speed-btn {
    padding: 6px 8px;
    font-size: 11px;
    min-width: 44px;
  }

  .onboarding-title {
    font-size: 22px;
  }

  .onboarding-icon {
    font-size: 56px;
  }
}


/* ========================================== */
/* RESPONSIVE: Tablet Layout (768px+)         */
/* Feature #62 - Utilize larger screen        */
/* ========================================== */

@media (min-width: 768px) {
  /* ---- Wider content area for tablets ---- */
  .app-content {
    max-width: 960px;
    padding: 32px 40px;
  }

  /* ---- Header: more spacious ---- */
  .app-header {
    padding: 12px 32px;
  }

  /* ---- Bottom Nav: larger touch targets, more spacing ---- */
  .bottom-nav {
    padding: 10px 0;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }

  .bottom-nav-item {
    padding: 12px 8px;
    gap: 6px;
  }

  .bottom-nav-icon {
    width: 28px;
    height: 28px;
  }

  .bottom-nav-icon svg {
    width: 28px;
    height: 28px;
  }

  .bottom-nav-label {
    font-size: 12px;
    letter-spacing: 0.5px;
  }

  /* ---- Auth Screens: centered, larger card ---- */
  .auth-card {
    padding: 48px 40px;
    max-width: 480px;
  }

  .auth-header h1 {
    font-size: 32px;
  }

  /* ---- Home/Library ---- */
  .pill-tab {
    padding: 10px 20px;
    font-size: 14px;
  }

  /* Book grid: show more columns on tablet */
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
  }

  .book-card-cover {
    height: 180px;
  }

  .book-card-info {
    padding: 14px;
  }

  .book-card-title {
    font-size: 15px;
  }

  .book-card-author {
    font-size: 13px;
  }

  /* Reader list items: wider layout */
  .reader-card {
    padding: 16px 20px;
  }

  /* Recent recordings: list items slightly more spacious */
  .recording-list-item {
    padding: 14px 16px;
  }

  /* ---- Recording Screen ---- */
  .recording-ui {
    max-width: 500px;
    margin: 0 auto;
    padding: 32px 0;
  }

  .recording-timer {
    font-size: 56px;
  }

  .recording-controls {
    gap: 20px;
  }

  .btn-record {
    width: 80px;
    height: 80px;
  }

  .btn-record-action {
    width: 64px;
    height: 64px;
  }

  .btn-record-stop {
    width: 64px;
    height: 64px;
  }

  .page-turn-section {
    max-width: 400px;
  }

  /* ---- Playback Screen: larger cover art ---- */
  .playback-player {
    max-width: 600px;
    margin: 0 auto;
  }

  .playback-cover {
    width: 320px;
    height: 320px;
  }

  .playback-cover-placeholder {
    font-size: 100px;
  }

  .playback-title {
    font-size: 28px;
  }

  .playback-reader {
    font-size: 18px;
  }

  .playback-btn-main {
    width: 80px;
    height: 80px;
  }

  .playback-btn-main svg {
    width: 32px;
    height: 32px;
  }

  /* Speed buttons: larger on tablet */
  .speed-btn {
    padding: 8px 16px;
    font-size: 14px;
    min-width: 56px;
  }

  /* Display mode buttons: larger on tablet */
  .display-mode-btn {
    width: 48px;
    height: 48px;
  }

  /* Reader initials: larger on tablet */
  .playback-initials-text {
    font-size: 96px;
  }

  /* ---- Settings Screen ---- */
  .settings-screen {
    max-width: 640px;
    margin: 0 auto;
  }

  .settings-profile-card {
    padding: 20px;
  }

  .settings-profile-avatar {
    width: 64px;
    height: 64px;
    font-size: 24px;
  }

  .settings-profile-name {
    font-size: 20px;
  }

  .settings-item {
    padding: 16px 20px;
  }

  .quality-option {
    padding: 16px 20px;
  }

  /* ---- Family Screen ---- */
  .family-screen {
    max-width: 640px;
    margin: 0 auto;
  }

  .milestone-card {
    padding: 16px 20px;
  }

  .family-member-card {
    padding: 16px 20px;
  }

  /* ---- Book Detail Screen ---- */
  .book-detail-screen {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px 32px;
  }

  .book-detail-cover {
    height: 280px;
  }

  .book-detail-title {
    font-size: 26px;
  }

  .book-detail-author {
    font-size: 17px;
  }

  /* ---- Add Book Screen ---- */
  .add-book-options {
    gap: 12px;
  }

  .add-book-option {
    padding: 20px;
  }

  .add-book-option-icon {
    font-size: 32px;
  }

  /* ---- Onboarding ---- */
  .onboarding-card {
    max-width: 560px;
  }

  .onboarding-icon {
    font-size: 120px;
  }

  .onboarding-title {
    font-size: 36px;
  }

  .onboarding-text {
    font-size: 18px;
    line-height: 1.7;
  }

  /* ---- Modals: centered, larger ---- */
  .modal-content {
    max-width: 560px;
    padding: 32px;
  }

  /* ---- Paywall ---- */
  .paywall-screen {
    max-width: 640px;
    margin: 0 auto;
  }

  .paywall-plans {
    display: flex;
    gap: 16px;
  }

  .paywall-plan {
    flex: 1;
  }

  /* ---- Ambience Screen ---- */
  .ambience-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }

  /* ---- Preview Screen ---- */
  .preview-player {
    max-width: 500px;
    margin: 0 auto 24px;
    padding: 32px;
  }

  .preview-title {
    font-size: 20px;
  }

  .preview-actions {
    max-width: 400px;
    margin: 0 auto;
  }

  /* ---- Empty states: more breathing room ---- */
  .empty-state {
    padding: 80px 40px;
  }

  .empty-state-icon {
    font-size: 80px;
  }

  .empty-state-title {
    font-size: 26px;
  }

  .empty-state-text {
    font-size: 17px;
  }

  /* ---- Page titles on large screens ---- */
  .page-title {
    font-size: 22px;
  }
}

/* Large tablets & landscape (1024px+) */
@media (min-width: 1024px) {
  .app-content {
    max-width: 1080px;
    padding: 40px 48px;
  }

  /* Book grid: even more columns */
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
  }

  .book-card-cover {
    height: 200px;
  }

  /* Two-column layout for playback extras */
  .playback-player {
    max-width: 700px;
  }

  .playback-cover {
    width: 360px;
    height: 360px;
  }

  /* Settings: even more centered */
  .settings-screen {
    max-width: 720px;
  }

  /* Family screen */
  .family-screen {
    max-width: 720px;
  }

  /* Paywall: horizontal plan layout */
  .paywall-plans {
    gap: 20px;
  }

  .paywall-plan {
    padding: 24px;
  }
}

/* ===== Modal Dialog System (WKWebView-compatible alert/confirm) ===== */
.readby-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
}
.readby-modal {
  background: rgba(27,20,100,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 24px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.readby-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 8px;
}
.readby-modal-message {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.readby-modal-actions {
  display: flex;
  gap: 12px;
}
.readby-modal-actions .btn {
  flex: 1;
  min-height: 44px;
}
.readby-modal-btn-destructive {
  background: var(--error) !important;
  border-color: var(--error) !important;
}

/* Single-select chooser (language picker, etc.) */
.readby-chooser { padding: 20px 16px; }
.readby-chooser .readby-modal-title { margin: 0 8px 12px; }
.readby-chooser-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.readby-chooser-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}
.readby-chooser-row:hover,
.readby-chooser-row:focus-visible { background: rgba(255,255,255,0.08); }
.readby-chooser-row.is-current { background: rgba(255,255,255,0.06); font-weight: 700; }
.readby-chooser-label { display: flex; flex-direction: column; }
.readby-chooser-sub { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-top: 2px; }
.readby-chooser-check { color: var(--accent, #E4C24A); font-size: 16px; }

/* Minimum 44px touch targets (Apple Human Interface Guidelines) */
button, .btn, .bottom-nav-item, .settings-item,
.btn-accept, .btn-decline, .btn-remove,
.notification-bell, .push-toast-close,
.notification-panel-close {
  min-height: 44px;
}

/* Keyboard avoidance for iOS */
input:focus, textarea:focus, select:focus {
  scroll-margin-bottom: 120px;
}

/* Prevent edge swipe gesture interference on recording/playback screens */
.record-screen, .playback-screen {
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

/* ===== Moonlit Dreams — Atmospheric Effects ===== */

/* Stars container — overlays the app layout */
.stars-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
  animation: twinkle var(--dur, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Floating clouds — soft blurred blobs drifting horizontally */
.cloud {
  position: absolute;
  border-radius: 50%;
  background: rgba(196,181,224,0.06);
  filter: blur(30px);
  animation: driftCloud linear infinite;
  pointer-events: none;
}

@keyframes driftCloud {
  0% { transform: translateX(-150px); }
  100% { transform: translateX(calc(100vw + 150px)); }
}

/* Fireflies — small golden dots floating upward */
.firefly {
  position: absolute;
  width: 3px; height: 3px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--primary), 0 0 12px rgba(245,215,110,0.3);
  animation: floatUp var(--dur, 6s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
  pointer-events: none;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) translateX(0); }
  20% { opacity: 0.8; }
  80% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-200px) translateX(30px); }
}

/* Shooting star — streaks diagonally across the sky */
.shooting-star {
  position: absolute;
  width: 80px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  border-radius: 2px;
  top: 60px; left: -100px;
  transform: rotate(-35deg);
  animation: shoot 4s ease-in-out infinite;
  animation-delay: 2s;
  pointer-events: none;
  z-index: 1;
}

@keyframes shoot {
  0% { left: -100px; top: 30px; opacity: 0; }
  5% { opacity: 1; }
  15% { left: calc(100vw + 100px); top: 150px; opacity: 0; }
  100% { opacity: 0; left: calc(100vw + 100px); }
}

/* Ensure app layout content sits above the stars */
.app-layout {
  position: relative;
  z-index: 1;
}

/* Heading font for key titles */
.page-title,
.screen-title,
.paywall-hero-title,
.auth-header h1,
.splash-title,
.app-header-title,
.notification-panel-header h3 {
  font-family: var(--font-heading);
}

/* Pre-record 3-2-1 countdown overlay */
.record-countdown-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 2000;
  pointer-events: none;
}
.record-countdown-num {
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  animation: record-countdown-pop 0.7s ease-out;
}
@keyframes record-countdown-pop {
  0% { transform: scale(0.4); opacity: 0; }
  30% { transform: scale(1.1); opacity: 1; }
  70% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.3; }
}
@media (prefers-reduced-motion: reduce) {
  .record-countdown-num { animation: none; }
}

/* Transient toast (non-blocking feedback) */
.readby-toast-host {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 3000;
  pointer-events: none;
}
.readby-toast {
  max-width: 88%;
  background: rgba(30, 30, 35, 0.95);
  color: #fff;
  padding: 11px 18px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.readby-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Playback: no playable media state */
.playback-no-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 28px;
  gap: 6px;
}
.playback-no-audio-icon { font-size: 44px; opacity: 0.7; }
.playback-no-audio-title { font-size: 17px; font-weight: 700; margin: 6px 0 0; }
.playback-no-audio-sub { font-size: 13px; color: var(--text-muted); max-width: 280px; line-height: 1.4; }

/* Secondary line under a settings label */
.settings-item-sublabel {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Playback: skip ±15s buttons flanking the play button */
.playback-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.playback-btn-skip {
  background: transparent;
  border: none;
  color: var(--text-light, #fff);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.playback-btn-skip:hover { opacity: 1; }
.playback-btn-skip:active { transform: scale(0.92); }

/* Page markers on the scrubber are styled as tick marks once, further up this
   file (search .playback-marker-dot). A second rule used to live here and,
   being later, silently won the cascade — which is what kept rendering them as
   squashed ovals. Do not re-add a competing rule here. */

/* Library search + sort row */
.library-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 16px 12px;
}
.library-search-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 22px;
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  background: var(--surface, rgba(255,255,255,0.06));
  color: var(--text-light, #fff);
  font-size: 14px;
}
.library-search-input::placeholder { color: var(--text-muted, #9aa0b5); }
.library-search-input:focus {
  outline: none;
  border-color: var(--secondary, #F5C45E);
}
.library-sort-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 22px;
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  background: var(--surface, rgba(255,255,255,0.06));
  color: var(--text-light, #fff);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.library-sort-btn:active { transform: scale(0.97); }

/* One-time page-turn hint shown during the first recording */
.page-turn-hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted, #9aa0b5);
  max-width: 260px;
  text-align: center;
}

/* ===== Home v2: Continue hero + reader quick-filters + empty state ===== */
.home-head { margin-bottom: 6px; }

.continue-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(150deg, rgba(245,215,110,0.16), rgba(245,215,110,0.05));
  border: 1px solid rgba(245,215,110,0.30);
  border-radius: 18px;
  padding: 14px;
  margin: 6px 0 18px;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease;
}
.continue-hero:active { transform: scale(0.99); }
.continue-cover {
  width: 52px; height: 68px; border-radius: 10px; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
}
.continue-cover-img { width: 100%; height: 100%; object-fit: cover; }
.continue-cover-ph { font-size: 24px; opacity: 0.6; }
.continue-info { min-width: 0; flex: 1; }
.continue-label {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--primary, #F5D76E); font-weight: 800;
}
.continue-title {
  font-family: var(--font-heading, 'Comfortaa', sans-serif);
  font-size: 16px; font-weight: 700; color: var(--text-light, #fff);
  margin: 3px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.continue-meta { font-size: 12px; color: var(--text-muted, #9a98b0); }
.continue-play {
  margin-left: auto; width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--primary, #F5D76E); color: var(--bg-dark, #0F0C29);
  display: flex; align-items: center; justify-content: center;
}
/* .continue-dismiss styling lives in the shared banner-dismiss rule below. */

.reader-chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 2px 14px; margin: 0 -2px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.reader-chips::-webkit-scrollbar { display: none; }
.reader-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card-bg, rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 22px; padding: 5px 14px 5px 5px;
  font-size: 12.5px; font-weight: 700; color: var(--text-muted, #9a98b0);
  flex: none; cursor: pointer; white-space: nowrap;
}
.reader-chip[data-reader-id=""] { padding-left: 14px; } /* "All" has no avatar */
.reader-chip.active {
  border-color: var(--primary, #F5D76E); color: var(--primary, #F5D76E);
  background: rgba(245,215,110,0.14);
}
.reader-chip-av, .reader-chip-av-img {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: var(--bg-dark, #0F0C29);
  background: var(--primary, #F5D76E); object-fit: cover;
}

.book-card-add {
  border: 1px dashed rgba(255,255,255,0.22) !important;
  background: transparent !important;
  text-decoration: none;
}
.book-card-add-cover {
  background: rgba(255,255,255,0.04) !important;
  color: var(--primary, #F5D76E); font-size: 34px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
}
.grid-empty {
  grid-column: 1 / -1;
  color: var(--text-muted, #9a98b0); font-size: 13px; text-align: center; padding: 30px 10px;
}

.home-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 44px 24px 30px; min-height: 52vh;
}
.home-empty-art {
  width: 104px; height: 104px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(245,215,110,0.22), rgba(245,215,110,0.03));
  border: 1px solid rgba(245,215,110,0.30);
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; margin-bottom: 22px;
}
.home-empty-title {
  font-family: var(--font-heading, 'Comfortaa', sans-serif);
  font-weight: 600; font-size: 20px; color: var(--text-light, #fff); margin-bottom: 9px;
}
.home-empty-text {
  font-size: 14px; color: var(--text-muted, #9a98b0); line-height: 1.6;
  max-width: 250px; margin-bottom: 24px;
}
.home-empty-btn { width: auto !important; display: inline-flex !important; padding-left: 26px; padding-right: 26px; }

/* ===== "Were you invited?" banner — persistent until acted on or dismissed ===== */
/* "Turn on notifications" nudge — shown only when the OS permission was denied. */
.push-nudge {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  background: rgba(245, 215, 110, 0.10);
  border: 1px solid rgba(245, 215, 110, 0.30);
  border-radius: 14px;
  padding: 12px 14px; margin: 0 0 18px;
}
.push-nudge-ic { font-size: 20px; line-height: 1; flex: 0 0 auto; }
.push-nudge-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.push-nudge-title { font-size: 14px; font-weight: 700; color: var(--accent, #F5C45E); }
.push-nudge-sub { font-size: 12.5px; color: var(--secondary, #C4B5E0); }
.push-nudge-cta {
  flex: 0 0 auto; background: var(--primary, #F5D76E); color: #1A1F3A;
  border: 0; border-radius: 999px; font-family: var(--font); font-weight: 700;
  font-size: 13px; padding: 8px 16px; cursor: pointer;
}
.push-nudge-cta:active { transform: scale(0.97); }
.push-nudge-x {
  flex: 0 0 auto; background: none; border: 0; cursor: pointer;
  color: var(--text-muted, #8478b0); font-size: 16px; line-height: 1; padding: 0 2px;
}
.push-nudge-x:hover { color: var(--text, #EDE7F6); }

.invite-banner {
  position: relative;
  display: flex; align-items: stretch; gap: 4px;
  background: rgba(245, 215, 110, 0.10);
  border: 1px solid rgba(245, 215, 110, 0.30);
  border-radius: 14px;
  margin: 0 0 18px;
  overflow: hidden;
}
.invite-banner-main {
  flex: 1; display: flex; align-items: center; gap: 12px;
  background: none; border: 0; cursor: pointer;
  padding: 13px 34px 13px 14px; text-align: left; font-family: inherit;
}
.invite-banner-icon { font-size: 20px; line-height: 1; flex: 0 0 auto; }
.invite-banner-text { display: flex; flex-direction: column; gap: 2px; }
.invite-banner-title { font-size: 14px; font-weight: 700; color: var(--accent, #F5C45E); }
.invite-banner-sub { font-size: 12.5px; color: var(--secondary, #C4B5E0); }
/* Shared dismiss "x" for banners/cards: no background, hard in the top-right
   corner. One rule so invite banner, continue card and request strip all match. */
.invite-banner-x, .continue-dismiss, .sr-strip-dismiss {
  position: absolute; top: 2px; right: 4px;
  width: 28px; height: 26px; padding: 0;
  display: flex; align-items: flex-start; justify-content: center;
  background: none; border: 0; border-radius: 0;
  color: var(--text-muted, #8478b0); font-size: 15px; line-height: 1;
  cursor: pointer;
}
.invite-banner-x:hover, .continue-dismiss:hover, .sr-strip-dismiss:hover { color: var(--text, #EDE7F6); background: none; }
.invite-banner-x:active, .continue-dismiss:active, .sr-strip-dismiss:active { color: #fff; transform: scale(0.92); }

/* ===== Invite hub + gift toggle ===== */
.invite-hub, .redeem-screen { max-width: 480px; margin: 0 auto; }
.hub-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--card-bg, rgba(255,255,255,0.05)); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; padding: 16px; margin-bottom: 12px; cursor: pointer; font-family: inherit;
}
.hub-card:hover { border-color: rgba(245,215,110,0.4); }
.hub-card-ic { font-size: 26px; flex: 0 0 auto; }
.hub-card-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.hub-card-title { font-size: 15.5px; font-weight: 700; color: var(--text, #EDE7F6); }
.hub-card-sub { font-size: 13px; color: var(--secondary, #B9AEE0); line-height: 1.45; }
.hub-card-arrow { color: var(--text-muted, #8478b0); font-size: 20px; flex: 0 0 auto; }
.hub-sheet-lead { font-size: 14px; color: var(--secondary, #B9AEE0); line-height: 1.55; margin: 0 0 16px; }

.gift-row {
  display: flex; align-items: flex-start; gap: 12px; margin: 0 0 16px;
  background: rgba(245,215,110,0.1); border: 1px solid rgba(245,215,110,0.3);
  border-radius: 12px; padding: 13px 14px;
}
.gift-row-locked { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
.gift-row-ic { font-size: 20px; flex: 0 0 auto; }
.gift-row-text { flex: 1; }
.gift-row-title { font-size: 13.5px; font-weight: 700; color: var(--accent, #F5C45E); }
.gift-row-locked .gift-row-title { color: var(--text-muted, #8478b0); }
.gift-row-sub { font-size: 12px; color: var(--secondary, #B9AEE0); line-height: 1.45; margin-top: 4px; }
.gift-row-left { font-size: 11.5px; color: var(--text-muted, #8478b0); margin-top: 6px; }
.gift-row-lock { font-size: 14px; align-self: center; }
.gift-upsell { color: var(--accent, #F5C45E); font-weight: 600; text-decoration: none; }
.gift-toggle {
  flex: 0 0 auto; width: 42px; height: 25px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255,255,255,0.18); position: relative; transition: background 0.15s; align-self: center; padding: 0;
}
.gift-toggle.on { background: var(--accent, #F5C45E); }
.gift-toggle-knob {
  position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%;
  background: #1A1F3A; transition: left 0.15s;
}
.gift-toggle.on .gift-toggle-knob { left: 20px; }

/* Redeem screen */
.redeem-hero { text-align: center; padding: 8px 0 4px; }
.redeem-gift { font-size: 42px; margin-bottom: 10px; }
.redeem-title { font-family: var(--font-heading, 'Comfortaa', sans-serif); font-size: 21px; font-weight: 600; color: #fff; line-height: 1.3; }
.redeem-text { font-size: 14px; color: var(--secondary, #B9AEE0); line-height: 1.6; margin: 10px auto 0; max-width: 320px; }
.redeem-plans { display: flex; gap: 12px; margin: 22px 0 18px; }
.redeem-plan {
  flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  background: rgba(255,255,255,0.05); border: 2px solid rgba(255,255,255,0.12);
  border-radius: 14px; padding: 14px; cursor: pointer; font-family: inherit;
}
.redeem-plan.selected { border-color: var(--accent, #F5C45E); background: rgba(245,215,110,0.08); }
.redeem-plan-name { font-size: 14px; font-weight: 700; color: var(--text, #EDE7F6); }
.redeem-plan-price { font-size: 15px; color: var(--accent, #F5C45E); font-weight: 600; }
.redeem-plan-after { font-size: 11px; color: var(--text-muted, #8478b0); }
.redeem-cta { width: 100%; }
.redeem-fine { font-size: 12px; color: var(--text-muted, #8478b0); text-align: center; margin: 12px 0 0; }
.invite-expiry {
  margin-top: 14px; text-align: center; font-size: 13px;
  color: var(--secondary, #C4B5E0);
}
.invite-expiry strong { color: var(--accent, #F5C45E); font-weight: 700; }
.redeem-expiry { margin-top: 10px; }
.join-gift-ribbon {
  background: rgba(245,215,110,0.12); border: 1px solid rgba(245,215,110,0.3); color: var(--accent, #F5C45E);
  font-size: 13px; line-height: 1.4; border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; text-align: center;
}

/* ===== Add a Book — search-first ===== */
.book-search-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-bg, rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.12); border-radius: 14px;
  padding: 12px 14px; margin-top: 6px;
}
.book-search-ic { color: var(--text-muted, #7B6FA3); display: flex; flex: none; }
.book-search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-light, #F0EBF4); font-size: 15px; font-family: inherit;
}
.book-search-input::placeholder { color: var(--text-muted, #7B6FA3); }

.isbn-inline { margin-top: 12px; }
.isbn-inline .isbn-input-row { display: flex; gap: 10px; }
.isbn-inline .form-input { flex: 1; }

.search-status { color: var(--text-muted, #7B6FA3); font-size: 13px; padding: 12px 2px; min-height: 8px; }
.search-status .spinner { vertical-align: middle; margin-right: 6px; }

.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-result {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card-bg, rgba(255,255,255,0.08));
  border: 1px solid var(--line, rgba(255,255,255,0.09)); border-radius: 14px;
  padding: 10px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s ease, transform 0.1s ease;
}
.search-result:active { transform: scale(0.99); }
.search-result:hover { border-color: rgba(245,215,110,0.35); }
.search-result-cover {
  width: 40px; height: 54px; border-radius: 7px; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); font-size: 20px;
}
.search-result-cover-img { width: 100%; height: 100%; object-fit: cover; }
.search-result-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.search-result-title {
  font-size: 14px; font-weight: 700; color: var(--text-light, #F0EBF4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result-meta {
  font-size: 12px; color: var(--text-muted, #7B6FA3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result-chev { color: var(--text-muted, #7B6FA3); font-size: 20px; flex: none; }

.search-empty { color: var(--text-muted, #7B6FA3); font-size: 13px; text-align: center; padding: 26px 10px; line-height: 1.6; }

.add-fallbacks { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 24px; }
.add-fallback-link {
  background: none; border: none; color: var(--secondary, #C4B5E0);
  font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; padding: 4px;
}

/* Confirm card */
.confirm-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--card-bg, rgba(255,255,255,0.08));
  border: 1px solid var(--line, rgba(255,255,255,0.09)); border-radius: 18px;
  padding: 24px 20px; margin: 8px 0 18px;
}
.confirm-cover {
  width: 108px; height: 144px; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); margin-bottom: 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.35);
}
.confirm-cover-img { width: 100%; height: 100%; object-fit: cover; }
.confirm-cover-ph { font-size: 46px; opacity: 0.6; }
.confirm-title { font-family: var(--font-heading, 'Comfortaa', sans-serif); font-weight: 600; font-size: 19px; color: #fff; }
.confirm-author { font-size: 14px; color: var(--secondary, #C4B5E0); margin-top: 5px; }
.confirm-author.confirm-muted { color: var(--text-muted, #7B6FA3); }
.confirm-note { font-size: 12px; color: var(--text-muted, #7B6FA3); margin-top: 10px; }
.confirm-actions { display: flex; justify-content: center; gap: 22px; margin-top: 16px; }

/* ===== Family — Final A (grid + member page) ===== */
.cap-row { font-size: 9px; color: #6a6488; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 800; margin: 20px 2px 10px; }
.family-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.fam-pending { display: flex; align-items: center; gap: 11px; background: rgba(245,215,110,0.10); border: 1px solid rgba(245,215,110,0.28); border-radius: 14px; padding: 11px; margin-top: 10px; }
.fam-pending-av { width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden; display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg,#C4B5E0,#9d8bc4); color: #1A1F3A; font-weight: 800; font-size: 15px; }
.fam-pending-info { flex: 1; min-width: 0; }
.fam-pending-name { font-size: 13px; font-weight: 800; color: #fff; }
.fam-pending-sub { font-size: 11px; color: var(--text-muted, #7B6FA3); margin-top: 1px; }
.fam-pending-acts { margin-left: auto; display: flex; gap: 8px; }
.fam-yes, .fam-no { width: 32px; height: 32px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; cursor: pointer; }
.fam-yes { background: var(--primary, #F5D76E); color: #1A1F3A; }
.fam-no { background: rgba(255,255,255,0.08); color: var(--text-muted, #7B6FA3); }

.fam-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* "Who you read to" — children management on the Family screen. */
.fam-children { margin-top: 4px; }
.fam-children-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.fam-children-empty { font-size: 13px; color: var(--text-muted, #7B6FA3); }
.fam-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; background: var(--card-bg, rgba(255,255,255,0.08)); border: 1px solid var(--line, rgba(255,255,255,0.09)); border-radius: 16px; padding: 16px 10px; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: border-color 0.12s ease, transform 0.1s ease; }
.fam-card:active { transform: scale(0.99); }
.fam-card:hover { border-color: rgba(245,215,110,0.3); }
.fam-card-av { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg,#C4B5E0,#9d8bc4); color: #1A1F3A; font-weight: 800; font-size: 18px; }
.fam-card-name { font-size: 13px; font-weight: 800; color: #fff; }
.fam-card-rel { font-size: 10.5px; color: var(--secondary, #C4B5E0); }
.fam-card-stat { font-size: 10.5px; color: var(--text-muted, #7B6FA3); margin-top: 3px; }
.fam-card-add { border-style: dashed; justify-content: center; }
.fam-card-plus { width: 54px; height: 54px; border-radius: 50%; border: 1.5px dashed rgba(255,255,255,0.25); color: var(--primary, #F5D76E); font-size: 26px; font-weight: 300; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.fam-card-add .fam-card-name { color: var(--primary, #F5D76E); }

.fam-sent-list { display: flex; flex-direction: column; gap: 8px; }
.fam-sent { display: flex; align-items: center; gap: 11px; background: var(--card-bg, rgba(255,255,255,0.08)); border: 1px solid var(--line, rgba(255,255,255,0.09)); border-radius: 13px; padding: 10px 12px; }
.fam-sent-ic { font-size: 18px; flex: none; }
.fam-sent-info { flex: 1; min-width: 0; }
.fam-sent-name { font-size: 12.5px; font-weight: 800; color: #fff; }
.fam-sent-sub { font-size: 10.5px; color: var(--text-muted, #7B6FA3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fam-sent-x { background: none; border: none; color: var(--text-muted, #7B6FA3); font-size: 15px; cursor: pointer; padding: 4px; flex: none; }

.fam-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 24px 20px; }
.fam-hero-art { width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(245,215,110,0.22), rgba(245,215,110,0.03)); border: 1px solid rgba(245,215,110,0.28); display: flex; align-items: center; justify-content: center; font-size: 42px; margin-bottom: 20px; }
.fam-hero-title { font-family: var(--font-heading, 'Comfortaa', sans-serif); font-weight: 600; font-size: 20px; color: #fff; margin-bottom: 9px; }
.fam-hero-text { font-size: 14px; color: var(--text-muted, #7B6FA3); line-height: 1.6; max-width: 250px; margin-bottom: 22px; }
.fam-hero-btn { width: auto !important; display: inline-flex !important; padding-left: 30px; padding-right: 30px; }
.fam-hero-link { background: none; border: none; color: var(--secondary, #C4B5E0); font-size: 13px; font-weight: 700; cursor: pointer; margin-top: 14px; font-family: inherit; }

.fam-detail { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 10px; }
.fam-detail-av { width: 78px; height: 78px; border-radius: 50%; overflow: hidden; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg,#C4B5E0,#9d8bc4); color: #1A1F3A; font-weight: 800; font-size: 26px; }
.fam-detail-name { font-family: var(--font-heading, 'Comfortaa', sans-serif); font-weight: 600; font-size: 19px; color: #fff; }
.fam-detail-rel { font-size: 12.5px; color: var(--secondary, #C4B5E0); margin-top: 3px; }
.fam-detail-stat { font-size: 13px; color: var(--text-light, #F0EBF4); margin-top: 12px; background: var(--card-bg, rgba(255,255,255,0.08)); border: 1px solid var(--line, rgba(255,255,255,0.09)); border-radius: 12px; padding: 9px 16px; }
.fam-detail-badge { display: inline-block; font-size: 11px; font-weight: 800; color: var(--primary, #F5D76E); background: rgba(245,215,110,0.13); border: 1px solid rgba(245,215,110,0.24); border-radius: 20px; padding: 4px 12px; margin-top: 12px; }

.fam-rec-list { display: flex; flex-direction: column; gap: 8px; }
.fam-rec { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card-bg, rgba(255,255,255,0.08)); border: 1px solid var(--line, rgba(255,255,255,0.09)); border-radius: 13px; padding: 9px; cursor: pointer; }
.fam-rec:active { transform: scale(0.99); }
.fam-rec-cover { width: 38px; height: 50px; border-radius: 7px; overflow: hidden; flex: none; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.06); font-size: 18px; }
.fam-rec-cover-img { width: 100%; height: 100%; object-fit: cover; }
.fam-rec-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fam-rec-title { font-size: 13px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fam-rec-meta { font-size: 11px; color: var(--text-muted, #7B6FA3); margin-top: 2px; }
.fam-rec-play { color: var(--primary, #F5D76E); font-size: 15px; flex: none; }
.fam-empty-rec { color: var(--text-muted, #7B6FA3); font-size: 13px; text-align: center; padding: 24px 10px; }

.fam-remove-btn { display: block; width: 100%; background: none; border: none; color: #c98b8b; font-size: 13px; font-weight: 700; cursor: pointer; padding: 18px; margin-top: 12px; font-family: inherit; }

.bottom-nav-2 .bottom-nav-item { flex: 1; }

/* ===== Swipe-to-delete rows (book detail recordings) ===== */
.swipe-row { position: relative; overflow: hidden; border-radius: 14px; margin-bottom: 8px; }
.swipe-row-delete {
  position: absolute; top: 0; right: 0; bottom: 0; width: 88px; border: none;
  background: var(--error, #E56F6F); color: #fff; font-weight: 800; font-size: 14px;
  cursor: pointer; z-index: 0;
}
.swipe-row-content {
  position: relative; z-index: 1; margin: 0 !important; border-radius: 14px;
  transition: transform 0.2s ease; will-change: transform; touch-action: pan-y;
  /* Opaque background (translucent glass over the page colour) so the Delete
     action behind is hidden until the row is swiped open. */
  background: linear-gradient(var(--card-bg, rgba(255,255,255,0.08)), var(--card-bg, rgba(255,255,255,0.08))), var(--bg-dark, #0F0C29) !important;
}

/* ===== Now Playing v2 — reader portrait + hidden options ===== */
/* Compact, viewport-fitting Now Playing so the transport never scrolls off. */
.playback-player { padding: 12px 0; }
.np-portrait { position: relative; width: min(30vh, 178px); height: min(30vh, 178px); border-radius: 50%; margin: 8px auto 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg,#C4B5E0,#8f79bd); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.np-portrait-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.np-portrait-initials { font-size: 52px; font-weight: 800; color: #1A1F3A; font-family: var(--font-heading, 'Comfortaa', sans-serif); }
.np-video-wrap { position: relative; height: min(40vh, 300px); aspect-ratio: 3 / 4; width: auto; margin: 8px auto 0; border-radius: 22px; overflow: hidden; background: #000; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.np-video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.np-fs-btn { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(0,0,0,.5); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.np-badge { position: absolute; bottom: -4px; right: -4px; width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(150deg,#8a6a52,#4a3a2f); display: flex; align-items: center; justify-content: center; font-size: 26px; border: 3px solid var(--bg-dark, #0F0C29); overflow: hidden; }
.np-badge-img { width: 100%; height: 100%; object-fit: cover; }
.np-reader-name { font-family: var(--font-heading, 'Comfortaa', sans-serif); font-weight: 600; font-size: 21px; color: #fff; text-align: center; margin-top: 14px; }
.np-reading { font-size: 14px; color: var(--secondary, #C4B5E0); text-align: center; margin-top: 4px; }
.np-reading b { color: #fff; }

/* .playback-player is a column flex with align-items:center, so its children
   shrink to fit rather than stretching. The scrub track inside .np-progress is
   position:absolute and so contributes no intrinsic width — leaving the whole
   progress block as narrow as the two time labels. Claim the full width back. */
.np-progress { margin-top: 16px; width: 100%; }
.np-page { font-size: 12px; color: var(--text-muted, #7B6FA3); text-align: center; margin: 0 0 8px; }
.np-scrub { margin-top: 4px; }
.np-times { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--text-muted, #7B6FA3); }

.np-more-handle { display: flex; flex-direction: column; align-items: center; gap: 5px; background: none; border: none; color: var(--text-muted, #7B6FA3); font-size: 11px; font-weight: 700; cursor: pointer; margin: 14px auto 6px; padding: 8px 20px; font-family: inherit; }
.np-grab { width: 40px; height: 4px; border-radius: 3px; background: rgba(255,255,255,.22); }
.np-more-label { opacity: .85; }

/* Short screens (e.g. iPhone 13 mini): shrink further so play stays visible. */
@media (max-height: 740px) {
  .playback-player { padding: 6px 0; }
  .np-video-wrap { height: 34vh; margin-top: 4px; }
  .np-portrait { width: 22vh; height: 22vh; margin-top: 4px; }
  .np-portrait-initials { font-size: 40px; }
  .np-reader-name { font-size: 18px; margin-top: 10px; }
  .np-reading { font-size: 13px; }
  .np-progress { margin-top: 10px; }
  .np-more-handle { margin: 8px auto 4px; }
}

.np-sheet-dim { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .22s ease; z-index: 120; }
.np-sheet-dim.open { opacity: 1; pointer-events: auto; }
.np-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 121;
  background: rgba(18,13,42,.98); border-top: 1px solid var(--line, rgba(255,255,255,.1));
  border-radius: 24px 24px 0 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -14px 44px rgba(0,0,0,.5);
  transform: translateY(105%); transition: transform .26s cubic-bezier(.2,.8,.2,1);
  max-height: 82vh; overflow-y: auto;
}
.np-sheet.open { transform: translateY(0); }
.np-sheet-grab { width: 40px; height: 4px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 0 auto 12px; }
.np-sheet-title { font-family: var(--font-heading, 'Comfortaa', sans-serif); font-size: 15px; color: #fff; font-weight: 600; margin-bottom: 4px; }
.np-kcap { font-size: 9.5px; color: #6a6488; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; margin: 16px 0 8px; }
.np-sheet-actions { display: flex; flex-direction: column; gap: 4px; }
/* Inside the sheet the mixer/speed sections shouldn't add their own big margins. */
.np-sheet .playback-speed-section,
.np-sheet .ambience-mixer-section { margin: 0; }

/* ---- Join Family (invite link) screen ---- */
.join-screen { padding-bottom: 40px; }
.join-card {
  max-width: 380px; margin: 24px auto 0; padding: 28px 24px;
  background: var(--bg-card, #20264d); border-radius: 18px; text-align: center;
}
.join-av {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--primary, #F5D76E); color: #3a2f05;
  font-size: 30px; font-weight: 600; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; overflow: hidden;
}
.join-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.join-name { font-size: 20px; font-weight: 600; color: var(--text-light, #EDE7F6); margin: 0 0 2px; }
.join-rel { font-size: 13px; color: var(--text-muted, #B9AEE0); margin-bottom: 16px; }
.join-text { font-size: 14px; line-height: 1.6; color: var(--text-muted, #CFC6EA); margin: 8px 0 22px; }
.join-text strong { color: var(--primary, #F5D76E); font-weight: 600; }
.join-accept { width: 100%; }
.join-decline {
  display: block; width: 100%; margin-top: 12px; padding: 10px;
  background: none; border: none; color: var(--text-muted, #8478b0);
  font-size: 14px; cursor: pointer;
}
.join-state-icon { font-size: 46px; margin-bottom: 12px; }

/* Invite code entry — the recovery path for people who installed the app from
   an invite link (the token cannot survive the App Store detour). */
.join-code-input {
  width: 100%; box-sizing: border-box; margin-bottom: 10px;
  padding: 14px 16px; border-radius: 12px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.16);
  color: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px; letter-spacing: 0.06em; text-align: center;
}
.join-code-input::placeholder { color: rgba(255,255,255,0.28); letter-spacing: 0.06em; }
.join-code-input:focus { outline: none; border-color: var(--accent, #F5C45E); }
.join-paste {
  display: block; width: 100%; margin: 0 0 16px; padding: 10px;
  background: none; border: none; color: var(--secondary, #C4B5E0);
  font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}

/* "Were you invited?" escape hatches on the two screens a lost invitee lands on. */
.home-empty-alt, .fam-hero-alt {
  display: inline-block; margin-top: 16px; padding: 6px;
  background: none; border: none; font-family: inherit;
  color: var(--secondary, #C4B5E0); font-size: 13.5px; font-weight: 700;
  text-decoration: none; cursor: pointer;
}

/* Offline: hide images that fail to load (uncached while offline) */
.img-broken { display: none !important; }

/* Offline-availability badge on recording rows */
.rec-offline { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 2px; line-height: 0; }
.rec-offline-on { color: var(--success, #5BbF8A); }
.rec-offline-off { background: none; border: none; padding: 2px; cursor: pointer; color: var(--text-muted, #8478b0); opacity: 0.6; }
.rec-offline-off:hover { opacity: 1; color: var(--primary, #F5D76E); }
.rec-offline-busy { opacity: 0.4; }

.fam-indirect-note { text-align:center; color: var(--text-muted, #8478b0); font-size: 12px; margin-top: 18px; }

.ambience-locked-btn { width:100%; padding:11px; background:var(--surface,#20264d); border:1px solid var(--border,#3a3566); border-radius:10px; color:var(--text-muted,#B9AEE0); font-size:14px; cursor:pointer; }
.ambience-locked-btn:hover { color:var(--primary,#F5D76E); }

/* ---- Social-first auth entry + email fallback ---- */
.auth-entry { text-align: center; }
.auth-entry .social-buttons { margin-top: 8px; }
.auth-email-link { display: block; width: 100%; background: none; border: none; color: var(--text-muted, #8478b0); font-size: 14px; margin-top: 18px; cursor: pointer; padding: 8px; }
.auth-email-link span { color: var(--primary, #F5D76E); border-bottom: 1px solid var(--primary, #F5D76E); }
.auth-legal { color: var(--text-muted, #6f6796); font-size: 12px; line-height: 1.5; margin-top: 20px; }
.auth-legal a { color: var(--text-muted, #8478b0); text-decoration: underline; }
.auth-back-link { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; color: var(--text-muted, #B9AEE0); font-size: 14px; cursor: pointer; padding: 0 0 8px; }
.auth-toggle { display: flex; gap: 4px; background: var(--surface, #20264d); border-radius: 12px; padding: 4px; margin: 8px 0 20px; }
.auth-toggle-btn { flex: 1; padding: 9px; border: none; border-radius: 9px; background: none; color: var(--text-muted, #B9AEE0); font-size: 14px; font-weight: 500; cursor: pointer; }
.auth-toggle-btn.active { background: var(--primary, #F5D76E); color: #3a2f05; }

/* ---------------------------------------------------------------
   Page-turn editor (Premium) — pageturns.js
   --------------------------------------------------------------- */
.pt-noscroll { overflow: hidden; }

.pt-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 60%, var(--bg-end) 100%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.pt-sheet {
  max-width: 560px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
  color: var(--text-light);
}

.pt-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 14px; }
.pt-title { font-family: var(--font-heading, inherit); font-size: 16px; color: var(--text-light); }
.pt-cancel, .pt-save {
  background: none; border: none; font-size: 15px; padding: 6px 2px; cursor: pointer;
}
.pt-cancel { color: var(--text-muted); }
.pt-save { color: var(--accent); font-weight: 600; }
.pt-save:disabled { opacity: 0.6; }

.pt-context {
  font-size: 13px; color: var(--text-muted);
  background: var(--card-bg); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pt-video-wrap { margin-bottom: 14px; }
.pt-video { width: 100%; max-height: 220px; border-radius: 14px; background: #000; display: block; }

/* Timeline */
.pt-track-wrap { margin: 6px 0 4px; }
.pt-track {
  position: relative; height: 56px;
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  touch-action: none;
  cursor: pointer;
}
.pt-track-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: rgba(245,215,110,0.10);
  border-radius: 12px 0 0 12px;
  pointer-events: none;
}
.pt-playhead {
  position: absolute; top: 6px; bottom: 6px; width: 2px; left: 0;
  background: #fff; border-radius: 2px; pointer-events: none;
}
.pt-pins { position: absolute; inset: 0; pointer-events: none; }
.pt-pin {
  position: absolute; top: 0; bottom: 0; width: 34px;
  margin-left: -17px;
  background: none; border: none; padding: 0;
  pointer-events: auto; touch-action: none; cursor: grab;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
.pt-pin:active { cursor: grabbing; }
.pt-pin-stem {
  width: 2px; flex: 1; background: var(--success);
  margin-bottom: 2px; border-radius: 2px;
}
.pt-pin-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--success); color: #04342C;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 5px;
}
.pt-pin-sel .pt-pin-stem { background: var(--accent); }
.pt-pin-sel .pt-pin-dot { background: var(--accent); color: #412402; transform: scale(1.12); }

.pt-times {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted); margin-top: 6px;
}

/* Transport */
.pt-transport {
  display: flex; align-items: center; justify-content: center; gap: 26px;
  margin: 12px 0 16px;
}
.pt-skip {
  background: none; border: none; color: var(--text-muted);
  font-size: 14px; cursor: pointer; padding: 8px;
}
.pt-play {
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: var(--accent); color: #412402;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* Add */
.pt-add {
  width: 100%; border: none; border-radius: 12px;
  background: var(--accent); color: #412402;
  font-size: 15px; font-weight: 600; padding: 14px; cursor: pointer;
}
.pt-add-plus { font-size: 17px; }
.pt-hint { font-size: 12px; color: var(--text-muted); text-align: center; margin: 8px 0 16px; }

/* List */
.pt-list-head { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.pt-empty {
  font-size: 13px; color: var(--text-muted); line-height: 1.5;
  background: var(--card-bg); border-radius: 12px; padding: 14px;
}
.pt-row {
  display: flex; align-items: center; gap: 6px;
  background: var(--card-bg); border: 1px solid transparent;
  border-radius: 12px; padding: 6px 8px; margin-bottom: 6px;
}
.pt-row-sel { background: var(--primary-light); border-color: var(--accent); }
.pt-row-main {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--text-light);
  font-size: 14px; text-align: left; padding: 6px 2px; cursor: pointer; min-width: 0;
}
.pt-row-num {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--success); color: #04342C;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.pt-row-sel .pt-row-num { background: var(--accent); color: #412402; }
.pt-row-time { color: var(--text-muted); font-size: 13px; }
.pt-icon {
  width: 34px; height: 34px; flex: none;
  background: rgba(255,255,255,0.06); border: none; border-radius: 9px;
  color: var(--text-light); font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pt-icon-del { color: var(--error, #E56F6F); }

/* Locked entry rows (free tier) */
.pt-entry {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--card-bg); border: none; border-radius: 12px;
  padding: 13px 12px; margin-top: 12px;
  color: var(--text-light); font-size: 14px; text-align: left; cursor: pointer;
}
.pt-entry-body { flex: 1; min-width: 0; }
.pt-entry-sub { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pt-entry-lock {
  flex: none; background: var(--primary-light); color: var(--accent);
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 20px;
}

/* ---------------------------------------------------------------
   Add Book — redesigned start panel, results and confirm
   --------------------------------------------------------------- */
.book-search-clear {
  background: none; border: none; padding: 4px; margin-left: auto;
  color: var(--text-muted); display: flex; align-items: center; cursor: pointer;
}

/* Start panel: shown until the first keystroke. */
.addbook-start { margin-top: 22px; }
.addbook-start-head { text-align: center; margin-bottom: 18px; }
.addbook-start-title {
  font-family: var(--font-heading, inherit);
  font-size: 19px; color: var(--text-light); margin: 0 0 6px;
}
.addbook-start-sub {
  font-size: 13px; color: var(--text-muted); line-height: 1.45;
  margin: 0 auto; max-width: 300px;
}

.addbook-tile {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--card-bg); border: 1px solid transparent;
  border-radius: 14px; padding: 14px 13px; margin-bottom: 10px;
  color: var(--text-light); text-align: left; cursor: pointer;
  font-family: inherit;
}
.addbook-tile:active { transform: scale(0.99); }
.addbook-tile-primary {
  background: var(--primary-light);
  border-color: rgba(245, 215, 110, 0.4);
}
.addbook-tile-primary .addbook-tile-ic,
.addbook-tile-primary .addbook-tile-title { color: var(--accent); }

.addbook-tile-ic {
  flex: none; width: 26px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.addbook-tile-body { flex: 1; min-width: 0; }
.addbook-tile-title { display: block; font-size: 14px; }
.addbook-tile-sub { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Results */
.search-count { font-size: 12px; color: var(--text-muted); margin: 6px 2px 10px; }

.search-result {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: var(--card-bg); border: none; border-radius: 12px;
  padding: 9px; margin-bottom: 8px;
  color: var(--text-light); text-align: left; cursor: pointer; font-family: inherit;
}
.search-result:active { background: rgba(255,255,255,0.12); }

.search-result-cover {
  flex: none; width: 42px; height: 58px; border-radius: 6px;
  background: rgba(255,255,255,0.10); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.search-result-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.search-result-cover-empty::after {
  content: '📖'; font-size: 17px; opacity: 0.5;
}
.search-result-info { flex: 1; min-width: 0; }
.search-result-title {
  display: block; font-size: 14px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.search-result-meta {
  display: block; font-size: 12px; color: var(--text-muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.search-manual-foot {
  text-align: center; font-size: 13px; color: var(--text-muted);
  padding-top: 12px; margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.10);
}

/* Confirm chips */
.confirm-chips { display: flex; gap: 10px; margin-top: 12px; }
.confirm-chip {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--card-bg); border: none; border-radius: 11px;
  padding: 11px 8px; color: var(--text-muted); font-size: 13px;
  cursor: pointer; font-family: inherit;
}
.confirm-chip:active { background: rgba(255,255,255,0.12); }

/* Fix the ISBN row: .btn carries width:100%, so inside this flex row the
   button ate the whole width and the input collapsed to a ~0px circle. */
.isbn-inline .isbn-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.isbn-inline .isbn-input-row .form-input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.isbn-inline .isbn-input-row .btn {
  flex: 0 0 auto;
  width: auto;
  padding: 0 20px;
  height: 48px;
  white-space: nowrap;
  margin: 0;
}

/* ---------------------------------------------------------------
   Playback options sheet — one row idiom instead of four
   --------------------------------------------------------------- */

/* Segmented rows: speed + sleep timer share the look. */
.seg-row,
.playback-speed-buttons {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}
.seg-btn,
.speed-btn {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.seg-btn.active,
.speed-btn.active {
  background: var(--accent);
  color: #412402;
  font-weight: 700;
}

/* Slider rows */
.sheet-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.sheet-slider-ic { flex: none; color: var(--text-muted); }
.sheet-slider-label {
  flex: none;
  min-width: 52px;
  max-width: 96px;
  font-size: 13px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-slider-row .volume-slider { flex: 1; min-width: 0; margin: 0; }
.sheet-slider-value {
  flex: none; width: 32px; text-align: right;
  font-size: 12px; color: var(--text-muted);
}

.sheet-sub { font-size: 13px; color: var(--text-muted); margin: 12px 0 7px; }

/* Ambience chips — replaces the native <select>, which opened a full-screen
   iOS wheel picker just to pick one of four sounds. */
.amb-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.amb-chips::-webkit-scrollbar { display: none; }
.amb-chip {
  flex: none;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.amb-chip.active {
  background: var(--primary-light);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* Upsell row (free tier) */
.sheet-upsell {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 11px;
  margin-bottom: 6px;
  border: 1px solid rgba(245, 215, 110, 0.35);
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--accent);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.sheet-upsell-body { flex: 1; min-width: 0; }
.sheet-upsell-title { display: block; font-size: 13px; color: var(--accent); }
.sheet-upsell-sub { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.sheet-pill {
  flex: none;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(245, 215, 110, 0.2);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

/* Action rows */
.sheet-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 13px 2px;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: none;
  color: var(--text-light);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.sheet-row:active { background: rgba(255, 255, 255, 0.04); }
.sheet-row-static { cursor: default; }
.sheet-row-ic { flex: none; color: var(--text-muted); }
.sheet-row-label { flex: 1; font-size: 14px; }
.sheet-row-chev { flex: none; color: var(--text-muted); }
.sheet-row-danger { margin-top: 6px; }
.sheet-row-danger .sheet-row-ic,
.sheet-row-danger .sheet-row-label { color: var(--error, #E56F6F); }

.sheet-link {
  display: block;
  margin-left: auto;
  padding: 2px 0 4px;
  border: none;
  background: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

/* ===== Notification settings ===== */
/* Section header that carries an action on the right ("Turn all on"). */
.set-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 6px 8px;
}
.set-label-row .set-label { margin: 0; }
.set-label-action {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #F5D76E);
  cursor: pointer;
  padding: 6px 4px;
  min-height: 32px;
}
.set-label-action:active { opacity: .6; }
.notif-caption {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(240,235,244,0.75);
  margin: 10px 8px 0;
}
.notif-caption:empty { margin: 0; }
.notif-footnote {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(240,235,244,0.6);
  margin: 4px 6px 0;
}


/* ===== Feed: mute a topic where it actually annoys you ===== */
.notification-mute {
  background: none;
  border: none;
  padding: 0;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: rgba(240,235,244,0.4);
  cursor: pointer;
  transition: var(--transition);
}
.notification-mute:hover,
.notification-mute:focus-visible {
  color: var(--text-light, #F0EBF4);
  background: rgba(255,255,255,0.08);
}

/* Toast with an Undo action. */
.readby-toast-action {
  display: flex;
  align-items: center;
  gap: 14px;
  /* The host sets pointer-events:none so a plain toast never blocks a tap on
     the UI underneath it. That also made the Undo button unclickable — the
     whole point of this variant. Re-enable it here, and only here. */
  pointer-events: auto;
}
.readby-toast-btn {
  background: none;
  border: none;
  color: var(--primary, #F5D76E);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 2px;
  min-height: 32px;
  flex-shrink: 0;
}
.readby-toast-btn:hover { text-decoration: underline; }

/* ===== Feed footer actions ===== */
.notification-panel-footer {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.notification-panel-action {
  flex: 1;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: rgba(240,235,244,0.85);
  padding: 10px 8px;
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
}
.notification-panel-action:hover { background: rgba(255,255,255,0.07); color: var(--text-light, #F0EBF4); }
.notification-panel-action-danger { color: #F2909A; }
.notification-panel-action-danger:hover { background: rgba(242,144,154,0.12); color: #F7B3BA; }

/* ============================================================
   Story requests — "ask Oma to read this one"
   ============================================================ */

/* Home strip: incoming requests, above the library. Not a queue. */
#story-requests-strip { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; }
.sr-strip-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-md);
  background: rgba(245,215,110,0.10); border: 1px solid rgba(245,215,110,0.28);
  text-decoration: none; color: var(--text-light);
}
.sr-strip-card:active { transform: scale(0.99); }
.sr-strip-cover { width: 40px; height: 52px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.sr-strip-cover-ph { display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.08); font-size: 20px; }
.sr-strip-text { flex: 1; min-width: 0; }
.sr-strip-title { font-size: 13px; color: var(--secondary); }
.sr-strip-book { font-family: var(--font-heading); font-weight: 700; font-size: 15px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-strip-mic { font-size: 22px; flex-shrink: 0; }
/* .sr-strip-dismiss styling lives in the shared banner-dismiss rule above. */
.sr-strip-item { position: relative; }

/* Book-detail entry points */
.bookc-ask {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 10px; padding: 13px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid rgba(196,181,224,0.20);
  color: var(--secondary); font-weight: 700; font-size: 15px; text-decoration: none;
}
.bookc-ask:active { transform: scale(0.99); }
.bookc-ask-quiet {
  display: block; text-align: center; margin-top: 14px;
  color: var(--text-muted); font-size: 14px; text-decoration: none;
}
.bookc-ask-quiet:active { color: var(--secondary); }

/* Ask composer */
.ask-screen, .srr-screen { padding-bottom: 40px; }
.ask-book { display: flex; align-items: center; gap: 12px; padding: 4px 4px 18px; }
.ask-cover { width: 48px; height: 62px; border-radius: 7px; object-fit: cover; }
.ask-cover-ph { display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.08); font-size: 22px; }
.ask-book-title { font-family: var(--font-heading); font-weight: 700; font-size: 17px; color: var(--text-light); }
.ask-book-author { font-size: 13px; color: var(--text-muted); }
.ask-section { margin-bottom: 20px; }
.ask-label { font-size: 14px; color: var(--secondary); margin-bottom: 10px; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-chip {
  padding: 9px 16px; border-radius: 20px; font-size: 14px; font-weight: 600;
  background: var(--surface); border: 1.5px solid rgba(196,181,224,0.20);
  color: var(--text-light); cursor: pointer; transition: var(--transition);
}
.ask-chip.selected { background: var(--primary); color: #1B1464; border-color: var(--primary); }
.ask-chip-add { border-style: dashed; color: var(--secondary); }
.ask-chip-self { color: var(--text-muted); }
.ask-name-input, .ask-message {
  width: 100%; margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid rgba(196,181,224,0.20);
  color: var(--text-light); font-family: var(--font); font-size: 15px; resize: none;
}
.ask-message::placeholder, .ask-name-input::placeholder { color: var(--text-muted); }
.ask-send { width: 100%; margin-top: 6px; }
.ask-already {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 14px; border-radius: var(--radius-md);
  background: rgba(245,215,110,0.10); border: 1px solid rgba(245,215,110,0.28);
  font-size: 14px; color: var(--text-light);
}
.ask-empty { text-align: center; padding: 30px 20px; color: var(--text-muted); }
.ask-empty .btn { margin-top: 16px; }

/* Sent + clip states */
.ask-sent, .ask-clip { text-align: center; padding: 30px 20px; }
.ask-sent-emoji, .ask-clip-emoji { font-size: 44px; }
.ask-sent-title { font-family: var(--font-heading); font-weight: 700; font-size: 20px; margin: 12px 0 6px; color: var(--text-light); }
.ask-sent-sub { font-size: 14px; color: var(--text-muted); line-height: 1.5; margin-bottom: 22px; }
.ask-sent .btn, .ask-clip .btn { width: 100%; }
.ask-sent .btn-text, .ask-clip .btn-text { margin-top: 10px; }
.ask-clip-timer { font-size: 40px; font-weight: 700; color: var(--text-light); font-variant-numeric: tabular-nums; margin: 8px 0 22px; }

/* Reader screen */
.srr-card { text-align: center; padding: 24px 20px; }
.srr-cover { width: 120px; height: 156px; border-radius: 12px; object-fit: cover; box-shadow: var(--shadow); }
.srr-cover-ph { display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.08); font-size: 44px; }
.srr-ask { margin-top: 20px; font-size: 15px; color: var(--secondary); }
.srr-title { font-family: var(--font-heading); font-weight: 700; font-size: 24px; margin: 4px 0 6px; color: var(--text-light); }
.srr-via { font-size: 13px; color: var(--text-muted); }
.srr-message { font-size: 15px; color: var(--text-light); font-style: italic; margin: 16px auto; max-width: 320px; line-height: 1.5; }
.srr-clip {
  display: inline-flex; align-items: center; gap: 10px; margin: 8px auto 20px;
  padding: 11px 18px; border-radius: 24px;
  background: var(--surface); border: 1px solid rgba(196,181,224,0.24);
  color: var(--text-light); font-size: 14px; font-weight: 600; cursor: pointer;
}
.srr-clip-play { color: var(--primary); font-size: 16px; }
.srr-record { width: 100%; margin-top: 8px; }
.srr-alt, .srr-notnow { display: block; width: 100%; margin-top: 12px; }
.srr-notnow { color: var(--text-muted); }
.srr-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.srr-emoji { font-size: 44px; margin-bottom: 12px; }
.srr-empty .btn { margin-top: 16px; }
