    /* ==========================================================================
       CSS Variables & Theme Definitions (Dark Mode Default)
       ========================================================================== */
    :root {
      --bg-app: #0b0f17;
      --bg-header: #131b26;
      --bg-sidebar: #0f1622;
      --bg-card: #182232;
      --bg-input: #1a2436;
      --bg-hover: #223048;
      --bg-active: #2a3c5a;
      --border-main: rgba(255, 255, 255, 0.08);
      --border-accent: rgba(56, 189, 248, 0.4);
      --text-main: #f1f5f9;
      --text-muted: #94a3b8;
      --text-dim: #64748b;
      --primary: #38bdf8;
      --primary-hover: #0284c7;
      --primary-dim: rgba(56, 189, 248, 0.15);
      --accent-green: #34d399;
      --accent-orange: #fb923c;
      --accent-red: #f87171;
      --shadow-modal: 0 16px 40px rgba(0, 0, 0, 0.65);
      --pdf-bg: #0b0f17;
      --canvas-filter: none;
      --canvas-bg: #ffffff;
      --header-height: 56px;
      --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    }

    [data-theme="light"] {
      --bg-app: #f1f5f9;
      --bg-header: #ffffff;
      --bg-sidebar: #f8fafc;
      --bg-card: #ffffff;
      --bg-input: #f1f5f9;
      --bg-hover: #e2e8f0;
      --bg-active: #cbd5e1;
      --border-main: rgba(0, 0, 0, 0.1);
      --border-accent: rgba(2, 132, 199, 0.4);
      --text-main: #0f172a;
      --text-muted: #475569;
      --text-dim: #94a3b8;
      --primary: #0284c7;
      --primary-hover: #0369a1;
      --primary-dim: rgba(2, 132, 199, 0.12);
      --shadow-modal: 0 16px 40px rgba(0, 0, 0, 0.2);
      --pdf-bg: #e2e8f0;
      --canvas-filter: none;
      --canvas-bg: #ffffff;
    }

    /* Invert / Night Filter for PDF canvas */
    body.pdf-night-filter .pdf-canvas {
      filter: invert(0.92) hue-rotate(180deg) contrast(0.95) brightness(0.95);
      background-color: #111827 !important;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: var(--font-family);
      background-color: var(--bg-app);
      color: var(--text-main);
      overflow: hidden;
      height: 100vh;
      display: flex;
      flex-direction: column;
      user-select: none;
      -webkit-font-smoothing: antialiased;
    }

    /* ==========================================================================
       Top Header Toolbar
       ========================================================================== */
    .app-header {
      height: var(--header-height);
      background-color: var(--bg-header);
      border-bottom: 1px solid var(--border-main);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 1rem;
      gap: 0.75rem;
      z-index: 100;
      flex-shrink: 0;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    }

    .header-left, .header-center, .header-right {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .brand-group {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      text-decoration: none;
      color: var(--text-main);
      margin-right: 0.5rem;
    }

    .brand-icon {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: linear-gradient(135deg, #0284c7, #38bdf8);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #ffffff;
      font-size: 1rem;
      box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
    }

    .brand-title {
      font-size: 1.05rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      white-space: nowrap;
    }

    .brand-title span {
      color: var(--primary);
    }

    .doc-name-badge {
      max-width: 220px;
      padding: 0.25rem 0.65rem;
      background: var(--bg-input);
      border: 1px solid var(--border-main);
      border-radius: 6px;
      font-size: 0.8rem;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: none;
      cursor: pointer;
    }

    @media (min-width: 768px) {
      .doc-name-badge {
        display: block;
      }
    }

    .btn-tool {
      background: transparent;
      border: 1px solid transparent;
      color: var(--text-main);
      padding: 0.45rem 0.65rem;
      border-radius: 6px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.4rem;
      font-size: 0.85rem;
      font-weight: 500;
      transition: all 0.15s ease;
      white-space: nowrap;
    }

    .btn-tool:hover {
      background: var(--bg-hover);
      color: var(--primary);
    }

    .btn-tool.active {
      background: var(--primary-dim);
      border-color: var(--border-accent);
      color: var(--primary);
    }

    .btn-primary {
      background: var(--primary);
      color: #ffffff;
      border: 1px solid transparent;
      padding: 0.45rem 0.85rem;
      border-radius: 6px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      font-size: 0.85rem;
      font-weight: 600;
      transition: all 0.15s ease;
    }

    .btn-primary:hover {
      background: var(--primary-hover);
      box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
    }

    .btn-secondary {
      background: var(--bg-input);
      border: 1px solid var(--border-main);
      color: var(--text-main);
      padding: 0.45rem 0.75rem;
      border-radius: 6px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      font-size: 0.85rem;
      font-weight: 500;
      transition: all 0.15s ease;
    }

    .btn-secondary:hover {
      background: var(--bg-hover);
      border-color: var(--primary);
      color: var(--primary);
    }

    .divider-v {
      width: 1px;
      height: 24px;
      background: var(--border-main);
      margin: 0 0.25rem;
    }

    .page-nav-group {
      display: flex;
      align-items: center;
      background: var(--bg-input);
      border: 1px solid var(--border-main);
      border-radius: 6px;
      padding: 2px 4px;
      gap: 4px;
    }

    .page-nav-input {
      width: 44px;
      text-align: center;
      background: transparent;
      border: none;
      color: var(--text-main);
      font-size: 0.85rem;
      font-weight: 600;
      outline: none;
    }

    .page-nav-total {
      font-size: 0.85rem;
      color: var(--text-muted);
      padding-right: 4px;
    }

    .zoom-select {
      background: var(--bg-input);
      border: 1px solid var(--border-main);
      color: var(--text-main);
      border-radius: 6px;
      padding: 0.35rem 0.5rem;
      font-size: 0.85rem;
      outline: none;
      cursor: pointer;
    }

    /* ==========================================================================
       Search Bar (Dropdown)
       ========================================================================== */
    .search-bar {
      position: absolute;
      top: calc(var(--header-height) + 8px);
      right: 18px;
      background: var(--bg-card);
      border: 1px solid var(--border-accent);
      border-radius: 8px;
      padding: 0.5rem 0.75rem;
      display: none;
      align-items: center;
      gap: 0.5rem;
      z-index: 200;
      box-shadow: var(--shadow-modal);
    }

    .search-bar.open {
      display: flex;
    }

    .search-input {
      background: var(--bg-input);
      border: 1px solid var(--border-main);
      border-radius: 6px;
      padding: 0.35rem 0.65rem;
      color: var(--text-main);
      font-size: 0.85rem;
      outline: none;
      width: 180px;
    }

    .search-count {
      font-size: 0.8rem;
      color: var(--text-muted);
      min-width: 50px;
      text-align: center;
    }

    /* ==========================================================================
       Main Workspace: Sidebar + Viewer Container
       ========================================================================== */
    .app-workspace {
      flex: 1;
      display: flex;
      overflow: hidden;
      position: relative;
    }

    /* Sidebar */
    .app-sidebar {
      width: 280px;
      background: var(--bg-sidebar);
      border-right: 1px solid var(--border-main);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      transition: margin-left 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      z-index: 90;
    }

    .app-sidebar.closed {
      margin-left: -280px;
    }

    @media (max-width: 768px) {
      .app-sidebar {
        position: fixed;
        top: var(--header-height);
        bottom: 0;
        left: 0;
        width: 82vw;
        max-width: 320px;
        z-index: 150;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6);
      }
      .app-sidebar.closed {
        margin-left: 0 !important;
        transform: translateX(-100%);
      }
      .app-sidebar:not(.closed) {
        transform: translateX(0);
      }
    }

    .sidebar-tabs {
      display: flex;
      border-bottom: 1px solid var(--border-main);
      background: var(--bg-header);
    }

    .sidebar-tab {
      flex: 1;
      padding: 0.65rem 0.5rem;
      text-align: center;
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-muted);
      cursor: pointer;
      border-bottom: 2px solid transparent;
      transition: all 0.15s ease;
    }

    .sidebar-tab:hover {
      color: var(--text-main);
      background: var(--bg-hover);
    }

    .sidebar-tab.active {
      color: var(--primary);
      border-bottom-color: var(--primary);
      background: var(--bg-sidebar);
    }

    .sidebar-content {
      flex: 1;
      overflow-y: auto;
      padding: 0.75rem;
    }

    /* Outline Items */
    .outline-tree {
      list-style: none;
    }

    .outline-item {
      padding: 0.45rem 0.5rem;
      border-radius: 6px;
      font-size: 0.85rem;
      color: var(--text-main);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.4rem;
      transition: background 0.15s ease;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .outline-item:hover {
      background: var(--bg-hover);
      color: var(--primary);
    }

    /* Thumbnails */
    .thumbnails-grid {
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
      align-items: center;
    }

    .thumbnail-card {
      width: 140px;
      border: 2px solid var(--border-main);
      border-radius: 6px;
      overflow: hidden;
      cursor: pointer;
      background: #ffffff;
      transition: all 0.15s ease;
      position: relative;
    }

    .thumbnail-card:hover {
      border-color: var(--primary);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }

    .thumbnail-card.active {
      border-color: var(--primary);
      box-shadow: 0 0 0 2px var(--primary);
    }

    .thumbnail-card canvas {
      width: 100%;
      height: auto;
      display: block;
    }

    .thumbnail-num {
      position: absolute;
      bottom: 4px;
      right: 4px;
      background: rgba(0, 0, 0, 0.75);
      color: #ffffff;
      font-size: 0.7rem;
      font-weight: 700;
      padding: 2px 6px;
      border-radius: 4px;
    }

    /* Viewer Container */
    .viewer-container {
      flex: 1;
      overflow: auto;
      overflow-anchor: none;
      background-color: var(--pdf-bg);
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 1.5rem 1rem 6.5rem 1rem;
      position: relative;
      user-select: text;
    }

    .pdf-pages-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1.5rem;
      width: 100%;
    }

    /* Individual Page Container */
    .pdf-page-wrapper {
      position: relative;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
      background: var(--canvas-bg);
      border-radius: 4px;
      overflow: hidden;
      margin: 0 auto;
      content-visibility: auto;
      contain-intrinsic-size: auto none auto 842px;
    }

    .pdf-canvas {
      display: block;
      width: 100%;
      height: 100%;
      background: #ffffff;
    }

    /* PDF.js Text Layer */
    .textLayer {
      position: absolute;
      text-align: initial;
      left: 0;
      top: 0;
      right: 0;
      bottom: 0;
      overflow: hidden;
      opacity: 1 !important;
      line-height: 1;
      -webkit-text-size-adjust: none;
      -moz-text-size-adjust: none;
      text-size-adjust: none;
      forced-color-adjust: none;
      transform-origin: 0 0;
      z-index: 2;
    }

    .textLayer span, .textLayer br {
      color: transparent;
      position: absolute;
      white-space: pre;
      cursor: text;
      transform-origin: 0% 0%;
      box-sizing: border-box;
    }

    .textLayer ::selection {
      background: rgba(56, 189, 248, 0.5);
      color: transparent;
    }

    /* PDF TextLayer Active Highlight (Only for canvas text overlay) */
    .textLayer span.tts-active-reading {
      background-color: rgba(254, 240, 138, 0.55) !important;
      border-bottom: 2px solid rgba(234, 179, 8, 0.75) !important;
      border-radius: 2px !important;
      outline: none !important;
      box-shadow: none !important;
      color: transparent !important;
      mix-blend-mode: multiply !important;
      z-index: 5 !important;
      transition: background-color 0.12s ease !important;
    }

    [data-theme="dark"] .textLayer span.tts-active-reading,
    body.pdf-night-filter .textLayer span.tts-active-reading {
      background-color: rgba(234, 179, 8, 0.25) !important;
      border-bottom: 2px solid #facc15 !important;
      border-radius: 2px !important;
      outline: none !important;
      box-shadow: none !important;
      color: transparent !important;
      mix-blend-mode: normal !important;
      z-index: 5 !important;
    }

    /* Bible Active Verse Highlight (Real HTML Text - Never transparent, never blackened) */
    .verse-cell.tts-active-reading,
    .parallel-verse-row.tts-active-reading .verse-cell,
    .single-verse-row.tts-active-reading .verse-cell,
    .verse-row-aligned.tts-active-reading .verse-cell {
      background-color: rgba(56, 189, 248, 0.16) !important;
      border-left: 3.5px solid #0284c7 !important;
      border-bottom: none !important;
      border-radius: 6px !important;
      outline: none !important;
      box-shadow: none !important;
      color: inherit !important;
      mix-blend-mode: normal !important;
      transition: background-color 0.15s ease, border-color 0.15s ease !important;
    }

    .verse-cell.tts-active-reading .verse-text,
    .verse-cell.tts-active-reading .verse-num {
      color: inherit !important;
      mix-blend-mode: normal !important;
    }

    [data-theme="dark"] .verse-cell.tts-active-reading,
    [data-theme="dark"] .parallel-verse-row.tts-active-reading .verse-cell,
    [data-theme="dark"] .single-verse-row.tts-active-reading .verse-cell,
    [data-theme="dark"] .verse-row-aligned.tts-active-reading .verse-cell {
      background-color: rgba(56, 189, 248, 0.22) !important;
      border-left: 3.5px solid #38bdf8 !important;
      border-bottom: none !important;
      color: #f8fafc !important;
      mix-blend-mode: normal !important;
    }

    [data-theme="dark"] .verse-cell.tts-active-reading .verse-text,
    [data-theme="dark"] .verse-cell.tts-active-reading .verse-num {
      color: #f8fafc !important;
    }

    .textLayer span.tts-upcoming-reading,
    .tts-upcoming-reading {
      outline: none !important;
      box-shadow: none !important;
      background-color: transparent !important;
      border-bottom: none !important;
    }

    /* Inline Resume Play Button directly next to text */
    .tts-inline-resume-btn {
      position: absolute;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: linear-gradient(135deg, #0284c7, #38bdf8);
      color: #ffffff;
      border: 2px solid #ffffff;
      box-shadow: 0 4px 14px rgba(56, 189, 248, 0.65), 0 0 0 3px rgba(56, 189, 248, 0.25);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.8rem;
      z-index: 50;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      animation: pulse-resume 1.8s infinite;
    }

    .tts-inline-resume-btn:hover {
      transform: scale(1.18);
      box-shadow: 0 6px 18px rgba(56, 189, 248, 0.85), 0 0 0 5px rgba(56, 189, 248, 0.35);
    }

    @keyframes pulse-resume {
      0%, 100% {
        box-shadow: 0 4px 14px rgba(56, 189, 248, 0.65), 0 0 0 3px rgba(56, 189, 248, 0.25);
      }
      50% {
        box-shadow: 0 6px 20px rgba(56, 189, 248, 0.9), 0 0 0 7px rgba(56, 189, 248, 0.4);
      }
    }

    /* Drag & Drop Overlay */
    .drop-overlay {
      position: absolute;
      inset: 0;
      background: rgba(11, 15, 23, 0.88);
      backdrop-filter: blur(8px);
      z-index: 500;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 1rem;
      border: 3px dashed var(--primary);
      margin: 1rem;
      border-radius: 16px;
      pointer-events: none;
    }

    .drop-overlay.active {
      display: flex;
    }

    .drop-overlay i {
      font-size: 3.5rem;
      color: var(--primary);
      animation: bounce 1.2s infinite ease-in-out;
    }

    .drop-overlay h3 {
      font-size: 1.5rem;
      font-weight: 700;
    }

    @keyframes bounce {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-10px); }
    }

    /* Loading Spinner */
    .loading-spinner {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1rem;
      z-index: 80;
    }

    .spinner-ring {
      width: 48px;
      height: 48px;
      border: 4px solid var(--border-main);
      border-top-color: var(--primary);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* Welcome / Empty State Screen */
    .welcome-screen {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 1.5rem;
      z-index: 50;
      background: radial-gradient(circle at 50% 40%, rgba(56, 189, 248, 0.05) 0%, transparent 65%);
    }

    .welcome-card {
      max-width: 520px;
      width: 100%;
      background: var(--bg-card);
      border: 2px dashed var(--border-accent);
      border-radius: 20px;
      padding: 2.75rem 2rem;
      text-align: center;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1.25rem;
      cursor: pointer;
      transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .welcome-card:hover {
      border-color: var(--primary);
      transform: translateY(-3px);
      box-shadow: 0 16px 36px rgba(56, 189, 248, 0.15);
      background: var(--bg-hover);
    }

    .welcome-icon-box {
      width: 72px;
      height: 72px;
      border-radius: 18px;
      background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(56, 189, 248, 0.15));
      border: 1px solid rgba(56, 189, 248, 0.35);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2.2rem;
      color: var(--primary);
      box-shadow: 0 4px 16px rgba(56, 189, 248, 0.2);
    }

    .welcome-title {
      font-size: 1.35rem;
      font-weight: 700;
      color: var(--text-main);
      margin: 0;
      letter-spacing: -0.01em;
    }

    .welcome-desc {
      font-size: 0.9rem;
      color: var(--text-muted);
      line-height: 1.55;
      margin: 0;
      max-width: 400px;
    }

    .welcome-actions {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
      margin-top: 0.5rem;
      width: 100%;
    }

    .welcome-btn-primary {
      padding: 0.75rem 1.6rem;
      font-size: 0.95rem;
      font-weight: 700;
      border-radius: 10px;
      background: var(--primary);
      color: #0b0f17;
      border: none;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 0.6rem;
      box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
      transition: all 0.2s ease;
    }

    .welcome-btn-primary:hover {
      background: #7dd3fc;
      transform: translateY(-1px);
      box-shadow: 0 6px 18px rgba(56, 189, 248, 0.4);
    }

    .welcome-btn-secondary {
      padding: 0.75rem 1.3rem;
      font-size: 0.9rem;
      font-weight: 600;
      border-radius: 10px;
      background: var(--bg-input);
      color: var(--text-main);
      border: 1px solid var(--border-main);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      transition: all 0.2s ease;
    }

    .welcome-btn-secondary:hover {
      background: var(--bg-hover);
      border-color: var(--border-accent);
      color: var(--primary);
    }

    .welcome-footer-hint {
      font-size: 0.8rem;
      color: var(--text-dim);
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }

    /* ==========================================================================
       TTS (Web Speech API & HD Neural) Desktop Persistent Player Bar & Settings Modal
       ========================================================================== */
    .tts-player-bar {
      position: fixed;
      bottom: 24px;
      left: 24px;
      transform: none;
      width: 520px;
      max-width: calc(100vw - 48px);
      background: rgba(19, 27, 38, 0.94);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      border: 1px solid rgba(56, 189, 248, 0.35);
      border-radius: 20px;
      box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65), 0 0 24px rgba(56, 189, 248, 0.2);
      z-index: 500;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      user-select: none;
    }

    [data-theme="light"] .tts-player-bar {
      background: rgba(255, 255, 255, 0.96);
      border: 1px solid rgba(2, 132, 199, 0.35);
      box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15), 0 0 20px rgba(2, 132, 199, 0.15);
    }

    .tpb-progress-line {
      width: 100%;
      height: 3px;
      background: rgba(255, 255, 255, 0.08);
      position: relative;
    }

    [data-theme="light"] .tpb-progress-line {
      background: rgba(0, 0, 0, 0.08);
    }

    .tpb-progress-fill {
      height: 100%;
      background: linear-gradient(90deg, #0284c7, #38bdf8);
      transition: width 0.2s ease;
    }

    .tpb-main {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.65rem 1.15rem;
      gap: 1.1rem;
    }

    .tpb-info {
      display: flex;
      align-items: center;
      gap: 0.85rem;
      flex: 1;
      min-width: 0;
      cursor: pointer;
      padding: 0.2rem 0.4rem;
      border-radius: 10px;
      transition: background 0.15s ease;
    }

    .tpb-info:hover {
      background: rgba(255, 255, 255, 0.05);
    }

    [data-theme="light"] .tpb-info:hover {
      background: rgba(0, 0, 0, 0.04);
    }

    .tpb-waves {
      display: flex;
      align-items: flex-end;
      gap: 3px;
      height: 18px;
      flex-shrink: 0;
    }

    .tpb-waves .wave-bar {
      width: 3px;
      height: 6px;
      background: var(--primary);
      border-radius: 2px;
      transition: height 0.2s ease;
    }

    .tts-player-bar.is-speaking .tpb-waves .wave-bar {
      animation: tpbWaveAnim 1.1s infinite ease-in-out;
    }

    .tts-player-bar.is-speaking .tpb-waves .wave-bar:nth-child(2) {
      animation-delay: 0.2s;
    }

    .tts-player-bar.is-speaking .tpb-waves .wave-bar:nth-child(3) {
      animation-delay: 0.4s;
    }

    @keyframes tpbWaveAnim {
      0%, 100% { height: 5px; }
      50% { height: 18px; }
    }

    .tpb-text-wrap {
      min-width: 0;
      flex: 1;
    }

    .tpb-title {
      font-size: 0.88rem;
      font-weight: 600;
      color: var(--text-main);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .tpb-meta {
      font-size: 0.72rem;
      color: var(--text-muted);
      margin-top: 1px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .tpb-controls {
      display: flex;
      align-items: center;
      gap: 0.55rem;
      flex-shrink: 0;
    }

    .tpb-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      border: none;
      transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
      touch-action: manipulation;
      user-select: none;
      border-radius: 12px;
    }

    .tpb-btn-nav,
    .tpb-btn-stop,
    .tpb-btn-gear {
      width: 40px;
      height: 40px;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: var(--text-main);
      font-size: 0.95rem;
    }

    [data-theme="light"] .tpb-btn-nav,
    [data-theme="light"] .tpb-btn-stop,
    [data-theme="light"] .tpb-btn-gear {
      background: rgba(0, 0, 0, 0.04);
      border: 1px solid rgba(0, 0, 0, 0.1);
      color: #1e293b;
    }

    .tpb-btn-nav:hover,
    .tpb-btn-gear:hover {
      background: rgba(56, 189, 248, 0.15);
      border-color: var(--primary);
      color: var(--primary);
      transform: scale(1.05);
    }

    .tpb-btn-nav:active,
    .tpb-btn-gear:active {
      transform: scale(0.94);
    }

    .tpb-btn-stop {
      color: #f87171;
      background: rgba(239, 68, 68, 0.1);
      border-color: rgba(239, 68, 68, 0.25);
    }

    .tpb-btn-stop:hover {
      background: rgba(239, 68, 68, 0.2);
      border-color: #f87171;
      color: #f87171;
      transform: scale(1.05);
    }

    .tpb-btn-stop:active {
      transform: scale(0.94);
    }

    .tpb-btn-play {
      width: 46px;
      height: 46px;
      border-radius: 50%;
      background: linear-gradient(135deg, #0284c7, #38bdf8);
      color: #ffffff;
      font-size: 1.15rem;
      box-shadow: 0 4px 16px rgba(2, 132, 199, 0.45);
      margin: 0 0.15rem;
    }

    .tpb-btn-play:hover {
      transform: scale(1.08);
      box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6);
    }

    .tpb-btn-play:active {
      transform: scale(0.92);
    }

    /* Fallback Tile (auf Desktop ausgeblendet, da Player Bar aktiv ist) */
    .tts-float-tile {
      display: none !important;
    }

    .tts-panel-overlay {
      position: fixed;
      inset: 0;
      z-index: 510;
      display: none;
      background: rgba(0, 0, 0, 0.55);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
    }

    .tts-panel-overlay.open {
      display: block;
    }

    /* Settings Panel als zentriertes Modal auf Desktop */
    .tts-control-panel {
      position: fixed;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%) scale(0.95);
      width: 460px;
      max-width: calc(100vw - 32px);
      max-height: min(84vh, 720px);
      background: var(--bg-card);
      border: 1px solid var(--border-accent);
      border-radius: 20px;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 24px rgba(56, 189, 248, 0.2);
      padding: 1.25rem 1.45rem;
      z-index: 520;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      color: var(--text-main);
      display: flex;
      flex-direction: column;
      gap: 0.95rem;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-width: thin;
      scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
    }

    .tts-control-panel::-webkit-scrollbar {
      width: 6px;
    }

    .tts-control-panel::-webkit-scrollbar-track {
      background: transparent;
    }

    .tts-control-panel::-webkit-scrollbar-thumb {
      background-color: rgba(56, 189, 248, 0.35);
      border-radius: 3px;
    }

    .tts-control-panel::-webkit-scrollbar-thumb:hover {
      background-color: var(--primary);
    }

    .tts-control-panel.open {
      opacity: 1;
      pointer-events: auto;
      transform: translate(-50%, -50%) scale(1);
    }

    .tts-panel-header {
      position: sticky;
      top: -1.25rem;
      background: var(--bg-card);
      margin: -1.25rem -1.45rem 0.25rem -1.45rem;
      padding: 1.15rem 1.45rem 0.85rem 1.45rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--border-main);
      z-index: 5;
    }

    .tts-panel-title {
      font-size: 0.95rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      color: var(--primary);
    }

    .tts-panel-close {
      background: transparent;
      border: none;
      color: var(--text-muted);
      font-size: 1.1rem;
      cursor: pointer;
      padding: 2px 6px;
      border-radius: 4px;
    }

    .tts-panel-close:hover {
      color: var(--text-main);
      background: var(--bg-hover);
    }

    .tts-action-buttons {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      margin-bottom: 1.25rem;
      padding: 0.25rem 0;
    }

    .tts-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      border: none;
      transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
      touch-action: manipulation;
      user-select: none;
    }

    /* Primary Play/Pause Button (56px FAB / Pill) */
    .tts-btn-play {
      height: 56px;
      min-width: 140px;
      border-radius: 28px;
      background: linear-gradient(135deg, #0284c7, #38bdf8);
      color: #ffffff;
      font-size: 1.05rem;
      font-weight: 700;
      gap: 10px;
      box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
      flex: 1.4;
    }

    .tts-btn-play:active {
      transform: scale(0.94);
      box-shadow: 0 2px 10px rgba(2, 132, 199, 0.3);
    }

    .tts-btn-play i {
      font-size: 1.35rem;
    }

    /* Previous, Next, Stop Buttons (52px x 52px Touch-Targets) */
    .tts-btn-prev,
    .tts-btn-next,
    .tts-btn-stop {
      width: 52px;
      height: 52px;
      min-width: 52px;
      min-height: 52px;
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.14);
      color: var(--text-main);
      font-size: 1.2rem;
      flex: 0 0 52px;
    }

    [data-theme="light"] .tts-btn-prev,
    [data-theme="light"] .tts-btn-next,
    [data-theme="light"] .tts-btn-stop {
      background: rgba(0, 0, 0, 0.05);
      border: 1px solid rgba(0, 0, 0, 0.12);
      color: #1e293b;
    }

    .tts-btn-prev:active,
    .tts-btn-next:active {
      transform: scale(0.92);
      background: rgba(255, 255, 255, 0.18);
    }

    .tts-btn-stop {
      background: rgba(239, 68, 68, 0.15);
      border-color: rgba(239, 68, 68, 0.3);
      color: #f87171;
    }

    .tts-btn-stop:active {
      transform: scale(0.92);
      background: rgba(239, 68, 68, 0.3);
    }

    .tts-setting-row {
      display: flex;
      flex-direction: column;
      gap: 0.45rem;
      margin-bottom: 0.85rem;
    }

    .tts-setting-label {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .tts-select {
      height: 50px;
      background: var(--bg-input);
      border: 1.5px solid var(--border-main);
      color: var(--text-main);
      border-radius: 14px;
      padding: 0 1rem;
      font-size: 0.92rem;
      font-weight: 500;
      outline: none;
      cursor: pointer;
      width: 100%;
      box-sizing: border-box;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .tts-select:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
    }

    /* Material 3 Slider with 26px Thumb and Thick 8px Track */
    .tts-slider {
      -webkit-appearance: none;
      appearance: none;
      width: 100%;
      height: 38px;
      background: transparent;
      cursor: pointer;
      margin: 4px 0;
    }

    .tts-slider:focus {
      outline: none;
    }

    .tts-slider::-webkit-slider-runnable-track {
      width: 100%;
      height: 8px;
      background: rgba(255, 255, 255, 0.14);
      border-radius: 4px;
    }

    [data-theme="light"] .tts-slider::-webkit-slider-runnable-track {
      background: rgba(0, 0, 0, 0.12);
    }

    .tts-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: #38bdf8;
      border: 3px solid #ffffff;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
      margin-top: -9px;
      transition: transform 0.12s ease, box-shadow 0.12s ease;
    }

    .tts-slider::-webkit-slider-thumb:active {
      transform: scale(1.18);
      box-shadow: 0 0 0 8px rgba(56, 189, 248, 0.3);
    }

    .tts-slider::-moz-range-track {
      width: 100%;
      height: 8px;
      background: rgba(255, 255, 255, 0.14);
      border-radius: 4px;
    }

    .tts-slider::-moz-range-thumb {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: #38bdf8;
      border: 3px solid #ffffff;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
      cursor: pointer;
    }

    /* Material 3 Card Toggles / Switches (52px Height Row) */
    .tts-toggle-card {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-height: 52px;
      padding: 0.65rem 0.95rem;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid var(--border-main);
      border-radius: 14px;
      cursor: pointer;
      margin-top: 0.45rem;
      user-select: none;
      transition: background 0.15s ease, border-color 0.15s ease;
    }

    [data-theme="light"] .tts-toggle-card {
      background: rgba(0, 0, 0, 0.03);
    }

    .tts-toggle-card:active {
      background: rgba(255, 255, 255, 0.08);
    }

    /* Stock Android M3 Switch */
    .m3-switch {
      position: relative;
      display: inline-block;
      width: 48px;
      height: 28px;
      flex-shrink: 0;
    }

    .m3-switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .m3-switch-slider {
      position: absolute;
      cursor: pointer;
      inset: 0;
      background-color: rgba(255, 255, 255, 0.2);
      border-radius: 28px;
      transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      border: 1.5px solid rgba(255, 255, 255, 0.3);
    }

    [data-theme="light"] .m3-switch-slider {
      background-color: rgba(0, 0, 0, 0.15);
      border-color: rgba(0, 0, 0, 0.25);
    }

    .m3-switch-slider::before {
      position: absolute;
      content: "";
      height: 20px;
      width: 20px;
      left: 2px;
      bottom: 2px;
      background-color: #ffffff;
      border-radius: 50%;
      transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    }

    .m3-switch input:checked + .m3-switch-slider {
      background-color: var(--primary);
      border-color: var(--primary);
    }

    .m3-switch input:checked + .m3-switch-slider::before {
      transform: translateX(20px);
    }

    .tts-status-badge {
      font-size: 0.8rem;
      padding: 0.65rem 0.85rem;
      background: var(--bg-input);
      border: 1px solid var(--border-main);
      border-radius: 12px;
      color: var(--text-muted);
      text-align: center;
      margin-top: 0.5rem;
    }

    /* Modal Dialog (Meine Dokumente) */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.65);
      backdrop-filter: blur(4px);
      z-index: 600;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 1rem;
    }

    .modal-overlay.open {
      display: flex;
    }

    .modal-box {
      background: var(--bg-card);
      border: 1px solid var(--border-accent);
      border-radius: 12px;
      width: 520px;
      max-width: 100%;
      max-height: 85vh;
      display: flex;
      flex-direction: column;
      box-shadow: var(--shadow-modal);
    }

    .modal-header {
      padding: 1rem 1.25rem;
      border-bottom: 1px solid var(--border-main);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .modal-header h3 {
      font-size: 1.1rem;
      font-weight: 700;
      color: var(--primary);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .modal-body {
      padding: 1.25rem;
      overflow-y: auto;
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }

    .doc-item-card {
      background: var(--bg-input);
      border: 1px solid var(--border-main);
      border-radius: 8px;
      padding: 0.75rem 1rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .doc-item-card:hover {
      border-color: var(--primary);
      background: var(--bg-hover);
      transform: translateX(3px);
    }

    .doc-item-info {
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
    }

    .doc-item-title {
      font-weight: 600;
      font-size: 0.9rem;
      color: var(--text-main);
    }

    .doc-item-meta {
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    /* Notification Toast */
    .toast {
      position: fixed;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%) translateY(100px);
      background: var(--bg-card);
      border: 1px solid var(--border-accent);
      color: var(--text-main);
      padding: 0.65rem 1.25rem;
      border-radius: 8px;
      box-shadow: var(--shadow-modal);
      font-size: 0.85rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      z-index: 1000;
      opacity: 0;
      transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      pointer-events: none;
    }

    .toast.show {
      transform: translateX(-50%) translateY(0);
      opacity: 1;
    }

    /* ==========================================================================
       Virtualization Placeholders & Layout Containment
       ========================================================================== */
    .pdf-page-placeholder {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 1;
      pointer-events: none;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: var(--bg-card);
      border: 1px dashed var(--border-main);
      border-radius: 4px;
      color: var(--text-dim);
      font-size: 0.9rem;
      gap: 0.75rem;
      user-select: none;
    }

    .placeholder-badge {
      padding: 0.35rem 0.85rem;
      background: var(--bg-input);
      border: 1px solid var(--border-main);
      border-radius: 6px;
      font-weight: 600;
      font-size: 0.85rem;
      color: var(--text-muted);
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

    /* ==========================================================================
       Floating Portrait Active Reading Plan Widget (Unten rechts & Mobil-optimiert)
       ========================================================================== */
    .rp-active-banner {
      position: fixed;
      bottom: 24px;
      right: 24px;
      width: 290px;
      max-width: calc(100vw - 32px);
      background: rgba(11, 15, 25, 0.94);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1px solid rgba(56, 189, 248, 0.35);
      border-radius: 14px;
      padding: 0;
      margin: 0;
      display: none;
      flex-direction: column;
      box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 20px rgba(56, 189, 248, 0.12);
      z-index: 990;
      overflow: hidden;
      transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      user-select: none;
    }

    .rp-widget-inner {
      display: flex;
      flex-direction: column;
      width: 100%;
    }

    .rp-widget-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.65rem 0.85rem;
      background: rgba(255, 255, 255, 0.03);
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .rp-widget-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #38bdf8;
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.3);
      padding: 0.2rem 0.55rem;
      border-radius: 9999px;
    }

    .rp-widget-controls {
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }

    .rp-widget-btn {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: #94a3b8;
      width: 26px;
      height: 26px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.75rem;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .rp-widget-btn:hover {
      background: rgba(255, 255, 255, 0.12);
      color: #ffffff;
    }

    .rp-widget-close:hover {
      background: rgba(239, 68, 68, 0.2);
      color: #f87171;
      border-color: rgba(239, 68, 68, 0.4);
    }

    .rp-widget-body {
      display: flex;
      flex-direction: column;
      padding: 0.85rem;
      gap: 0.6rem;
    }

    .rp-widget-title {
      font-size: 0.92rem;
      font-weight: 700;
      color: #f8fafc;
      line-height: 1.35;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .rp-widget-sub {
      font-size: 0.8rem;
      color: #94a3b8;
      line-height: 1.3;
    }

    .rp-widget-time {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      font-size: 0.82rem;
      color: #cbd5e1;
      background: rgba(15, 23, 42, 0.7);
      border: 1px solid rgba(255, 255, 255, 0.08);
      padding: 0.35rem 0.65rem;
      border-radius: 8px;
      width: fit-content;
    }

    .rp-widget-time b {
      color: #38bdf8;
    }

    .rp-widget-actions {
      display: flex;
      flex-direction: column;
      gap: 0.45rem;
      margin-top: 0.25rem;
    }

    .rp-btn-action {
      width: 100%;
      padding: 0.6rem 0.85rem;
      border-radius: 8px;
      font-size: 0.85rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      cursor: pointer;
      transition: all 0.15s ease;
      border: none;
    }

    .rp-btn-play {
      background: linear-gradient(135deg, #0284c7, #2563eb);
      color: #ffffff;
      box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
    }

    .rp-btn-play:hover {
      background: linear-gradient(135deg, #0369a1, #1d4ed8);
      transform: translateY(-1px);
      box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
    }

    .rp-btn-complete {
      background: linear-gradient(135deg, #059669, #10b981);
      color: #ffffff;
      box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    }

    .rp-btn-complete:hover {
      background: linear-gradient(135deg, #047857, #059669);
      transform: translateY(-1px);
      box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
    }

    /* Minimized Capsule Pill */
    .rp-widget-min {
      display: none;
      align-items: center;
      justify-content: space-between;
      padding: 0.5rem 0.75rem;
      cursor: pointer;
      background: rgba(11, 15, 25, 0.95);
      gap: 0.5rem;
    }

    .rp-min-left {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      font-size: 0.82rem;
      color: #f1f5f9;
    }

    .rp-min-tag {
      font-weight: 700;
      color: #38bdf8;
    }

    .rp-min-sep {
      color: #64748b;
    }

    .rp-min-time {
      color: #94a3b8;
      font-size: 0.78rem;
    }

    .rp-min-right {
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }

    .rp-min-play-btn {
      background: #0284c7;
      color: #fff;
      border: none;
      width: 24px;
      height: 24px;
      border-radius: 9999px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.68rem;
      cursor: pointer;
      transition: transform 0.15s ease;
    }

    .rp-min-play-btn:hover {
      transform: scale(1.1);
      background: #0369a1;
    }

    .rp-min-expand-btn {
      background: transparent;
      color: #94a3b8;
      border: none;
      font-size: 0.75rem;
      cursor: pointer;
      padding: 0.2rem;
    }

    /* When .minimized class is active */
    .rp-active-banner.minimized {
      width: auto;
      border-radius: 9999px;
      padding: 0;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    }

    .rp-active-banner.minimized .rp-widget-header,
    .rp-active-banner.minimized .rp-widget-body {
      display: none !important;
    }

    .rp-active-banner.minimized .rp-widget-min {
      display: flex !important;
    }

    /* Mobile Floating Positioning (gestapelt über Bottom-Dock & Hören-Steuerung) */
    @media (max-width: 768px) {
      .rp-active-banner {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        right: 12px;
        left: auto;
        width: auto;
        max-width: calc(100vw - 24px);
        z-index: 992;
        transition: bottom 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
      }

      /* Wenn die Hören-Steuerung (Mini-Player) aktiv / eingeblendet ist: Leseplan-Widget sauber oberhalb der Hören-Steuerung stapeln */
      body.has-mobile-tts .rp-active-banner,
      body.tts-playing .rp-active-banner,
      body.has-tts-player .rp-active-banner,
      .has-mobile-tts .rp-active-banner {
        bottom: calc(152px + env(safe-area-inset-bottom, 0px)) !important;
      }
    }

    /* Mobile Sheet Active Plan Card (Burgermenü) */
    .sheet-plan-card {
      background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.85));
      border: 1px solid rgba(56, 189, 248, 0.4);
      border-radius: 12px;
      padding: 0.85rem;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
      margin-bottom: 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 0.6rem;
    }

    .sheet-plan-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .sheet-plan-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      color: #38bdf8;
      background: rgba(56, 189, 248, 0.15);
      padding: 0.2rem 0.5rem;
      border-radius: 6px;
    }

    .sheet-plan-time {
      font-size: 0.8rem;
      color: #94a3b8;
      background: rgba(0, 0, 0, 0.25);
      padding: 0.2rem 0.5rem;
      border-radius: 6px;
    }

    .sheet-plan-time b {
      color: #38bdf8;
    }

    .sheet-plan-title {
      font-size: 0.92rem;
      font-weight: 700;
      color: #ffffff;
      line-height: 1.35;
    }

    .sheet-plan-sub {
      font-size: 0.8rem;
      color: #cbd5e1;
    }

    .sheet-plan-buttons {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
      margin-top: 0.25rem;
    }

    .sheet-plan-btn {
      padding: 0.55rem;
      border-radius: 8px;
      font-size: 0.82rem;
      font-weight: 600;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.4rem;
      transition: all 0.15s ease;
    }

    .sheet-plan-btn-play {
      background: linear-gradient(135deg, #0284c7, #2563eb);
      color: #ffffff;
    }

    .sheet-plan-btn-complete {
      background: linear-gradient(135deg, #059669, #10b981);
      color: #ffffff;
    }

    .sheet-plan-btn-exit {
      background: transparent;
      color: #94a3b8;
      border: 1px solid rgba(255, 255, 255, 0.1);
      padding: 0.4rem;
      border-radius: 6px;
      font-size: 0.75rem;
      cursor: pointer;
      margin-top: 0.2rem;
      text-align: center;
      transition: all 0.15s ease;
    }

    .sheet-plan-btn-exit:hover {
      color: #f87171;
      border-color: rgba(239, 68, 68, 0.3);
    }

    /* Reading Plans Modal & Cards */
    .rp-modal-container {
      max-width: 860px;
      width: 95%;
      max-height: 88vh;
      display: flex;
      flex-direction: column;
    }

    .rp-main-tabs {
      display: flex;
      gap: 0.5rem;
      border-bottom: 1px solid var(--border-main);
      padding: 0 1.25rem;
      background: var(--bg-header);
    }

    .rp-main-tab-btn {
      background: none;
      border: none;
      border-bottom: 2px solid transparent;
      padding: 0.75rem 1rem;
      color: var(--text-muted);
      font-weight: 600;
      font-size: 0.85rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.4rem;
      transition: all 0.15s ease;
    }

    .rp-main-tab-btn:hover {
      color: var(--text-main);
    }

    .rp-main-tab-btn.active {
      color: var(--primary);
      border-bottom-color: var(--primary);
    }

    .rp-cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
      gap: 1rem;
      padding: 1.25rem;
    }

    .rp-card {
      background: var(--bg-card);
      border: 1px solid var(--border-main);
      border-radius: 10px;
      padding: 1.15rem;
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
      transition: all 0.2s ease;
      position: relative;
    }

    .rp-card:hover {
      border-color: var(--border-accent);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
      transform: translateY(-2px);
    }

    .rp-card-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 0.75rem;
    }

    .rp-card-doc-tag {
      font-size: 0.72rem;
      color: var(--text-dim);
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      margin-bottom: 0.2rem;
    }

    .rp-card-doc-tag-physical {
      background: rgba(245, 158, 11, 0.15) !important;
      color: #f59e0b !important;
      border: 1px solid rgba(245, 158, 11, 0.3) !important;
      border-radius: 4px;
      padding: 0.15rem 0.45rem;
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
    }

    .gen-type-btn {
      background: transparent;
      color: var(--text-muted);
    }

    .gen-type-btn.active {
      background: var(--bg-card) !important;
      color: var(--primary) !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    }

    [data-theme="light"] .gen-type-btn.active {
      background: #ffffff !important;
      color: var(--primary) !important;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
    }

    .rp-card-title {
      font-size: 1rem;
      font-weight: 700;
      color: var(--text-main);
    }

    .rp-badge {
      padding: 0.2rem 0.55rem;
      border-radius: 6px;
      font-size: 0.72rem;
      font-weight: 700;
      white-space: nowrap;
    }

    .rp-badge-active {
      background: rgba(56, 189, 248, 0.15);
      border: 1px solid var(--border-accent);
      color: var(--primary);
    }

    .rp-badge-done {
      background: rgba(16, 185, 129, 0.15);
      border: 1px solid rgba(16, 185, 129, 0.4);
      color: #34d399;
    }

    .rp-card-desc {
      font-size: 0.8rem;
      color: var(--text-muted);
      line-height: 1.4;
    }

    .rp-card-stats-box {
      background: var(--bg-input);
      border: 1px solid var(--border-main);
      border-radius: 8px;
      padding: 0.65rem 0.85rem;
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
    }

    .rp-stat-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 0.8rem;
    }

    .rp-stat-label {
      color: var(--text-muted);
    }

    .rp-stat-val {
      font-weight: 600;
      color: var(--text-main);
    }

    .rp-time-highlight {
      color: var(--primary) !important;
      font-weight: 700 !important;
    }

    .rp-progress-wrapper {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
    }

    .rp-progress-labels {
      display: flex;
      justify-content: space-between;
      font-size: 0.72rem;
      color: var(--text-dim);
      font-weight: 600;
    }

    .rp-progress-track {
      width: 100%;
      height: 6px;
      background: var(--bg-input);
      border-radius: 999px;
      overflow: hidden;
      border: 1px solid var(--border-main);
    }

    .rp-progress-fill {
      height: 100%;
      background: linear-gradient(90deg, #0284c7, #38bdf8);
      border-radius: 999px;
      transition: width 0.3s ease;
    }

    .rp-card-actions {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-top: 0.25rem;
    }

    .rp-btn-read {
      flex: 1;
      padding: 0.45rem 0.85rem;
      font-size: 0.82rem;
      justify-content: center;
    }

    .rp-empty-state {
      grid-column: 1 / -1;
      text-align: center;
      padding: 3.5rem 1rem;
      color: var(--text-muted);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.75rem;
    }

    .rp-empty-icon {
      font-size: 3rem;
      opacity: 0.4;
      margin-bottom: 0.5rem;
      color: var(--primary);
    }

    /* Live Speed Slider Control in Modal Header */
    .rp-speed-control-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: var(--bg-card);
      border-bottom: 1px solid var(--border-main);
      padding: 0.6rem 1.25rem;
      font-size: 0.82rem;
      gap: 1rem;
      flex-wrap: wrap;
    }

    .rp-speed-slider-group {
      display: flex;
      align-items: center;
      gap: 0.65rem;
    }

    .rp-speed-slider {
      width: 120px;
      accent-color: var(--primary);
    }

    /* Overall Summary Banner in Modal */
    .rp-overall-summary-banner {
      background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(56, 189, 248, 0.05));
      border-bottom: 1px solid var(--border-accent);
      padding: 0.75rem 1.25rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      flex-wrap: wrap;
    }

    .rp-overall-stat-item {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      font-size: 0.84rem;
    }

    .rp-overall-stat-icon {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.95rem;
      flex-shrink: 0;
    }

    .rp-overall-stat-text {
      display: flex;
      flex-direction: column;
      line-height: 1.25;
    }

    .rp-overall-stat-title {
      font-size: 0.72rem;
      color: var(--text-muted);
      text-transform: uppercase;
      font-weight: 600;
      letter-spacing: 0.03em;
    }

    .rp-overall-stat-val {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--text-main);
    }

    /* Day Row in Overview */
    .rp-day-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.75rem 1rem;
      border-bottom: 1px solid var(--border-main);
      transition: background 0.15s ease;
    }

    .rp-day-row:hover {
      background: var(--bg-hover);
    }

    .rp-day-row.done {
      opacity: 0.7;
    }

    .rp-day-title {
      font-weight: 600;
      font-size: 0.88rem;
      color: var(--text-main);
    }

    .rp-day-meta {
      font-size: 0.75rem;
      color: var(--text-muted);
      display: flex;
      gap: 0.5rem;
      margin-top: 0.2rem;
    }

    /* Next Plan Auto-Launch Countdown Banner */
    .rp-next-plan-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(56, 189, 248, 0.15));
      border: 1px solid var(--border-accent);
      border-radius: 8px;
      padding: 0.85rem 1.15rem;
      margin: 1rem 0;
      gap: 1rem;
    }

    .rp-np-info {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      font-size: 0.88rem;
      color: var(--text-main);
    }

    /* Multi-Device Sync Status Badge */
    .sync-status-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      font-size: 0.82rem;
      font-weight: 600;
      padding: 0.35rem 0.75rem;
      border-radius: 20px;
      border: 1px solid var(--border-main);
      background: var(--bg-card);
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .sync-status-badge:hover {
      border-color: var(--primary);
      color: var(--text-main);
      transform: translateY(-1px);
    }

    .sync-status-badge.active {
      background: rgba(16, 185, 129, 0.12);
      border-color: rgba(16, 185, 129, 0.45);
      color: #10b981;
    }

    .sync-status-badge.active i {
      animation: pulse-sync 2s infinite ease-in-out;
    }

    @keyframes pulse-sync {
      0%, 100% { transform: scale(1); opacity: 1; }
      50% { transform: scale(1.2); opacity: 0.75; }
    }

    /* Mobile & Modern App Responsive Rules */
    @media (max-width: 640px) {
      .rp-cards-grid {
        grid-template-columns: 1fr !important;
        padding: 0.85rem !important;
        gap: 0.85rem !important;
      }
      .rp-card {
        padding: 1rem !important;
        border-radius: 16px !important;
      }
      .rp-card-title {
        font-size: 1.05rem !important;
      }
      .rp-day-row {
        padding: 0.75rem 0.65rem !important;
        gap: 0.5rem !important;
      }
      .rp-day-title {
        font-size: 0.85rem !important;
      }
      .doc-item-card {
        padding: 0.75rem 0.85rem !important;
        gap: 0.65rem !important;
      }
      .doc-item-title {
        font-size: 0.85rem !important;
        word-break: break-word !important;
      }
    }

    /* Reading Plan Day Completion Card (analog to efb/bible) */
    .rp-day-completion-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      gap: 0.85rem;
      padding: 2.25rem 1.5rem;
      margin: 2rem auto;
      max-width: 620px;
      width: 92%;
      background: linear-gradient(135deg, rgba(2, 132, 199, 0.16), rgba(16, 185, 129, 0.1));
      border: 2px dashed rgba(56, 189, 248, 0.45);
      border-radius: 20px;
      box-shadow: 0 10px 32px rgba(0, 0, 0, 0.3);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }

    .rp-dcc-icon {
      width: 58px;
      height: 58px;
      border-radius: 50%;
      background: rgba(16, 185, 129, 0.2);
      color: #10b981;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.7rem;
      border: 1px solid rgba(16, 185, 129, 0.4);
    }

    .rp-dcc-title {
      font-size: 1.3rem;
      font-weight: 800;
      color: var(--text-main);
    }

    .rp-dcc-sub {
      font-size: 0.9rem;
      color: var(--text-muted);
    }

    .rp-dcc-btn {
      padding: 0.85rem 1.8rem;
      font-size: 1rem;
      font-weight: 700;
      border-radius: 12px;
      cursor: pointer;
      box-shadow: 0 4px 18px rgba(2, 132, 199, 0.45);
      display: flex;
      align-items: center;
      gap: 0.6rem;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .rp-dcc-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 24px rgba(2, 132, 199, 0.6);
    }

    .rp-dcc-btn:active {
      transform: scale(0.96);
    }

    /* Auto-Chain Banner on Dashboard */
    .dash-chain-banner {
      background: linear-gradient(135deg, rgba(2, 132, 199, 0.22), rgba(56, 189, 248, 0.1));
      border: 1px solid var(--primary);
      border-radius: 16px;
      padding: 1rem 1.25rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      flex-wrap: wrap;
      box-shadow: 0 4px 20px rgba(56, 189, 248, 0.2);
    }

    .dash-chain-info {
      display: flex;
      align-items: center;
      gap: 0.85rem;
    }

    .dash-chain-icon {
      width: 44px;
      height: 44px;
      border-radius: 12px;
      background: rgba(56, 189, 248, 0.2);
      color: var(--primary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.25rem;
      flex-shrink: 0;
    }

    .dash-chain-title {
      font-size: 0.98rem;
      font-weight: 600;
      color: var(--text-main);
    }

    .dash-chain-sub {
      font-size: 0.84rem;
      color: var(--text-muted);
      margin-top: 0.15rem;
    }

    .dash-chain-actions {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    /* Collapsible "Später" / Auf Stand Accordion */
    .rp-later-section {
      grid-column: 1 / -1;
      margin-top: 1.25rem;
      border: 1px solid var(--border-main);
      border-radius: 16px;
      background: rgba(19, 27, 38, 0.45);
      backdrop-filter: blur(8px);
      overflow: hidden;
      transition: all 0.25s ease;
    }

    .rp-later-header {
      padding: 1rem 1.25rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      cursor: pointer;
      user-select: none;
      background: rgba(255, 255, 255, 0.02);
      transition: background 0.2s ease;
    }

    .rp-later-header:hover {
      background: rgba(56, 189, 248, 0.05);
    }

    .rp-later-title-wrap {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .rp-later-icon {
      width: 38px;
      height: 38px;
      border-radius: 10px;
      background: rgba(16, 185, 129, 0.15);
      border: 1px solid rgba(16, 185, 129, 0.3);
      color: #10b981;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.05rem;
      flex-shrink: 0;
    }

    .rp-later-title {
      font-weight: 700;
      font-size: 0.98rem;
      color: var(--text-main);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .rp-later-badge {
      font-size: 0.75rem;
      padding: 0.15rem 0.55rem;
      border-radius: 999px;
      background: var(--bg-card);
      border: 1px solid var(--border-main);
      color: var(--text-muted);
      font-weight: 600;
    }

    .rp-later-chevron {
      font-size: 0.95rem;
      color: var(--text-muted);
      transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .rp-later-section.open .rp-later-chevron {
      transform: rotate(180deg);
      color: var(--primary);
    }

    .rp-later-content {
      display: none;
      padding: 1rem 1.25rem 1.25rem 1.25rem;
      border-top: 1px solid var(--border-main);
      animation: fadeInLater 0.2s ease;
    }

    .rp-later-section.open .rp-later-content {
      display: block;
    }

    @keyframes fadeInLater {
      from { opacity: 0; transform: translateY(-4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .rp-later-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
      gap: 1rem;
    }

    @media (max-width: 640px) {
      .rp-later-grid {
        grid-template-columns: 1fr;
      }
      .rp-later-header {
        padding: 0.85rem 1rem;
      }
      .rp-later-content {
        padding: 0.85rem 1rem 1rem 1rem;
      }
    }

    /* ==========================================================================
       Native Mobile App Experience for BSB PDF Reader (Screens <= 768px)
       ========================================================================== */
    .mobile-app-header {
      display: none;
    }

    .mobile-app-dock {
      display: none;
    }

    .mobile-mini-player {
      display: none !important;
    }

    .mobile-bottom-sheet {
      display: none;
    }

    .mobile-sheet-overlay {
      display: none;
    }

    .sheet-drag-handle {
      display: none;
    }

    .immersive-restore-pill {
      display: none;
    }

    @media (max-width: 768px) {
      /* Hide crowded desktop header, float tile & desktop player bar */
      .app-header {
        display: none !important;
      }
      .tts-float-tile {
        display: none !important;
      }
      .tts-player-bar {
        display: none !important;
      }

      /* Native Mobile Top Header */
      .mobile-app-header {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: calc(56px + env(safe-area-inset-top, 0px));
        padding-top: env(safe-area-inset-top, 0px);
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        background: rgba(19, 27, 38, 0.92);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-main);
        z-index: 150;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
      }

      [data-theme="light"] .mobile-app-header {
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
      }

      .mah-left {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        flex: 1;
        min-width: 0;
      }

      .mah-btn {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border-main);
        color: var(--text-main);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.95rem;
        cursor: pointer;
        flex-shrink: 0;
        transition: all 0.15s ease;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
      }

      .mah-btn:active {
        transform: scale(0.92);
        background: var(--bg-hover);
      }

      .mah-btn-back {
        color: var(--primary);
        font-size: 1.05rem;
      }

      .mah-title-group {
        display: flex;
        flex-direction: column;
        justify-content: center;
        cursor: pointer;
        min-width: 0;
        flex: 1;
      }

      .mah-title {
        font-size: 0.92rem;
        font-weight: 700;
        color: var(--text-main);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        letter-spacing: -0.01em;
      }

      .mah-subtitle {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.72rem;
        color: var(--text-muted);
        margin-top: 1px;
      }

      .mah-badge {
        font-weight: 600;
        color: var(--primary);
      }

      .mah-plan-chip {
        background: rgba(56, 189, 248, 0.15);
        color: #38bdf8;
        padding: 0.1rem 0.45rem;
        border-radius: 999px;
        font-weight: 700;
        font-size: 0.68rem;
        border: 1px solid rgba(56, 189, 248, 0.3);
      }

      .mah-right {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        flex-shrink: 0;
      }

      /* Adjust Viewer Container for Mobile Bars */
      .viewer-container {
        padding-top: calc(56px + env(safe-area-inset-top, 0px) + 6px);
        padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px) + 16px);
        padding-left: 0.35rem;
        padding-right: 0.35rem;
      }

      /* Thumb-Friendly Bottom Navigation Dock */
      .mobile-app-dock {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 150;
        background: rgba(19, 27, 38, 0.94);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-top: 1px solid var(--border-main);
        padding: 0.45rem 0.65rem calc(0.45rem + env(safe-area-inset-bottom, 0px)) 0.65rem;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
      }

      [data-theme="light"] .mobile-app-dock {
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
      }

      .mad-inner {
        width: 100%;
        max-width: 520px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.4rem;
      }

      .mad-btn {
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border-main);
        color: var(--text-main);
        border-radius: 12px;
        padding: 0.45rem 0.6rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        min-width: 44px;
        min-height: 44px;
        transition: all 0.15s ease;
        -webkit-tap-highlight-color: transparent;
      }

      .mad-btn:active {
        transform: scale(0.92);
        background: var(--bg-hover);
      }

      .mad-btn-nav {
        font-size: 1rem;
        color: var(--primary);
        width: 44px;
        height: 44px;
        padding: 0;
      }

      .mad-btn-label {
        font-size: 0.68rem;
        font-weight: 600;
        margin-top: 2px;
        color: var(--text-muted);
      }

      /* Interactive Page Scrubber Capsule */
      .mad-page-capsule {
        flex: 1;
        min-width: 80px;
        max-width: 130px;
        height: 44px;
        background: rgba(56, 189, 248, 0.08);
        border: 1px solid var(--border-accent);
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.2rem 0.5rem;
        cursor: pointer;
        transition: all 0.15s ease;
        -webkit-tap-highlight-color: transparent;
      }

      .mad-page-capsule:active {
        transform: scale(0.95);
        background: rgba(56, 189, 248, 0.16);
      }

      .mad-capsule-text {
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--text-main);
        letter-spacing: -0.01em;
      }

      .mad-capsule-bar {
        width: 100%;
        height: 3px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 999px;
        margin-top: 3px;
        overflow: hidden;
      }

      .mad-capsule-progress {
        height: 100%;
        background: var(--primary);
        border-radius: 999px;
        transition: width 0.2s ease;
      }

      .mad-dock-divider {
        width: 1px;
        height: 28px;
        background: var(--border-main);
        margin: 0 0.15rem;
      }

      /* Vorlese-Kapsel (Audio-Player Button) */
      .mad-btn-tts {
        flex: 1.1;
        background: linear-gradient(135deg, rgba(2, 132, 199, 0.18), rgba(56, 189, 248, 0.12));
        border: 1px solid var(--border-accent);
      }

      .mad-tts-icon-wrap {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .mad-tts-icon-wrap i {
        font-size: 0.95rem;
        color: var(--primary);
      }

      .mad-btn-tts.is-speaking {
        background: var(--primary);
        border-color: var(--primary);
      }

      .mad-btn-tts.is-speaking .mad-tts-icon-wrap i {
        color: #ffffff;
      }

      .mad-btn-tts.is-speaking .mad-btn-label {
        color: #ffffff;
      }

      .mad-tts-pulse-ring {
        display: none;
        position: absolute;
        inset: -6px;
        border-radius: 50%;
        border: 2px solid var(--primary);
        animation: madPulse 1.6s infinite ease-out;
      }

      .mad-btn-tts.is-speaking .mad-tts-pulse-ring {
        display: block;
      }

      @keyframes madPulse {
        0% { transform: scale(0.8); opacity: 0.8; }
        100% { transform: scale(1.6); opacity: 0; }
      }

      /* Floating Mini-Player (Nur Mobilgeräte <= 768px) */
      .mobile-mini-player {
        display: flex !important;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 8px);
        z-index: 145;
        background: rgba(24, 34, 50, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--border-accent);
        border-radius: 14px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.65), 0 0 16px rgba(56, 189, 248, 0.2);
        flex-direction: column;
        overflow: hidden;
        cursor: pointer;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
        animation: slideUpMini 0.25s ease-out;
      }

      [data-theme="light"] .mobile-mini-player {
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 16px rgba(2, 132, 199, 0.15);
      }

      @keyframes slideUpMini {
        from { transform: translateY(20px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
      }

      .mmp-progress-bar {
        width: 100%;
        height: 3px;
        background: rgba(255, 255, 255, 0.08);
      }

      .mmp-progress-fill {
        height: 100%;
        background: var(--primary);
        transition: width 0.2s ease;
      }

      .mmp-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 0.75rem;
        gap: 0.6rem;
      }

      .mmp-meta {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        min-width: 0;
        flex: 1;
      }

      .mmp-waves {
        display: flex;
        align-items: flex-end;
        gap: 2px;
        height: 16px;
        flex-shrink: 0;
      }

      .wave-bar {
        width: 3px;
        height: 8px;
        background: var(--primary);
        border-radius: 2px;
        animation: waveAnim 1s infinite ease-in-out;
      }

      .wave-bar:nth-child(2) { animation-delay: 0.2s; height: 14px; }
      .wave-bar:nth-child(3) { animation-delay: 0.4s; height: 10px; }

      @keyframes waveAnim {
        0%, 100% { height: 4px; }
        50% { height: 16px; }
      }

      .mmp-text-box {
        min-width: 0;
        flex: 1;
      }

      .mmp-snippet {
        font-size: 0.82rem;
        font-weight: 600;
        color: var(--text-main);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .mmp-subtext {
        font-size: 0.7rem;
        color: var(--text-muted);
        margin-top: 1px;
      }

      .mmp-controls {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex-shrink: 0;
      }

      .mmp-btn {
        min-width: 48px;
        min-height: 48px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.14);
        color: var(--text-main);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.15rem;
        cursor: pointer;
        transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease;
        touch-action: manipulation;
      }

      .mmp-btn:active {
        transform: scale(0.9);
        background: rgba(255, 255, 255, 0.18);
      }

      .mmp-btn-play {
        background: linear-gradient(135deg, #0284c7, #38bdf8);
        border: none;
        color: #ffffff;
        min-width: 56px;
        min-height: 56px;
        border-radius: 50%;
        font-size: 1.35rem;
        box-shadow: 0 4px 18px rgba(2, 132, 199, 0.5);
      }

      .mmp-btn-play:active {
        transform: scale(0.92);
        box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
      }

      .mmp-btn-close {
        color: var(--text-dim);
      }

      /* Native Bottom Sheets */
      .mobile-sheet-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 550;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        display: block;
      }

      .mobile-sheet-overlay.open {
        opacity: 1;
        pointer-events: auto;
      }

      .mobile-bottom-sheet {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 85vh;
        background: var(--bg-card);
        border-top: 1px solid var(--border-accent);
        border-radius: 24px 24px 0 0;
        z-index: 600;
        transform: translateY(100%);
        transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.75);
        flex-direction: column;
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
      }

      .mobile-bottom-sheet.open {
        transform: translateY(0);
      }

      .sheet-drag-handle {
        width: 44px;
        height: 4px;
        background: var(--text-dim);
        border-radius: 999px;
        margin: 0.75rem auto 0.5rem auto;
        opacity: 0.45;
        cursor: pointer;
      }

      .sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 1.25rem 0.85rem 1.25rem;
        border-bottom: 1px solid var(--border-main);
      }

      .sheet-title {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--text-main);
        display: flex;
        align-items: center;
        gap: 0.5rem;
      }

      .sheet-close-btn {
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-size: 1.2rem;
        cursor: pointer;
        padding: 4px;
      }

      .sheet-body {
        padding: 1.15rem 1.25rem;
      }

      .sheet-body-scroll {
        overflow-y: auto;
        flex: 1;
        max-height: calc(85vh - 75px);
      }

      .sheet-section-title {
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-dim);
        margin: 0.85rem 0 0.5rem 0;
      }

      .sheet-section-title:first-child {
        margin-top: 0;
      }

      .sheet-grid-3 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.65rem;
      }

      .sheet-action-card {
        background: var(--bg-input);
        border: 1px solid var(--border-main);
        border-radius: 12px;
        padding: 0.75rem 0.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        color: var(--text-main);
        cursor: pointer;
        transition: all 0.15s ease;
      }

      .sheet-action-card:active {
        transform: scale(0.94);
        background: var(--bg-hover);
      }

      .sheet-action-card.active {
        background: var(--primary-dim);
        border-color: var(--border-accent);
        color: var(--primary);
      }

      .sheet-action-card .sheet-icon {
        font-size: 1.15rem;
        margin-bottom: 2px;
      }

      .sheet-action-card .sheet-label {
        font-size: 0.78rem;
        font-weight: 600;
      }

      .sheet-action-card .sheet-sublabel {
        font-size: 0.68rem;
        color: var(--text-muted);
      }

      .sheet-zoom-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 0.45rem;
      }

      .zoom-pill {
        background: var(--bg-input);
        border: 1px solid var(--border-main);
        color: var(--text-main);
        padding: 0.45rem 0.85rem;
        border-radius: 8px;
        font-size: 0.8rem;
        font-weight: 600;
        cursor: pointer;
      }

      .zoom-pill:active {
        background: var(--primary);
        color: #fff;
      }

      .sheet-list-group {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
      }

      .sheet-list-item {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        padding: 0.75rem 0.85rem;
        background: var(--bg-input);
        border: 1px solid var(--border-main);
        border-radius: 12px;
        color: var(--text-main);
        text-align: left;
        cursor: pointer;
        transition: all 0.15s ease;
        width: 100%;
      }

      .sheet-list-item:active {
        background: var(--bg-hover);
        transform: scale(0.98);
      }

      .sli-icon {
        font-size: 1.25rem;
        width: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .sli-text {
        flex: 1;
        min-width: 0;
      }

      .sli-title {
        font-size: 0.88rem;
        font-weight: 600;
        color: var(--text-main);
      }

      .sli-desc {
        font-size: 0.72rem;
        color: var(--text-muted);
        margin-top: 2px;
      }

      .sli-arrow {
        color: var(--text-dim);
        font-size: 0.8rem;
      }

      /* Scrubber Sheet */
      .scrubber-display {
        text-align: center;
        padding: 0.5rem 0 1rem 0;
      }

      .scrubber-current-page {
        font-size: 2.2rem;
        font-weight: 800;
        color: var(--primary);
      }

      .scrubber-total-pages {
        font-size: 1.1rem;
        color: var(--text-muted);
        margin-left: 0.35rem;
      }

      .scrubber-slider-wrap {
        padding: 0.5rem 0.25rem 1rem 0.25rem;
      }

      .scrubber-range-slider {
        width: 100%;
        height: 8px;
        accent-color: var(--primary);
        cursor: pointer;
      }

      .scrubber-quick-chips {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        margin-bottom: 1.25rem;
      }

      .scrubber-chip {
        background: var(--bg-input);
        border: 1px solid var(--border-main);
        color: var(--text-main);
        padding: 0.4rem 0.75rem;
        border-radius: 8px;
        font-size: 0.78rem;
        font-weight: 600;
        cursor: pointer;
      }

      .scrubber-input-row {
        display: flex;
        gap: 0.65rem;
      }

      .scrubber-num-input {
        flex: 1;
        background: var(--bg-input);
        border: 1px solid var(--border-main);
        border-radius: 8px;
        padding: 0.6rem 0.85rem;
        color: var(--text-main);
        font-size: 0.95rem;
        font-weight: 600;
        outline: none;
      }

      /* Mobile Audio Sheet: Convert #ttsControlPanel into native bottom sheet */
      .tts-panel-overlay {
        position: fixed !important;
        inset: 0 !important;
        z-index: 590 !important;
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease !important;
      }

      .tts-panel-overlay.open {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
      }

      .tts-control-panel {
        top: auto !important;
        right: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 24px 24px 0 0 !important;
        transform: translateY(100%) scale(1) !important;
        border-bottom: none !important;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.75) !important;
        padding: 0.75rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) 1.25rem !important;
        z-index: 600 !important;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease !important;
      }

      .tts-control-panel.open {
        transform: translateY(0) scale(1) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
      }

      .tts-control-panel .tts-panel-header {
        position: static !important;
        top: auto !important;
        margin: 0 !important;
        padding: 0 0 0.6rem 0 !important;
        background: transparent !important;
      }

      /* All desktop modals become native bottom sheets on mobile */
      .modal-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
      }

      .modal-box {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        max-height: 90vh !important;
        border-bottom: none !important;
        margin: 0 !important;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        animation: slideUpSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      }

      @keyframes slideUpSheet {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
      }

      /* Mobile In-PDF Search Bar */
      .search-bar {
        position: fixed !important;
        top: calc(56px + env(safe-area-inset-top, 0px) + 6px) !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        border-radius: 14px !important;
      }

      .search-input {
        flex: 1 !important;
        width: auto !important;
      }

      /* Immersive Distraction-Free Reading Mode */
      body.immersive-mode .mobile-app-header {
        transform: translateY(-100%) !important;
      }

      body.immersive-mode .mobile-app-dock {
        transform: translateY(100%) !important;
      }

      body.immersive-mode .mobile-mini-player {
        transform: translateY(180%) !important;
      }

      body.immersive-mode .immersive-restore-pill {
        display: flex;
      }

      .immersive-restore-pill {
        position: fixed;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        background: rgba(19, 27, 38, 0.85);
        backdrop-filter: blur(12px);
        border: 1px solid var(--border-accent);
        border-radius: 999px;
        padding: 0.45rem 0.85rem;
        gap: 0.45rem;
        color: var(--primary);
        font-size: 0.78rem;
        font-weight: 700;
        align-items: center;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
        cursor: pointer;
        z-index: 120;
        animation: fadeInLater 0.2s ease;
      }
    }

    /* ==========================================================================
       Smooth Zoom Containment (Prevent Viewport Overlays from moving)
       ========================================================================== */
    .viewer-container {
      touch-action: pan-x pan-y;
    }

    #pdfPagesWrapper {
      transition: transform 0.05s ease-out;
    }

    /* ==========================================================================
       Vereinfachte Leseansicht (Reflow Reader Mode)
       Desktop: Bilder links, Text groß und mitlaufend mittig
       Mobile: Text groß und mitlaufend oben, Bilderleiste unten
       ========================================================================== */
    .simplified-reader-container {
      flex: 1 1 0%;
      min-height: 0;
      height: 100%;
      width: 100%;
      display: flex;
      overflow: hidden;
      background-color: var(--bg-app);
      color: var(--text-main);
      position: relative;
    }

    /* Desktop Left Media Sidebar (Entfernt / Ausgeblendet) */
    .simplified-media-sidebar {
      display: none !important;
    }

    .simplified-media-header {
      padding: 1rem 1.15rem;
      font-weight: 700;
      font-size: 0.88rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      color: var(--primary);
      border-bottom: 1px solid var(--border-main);
      background: var(--bg-card);
      position: sticky;
      top: 0;
      z-index: 10;
    }

    .simplified-media-gallery {
      padding: 1rem 0.85rem;
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .simplified-media-card {
      background: var(--bg-card);
      border: 1px solid var(--border-main);
      border-radius: 8px;
      overflow: hidden;
      cursor: pointer;
      transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .simplified-media-card:hover {
      transform: translateY(-2px);
      border-color: var(--primary);
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    }

    .simplified-media-card img {
      width: 100%;
      height: auto;
      display: block;
    }

    .simplified-media-label {
      padding: 0.4rem 0.6rem;
      font-size: 0.75rem;
      color: var(--text-muted);
      font-weight: 600;
      background: rgba(0, 0, 0, 0.25);
      text-align: center;
    }

    .simplified-thumb-fallback {
      height: 140px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0.4rem;
      color: var(--text-muted);
      font-size: 0.82rem;
      background: rgba(255, 255, 255, 0.03);
    }

    /* Center Text Column */
    .simplified-text-column {
      flex: 1 1 0%;
      min-height: 0;
      height: 100%;
      width: 100%;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-y: contain;
      touch-action: pan-y;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 1.5rem 1.25rem 6rem 1.25rem;
    }

    .simplified-top-bar {
      width: 100%;
      max-width: 820px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-bottom: 1.25rem;
      margin-bottom: 1.5rem;
      border-bottom: 1px solid var(--border-main);
      gap: 1rem;
    }

    .simplified-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      color: #38bdf8;
      background: rgba(56, 189, 248, 0.12);
      padding: 0.2rem 0.55rem;
      border-radius: 999px;
      margin-bottom: 0.35rem;
    }

    .simplified-title {
      font-size: 1.35rem;
      font-weight: 700;
      color: var(--text-main);
      line-height: 1.3;
    }

    .simplified-controls {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    /* Article Body */
    .simplified-article-body {
      width: 100%;
      max-width: 820px;
      line-height: 1.85;
      color: var(--text-main);
      font-family: var(--font-family);
      user-select: text;
    }

    .simplified-page-divider {
      margin: 2.5rem 0 1.25rem 0;
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .simplified-page-divider::before,
    .simplified-page-divider::after {
      content: "";
      flex: 1;
      height: 1px;
      background: var(--border-main);
    }

    .simplified-page-badge {
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--primary);
      background: rgba(56, 189, 248, 0.08);
      border: 1px solid rgba(56, 189, 248, 0.25);
      padding: 0.2rem 0.65rem;
      border-radius: 999px;
    }

    .simplified-paragraph {
      margin-bottom: 1.35rem;
    }

    .simplified-sentence {
      display: inline;
      padding: 0.1rem 0.2rem;
      border-radius: 4px;
      transition: background-color 0.2s ease, color 0.2s ease;
      cursor: pointer;
    }

    .simplified-sentence:hover {
      background-color: rgba(56, 189, 248, 0.1);
    }

    .simplified-sentence.is-speaking {
      background-color: rgba(56, 189, 248, 0.28) !important;
      color: #38bdf8 !important;
      font-weight: 600;
      box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
      outline: 1px solid rgba(56, 189, 248, 0.5);
    }

    /* Mobile Bottom Media Strip (Unten auf dem Handy) */
    .simplified-media-bottom-strip {
      display: none;
      width: 100%;
      max-width: 820px;
      margin-top: 2rem;
      padding-top: 1.25rem;
      border-top: 1px solid var(--border-main);
      flex-direction: column;
      gap: 0.75rem;
    }

    .simplified-media-strip-header {
      font-size: 0.82rem;
      font-weight: 700;
      color: var(--primary);
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }

    .simplified-media-strip-carousel {
      display: flex;
      gap: 0.85rem;
      overflow-x: auto;
      padding-bottom: 0.75rem;
      -webkit-overflow-scrolling: touch;
    }

    .simplified-strip-card {
      width: 130px;
      flex-shrink: 0;
      background: var(--bg-card);
      border: 1px solid var(--border-main);
      border-radius: 8px;
      overflow: hidden;
      cursor: pointer;
    }

    .simplified-strip-card img {
      width: 100%;
      height: 90px;
      object-fit: cover;
      display: block;
    }

    /* Responsive Rules für Mobile */
    @media (max-width: 768px) {
      .simplified-reader-container {
        flex: 1 1 0%;
        min-height: 0;
        height: 100%;
        width: 100%;
        position: relative;
      }

      .simplified-media-sidebar {
        display: none !important;
      }

      .simplified-media-bottom-strip {
        display: none !important;
      }

      .simplified-text-column {
        flex: 1 1 0%;
        min-height: 0;
        height: 100%;
        width: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        touch-action: pan-y;
        padding-top: calc(56px + env(safe-area-inset-top, 0px) + 12px);
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 28px);
        padding-left: 1rem;
        padding-right: 1rem;
      }

      .simplified-title {
        font-size: 1.15rem;
      }
    }

/* ==========================================================================
   Eingereihtes Bibelstellen-Tab Panel (Rechts angedockt, Gelb hinterlegt)
   Gleiche Schriftgröße wie im Reader, separate Stimme & Geschwindigkeit
   ========================================================================== */
/* ==========================================================================
   Eingereihtes Bibelstellen-Tab Panel (Schwebende Lesekarte im PDF-Modus)
   Gleiche Schriftgröße wie im Reader, separate Stimme & Geschwindigkeit
   ========================================================================== */
.tts-bible-tab-panel {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  right: 24px;
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: 55vh;
  background: #fefce8;
  color: #1e293b;
  border-left: 5px solid #f59e0b;
  border-top: 1px solid rgba(245, 158, 11, 0.3);
  border-right: 1px solid rgba(245, 158, 11, 0.3);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  z-index: 500;
  display: flex;
  flex-direction: column;
  transform: translateY(30px) scale(0.96);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  pointer-events: auto;
  font-family: inherit;
}

[data-theme="dark"] .tts-bible-tab-panel {
  background: #251c07;
  color: #fef08a;
  border-left-color: #d97706;
  border-top-color: rgba(217, 119, 6, 0.35);
  border-right-color: rgba(217, 119, 6, 0.35);
  border-bottom-color: rgba(217, 119, 6, 0.35);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}

.tts-bible-tab-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.tbv-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  background: rgba(245, 158, 11, 0.15);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  gap: 0.75rem;
}

.tbv-tab-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: #b45309;
}

[data-theme="dark"] .tbv-tab-title-wrap {
  color: #fbbf24;
}

.tbv-tab-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tbv-voice-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.22);
  color: #b45309;
}

[data-theme="dark"] .tbv-voice-badge {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.25);
}

.tbv-trans-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f59e0b;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.tbv-close-btn {
  background: none;
  border: none;
  color: #b45309;
  cursor: pointer;
  padding: 6px;
  font-size: 1.1rem;
  border-radius: 8px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .tbv-close-btn {
  color: #fde68a;
}

.tbv-close-btn:hover {
  background: rgba(245, 158, 11, 0.25);
}

.tbv-tab-body {
  padding: 1.15rem 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.tbv-tab-verse-item {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 12px;
  padding: 0.95rem 1.15rem;
}

.tbv-tab-verse-header {
  font-size: 0.9rem;
  font-weight: 700;
  color: #d97706;
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

[data-theme="dark"] .tbv-tab-verse-header {
  color: #fbbf24;
}

.tbv-tab-verse-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #1e293b;
  font-family: Georgia, "Times New Roman", serif;
}

[data-theme="dark"] .tbv-tab-verse-text {
  color: #fef08a;
}

.tbv-tab-footer {
  padding: 0.65rem 1.25rem;
  background: rgba(245, 158, 11, 0.12);
  border-top: 1px solid rgba(245, 158, 11, 0.2);
  font-size: 0.78rem;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

[data-theme="dark"] .tbv-tab-footer {
  color: #fde68a;
}

/* Mobile: Tab-Panel schwebend über Dock */
@media (max-width: 768px) {
  .tts-bible-tab-panel {
    right: 12px;
    left: 12px;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: 100%;
    max-height: 52vh;
    border-radius: 18px;
    transform: translateY(20px) scale(0.96);
  }

  body.has-active-tts .tts-bible-tab-panel,
  body:has(#mobileMiniPlayer:not([style*="display: none"])) .tts-bible-tab-panel {
    bottom: calc(128px + env(safe-area-inset-bottom, 0px));
  }

  .tts-bible-tab-panel.open {
    transform: translateY(0) scale(1);
  }
}

/* Canonical alias for unified-mode-switcher */
.unified-mode-switcher {
  display: flex;
  align-items: center;
}

/* ==========================================================================
   Vereinfachte Ansicht: Eingebettete gelbe Bibel-Zitatsbox (Im Buchtext, mit Tab eingereiht)
   ========================================================================== */
.simplified-bible-quote-box {
  background: #fefce8;
  border-left: 5px solid #f59e0b;
  border-top: 1px solid rgba(245, 158, 11, 0.3);
  border-right: 1px solid rgba(245, 158, 11, 0.3);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 14px;
  padding: 1.15rem 1.4rem;
  margin: 1.25rem 0 1.25rem 2rem; /* Eingereiht nach rechts wie ein Tab! */
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.18);
  width: calc(100% - 2rem);
  box-sizing: border-box;
  font-size: inherit;
  animation: fadeInQuoteBox 0.25s ease-out;
}

@keyframes fadeInQuoteBox {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-theme="dark"] .simplified-bible-quote-box {
  background: #251c07;
  border-left-color: #d97706;
  border-top-color: rgba(217, 119, 6, 0.35);
  border-right-color: rgba(217, 119, 6, 0.35);
  border-bottom-color: rgba(217, 119, 6, 0.35);
  color: #fef08a;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

@media (max-width: 768px) {
  .simplified-bible-quote-box {
    margin-left: 1rem;
    width: calc(100% - 1rem);
    padding: 1rem 1.15rem;
  }
}

.sbq-header {
  font-size: 0.88rem;
  font-weight: 700;
  color: #d97706;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="dark"] .sbq-header {
  color: #fbbf24;
}

.sbq-item {
  margin-bottom: 0.85rem;
}

.sbq-item:last-child {
  margin-bottom: 0;
}

.sbq-ref {
  font-size: 0.92rem;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 0.25rem;
}

[data-theme="dark"] .sbq-ref {
  color: #fde68a;
}

.sbq-text {
  font-size: 1.05rem;
  line-height: 1.7;
  font-family: Georgia, serif;
}

/* ==========================================================================
   Text-Markierungen (Highlighter) mit 7 Farben
   ========================================================================== */
.highlight-floating-bar {
  position: fixed;
  z-index: 10000;
  background: rgba(19, 27, 38, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translateY(6px) scale(0.95);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

[data-theme="light"] .highlight-floating-bar {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.highlight-floating-bar.open {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.hfb-swatches {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hfb-color-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease;
  touch-action: manipulation;
  outline: none;
}

.hfb-color-btn:hover {
  transform: scale(1.22);
  box-shadow: 0 0 8px currentColor;
}

.hfb-color-btn:active {
  transform: scale(0.92);
}

.hfb-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.85rem;
  border-radius: 50%;
  transition: color 0.15s ease;
}

.hfb-close-btn:hover {
  color: var(--text-main);
}

/* User Highlight Marks */
.pdf-user-highlight {
  border-radius: 2px;
  padding: 1px 0;
  color: #0f172a !important;
  transition: opacity 0.2s ease;
}

.pdf-hl-yellow { background-color: #fef08a !important; }
.pdf-hl-green  { background-color: #bbf7d0 !important; }
.pdf-hl-blue   { background-color: #bae6fd !important; }
.pdf-hl-purple { background-color: #e9d5ff !important; }
.pdf-hl-pink   { background-color: #fbcfe8 !important; }
.pdf-hl-orange { background-color: #fed7aa !important; }
.pdf-hl-cyan   { background-color: #a5f3fc !important; }

/* Typografie für die vereinfachte Ansicht */
.simplified-heading {
  font-size: 1.45em;
  font-weight: 800;
  margin: 1.6rem 0 0.75rem 0;
  color: var(--text-main);
  line-height: 1.35;
}

.simplified-paragraph {
  margin-bottom: 1.35rem;
  line-height: 1.85;
}

.simplified-text-span {
  display: inline;
  padding: 1px 2px;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.simplified-text-span:hover {
  background-color: rgba(56, 189, 248, 0.15);
}

.simplified-text-span.is-speaking {
  background-color: rgba(56, 189, 248, 0.3) !important;
  color: #38bdf8 !important;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  outline: 1px solid rgba(56, 189, 248, 0.6);
}

/* Eingereihte Bibelverse in der vereinfachten Leseansicht */
.simplified-inline-verse {
  display: block;
  margin: 1.15rem 0 1.45rem 0;
  padding: 0.95rem 1.25rem;
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .simplified-inline-verse {
  background: rgba(245, 158, 11, 0.12);
  border-left-color: #fbbf24;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.simplified-inline-verse.is-speaking-bible {
  background: rgba(245, 158, 11, 0.22) !important;
  border-left-color: #d97706 !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35) !important;
}
[data-theme="dark"] .simplified-inline-verse.is-speaking-bible {
  background: rgba(245, 158, 11, 0.26) !important;
  border-left-color: #fbbf24 !important;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.4) !important;
}
.siv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #d97706;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  padding-bottom: 0.35rem;
}
[data-theme="dark"] .siv-header {
  color: #fbbf24;
  border-bottom-color: rgba(251, 191, 36, 0.2);
}
.siv-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.siv-trans {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(217, 119, 6, 0.15);
  color: #d97706;
  font-weight: 600;
}
[data-theme="dark"] .siv-trans {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
}
.siv-body {
  font-size: 1.02em;
  line-height: 1.68;
  color: var(--text-main);
  font-style: italic;
}
.simplified-bible-word {
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s ease;
}
.simplified-bible-word:hover {
  background: rgba(245, 158, 11, 0.25);
}


