/* Waitlist Screen */
.waitlist-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 2rem;
  background: radial-gradient(circle at center, var(--color-surface-brighter) 0%, var(--color-surface) 100%);
}

.waitlist-container {
  width: 100%;
  max-width: 600px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.waitlist-card {
  padding: 3rem;
  border-radius: 2rem;
  background: var(--color-surface-card);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Focus Mode / Reading Mode Transitions */
.hero-panel,
.app-nav {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.4s ease, 
              margin 0.5s ease, 
              max-height 0.5s ease;
  max-height: 500px;
  overflow: hidden;
}

.focus-mode-exit {
  display: none !important;
}

body.focus-mode .hero-panel,
body.focus-mode .app-nav,
body.focus-mode .read-screen > .screen-heading {
  display: none !important;
}

body.focus-mode .app-shell {
  padding-top: 5px !important;
}

body.focus-mode .workspace {
  margin-top: 0 !important;
}

.focus-mode-exit {
  display: none !important;
}

body.focus-mode .focus-mode-exit {
  display: inline-flex !important;
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  justify-content: center;
  background: rgba(30, 20, 15, 0.8) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 95, 36, 0.3) !important;
  color: rgba(255, 255, 255, 0.8) !important;
  width: 38px !important;
  height: 38px !important;
  font-size: 0.9rem !important;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 1000000 !important;
  transition: all 0.3s ease;
}

.focus-mode-exit:hover {
  background: rgba(255, 95, 36, 0.9) !important;
  color: #fff !important;
  transform: translateX(-50%) scale(1.1);
  border-color: rgba(255, 255, 255, 0.5) !important;
}

@media (max-width: 480px) {
  body.focus-mode .focus-mode-exit {
    top: 8px;
    width: 32px !important;
    height: 32px !important;
    font-size: 0.8rem !important;
  }
}


.waitlist-header {
  text-align: center;
}

.waitlist-header h1 {
  font-size: 2.5rem;
  margin-top: 1rem;
  background: linear-gradient(135deg, #fff 0%, #aaa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.info-box {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: 1rem;
  line-height: 1.6;
}

.info-box.info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.info-box.highlight {
  background: rgba(var(--color-primary-rgb), 0.1);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  color: var(--color-primary-light);
  font-weight: 500;
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.waitlist-form input[type="email"],
.waitlist-form textarea {
  width: 100%;
  padding: 1.25rem 1.5rem;
  font-size: 1.125rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  color: #fff;
  transition: all 0.3s ease;
}

.waitlist-form input[type="email"]:focus,
.waitlist-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.05);
  box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.1);
}

.waitlist-form textarea {
  min-height: 120px;
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

/* No Document Placeholder */
.no-document-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  height: 100%;
  min-height: 400px;
  animation: fadeIn 0.4s ease-out;
}

.placeholder-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
  animation: float 3s ease-in-out infinite;
}

.no-document-placeholder h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--ink);
}

.no-document-placeholder p {
  max-width: 400px;
  margin-bottom: 2rem;
  color: var(--muted);
  line-height: 1.6;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

:root {
  color-scheme: light;
  --ink: #1d1912;
  --muted: #766f62;
  --paper: #fffaf0;
  --paper-strong: #fff4d6;
  --panel: rgba(255, 250, 240, 0.84);
  --line: rgba(61, 44, 22, 0.14);
  --accent: #b65f24;
  --accent-strong: #803713;
  --sage: #536f5c;
  --sky: #527a8e;
  --shadow: 0 24px 70px rgba(63, 42, 18, 0.16);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 210, 116, 0.38), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(82, 122, 142, 0.2), transparent 38rem),
    linear-gradient(135deg, #f6ead1 0%, #fffaf0 42%, #e9d8b9 100%);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  overflow-x: hidden !important; /* Definitivní stop pro bílý pruh */
  max-width: 100vw;
}

body.theme-dark {
  --ink: #f4ead7;
  --muted: #c4b79f;
  --paper: #15110d;
  --paper-strong: #241a12;
  --panel: rgba(31, 24, 17, 0.88);
  --line: rgba(255, 236, 203, 0.16);
  --accent: #d88745;
  --accent-strong: #ffb36e;
  --sage: #b7d1bb;
  --sky: #adcddd;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  background:
    radial-gradient(circle at top left, rgba(216, 135, 69, 0.18), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(82, 122, 142, 0.22), transparent 36rem),
    linear-gradient(135deg, #120f0b 0%, #1c1510 48%, #2a2117 100%);
}

body.theme-dark html,
body.theme-dark {
  color-scheme: dark;
}

body.theme-dark .reader-body,
body.theme-dark #manualText,
body.theme-dark .document-view {
  background-color: #18140f;
  color: var(--ink);
}

body.theme-dark .reader-body {
  background:
    linear-gradient(90deg, rgba(255, 236, 203, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    #18140f;
}

body.theme-dark select,
body.theme-dark input,
body.theme-dark textarea,
body.theme-dark .library-item,
body.theme-dark .detail-metric-card,
body.theme-dark .detail-help,
body.theme-dark .detail-audio-item,
body.theme-dark .settings-card,
body.theme-dark .listen-card,
body.theme-dark .document-edit-form,
body.theme-dark .detail-content-row {
  background: rgba(255, 246, 222, 0.06);
  color: var(--ink);
}

body.theme-dark .hero-panel {
  background:
    linear-gradient(120deg, rgba(18, 12, 7, 0.94), rgba(76, 42, 20, 0.82)),
    radial-gradient(circle at 82% 18%, rgba(216, 135, 69, 0.34), transparent 20rem);
}

body.theme-dark .hero-panel,
body.theme-dark .hero-copy,
body.theme-dark .hero-lede,
body.theme-dark .eyebrow {
  color: #fff4dc;
}

body.theme-dark .app-nav,
body.theme-dark .screen-heading,
body.theme-dark .card,
body.theme-dark .reader-stage,
body.theme-dark .document-detail-panel,
body.theme-dark .listen-category,
body.theme-dark .status-message,
body.theme-dark .guest-restriction-notice {
  border-color: rgba(255, 230, 190, 0.2);
  background: rgba(28, 22, 16, 0.92);
  color: var(--ink);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.42);
}

.guest-restriction-notice {
  margin: 14px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-strong);
  font-size: 0.88rem;
  line-height: 1.5;
}

.guest-restriction-notice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.is-disabled-overlay {
  pointer-events: none !important;
  opacity: 0.5 !important;
  filter: grayscale(1) !important;
}

body.theme-dark .kicker,
body.theme-dark .metric-label,
body.theme-dark .screen-heading p:not(.kicker),
body.theme-dark .library-meta,
body.theme-dark .progress-meta,
body.theme-dark .playback-hint,
body.theme-dark .settings-card p,
body.theme-dark .detail-help,
body.theme-dark .premium-audio-summary span {
  color: #d8c9ae;
}

body.theme-dark .app-nav-button,
body.theme-dark .library-tab,
body.theme-dark .detail-tab,
body.theme-dark .document-action,
body.theme-dark .secondary-button,
body.theme-dark .ghost-button,
body.theme-dark .icon-button,
body.theme-dark .chapter-item,
body.theme-dark .premium-voice-row,
body.theme-dark .voice-icon-button,
body.theme-dark .voice-name-button,
body.theme-dark .premium-audio-actions button,
body.theme-dark .premium-audio-actions a {
  border-color: rgba(255, 230, 190, 0.18);
  background: rgba(255, 246, 222, 0.09);
  color: #f8ead2;
}

body.theme-dark .app-nav-button:hover,
body.theme-dark .app-nav-button:focus-visible,
body.theme-dark .app-nav-button.is-active,
body.theme-dark .library-tab.is-active,
body.theme-dark .detail-tab.is-active,
body.theme-dark .settings-choice-row .is-selected {
  border-color: rgba(135, 205, 230, 0.48);
  background: rgba(83, 155, 184, 0.22);
  color: #d8f3ff;
}

body.theme-dark .primary-button,
body.theme-dark .import-button {
  background: linear-gradient(135deg, #d77a32, #a74b1c);
  color: #fff9ed;
  box-shadow: 0 12px 30px rgba(215, 122, 50, 0.2);
}

body.theme-dark .primary-button:hover,
body.theme-dark .primary-button:focus-visible,
body.theme-dark .import-button:hover,
body.theme-dark .import-button:focus-visible,
body.theme-dark .secondary-button:hover,
body.theme-dark .secondary-button:focus-visible,
body.theme-dark .ghost-button:hover,
body.theme-dark .ghost-button:focus-visible,
body.theme-dark .icon-button:hover,
body.theme-dark .icon-button:focus-visible,
body.theme-dark .document-action:hover,
body.theme-dark .document-action:focus-visible {
  border-color: rgba(255, 190, 126, 0.48);
  background: rgba(216, 135, 69, 0.24);
  color: #fff4dc;
}

body.theme-dark .chapter-item.is-active {
  border-color: rgba(255, 179, 110, 0.72);
  background: rgba(161, 85, 31, 0.34);
  color: #ffe4c0;
  box-shadow: inset 4px 0 0 #ffb36e;
}

body.theme-dark .premium-voice-row.is-selected {
  border-color: rgba(255, 179, 110, 0.72);
  background:
    linear-gradient(135deg, rgba(216, 135, 69, 0.3), rgba(83, 155, 184, 0.14));
  box-shadow: inset 4px 0 0 #ffb36e;
}

body.theme-dark .premium-voice-row.is-selected .voice-name-button,
body.theme-dark .premium-voice-row.is-selected .voice-icon-button {
  background: rgba(255, 246, 222, 0.12);
  color: #fff1d5;
}

body:not(.theme-dark) .app-nav,
body:not(.theme-dark) .screen-heading,
body:not(.theme-dark) .card,
body:not(.theme-dark) .reader-stage,
body:not(.theme-dark) .document-detail-panel,
body:not(.theme-dark) .listen-category,
body:not(.theme-dark) .library-filters,
body:not(.theme-dark) .settings-card,
body:not(.theme-dark) .detail-help,
body:not(.theme-dark) .detail-metric-card,
body:not(.theme-dark) .detail-audio-item,
body:not(.theme-dark) .detail-content-row,
body:not(.theme-dark) .premium-audio-item,
body:not(.theme-dark) .premium-audio-empty,
body:not(.theme-dark) .speech-preview {
  border-color: rgba(103, 73, 35, 0.24);
  background: rgba(255, 252, 244, 0.94);
  color: #21170d;
  box-shadow: 0 16px 38px rgba(103, 73, 35, 0.1);
}

body:not(.theme-dark) .app-nav-button,
body:not(.theme-dark) .library-tab,
body:not(.theme-dark) .detail-tab,
body:not(.theme-dark) .document-action,
body:not(.theme-dark) .secondary-button,
body:not(.theme-dark) .ghost-button,
body:not(.theme-dark) .icon-button,
body:not(.theme-dark) .chapter-item,
body:not(.theme-dark) .premium-voice-row,
body:not(.theme-dark) .voice-icon-button,
body:not(.theme-dark) .voice-name-button,
body:not(.theme-dark) .premium-audio-actions button,
body:not(.theme-dark) .premium-audio-actions a,
body:not(.theme-dark) .library-audio-row button,
body:not(.theme-dark) .batch-action-btn {
  border-color: rgba(103, 73, 35, 0.26);
  background: rgba(255, 251, 242, 0.96);
  color: #3a2b1b;
}

body:not(.theme-dark) .app-nav-button:hover,
body:not(.theme-dark) .app-nav-button:focus-visible,
body:not(.theme-dark) .library-tab:hover,
body:not(.theme-dark) .library-tab:focus-visible,
body:not(.theme-dark) .detail-tab:hover,
body:not(.theme-dark) .detail-tab:focus-visible,
body:not(.theme-dark) .document-action:hover,
body:not(.theme-dark) .document-action:focus-visible,
body:not(.theme-dark) .secondary-button:hover,
body:not(.theme-dark) .secondary-button:focus-visible,
body:not(.theme-dark) .ghost-button:hover,
body:not(.theme-dark) .ghost-button:focus-visible,
body:not(.theme-dark) .icon-button:hover,
body:not(.theme-dark) .icon-button:focus-visible,
body:not(.theme-dark) .chapter-item:hover,
body:not(.theme-dark) .chapter-item:focus-visible,
body:not(.theme-dark) .premium-voice-row:hover,
body:not(.theme-dark) .premium-voice-row:focus-within,
body:not(.theme-dark) .voice-icon-button:hover,
body:not(.theme-dark) .voice-icon-button:focus-visible,
body:not(.theme-dark) .voice-name-button:hover,
body:not(.theme-dark) .voice-name-button:focus-visible,
body:not(.theme-dark) .premium-audio-actions button:hover,
body:not(.theme-dark) .premium-audio-actions button:focus-visible,
body:not(.theme-dark) .premium-audio-actions a:hover,
body:not(.theme-dark) .premium-audio-actions a:focus-visible,
body:not(.theme-dark) .library-audio-row button:hover,
body:not(.theme-dark) .library-audio-row button:focus-visible,
body:not(.theme-dark) .batch-action-btn:hover:not(:disabled) {
  border-color: rgba(182, 95, 36, 0.58);
  background: #f3dfbd;
  color: #6f2f10;
  box-shadow: 0 10px 22px rgba(103, 73, 35, 0.14);
}

body:not(.theme-dark) .app-nav-button.is-active,
body:not(.theme-dark) .library-tab.is-active,
body:not(.theme-dark) .detail-tab.is-active,
body:not(.theme-dark) .document-action.is-active,
body:not(.theme-dark) .premium-voice-row.is-selected {
  border-color: rgba(82, 122, 142, 0.56);
  background: #dfeff3;
  color: #285b6d;
  box-shadow: inset 0 0 0 2px rgba(82, 122, 142, 0.12), 0 10px 22px rgba(82, 122, 142, 0.1);
}

body:not(.theme-dark) .document-card,
body:not(.theme-dark) .library-item,
body:not(.theme-dark) .listen-card,
body:not(.theme-dark) .folder-card {
  border-color: rgba(103, 73, 35, 0.22);
  background: rgba(255, 252, 244, 0.9);
}

body:not(.theme-dark) .document-card:hover,
body:not(.theme-dark) .document-card:focus-within,
body:not(.theme-dark) .library-item:hover,
body:not(.theme-dark) .library-item:focus-visible,
body:not(.theme-dark) .listen-card:hover,
body:not(.theme-dark) .listen-card:focus-visible,
body:not(.theme-dark) .folder-card:hover,
body:not(.theme-dark) .folder-card:focus-within {
  border-color: rgba(182, 95, 36, 0.5);
  background: linear-gradient(145deg, #fffaf0, #f4e3c7);
  box-shadow: 0 18px 42px rgba(103, 73, 35, 0.16);
}

body:not(.theme-dark) select,
body:not(.theme-dark) input,
body:not(.theme-dark) textarea,
body:not(.theme-dark) .library-filters input,
body:not(.theme-dark) .library-filters select,
body:not(.theme-dark) .dropdown-field select,
body:not(.theme-dark) .field select,
body:not(.theme-dark) .field input,
body:not(.theme-dark) .field textarea {
  border-color: rgba(103, 73, 35, 0.28);
  background: #fffdf8;
  color: #21170d;
}

body:not(.theme-dark) select:hover,
body:not(.theme-dark) input:hover,
body:not(.theme-dark) textarea:hover,
body:not(.theme-dark) .library-filters input:hover,
body:not(.theme-dark) .library-filters select:hover {
  border-color: rgba(182, 95, 36, 0.52);
  background: #fff8ea;
}

body:not(.theme-dark) select:focus,
body:not(.theme-dark) input:focus,
body:not(.theme-dark) textarea:focus,
body:not(.theme-dark) .library-filters input:focus,
body:not(.theme-dark) .library-filters select:focus,
body:not(.theme-dark) .dropdown-field select:focus,
body:not(.theme-dark) .field select:focus,
body:not(.theme-dark) .field input:focus,
body:not(.theme-dark) .field textarea:focus {
  outline: none;
  border-color: rgba(82, 122, 142, 0.68);
  background: #fffdf8;
  box-shadow: 0 0 0 3px rgba(82, 122, 142, 0.18);
}

body:not(.theme-dark) ::placeholder {
  color: rgba(72, 56, 34, 0.62);
}

body:not(.theme-dark) .detail-help,
body:not(.theme-dark) .screen-heading p:not(.kicker),
body:not(.theme-dark) .library-meta,
body:not(.theme-dark) .premium-audio-summary span,
body:not(.theme-dark) .listen-card span,
body:not(.theme-dark) .progress-meta,
body:not(.theme-dark) .playback-hint {
  color: #5f503e;
}

body.theme-dark .chapter-item:hover,
body.theme-dark .chapter-item:focus-visible {
  border-color: rgba(255, 190, 126, 0.42);
  background: rgba(216, 135, 69, 0.2);
  color: #fff1d5;
}

body.theme-dark .reader-toolbar,
body.theme-dark .progress-shell,
body.theme-dark .inspector {
  border-color: rgba(255, 230, 190, 0.14);
  background: rgba(23, 18, 13, 0.92);
  color: var(--ink);
}

body.theme-dark .inspector strong,
body.theme-dark .progress-meta strong,
body.theme-dark #sentenceCount,
body.theme-dark #progressText {
  color: #fff1d5;
}

body.theme-dark select,
body.theme-dark input,
body.theme-dark textarea {
  border-color: rgba(255, 230, 190, 0.2);
  background: rgba(18, 14, 10, 0.92);
  color: #fff1d5;
}

body.theme-dark select option {
  background: #1b140f;
  color: #fff1d5;
}

body.theme-dark .chunk.active {
  background: var(--accent);
  color: #fff;
}

@keyframes bookmarkPulse {
  0% { background-color: var(--accent); color: #fff; transform: scale(1.02); }
  50% { background-color: var(--accent-strong); color: #fff; transform: scale(1.05); }
  100% { background-color: transparent; transform: scale(1); }
}

.bookmark-pulse {
  animation: bookmarkPulse 2s ease-out;
  border-radius: 4px;
}

body.theme-dark .document-view ::selection,
body.theme-dark #manualText::selection {
  background: rgba(255, 190, 126, 0.36);
  color: #fff7ea;
}

body.theme-dark .chunk.active {
  background: rgba(216, 135, 69, 0.28);
  box-shadow: 0 0 0 5px rgba(216, 135, 69, 0.12);
  color: #ffd8aa;
}

body.theme-dark .chunk.done {
  color: rgba(244, 234, 215, 0.45);
}

body.theme-dark .chunk.heading {
  color: #ffb36e;
}

body.theme-dark .mini-progress,
body.theme-dark .progress-track {
  background: rgba(255, 246, 222, 0.14);
}

body.theme-dark .premium-timeline {
  border-color: rgba(255, 230, 190, 0.2);
  background: rgba(255, 246, 222, 0.1);
}

body.theme-dark .premium-timeline-label,
body.theme-dark .playback-volume {
  color: #ead9bd;
}

body.theme-dark .document-card:hover,
body.theme-dark .document-card:focus-within,
body.theme-dark .listen-card:hover,
body.theme-dark .listen-card:focus-visible {
  border-color: rgba(255, 179, 110, 0.5);
  background: rgba(216, 135, 69, 0.14);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
}

body.theme-dark .delete-document {
  background: rgba(255, 116, 95, 0.14);
  color: #ffb7a7;
}

body.theme-dark .pill {
  background: rgba(216, 135, 69, 0.18);
  color: #ffd0a0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1880px, calc(100vw - clamp(18px, 4vw, 72px)));
  margin: 0 auto;
  padding: clamp(14px, 2.2vw, 34px) 0 clamp(24px, 3vw, 42px);
  overflow-x: hidden; /* Brání přetečení statistik na mobilu */
}

.hero-panel {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: center;
  min-height: 220px;
  padding: 2.5rem 3rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  /* More vibrant gradient to stand out from app background */
  background: 
    radial-gradient(circle at 90% 10%, rgba(182, 95, 36, 0.25), transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(82, 122, 142, 0.15), transparent 50%),
    linear-gradient(135deg, #1e160d 0%, #2c1d12 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 40px rgba(182, 95, 36, 0.05);
  color: #fff;
}

/* Audio wave pattern detail - more subtle */
.hero-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0px, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 30px);
  mask-image: radial-gradient(circle at center, black, transparent 80%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem !important;
  padding: 0.4rem 0.9rem;
  background: rgba(182, 95, 36, 0.15);
  border: 1px solid rgba(182, 95, 36, 0.3);
  border-radius: 999px;
  color: #ffb36e;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.hero-copy h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.5rem, 6vw, 3.8rem);
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: linear-gradient(to bottom, #fff 40%, #e0e0e0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.hero-lede {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.05rem;
  line-height: 1.5;
  font-weight: 400;
}

body.theme-dark .hero-panel {
  /* Dark mode specific pop - slightly warmer and brighter border */
  background: 
    radial-gradient(circle at 90% 10%, rgba(216, 135, 69, 0.2), transparent 60%),
    linear-gradient(135deg, #1d150e 0%, #2a1b12 100%);
  border-color: rgba(182, 95, 36, 0.25);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.app-hero-actions {
  display: block;
  margin-top: 1.35rem;
  text-align: left;
  width: 100%;
}

.hero-home-link {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 1rem;
  border: 1px solid rgba(255, 230, 190, 0.24);
  border-radius: 999px;
  background: rgba(255, 246, 222, 0.08);
  color: #fff4dc;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1;
  margin: 0;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.hero-home-link:hover,
.hero-home-link:focus-visible {
  border-color: rgba(255, 179, 110, 0.6);
  background: rgba(216, 135, 69, 0.22);
  color: #fff9ed;
  transform: translateY(-1px);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(250px, clamp(270px, 24vw, 390px)) minmax(0, 1fr);
  gap: clamp(18px, 2.2vw, 38px);
  align-items: stretch;
  margin-top: 22px;
  max-width: 100%;
  overflow-x: hidden; /* Brání bílému pruhu na mobilu bez globálního zásahu */
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.card,
.reader-stage {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: 0 16px 48px rgba(71, 49, 21, 0.1);
  backdrop-filter: blur(18px);
}

.card {
  overflow: hidden;
  padding: 22px;
}

.section-heading,
.reader-toolbar,
.progress-meta,
.inspector,
.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.section-heading h2,
.reader-toolbar h2 {
  margin: 3px 0 0;
  font-size: 1.35rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.kicker,
.metric-label {
  color: var(--muted);
}

.pill {
  display: inline-grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: rgba(182, 95, 36, 0.12);
  color: var(--accent-strong);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-weight: 800;
}

.library-list {
  display: grid;
  gap: 10px;
  flex: 1;
  min-height: 300px;
  margin-top: 18px;
  overflow-y: auto;
  padding-right: 4px;
}

.chapter-list {
  display: grid;
  gap: 8px;
  flex: 1; /* Allow to grow and fill sidebar */
  min-height: 200px;
  margin-top: 18px;
  overflow-y: auto;
  padding-right: 4px;
}

.chapter-item {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.36);
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.chapter-item:hover,
.chapter-item:focus-visible {
  border-color: rgba(182, 95, 36, 0.42);
  background: rgba(255, 246, 222, 0.88);
  color: var(--accent-strong);
  transform: translateX(2px);
}

.chapter-item.is-active {
  border-color: rgba(83, 111, 92, 0.34);
  background: rgba(83, 111, 92, 0.12);
  color: var(--sage);
}

.library-item {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.library-item:hover,
.library-item:focus-visible,
.library-item.is-active {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(255, 246, 222, 0.94);
  box-shadow: 0 12px 28px rgba(71, 49, 21, 0.12);
}

.library-item.is-active {
  border-width: 2px;
  border-color: var(--accent);
}

.library-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 14px 0 12px;
  width: 100%;
}

.library-tab {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
}

.library-tab:hover,
.library-tab:focus-visible {
  border-color: rgba(82, 122, 142, 0.36);
  background: rgba(82, 122, 142, 0.05);
}

.library-tab.is-active {
  border-color: rgba(82, 122, 142, 0.36);
  background: rgba(82, 122, 142, 0.12);
  color: var(--sky);
}

.folder-toolbar {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-start;
  margin: -4px 0 4px;
}

.folder-create-button {
  gap: 0.5rem;
  min-height: 44px !important;
  padding: 0 1.1rem !important;
  border-radius: var(--radius-md) !important;
  font-size: 0.9rem;
}

.folder-create-button span {
  display: inline-grid;
  width: 1.15rem;
  place-items: center;
  line-height: 1;
}

.library-breadcrumbs {
  grid-column: 1 / -1;
}

.folder-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 176px;
  gap: 18px;
  cursor: pointer;
}

.folder-card-main {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  min-width: 0;
}

.folder-card-icon {
  flex: 0 0 auto;
  display: inline-grid;
  width: 1.45rem;
  place-items: center;
  font-size: 1.35rem;
  line-height: 1.1;
}

.folder-card-name {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.folder-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 230, 190, 0.18);
}

.folder-card-action {
  min-height: 34px !important;
  padding: 0 0.9rem !important;
  font-size: 0.78rem;
}

.folder-card-action-danger {
  border-color: rgba(157, 63, 47, 0.34) !important;
  color: #ffb49f !important;
}

.folder-card-action-danger:hover,
.folder-card-action-danger:focus-visible {
  border-color: rgba(157, 63, 47, 0.6) !important;
  background: rgba(157, 63, 47, 0.2) !important;
  color: #ffe0d6 !important;
}

.folder-card.is-drop-target {
  border-color: rgba(82, 122, 142, 0.58);
  background: rgba(82, 122, 142, 0.14);
}

.library-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.is-active-playback {
  background-color: rgba(var(--accent-rgb), 0.15) !important;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.1);
}

.library-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.78rem;
}

.delete-document {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(157, 63, 47, 0.08);
  color: #9d3f2f;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 5px 9px;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.delete-document:hover,
.delete-document:focus-visible {
  background: #9d3f2f;
  color: #fff7e8;
  transform: translateY(-1px);
}

.mini-progress {
  height: 7px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(29, 25, 18, 0.1);
}

.mini-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #d8a13f);
}

.library-document-status {
  margin-top: 10px;
  color: var(--sage);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
}

.library-add-button {
  width: 100%;
  min-height: 34px;
  margin-top: 11px;
  border: 1px solid rgba(82, 122, 142, 0.28);
  border-radius: 999px;
  background: rgba(82, 122, 142, 0.1);
  color: var(--sky);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.76rem;
  font-weight: 900;
}

.library-add-button:hover,
.library-add-button:focus-visible {
  background: rgba(82, 122, 142, 0.18);
}

.library-document-details {
  display: grid;
  gap: 12px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px dashed rgba(41, 33, 22, 0.18);
}

.library-detail-block {
  display: grid;
  gap: 7px;
}

.library-detail-block > strong {
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.library-chapter-link,
.library-audio-row {
  border: 1px solid rgba(41, 33, 22, 0.1);
  border-radius: 12px;
  background: rgba(255, 250, 240, 0.62);
}

.library-chapter-link {
  min-height: 34px;
  padding: 8px 10px;
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: left;
}

.library-chapter-link:hover,
.library-chapter-link:focus-visible {
  border-color: rgba(83, 111, 92, 0.32);
  background: rgba(83, 111, 92, 0.1);
  color: var(--sage);
}

.library-audio-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
}

.library-audio-row span {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-audio-row button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--accent-strong);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0 9px;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.field span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

select,
input[type="range"],
textarea {
  width: 100%;
}

select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
}

select.is-selected {
  border-color: rgba(82, 122, 142, 0.42);
  background: rgba(82, 122, 142, 0.1);
  box-shadow: 0 0 0 3px rgba(82, 122, 142, 0.08);
}

input[type="range"] {
  accent-color: var(--accent);
}

.slider-grid {
  display: grid;
  gap: 4px;
}

.premium-card {
  border-color: rgba(82, 122, 142, 0.24);
  background:
    linear-gradient(160deg, rgba(82, 122, 142, 0.1), rgba(255, 250, 240, 0.86)),
    var(--panel);
}

.wide-button {
  width: 100%;
  margin-top: 18px;
}

.premium-player {
  display: none;
}

.premium-timeline {
  margin-top: 14px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(41, 33, 22, 0.12);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.72);
}

.premium-timeline-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
}

.premium-timeline input {
  width: 100%;
  accent-color: var(--accent);
}

.premium-timeline input:disabled {
  opacity: 0.55;
}

.playback-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 14px;
}

.playback-actions .primary-button,
.playback-actions .secondary-button,
.playback-actions .icon-button {
  width: 100%;
  min-height: 42px;
}

.playback-volume {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
}

.playback-volume input {
  width: 100%;
  accent-color: var(--accent);
}

.download-link {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  margin-top: 12px;
  color: var(--sky);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-weight: 900;
}

.speech-preview {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(82, 122, 142, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
}

.speech-preview-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.speech-preview pre {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.88rem;
  line-height: 1.55;
}

.premium-voice-list {
  display: grid;
  gap: 7px;
  max-height: 270px;
  overflow: auto;
  padding-right: 4px;
}

.premium-voice-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.42);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.premium-voice-row.is-selected {
  border-color: rgba(82, 122, 142, 0.42);
  background: rgba(82, 122, 142, 0.12);
}

.premium-voice-row:hover,
.premium-voice-row:focus-within {
  border-color: rgba(182, 95, 36, 0.36);
  transform: translateY(-1px);
}

.voice-icon-button,
.voice-name-button {
  min-height: 30px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-weight: 900;
}

.voice-icon-button {
  display: grid;
  width: 30px;
  place-items: center;
}

.voice-icon-button:hover,
.voice-icon-button:focus-visible {
  background: rgba(182, 95, 36, 0.12);
  color: var(--accent-strong);
}

.voice-icon-button.is-favorite {
  color: #d1962d;
}

.voice-name-button {
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-name-button:hover,
.voice-name-button:focus-visible {
  color: var(--sky);
}

.premium-audio-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.premium-audio-title {
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.premium-audio-empty,
.premium-audio-item {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.42);
}

.premium-audio-empty {
  padding: 12px;
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
}

.premium-audio-item {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.premium-audio-summary {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.premium-audio-summary strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.premium-audio-summary span {
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
}

.premium-audio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.premium-audio-actions button,
.premium-audio-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.72);
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.premium-audio-actions button:hover,
.premium-audio-actions button:focus-visible,
.premium-audio-actions a:hover,
.premium-audio-actions a:focus-visible {
  border-color: rgba(182, 95, 36, 0.42);
  background: rgba(255, 246, 222, 0.96);
  color: var(--accent-strong);
}

.reader-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: clamp(720px, calc(100vh - 260px), 1180px);
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.reader-toolbar {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-weight: 900;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
  box-sizing: border-box;
  text-align: center;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 1.5rem !important;
  min-height: 48px !important;
  line-height: 1 !important;
  vertical-align: middle;
}

.primary-button,
.import-button {
  border: 0;
  background: linear-gradient(135deg, #c76e2b, #8e3d15);
  color: #fff8ea;
  box-shadow: 0 12px 28px rgba(142, 61, 21, 0.24);
}

.primary-button {
  padding: 0 20px;
}

.import-button {
  flex-direction: column;
  min-width: 176px;
  min-height: 64px;
  padding: 10px 18px;
}

.import-button small {
  margin-top: 2px;
  opacity: 0.76;
}

.secondary-button,
.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

.primary-button:hover,
.primary-button:focus-visible,
.import-button:hover,
.import-button:focus-visible {
  background: linear-gradient(135deg, #df7d32, #9c4317);
  box-shadow: 0 16px 34px rgba(142, 61, 21, 0.3);
}

.primary-button.is-preparing {
  background: linear-gradient(135deg, #b86129, #7f3816);
  box-shadow: inset 0 3px 9px rgba(49, 24, 9, 0.28), 0 6px 16px rgba(142, 61, 21, 0.16);
  filter: saturate(0.82) brightness(1.08);
  opacity: 0.78;
  transform: translateY(1px) scale(0.985);
}

.secondary-button:hover,
.secondary-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(182, 95, 36, 0.42);
  background: rgba(255, 246, 222, 0.96);
  color: var(--accent-strong);
  box-shadow: 0 10px 20px rgba(71, 49, 21, 0.08);
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.icon-button:active,
.import-button:active {
  transform: translateY(0) scale(0.98);
}

.secondary-button,
.ghost-button {
  padding: 0 18px;
}

.icon-button {
  min-width: 72px;
  padding: 0 14px;
}

.compact {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.85rem;
}

.engine-comparison-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.engine-comparison-panel[hidden] {
  display: none;
}

.engine-comparison-panel .secondary-button.is-active {
  border-color: rgba(182, 95, 36, 0.58);
  background: rgba(182, 95, 36, 0.14);
  color: var(--accent-strong);
}

body.theme-dark .engine-comparison-panel .secondary-button.is-active {
  border-color: rgba(255, 179, 110, 0.72);
  background: rgba(255, 179, 110, 0.18);
  color: #fff1d5;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:not(:disabled):hover,
.import-button:hover {
  transform: translateY(-1px);
}

.progress-shell {
  padding: 0 24px 18px;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(29, 25, 18, 0.1);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), #d4a043, var(--accent));
  transition: width 240ms ease;
}

.progress-meta {
  margin-top: 8px;
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
}

.resume-banner {
  margin: 0 24px 18px;
  padding: 14px 16px;
  border: 1px solid rgba(82, 122, 142, 0.28);
  border-radius: 18px;
  background: rgba(82, 122, 142, 0.11);
  color: var(--sky);
  font-family: "Trebuchet MS", Verdana, sans-serif;
}

.resume-banner span {
  display: block;
  margin-top: 3px;
}

.resume-actions {
  display: flex;
  gap: 8px;
}

.reader-body {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid rgba(61, 44, 22, 0.08);
  background:
    linear-gradient(90deg, rgba(61, 44, 22, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    #fffdf7;
}

#manualText,
.document-view {
  position: absolute;
  inset: 0;
  padding: clamp(32px, 4vw, 64px);
  overflow: auto;
}

#manualText {
  border: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-size: clamp(1.04rem, 1.35vw, 1.22rem);
  line-height: 1.86;
  outline: none;
}

.document-view {
  color: var(--ink);
  font-size: clamp(1.04rem, 1.28vw, 1.18rem);
  line-height: 1.9;
}

.document-page {
  width: min(100%, 980px);
  min-height: 100%;
  margin: 0 auto;
}

.chunk {
  border-radius: 8px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.chunk:hover {
  background: rgba(216, 161, 63, 0.14);
}

.document-view ::selection,
#manualText::selection {
  background: rgba(182, 95, 36, 0.28);
  color: #3a1808;
}

.chunk:focus-visible {
  outline: 2px solid rgba(182, 95, 36, 0.45);
  outline-offset: 4px;
}

.chunk.heading {
  display: block;
  margin: 2rem 0 0.7rem;
  color: var(--accent-strong);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 1.08em;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chunk.active {
  background: rgba(182, 95, 36, 0.16);
  box-shadow: 0 0 0 5px rgba(182, 95, 36, 0.09);
  color: #59220b;
}

.chunk.done {
  color: rgba(29, 25, 18, 0.42);
}

.paragraph-break {
  display: block;
  height: 0.9rem;
}

.inspector {
  flex: 0 0 54px;
  min-height: 54px;
  max-height: 54px;
  padding: 8px 24px;
  border-top: 1px solid var(--line);
  background: rgba(255, 246, 222, 0.58);
}

.inspector > div {
  display: grid;
  gap: 4px;
}

.inspector strong {
  font-family: "Trebuchet MS", Verdana, sans-serif;
}

.status-message {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: min(100%, 250px);
  margin: 14px auto 0;
  padding: 9px 10px;
  border: 1px solid rgba(82, 122, 142, 0.16);
  border-radius: 13px;
  background: rgba(82, 122, 142, 0.1);
  color: var(--sky);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.28;
  text-align: center;
}

.status-message[hidden] {
  display: none;
}

.status-message button {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  align-self: center;
  border: 0;
  border-radius: 999px;
  background: rgba(82, 122, 142, 0.12);
  color: inherit;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
}

.status-message button:hover,
.status-message button:focus-visible {
  background: rgba(82, 122, 142, 0.22);
}

.status-message.is-error {
  background: rgba(157, 63, 47, 0.12);
  color: #9d3f2f;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reader-stage {
    height: min(940px, calc(100vh - 120px));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1540px);
    padding-top: 10px;
  }

  .hero-panel,
  .reader-toolbar,
  .resume-banner,
  .inspector {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-panel {
    padding: 26px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .toolbar-actions,
  .hero-actions,
  .resume-actions {
    justify-content: stretch;
  }

  .toolbar-actions > *,
  .hero-actions > *,
  .resume-actions > * {
    flex: 1 1 auto;
  }

  .reader-stage {
    height: min(860px, calc(100vh - 80px));
  }

  .inspector {
    flex-basis: auto;
    max-height: none;
  }

  /* Optimalizace přehrávacího panelu na mobilu */
  .playback-panel .section-heading {
    flex-direction: row !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
  }

  .playback-panel .section-heading .kicker {
    margin: 0 !important;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    font-family: inherit !important;
    color: var(--accent) !important; /* Make it slightly more prominent if unified */
  }

  .playback-panel .section-heading h2 {
    margin: 0 !important;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    font-family: inherit !important;
  }

  .playback-panel.card {
    padding: 12px 16px !important;
  }

  .playback-actions {
    margin-top: 8px !important;
    gap: 6px !important;
  }
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.78);
  box-shadow: 0 16px 42px rgba(71, 49, 21, 0.08);
  backdrop-filter: blur(16px);
}

.app-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-nav-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-weight: 900;
}

.app-nav-button:hover,
.app-nav-button:focus-visible,
.app-nav-button.is-active {
  border-color: rgba(82, 122, 142, 0.28);
  background: rgba(82, 122, 142, 0.12);
  color: var(--sky);
}

/* Ensure <a> elements styled as nav buttons render identically to <button> */
a.app-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  line-height: 1;
}

.profile-button {
  min-width: 112px;
}

.app-main {
  position: relative;
  margin-top: 22px;
}

.app-screen {
  min-width: 0;
}

.screen-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: 0 16px 48px rgba(71, 49, 21, 0.1);
}

.app-screen > .screen-heading {
  grid-column: 1 / -1;
  width: 100%;
}

.screen-heading h2 {
  margin: 3px 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1;
}

.screen-heading p:not(.kicker) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(520px, 620px) 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.compact-import {
  flex-direction: row;
  min-width: 190px;
  min-height: 48px;
  gap: 8px;
}

.compact-import small {
  margin: 0;
}

.library-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.7fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr);
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 240, 0.64);
}

.library-filters label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.library-filters input {
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
}

body.theme-dark .library-filters {
  border-color: rgba(255, 230, 190, 0.32);
  background: rgba(34, 27, 20, 0.94);
}

body.theme-dark .library-filters label {
  color: #f1dfc0;
}

body.theme-dark .library-filters input,
body.theme-dark .library-filters select {
  border-color: rgba(255, 230, 190, 0.36);
  background: #120d08;
  color: #fff1d5;
}

body.theme-dark .library-filters input::placeholder {
  color: rgba(255, 241, 213, 0.62);
}

.library-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  max-height: none;
  margin-top: 0;
  overflow: visible;
  padding: 0;
}

.document-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 176px;
  padding: 16px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.document-card.is-completed {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.05);
}

.document-card.is-completed::after {
  content: "✅";
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.2rem;
}

.document-card:hover,
.document-card:focus-within {
  border-color: rgba(182, 95, 36, 0.32);
  background:
    linear-gradient(145deg, rgba(255, 250, 240, 0.92), rgba(255, 241, 221, 0.74));
  box-shadow: 0 20px 48px rgba(84, 56, 24, 0.16);
  transform: translateY(-2px);
}

.document-card .library-title {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-height: 1.15;
}

.document-card-actions,
.document-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.document-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.74);
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
}

.document-card .document-action {
  border-color: rgba(182, 95, 36, 0.26);
  background: rgba(182, 95, 36, 0.1);
  color: var(--accent-strong);
}

.document-card .document-action:hover,
.document-card .document-action:focus-visible,
.document-card .document-action.is-active {
  border-color: rgba(182, 95, 36, 0.48);
  background: linear-gradient(135deg, #d77a32, #a74b1c);
  color: #fff9ed;
  box-shadow: 0 12px 30px rgba(215, 122, 50, 0.18);
}

.document-action-read,
.document-action-prepare {
  border-color: rgba(182, 95, 36, 0.26);
  background: rgba(182, 95, 36, 0.1);
  color: var(--accent-strong);
}

.selection-confirm-button {
  position: fixed;
  z-index: 50;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(182, 95, 36, 0.38);
  border-radius: 999px;
  background: linear-gradient(135deg, #d77a32, #a74b1c);
  color: #fff9ed;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.8rem;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(71, 49, 21, 0.22);
}

.document-action.is-active {
  border-color: rgba(82, 122, 142, 0.42);
  background: rgba(82, 122, 142, 0.14);
  color: var(--sky);
  box-shadow: inset 0 0 0 2px rgba(82, 122, 142, 0.08);
}

.document-detail-panel {
  width: 100%;
  min-height: 520px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: 0 16px 48px rgba(71, 49, 21, 0.1);
  animation: detailFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.document-detail-body {
  max-width: min(100%, 980px);
}

.document-detail-empty {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.document-detail-empty strong {
  color: var(--ink);
  font-size: 1.3rem;
}

.document-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.document-detail-header h3 {
  margin: 3px 0 8px;
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  line-height: 1.08;
}

.document-detail-header p:not(.kicker) {
  margin: 0;
  color: var(--muted);
}

.detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-tab {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-weight: 900;
}

.detail-tab.is-active {
  border-color: rgba(82, 122, 142, 0.32);
  background: rgba(82, 122, 142, 0.12);
  color: var(--sky);
}

.detail-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 12px;
}

.detail-metric-card,
.detail-help,
.detail-audio-item,
.settings-card,
.listen-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.detail-metric-card {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.detail-metric-card.has-actions {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  grid-column: span 2;
}

.detail-metric-card-info {
  display: grid;
  gap: 4px;
}

.card-actions-right {
  display: flex;
  gap: 8px;
}

.batch-action-btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 160ms ease;
  white-space: nowrap;
}

.batch-action-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
}

.batch-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(1);
}

.batch-action-btn.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.detail-metric-card span,
.detail-info-list dt,
.listen-card span {
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-metric-card strong {
  font-size: 1.12rem;
}

.detail-help {
  margin-top: 14px;
  padding: 16px;
  color: var(--muted);
  line-height: 1.55;
}

.detail-content-list,
.detail-audio-list {
  display: grid;
  gap: 9px;
  max-width: min(100%, 760px);
}

.detail-content-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.64);
  color: var(--ink);
  text-align: left;
}

.detail-content-row span {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-content-row.is-active {
  border-color: var(--accent);
  background: rgba(182, 95, 36, 0.08);
  color: var(--accent-strong);
  box-shadow: inset 3px 0 0 var(--accent);
}

.detail-content-row.is-readonly {
  cursor: default;
}

.detail-content-row.is-readonly:hover {
  background: rgba(255, 246, 222, 0.06);
  transform: none;
}

.detail-content-row.has-audio {
  border-left: 3px solid var(--sage);
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 8px var(--sage);
}

.detail-content-row small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-content-row.has-audio small {
  color: var(--sage);
}

.detail-audio-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.detail-audio-item div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.detail-audio-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-prepare .prepare-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  max-width: min(100%, 760px);
}

.audio-ready-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
  animation: detailFadeIn 0.4s ease-out;
}

.audio-ready-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-weight: 600;
}

.detail-prepare .detail-help {
  max-width: min(100%, 760px);
}

.detail-prepare .field,
.detail-prepare .premium-voice-list,
.detail-prepare .wide-button,
.detail-prepare .speech-preview,
.detail-prepare .premium-audio-list {
  max-width: min(100%, 760px);
}

body:not(.theme-dark) .detail-prepare .field {
  gap: 10px;
  margin-top: 14px;
  padding: 13px 14px 14px;
  border: 1px solid rgba(103, 73, 35, 0.28);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(248, 239, 222, 0.78));
  box-shadow: 0 12px 30px rgba(103, 73, 35, 0.08);
}

body:not(.theme-dark) .detail-prepare .field span {
  color: #4b3923;
  letter-spacing: 0.05em;
}

body:not(.theme-dark) .detail-prepare .field select {
  border-color: rgba(103, 73, 35, 0.34);
  background: #fffaf0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

body:not(.theme-dark) .detail-prepare .field select:hover,
body:not(.theme-dark) .detail-prepare .field select:focus {
  border-color: rgba(182, 95, 36, 0.62);
  background: #fff3dc;
  box-shadow: 0 0 0 3px rgba(182, 95, 36, 0.14);
}

body:not(.theme-dark) .detail-prepare .premium-voice-list {
  padding: 8px;
  border: 1px solid rgba(103, 73, 35, 0.24);
  border-radius: 18px;
  background: rgba(255, 252, 244, 0.86);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52);
}

body:not(.theme-dark) .detail-prepare .premium-voice-row {
  border-color: rgba(103, 73, 35, 0.28);
  background: #fffdf8;
}

.detail-info-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px 18px;
  margin: 0;
}

.detail-info-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}

.document-edit-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.document-edit-form input[type="text"],
.manual-editor-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
}

.document-edit-form input[type="text"] {
  min-height: 44px;
  padding: 0 12px;
}

.manual-editor-field textarea {
  min-height: 260px;
  padding: 14px;
  resize: vertical;
  line-height: 1.65;
}

body.theme-dark .document-edit-form input[type="text"],
body.theme-dark .document-edit-form select,
body.theme-dark .manual-editor-field textarea {
  border-color: rgba(255, 230, 190, 0.36);
  background: #120d08;
  color: #fff1d5;
}

body.theme-dark .detail-content-row.is-active {
  border-color: rgba(255, 179, 110, 0.72);
  background: rgba(161, 85, 31, 0.34);
  color: #ffe4c0;
  box-shadow: inset 4px 0 0 #ffb36e;
}

.detail-info-list dd {
  margin: 0;
}

.read-screen {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr) minmax(260px, 320px);
  grid-template-rows: auto auto;
  gap: 20px;
  align-items: stretch;
}

.read-screen > .screen-heading {
  grid-column: 1 / 4;
  grid-row: 1;
  margin-bottom: 15px;
}

.reading-contents { grid-column: 1; grid-row: 2; }
.reader-stage { grid-column: 2; grid-row: 2; }
.playback-panel { grid-column: 3; grid-row: 2; }

/* Listening Room Layout */
.listen-screen {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.listen-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Integrated Listening Sidebar */
.listen-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0 !important;
  position: sticky;
  top: 20px;
  align-self: start;
  z-index: 10;
}

.listen-sidebar.is-scrolling {
  position: static !important;
}

.listen-playback-slot {
  position: relative !important; /* Un-stick internal player in Listen section */
  border-radius: var(--radius-lg) !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  transition: border-radius 0.3s ease;
  top: 0 !important;
  max-height: none !important;
}

/* If playlist is hidden or doesn't exist, round the bottom corners of the player */
.listen-sidebar:not(:has(.listen-playlist-panel:not([hidden]))) .listen-playback-slot {
  border-bottom-left-radius: var(--radius-lg) !important;
  border-bottom-right-radius: var(--radius-lg) !important;
  border-bottom: 1px solid var(--line);
}

.listen-playlist-panel {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-top: none !important;
  margin-top: 0 !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  background: rgba(30, 26, 22, 0.95) !important;
  backdrop-filter: blur(10px);
}

.playlist-toggle-btn {
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.playlist-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Playlist Headers and Removal */
.playlist-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
}

.clear-playlist-btn {
  font-size: 1.1rem !important;
  opacity: 0.6;
  transition: all 0.2s;
}

.clear-playlist-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  background: rgba(255, 68, 68, 0.1) !important;
}

.listen-playlist-item {
  position: relative;
  padding-right: 40px !important; /* Space for the X */
}

.remove-playlist-item {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

.remove-playlist-item:hover {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

.reader-footer-meta {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: space-around;
  align-items: center;
  padding: 8px 12px !important;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
  min-height: 44px !important;
  overflow-x: auto;
  gap: 12px;
}

.metric-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.metric-icon {
  font-size: 1rem;
  opacity: 0.9;
}

.metric-item strong {
  color: var(--primary-color);
  font-weight: 700;
}

.reading-contents,
.playback-panel {
  position: sticky;
  top: 10px;
  height: auto;
  max-height: calc(100vh - 40px);
  overflow-y: hidden; /* No more scrollbars on desktop! */
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px !important;
}

/* Allow scrolling in contents if list is long, but NOT in player */
.reading-contents {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Avoid outer scrollbar, let inner list scroll */
}

.batch-action-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.1);
}

.settings-cog {
  min-width: 38px !important;
  height: 38px !important;
  font-size: 1.1rem !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(182, 95, 36, 0.1) !important;
  border: 1px solid rgba(182, 95, 36, 0.2) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.settings-cog:hover {
  background: var(--accent) !important;
  color: white !important;
  transform: rotate(45deg);
}

.playback-settings-dropdown {
  position: absolute;
  top: 60px;
  right: 10px;
  width: 320px;
  z-index: 1000;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0;
  animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.dropdown-header h3 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-strong);
}

.dropdown-body {
  padding: 14px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dropdown-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dropdown-field label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}

.dropdown-field select {
  min-height: 38px;
  font-size: 0.88rem;
}

/* Multi-audio selector styling */
.multi-audio-selector {
  margin-top: 16px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.multi-audio-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  padding-left: 6px;
}

.audio-version-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid transparent;
}

.audio-version-item:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(182, 95, 36, 0.2);
  transform: translateX(2px);
}

.audio-version-item.is-active {
  background: var(--paper-strong);
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}

.audio-version-type {
  font-size: 0.7rem;
  opacity: 0.7;
}

/* Compact layout for shorter screens */
@media (max-height: 950px) {
  .playback-panel {
    padding: 12px 14px !important;
    gap: 6px !important;
  }
  .playback-panel .section-heading h2 {
    font-size: 1.05rem;
    margin-bottom: 2px;
  }
  .playback-panel .kicker {
    font-size: 0.7rem;
    margin-bottom: 2px;
  }
  .playback-panel .playback-actions {
    gap: 4px;
  }
  .playback-panel .playback-hint {
    display: none;
  }
  .playback-controls-extra {
    gap: 4px;
    margin-top: 2px;
  }
  .playback-volume,
  .playback-speed,
  .sleep-timer-control {
    margin-top: 2px;
    font-size: 0.8rem;
  }
  .playback-panel .primary-button {
    padding: 10px !important;
    font-size: 0.85rem;
  }
}

.reading-contents {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.playback-panel {
  height: auto;
  max-height: min(720px, calc(100vh - 96px));
  overflow-y: auto;
  overflow-x: hidden;
}

/* Ensure mobile player is fully visible */
@media (max-width: 600px) {
  .playback-panel {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    padding: 10px 8px !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .playback-panel .playback-actions {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 4px !important;
  }
  
  .playback-panel .playback-actions .primary-button {
    grid-column: span 2 !important;
    order: -1;
    padding: 12px !important;
    font-size: 0.9rem;
  }

  .playback-controls-extra {
    gap: 8px !important;
    margin-top: 8px;
  }

  .playback-speed span,
  .sleep-timer-control span {
    font-size: 0.75rem;
  }
}

.playback-panel .playback-hint {
  font-size: 0.88rem;
}

.read-screen .reader-stage {
  height: auto;
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.reading-contents .sidebar-content:not([hidden]) {
  flex: 1 !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: auto;
}

.reading-contents .chapter-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.playback-hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.listen-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px) minmax(230px, 280px);
  gap: 18px;
  align-items: start;
}

.listen-screen[hidden] {
  display: none !important;
}

.listen-heading {
  max-width: min(100%, 760px);
}

.listen-audio-list,
.settings-grid {
  display: grid;
  gap: 18px;
  width: 100%;
}

.listen-category {
  max-width: min(100%, 920px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: 0 16px 48px rgba(71, 49, 21, 0.1);
}

.listen-category h3 {
  margin: 0 0 14px;
  font-size: 1.35rem;
}

.listen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
  gap: 12px;
}

.listen-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.listen-card:hover,
.listen-card:focus-visible {
  border-color: rgba(182, 95, 36, 0.32);
  box-shadow: 0 18px 42px rgba(84, 56, 24, 0.14);
  transform: translateY(-2px);
}

.listen-card.is-active {
  border-color: rgba(82, 122, 142, 0.38);
  background: rgba(82, 122, 142, 0.12);
  box-shadow: inset 4px 0 0 rgba(82, 122, 142, 0.7), 0 18px 42px rgba(84, 56, 24, 0.12);
}

.listen-playlist-panel {
  position: sticky;
  top: 18px;
  max-height: min(720px, calc(100vh - 96px));
  overflow: auto;
}

.listen-playlist-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.listen-playlist-item {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.54);
}

.listen-playlist-item strong {
  line-height: 1.25;
}

.playlist-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.playlist-controls button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
}

.playlist-controls button:not(:disabled):hover,
.playlist-controls button:not(:disabled):focus-visible {
  border-color: rgba(182, 95, 36, 0.36);
  color: var(--accent-strong);
}

body.theme-dark .listen-card.is-active {
  border-color: rgba(255, 179, 110, 0.72);
  background: rgba(161, 85, 31, 0.34);
  color: #ffe4c0;
  box-shadow: inset 4px 0 0 #ffb36e, 0 20px 48px rgba(0, 0, 0, 0.34);
}

body.theme-dark .document-action.is-active {
  border-color: rgba(255, 179, 110, 0.7);
  background: rgba(216, 135, 69, 0.24);
  color: #ffe4c0;
}

body.theme-dark .document-card .document-action:hover,
body.theme-dark .document-card .document-action:focus-visible,
body.theme-dark .document-card .document-action.is-active {
  border-color: rgba(255, 179, 110, 0.7);
  background: linear-gradient(135deg, #d77a32, #a74b1c);
  color: #fff9ed;
}

body.theme-dark .listen-playlist-item {
  border-color: rgba(255, 230, 190, 0.18);
  background: rgba(255, 246, 222, 0.08);
}

body.theme-dark .playlist-controls button {
  border-color: rgba(255, 230, 190, 0.16);
  background: rgba(255, 246, 222, 0.08);
  color: #ead9bd;
}

.playback-panel .playback-actions {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: stretch;
}

.playback-panel .playback-actions > * {
  width: 100%;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
  gap: 24px;
  width: 100%;
  align-items: start; /* Zabrání 'nudli' - karty se nebudou natahovat na výšku nejvyšší */
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.settings-card h3,
.settings-card p,
.settings-card div,
.settings-card span {
  margin: 0;
  line-height: 1.5;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.settings-card h3 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.settings-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.settings-choice-row .is-selected {
  border-color: rgba(82, 122, 142, 0.36);
  background: rgba(82, 122, 142, 0.12);
  color: var(--sky);
}

.status-message {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  transform: none;
  box-shadow: 0 18px 44px rgba(71, 49, 21, 0.16);
}

@media (max-width: 1260px) {
  .read-screen,
  .listen-screen {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .read-screen > .screen-heading {
    grid-column: 1;
  }

  .reading-contents,
  .reader-stage,
  .playback-panel {
    grid-column: 1 !important;
    grid-row: auto !important;
    position: static !important;
    height: auto !important;
    max-height: none !important;
  }

  /* Force logical order for Classroom on mobile */
  .reading-contents { order: 1; }
  .reader-stage { order: 2; }
  .playback-panel { order: 3; }

  .listen-sidebar {
    grid-column: 1 !important;
    position: static !important;
    order: 2;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .listen-main {
    order: 1;
  }

  /* Ensure player stays top inside sidebar on mobile */
  .listen-playback-slot { order: 1 !important; }
  .listen-playlist-panel { order: 2 !important; }

  .listen-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 1540px);
    padding-top: 10px;
  }

  .hero-panel {
    min-height: 160px;
    padding: 30px 20px;
    border-radius: 20px;
    align-items: center;
    text-align: center;
  }

  .hero-panel .hero-copy {
    width: 100%;
  }

  .hero-panel h1 {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
    letter-spacing: 0.1em;
    max-width: 100%;
    margin-bottom: 8px;
  }

  .hero-panel .eyebrow {
    margin-inline: auto;
  }

  .hero-panel .hero-lede {
    margin-inline: auto;
    font-size: 0.95rem;
    max-width: 90%;
  }
}

@media (max-width: 380px) {
  .hero-panel {
    padding: 16px 12px;
    min-height: 140px;
  }
  .hero-panel h1 {
    font-size: 1.7rem;
    letter-spacing: -0.04em;
  }
  .hero-panel .eyebrow {
    font-size: 0.6rem;
  }
}

@media (max-width: 820px) {
  .app-nav {
    align-items: stretch;
    border-radius: var(--radius-lg);
    flex-direction: column;
    gap: 10px;
  }

  .app-nav-links,
  .app-nav-actions,
  .library-actions,
  .library-tabs {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
  }

  .profile-button,
  .app-nav-button,
  .library-actions > *,
  .library-tab {
    width: 100%;
  }

  .screen-heading,
  .library-toolbar,
  .library-filters {
    grid-template-columns: 1fr;
  }

  .library-toolbar {
    align-items: stretch;
  }

  .document-grid,
  .listen-grid,
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
}

  .document-card,
  .listen-card,
  .document-detail-panel,
  .listen-category,
  .card,
  .reader-stage {
    border-radius: 22px;
  }

  .document-detail-panel,
  .listen-category,
  .settings-card {
    padding: 18px;
  }

  .document-detail-header,
  .screen-heading {
    flex-direction: column;
  }

  .detail-overview-grid {
    grid-template-columns: 1fr;
  }

  .detail-audio-item,
  .detail-content-row {
    grid-template-columns: 1fr;
  }

  .read-screen {
    gap: 12px;
  }

  .reading-contents,
  .playback-panel {
    height: auto;
  }

  .reading-contents .chapter-list {
    max-height: 360px;
  }

  .read-screen .reader-stage {
    height: min(820px, calc(100vh - 96px));
  }

  .reader-toolbar,
  .progress-shell,
  .inspector {
    padding-inline: 16px;
  }

  .reader-body {
    padding: 18px 16px;
  }

  .document-view {
    font-size: 1rem;
    line-height: 1.65;
  }

  .playback-panel .section-heading > div {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }

  .playback-panel .section-heading h2 {
    font-size: 1.1rem;
    margin-bottom: 0;
  }

  .playback-panel .kicker {
    margin-bottom: 0;
    font-size: 0.75rem;
  }

  .playback-panel .playback-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .playback-panel .playback-actions .primary-button {
    grid-column: 1 / -1;
    padding: 10px !important;
  }

  body.focus-mode .document-view {
    padding-bottom: 40vh !important; /* Ensure enough scroll space past bottom */
  }

  .status-message {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
}

/* Admin panel */
.admin-panel {
  grid-column: 1 / -1;
}

.admin-panel h4 {
  margin: 18px 0 8px;
  font-size: 1.05rem;
  color: var(--ink);
}

.admin-categories,
.admin-public-docs {
  margin-top: 6px;
}

.admin-category-list {
  display: grid;
  gap: 6px;
  max-width: min(100%, 480px);
}

.admin-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 240, 0.54);
  font-weight: 700;
}

body.theme-dark .admin-category-row {
  border-color: rgba(255, 230, 190, 0.18);
  background: rgba(255, 246, 222, 0.06);
}

.admin-builtin-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(82, 122, 142, 0.14);
  color: var(--sky);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-category-add {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  max-width: min(100%, 480px);
}

.admin-category-add input {
  flex: 1;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  font-size: 0.88rem;
}

body.theme-dark .admin-category-add input {
  border-color: rgba(255, 230, 190, 0.36);
  background: #120d08;
  color: #fff1d5;
}

.admin-public-list {
  display: grid;
  gap: 10px;
}

.admin-public-doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.54);
}

body.theme-dark .admin-public-doc-row {
  border-color: rgba(255, 230, 190, 0.18);
  background: rgba(255, 246, 222, 0.06);
}

.admin-doc-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-doc-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-doc-info span {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-doc-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-doc-controls select {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  font-size: 0.82rem;
}

body.theme-dark .admin-doc-controls select {
  border-color: rgba(255, 230, 190, 0.36);
  background: #120d08;
  color: #fff1d5;
}

.admin-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: normal;
  line-height: 1.4;
}

.admin-checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.admin-remove-btn {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(180, 60, 40, 0.28);
  border-radius: 999px;
  background: rgba(180, 60, 40, 0.08);
  color: #b43c28;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.admin-remove-btn:hover,
.admin-remove-btn:focus-visible {
  border-color: rgba(180, 60, 40, 0.52);
  background: rgba(180, 60, 40, 0.18);
}

body.theme-dark .admin-remove-btn {
  border-color: rgba(255, 100, 80, 0.32);
  background: rgba(255, 100, 80, 0.1);
  color: #ff8a78;
}

.document-action-publish {
  border-color: rgba(50, 140, 80, 0.28) !important;
  background: rgba(50, 140, 80, 0.1) !important;
  color: #2d8a48 !important;
}

.document-action-publish:hover,
.document-action-publish:focus-visible {
  border-color: rgba(50, 140, 80, 0.52) !important;
  background: linear-gradient(135deg, #3aa85c, #267842) !important;
  color: #fff !important;
  box-shadow: 0 12px 30px rgba(50, 140, 80, 0.18) !important;
}

body.theme-dark .document-action-publish {
  border-color: rgba(80, 200, 120, 0.32) !important;
  background: rgba(80, 200, 120, 0.12) !important;
  color: #6eda92 !important;
}

.document-action-unpublish {
  border-color: rgba(180, 60, 40, 0.28) !important;
  background: rgba(180, 60, 40, 0.08) !important;
  color: #b43c28 !important;
}

.document-action-unpublish:hover,
.document-action-unpublish:focus-visible {
  border-color: rgba(180, 60, 40, 0.52) !important;
  background: rgba(180, 60, 40, 0.18) !important;
}

body.theme-dark .document-action-unpublish {
  border-color: rgba(255, 100, 80, 0.32) !important;
  background: rgba(255, 100, 80, 0.1) !important;
  color: #ff8a78 !important;
}

@media (max-width: 820px) {
  .admin-public-doc-row {
    grid-template-columns: 1fr;
  }

  .admin-doc-controls {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Loading states for buttons */
.document-action.loading,
.secondary-button.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.document-action.loading::after,
.secondary-button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: calc(50% - 8px);
    left: calc(50% - 8px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

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

.document-favorite-btn {
  padding: 4px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
  line-height: 1;
}

.document-favorite-btn:hover {
  transform: scale(1.2);
  color: #f1c40f;
}

.document-favorite-btn.is-favorite {
  color: #f1c40f;
  text-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
}


/* Statistiky a Dashboard */
.stats-dashboard {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.stats-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stats-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 12px 36px rgba(71, 49, 21, 0.08);
}

.stats-card.alternate {
  background: rgba(255, 255, 255, 0.42);
}

.stats-card-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stats-card-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stats-section-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 600px) {
  .stats-section-card {
    padding: 16px;
    border-radius: 16px;
  }
}

.stats-section-card.admin-only {
  border-color: rgba(82, 122, 142, 0.28);
  background: rgba(82, 122, 142, 0.04);
}

/* Heatmap */
.heatmap-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, 14px);
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 14px);
  gap: 4px;
  margin: 20px 0;
  padding-bottom: 8px;
  overflow-x: auto;
}

.heatmap-cell {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.06);
  transition: transform 0.1s ease;
}

.heatmap-cell:hover {
  transform: scale(1.2);
  z-index: 2;
}

.heatmap-cell.level-0 { background: rgba(0, 0, 0, 0.06); }
.heatmap-wrapper {
  display: flex;
  gap: 16px;
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid var(--line);
}

.heatmap-labels {
  display: grid;
  grid-template-rows: repeat(7, 20px);
  gap: 4px;
  padding-top: 1rem;
}

.heatmap-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  height: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.heatmap-grid-scroll {
  flex: 1;
  overflow-x: auto;
  padding-bottom: 8px;
}

.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 20px);
  grid-auto-flow: column;
  grid-auto-columns: 20px;
  gap: 4px;
  padding: 1rem 0;
}

.heatmap-cell {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.heatmap-cell.level-active {
  background: #f1c40f;
  box-shadow: 0 0 12px rgba(241, 196, 15, 0.3);
}

.heatmap-cell.level-inactive {
  background: #4a0404;
  opacity: 0.6;
}

.heatmap-cell.is-weekend {
  border: 2px solid #e67e22;
}

.heatmap-cell.is-today {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Admin Usage Table */
.admin-usage-table-wrapper {
  margin-top: 24px;
  overflow-x: auto;
}

.admin-usage-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-usage-table th {
  padding: 12px;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
}

.admin-usage-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-ok { background: #44a340; box-shadow: 0 0 8px #44a340; }
.status-warn { background: #e6a23c; box-shadow: 0 0 8px #e6a23c; }
.status-danger { background: #f56c6c; box-shadow: 0 0 8px #f56c6c; }

/* Profil a Nastavení */
.profile-info-card .profile-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

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

.profile-title h3 {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  font-size: clamp(1rem, 4vw, 1.3rem); /* Dynamická velikost písma */
}

.profile-title p {
  white-space: normal;
  word-break: break-all;
  font-size: 0.85rem;
}

.profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-size: 1.8rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(182, 95, 36, 0.25);
  flex-shrink: 0;
}

.sub-card {
  border-color: rgba(82, 122, 142, 0.25);
  background: rgba(82, 122, 142, 0.05);
}

.usage-meter {
  margin-top: 14px;
}

.usage-meter-bar {
  height: 8px;
  margin-bottom: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.usage-meter-bar span {
  display: block;
  height: 100%;
  background: var(--sky);
  border-radius: 4px;
}

.usage-meter-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.danger-btn {
  border-color: rgba(180, 60, 40, 0.3) !important;
  color: #b43c28 !important;
}

.danger-btn:hover {
  background: rgba(180, 60, 40, 0.08) !important;
}

body.theme-dark .profile-avatar {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body.theme-dark .usage-meter-bar {
  background: rgba(255, 255, 255, 0.1);
}

body.theme-dark .stats-card,
body.theme-dark .stats-section-card {
  background: rgba(255, 246, 222, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}


body.theme-dark .heatmap-cell {
  background: rgba(255, 255, 255, 0.06);
}

body.theme-dark .heatmap-cell.level-active {
  background: #f1c40f;
  box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
}

body.theme-dark .heatmap-cell.level-inactive {
  background: #2a0000;
  opacity: 0.5;
}


/* Přehrávač - Extra ovládací prvky */
.playback-controls-extra {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.playback-speed {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.playback-speed span {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
}

.playback-speed strong {
  color: var(--accent-light);
  font-family: var(--font-mono);
}

.sidebar-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 1rem;
  padding: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
}

.sidebar-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-tab.is-active {
  background: var(--bg);
  color: var(--accent-strong);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 1rem;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

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

.bookmark-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.bookmark-item:hover {
  background: rgba(182, 95, 36, 0.05);
  border-color: var(--accent);
}

.bookmark-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.bookmark-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.btn-delete-bookmark {
  border: 0;
  background: transparent;
  color: var(--error);
  font-size: 0.7rem;
  padding: 4px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.bookmark-item:hover .btn-delete-bookmark {
  opacity: 1;
}

.reader-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reader-toolbar-actions {
  display: flex;
  gap: 8px;
}

.sleep-timer-control {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sleep-timer-control span {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.sleep-timer-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.sleep-timer-buttons button {
  padding: 0.5rem;
  font-size: 0.8rem;
  background: var(--surface-secondary, rgba(0,0,0,0.05));
  border: 1px solid var(--border-subtle, rgba(0,0,0,0.1));
  color: var(--text-secondary, #666);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sleep-timer-buttons button:hover {
  background: var(--surface-tertiary, rgba(0,0,0,0.1));
  color: var(--text-primary, #000);
}

.sleep-timer-buttons button.is-active {
  background: var(--accent, #b65f24);
  border-color: var(--accent, #b65f24);
  color: white !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(182, 95, 36, 0.3);
}

/* Úprava hlasitosti pro lepší konzistenci */
.playback-volume {
  margin-top: 0.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 601px) and (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 sloupce pro tablety */
  }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stats-card { padding: 1rem !important; gap: 1rem !important; min-height: 80px !important; }
  .stats-card-value { font-size: 1.2rem; }
  .stats-card-icon { width: 36px; height: 36px; font-size: 1.2rem; }
}

.stats-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  text-align: left !important;
  gap: 1.25rem;
  padding: 1.25rem !important;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  min-height: 100px !important;
}

.stats-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
  border-color: rgba(182, 95, 36, 0.2);
}

.stats-card-info {
  display: flex;
  flex-direction: column;
}

.stats-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.stats-card-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stats-card-icon {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stats-card-diff {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.stats-card-diff.is-plus { color: #2ecc71; }
.stats-card-diff.is-minus { color: #e74c3c; }

/* Dashboard - Layout a Odznaky */
.stats-layout-main {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .stats-layout-main { grid-template-columns: 1fr; }
}

.badges-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.badge-item.is-locked {
  opacity: 0.25;
  filter: grayscale(1);
  cursor: help;
  border-style: dashed;
}

.badge-item.is-earned {
  background: rgba(182, 95, 36, 0.08);
  border-color: rgba(182, 95, 36, 0.2);
  color: var(--accent);
}

.badge-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.badge-icon { font-size: 1.25rem; }

.empty-text-hint {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

/* Admin Tabulka a Semafor */
.admin-stats-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
}

.admin-user-table-container,
.admin-popularity-table-container,
.admin-usage-table-wrapper,
#heatmapContainer {
  overflow-x: auto !important;
  max-width: 100% !important;
  margin-top: 1.5rem;
  background: rgba(0,0,0,0.1);
  border-radius: var(--radius-md);
  padding: 8px;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.admin-user-table,
.admin-usage-table {
  width: 100%;
  min-width: 650px; /* Ensure columns don't squash too much */
  border-collapse: collapse;
  text-align: left;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-wrapper {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.user-avatar-small {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.user-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
}

.online-pulse {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #2ecc71;
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px #2ecc71;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-info-text strong {
  font-size: 0.9rem;
  color: var(--text);
}

.user-info-text small {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.stats-mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-item {
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
}

.last-seen-text {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.cost-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  font-weight: 700;
  font-size: 0.9rem;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.admin-user-detail-view {
  border-left: 4px solid var(--accent);
  margin-top: 2rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.btn-close-detail {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.btn-close-detail:hover {
  background: var(--error);
  color: #fff;
}

.user-detail-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .user-detail-sections { grid-template-columns: 1fr; }
}

.sub-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}

.admin-usage-table.mini {
  font-size: 0.85rem;
}

.admin-usage-table.mini td {
  padding: 8px 12px;
}

.doc-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-info {
  display: flex;
  flex-direction: column;
}

.doc-info small {
  color: var(--text-dim);
  font-size: 0.7rem;
}

.progress-mini-bar {
  width: 60px;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: rgba(82, 122, 142, 0.1);
  color: var(--sky);
  font-size: 0.7rem;
  border-radius: 999px;
  font-weight: 800;
  text-transform: uppercase;
  border: 1px solid rgba(82, 122, 142, 0.2);
}

.public-clone-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 12px;
  background: rgba(230, 126, 34, 0.08);
  color: var(--accent-main);
  font-size: 0.7rem;
  border-radius: 999px;
  font-weight: 800;
  text-transform: uppercase;
  border: 1px solid rgba(230, 126, 34, 0.2);
  margin-left: 8px;
  letter-spacing: 0.02em;
}

.library-add-button,
.library-add-listen-button {
  margin-top: 8px;
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
}

.library-add-button {
  background: rgba(82, 122, 142, 0.1);
  border: 1px solid rgba(82, 122, 142, 0.2);
  color: var(--sky);
}

.library-add-listen-button {
  background: rgba(182, 95, 36, 0.08);
  border: 1px solid rgba(182, 95, 36, 0.2);
  color: var(--accent-strong);
}

.library-add-button:hover {
  background: var(--sky);
  color: white;
}

.library-add-listen-button:hover {
  background: var(--accent-strong);
  color: white;
}

.admin-card {
  background: rgba(230, 126, 34, 0.05);
  border: 1px solid rgba(230, 126, 34, 0.1);
}

/* Odznaky v Profilu */
.profile-badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.profile-badge-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 1rem;
  cursor: help;
  transition: all 0.2s ease;
}

.profile-badge-mini:hover {
  transform: scale(1.2);
  background: rgba(255, 255, 255, 0.1);
}

/* Listen Library Refactor Styles */
.document-group {
    margin-bottom: 32px;
}

.listen-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.listen-group-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.listen-group-title h3 {
    margin: 0;
    font-size: 1.25rem;
}

/* Admin sekce v Profilu - Optimalizace proti 'nudli' */
.admin-panel {
  grid-column: span 2; /* Na větších obrazovkách zabere 2 sloupce pro lepší balanc */
}

@media (max-width: 1100px) {
  .admin-panel { grid-column: span 1; }
}

.admin-category-list,
.admin-public-list {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
  margin-bottom: 1rem;
}

/* Scrollbar styling pro admin seznamy */
.admin-category-list::-webkit-scrollbar,
.admin-public-list::-webkit-scrollbar {
  width: 6px;
}
.admin-category-list::-webkit-scrollbar-thumb,
.admin-public-list::-webkit-scrollbar-thumb {
  background: rgba(182, 95, 36, 0.2);
  border-radius: 3px;
}
.orphan-label {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    background: rgba(157, 63, 47, 0.12);
    color: #9d3f2f;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid rgba(157, 63, 47, 0.2);
}

.is-orphan .listen-card {
    border-color: rgba(157, 63, 47, 0.3);
    background: rgba(157, 63, 47, 0.02);
}

.btn-delete-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 16px;
    background: transparent;
    border: 1px solid rgba(157, 63, 47, 0.4);
    color: #9d3f2f;
    font-size: 0.75rem;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete-group:hover {
    background: #9d3f2f;
    color: white;
    border-color: #9d3f2f;
    transform: translateY(-1px);
}

/* Režim čtení (Focus Mode) */
body.focus-mode .hero-panel,
body.focus-mode .app-nav {
  display: none !important;
}

body.focus-mode .app-shell {
  padding-top: 0 !important;
}

.focus-mode-exit {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  width: 44px;
  height: 44px;
  background: rgba(20, 20, 20, 0.6);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.focus-mode-exit:hover {
  background: #e74c3c;
  border-color: #e74c3c;
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 20px rgba(231, 76, 60, 0.4);
}

body:not(.focus-mode) .focus-mode-exit {
  display: none !important;
}
/* Admin sekce v Profilu - Úhledné svislé uspořádání */
.admin-dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 15px;
  width: 100%;
}

.admin-category-list,
.admin-public-list {
  max-height: 450px;
  overflow-y: auto;
  padding-right: 8px;
  margin-top: 12px;
  background: rgba(0,0,0,0.08);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-public-doc-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 14px !important;
  padding: 18px !important;
  margin-bottom: 8px;
}

.admin-doc-info strong {
  display: block;
  font-size: 1.15rem;
  line-height: 1.4;
  margin-bottom: 4px;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
}

.admin-doc-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.admin-tts-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-tts-limits .admin-usage-table td {
  vertical-align: top;
}

.admin-tts-limits label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 12px 8px 0;
}

.admin-tts-limits input[type="number"] {
  width: min(100%, 180px);
  margin: 0 8px 8px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
/* --- Public Shell Styles --- */
.public-shell {
  --surface-primary: var(--paper);
  --surface-secondary: var(--paper-strong);
  --text-primary: var(--ink);
  --text-secondary: var(--muted);
  --brand-primary: var(--accent);
  --border-subtle: var(--line);
  
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-primary);
  color: var(--text-primary);
}

.public-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.public-header {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  background: #15110d;
  padding: 0.4rem 1.2rem;
  border-radius: 0.8rem;
  box-shadow: 
    0 4px 15px rgba(0,0,0,0.4),
    inset 0 1px 1px rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.08);
  text-decoration: none !important;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

.brand-logo:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 
    0 8px 25px rgba(0,0,0,0.5),
    inset 0 1px 1px rgba(255,255,255,0.15);
}

/* Base style for the logo text itself - silver gradient and caps */
.logo-text-brand {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(to bottom, #ffffff 0%, #b8b8b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
  line-height: 1.2;
}

/* Specific size for the logo in the badge */
.brand-logo .logo-text-brand {
  font-size: 1.4rem;
  white-space: nowrap;
}

/* Kerning adjustments for the letter A */
.logo-text-brand .kern-a {
  display: inline-block;
  margin-right: -0.06em;
}

.logo-text-brand span:last-child {
  margin-right: 0;
  margin-left: -0.06em;
}

.public-nav {
  display: none;
}

@media (min-width: 768px) {
  .public-nav {
    display: flex;
    gap: 2rem;
  }
  .public-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
  }
  .public-nav a:hover,
  .public-nav a.is-active {
    color: var(--brand-primary);
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Intermediate breakpoint to scale down header items before hamburger menu */
@media (max-width: 1100px) and (min-width: 769px) {
  .brand-logo .logo-text-brand { font-size: 1.15rem; }
  .brand-logo { padding: 0.35rem 0.8rem; }
  .public-nav { gap: 1.25rem; }
  .public-nav a { font-size: 0.85rem; }
  .header-actions { gap: 0.5rem; }
  .header-actions .primary-button,
  .header-actions .ghost-button {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
  
  /* Scale down large headings */
  .public-hero h1 { font-size: 2.8rem; }
  .split-content h2, .cta-section h2 { font-size: 2.2rem; }
}

.theme-toggle-btn {
  order: 10;
  margin-left: 0.5rem;
}

.public-main {
  flex: 1;
}

/* Hero section */
.public-hero {
  padding: 6rem 0;
  text-align: center;
  background: linear-gradient(to bottom, var(--surface-primary), var(--surface-secondary));
}

.public-hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  color: var(--text-primary);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 2rem;
  font-size: 1.1rem;
  height: 3.5rem;
  line-height: 1;
}

/* Footer */
.public-footer {
  background: var(--surface-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 0;
  margin-top: auto;
}

.footer-inner {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 2fr 3fr;
  }
}

.footer-brand p {
  color: var(--text-secondary);
  margin-top: 1rem;
  line-height: 1.6;
  max-width: 300px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
}

.footer-col h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.footer-col a:hover {
  color: var(--brand-primary);
}

.footer-bottom {
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.8rem;
}
/* --- Homepage Specific Styles --- */
.public-section {
  padding: 5rem 0;
}

.public-section.section-white {
  background: #ffffff !important;
}

.public-section.section-cream {
  background: #fffaf0 !important;
}

/* Logic for cards inside sections */
.public-section.section-white .feature-card,
.public-section.section-white .pricing-card.mini,
.public-section.section-white .public-catalog-card,
.public-section.section-white .comparison-card,
.public-section.section-white .situation-card {
  background: #fffaf0 !important;
  border: 1px solid rgba(182, 95, 36, 0.12) !important;
  box-shadow: 0 10px 30px rgba(71, 49, 21, 0.05) !important;
}

.public-section.section-white .ghost-button {
  background: #ffffff !important;
}

.public-section.section-cream .feature-card,
.public-section.section-cream .pricing-card.mini,
.public-section.section-cream .public-catalog-card,
.public-section.section-cream .comparison-card,
.public-section.section-cream .situation-card {
  background: #ffffff !important;
  border: 1px solid rgba(182, 95, 36, 0.12) !important;
  box-shadow: 0 15px 40px rgba(71, 49, 21, 0.08) !important;
}

.public-section.section-cream .ghost-button {
  background: #fffaf0 !important;
}

/* Dark mode overrides - ensure dark mode keeps its own logic */
body.theme-dark .public-section.section-white,
body.theme-dark .public-section.section-cream {
  background: var(--surface-primary) !important;
}

body.theme-dark .public-section .feature-card,
body.theme-dark .public-section .pricing-card.mini,
body.theme-dark .public-section .public-catalog-card,
body.theme-dark .public-section .comparison-card,
body.theme-dark .public-section .situation-card {
  background: var(--surface-secondary) !important;
  border: 1px solid var(--border-subtle) !important;
}

body.theme-dark .public-section .ghost-button {
  background: var(--surface-primary) !important;
}

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

.text-center {
  text-align: center;
}

.section-lede {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 3rem;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.features-grid-2x2, .pricing-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 2rem;
}

@media (max-width: 768px) {
  .features-grid-2x2, .pricing-grid-2x2 {
    grid-template-columns: 1fr !important;
  }
}

.feature-card {
  background: var(--surface-primary);
  padding: 2.5rem;
  border-radius: 1.5rem;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-card h3 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--text-primary);
}

.feature-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.1);
  border-color: var(--brand-primary);
}

.feature-card.outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  box-shadow: none;
}

.feature-card.outline:hover {
  border-color: var(--brand-primary);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.split-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  align-items: center;
}

@media (min-width: 900px) {
  .split-section {
    grid-template-columns: 1fr 1fr;
  }
}

.split-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.split-content p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.benefit-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
}

.benefit-list li {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: 500;
}

.cta-section {
  background: var(--brand-primary);
  color: white;
  padding: 6rem 0;
}

.cta-section h2 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.cta-section .section-lede {
  color: rgba(255, 255, 255, 0.9);
}

.cta-section .bg-dark {
  background: rgba(0, 0, 0, 0.2);
  border-color: transparent;
  color: white;
}

.cta-section .bg-dark:hover {
  background: rgba(0, 0, 0, 0.3);
}

.mockup-placeholder {
  background: var(--surface-secondary);
  border: 1px dashed var(--border-subtle);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-weight: 500;
  padding: 2rem;
  aspect-ratio: 16 / 9;
  margin-top: 3rem;
  width: 100%;
}

.mockup-placeholder.small {
  margin-top: 0;
  aspect-ratio: 4 / 3;
}
/* Guest restriction and locked features */
.placeholder-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.is-disabled-overlay {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
  filter: grayscale(0.5);
}

.is-disabled-overlay::after {
  content: "🔒 Pouze pro prémiové účty";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.4);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 900;
  pointer-events: auto;
  cursor: pointer;
  z-index: 10;
}

.guest-restriction-notice {
  margin-top: 40px;
  max-width: 600px !important;
  margin-left: auto;
  margin-right: auto;
}

/* === PUBLIC PORTAL ENHANCEMENTS === */

.public-section.bg-secondary {
  background: var(--surface-secondary);
}

.public-section.bg-dark {
  background: var(--paper-strong);
  border-top: 1px solid var(--border-subtle);
}

/* Comparison Cards */
.comparison-block {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .comparison-block {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 4rem;
  }
}

/* Comparison Table */
.comparison-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
  background: var(--surface-secondary);
}

.comparison-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  text-align: left;
}

.comparison-table th,
.comparison-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.comparison-table th {
  font-weight: 700;
  font-size: 1.05rem;
  background: rgba(0,0,0,0.02);
}

body.theme-dark .comparison-table th {
  background: rgba(255,255,255,0.02);
}

.comparison-table td {
  font-size: 0.95rem;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-card {
  padding: 2.5rem;
  border-radius: 1.5rem;
  background: var(--surface-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.comparison-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.comparison-card h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

/* Situations Grid */
.situations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.situation-card {
  padding: 2.5rem;
  border-radius: 1.5rem;
  background: var(--surface-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.situation-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  background: var(--paper-strong);
}

.situation-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

/* Interactive Tabs */
.interactive-tabs-container {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--surface-primary);
  border-radius: 2rem;
  overflow: hidden;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tabs-nav {
  display: flex;
  background: var(--surface-secondary);
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.tab-btn {
  flex: 1;
  padding: 1.25rem;
  border: none;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
  border-radius: 1.5rem;
  transition: all 0.2s;
  color: var(--text-secondary);
}

.tab-btn.active {
  background: var(--surface-primary);
  color: var(--brand-primary);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.tabs-content {
  padding: 3rem;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-panel.active {
  display: block;
}

.preview-window {
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--surface-secondary);
}

.preview-header {
  padding: 0.75rem 1.5rem;
  background: var(--line);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.preview-body {
  padding: 2rem;
  min-height: 200px;
}

.audio-wave {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 1.5rem;
}

.audio-wave span {
  width: 4px;
  height: 20px;
  background: var(--brand-primary);
  border-radius: 2px;
  animation: wave 1s infinite ease-in-out;
}

.audio-wave span:nth-child(2) { height: 35px; animation-delay: 0.1s; }
.audio-wave span:nth-child(3) { height: 25px; animation-delay: 0.2s; }
.audio-wave span:nth-child(4) { height: 40px; animation-delay: 0.3s; }

@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.5); }
}

/* Pricing Grid Compact */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
}

.pricing-card.mini {
  padding: 2.5rem 2rem;
  background: var(--surface-secondary);
  border-radius: 1.5rem;
  border: 1px solid var(--border-subtle);
  position: relative;
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

/* Section Background logic */
.pricing-section {
  background: #ffffff !important;
}

body.theme-dark .pricing-section {
  background: var(--surface-primary) !important;
}

body.theme-dark .pricing-card.mini {
  background: var(--surface-primary);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.pricing-card.mini:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  border-color: var(--brand-primary);
}

.pricing-card.mini.featured {
  border: 2px solid var(--brand-primary);
  transform: scale(1.03);
  box-shadow: 0 20px 60px rgba(182, 95, 36, 0.1), 0 10px 30px rgba(0, 0, 0, 0.05);
  background: var(--surface-secondary);
}

body.theme-dark .pricing-card.mini.featured {
  background: var(--surface-secondary);
  box-shadow: 0 20px 60px rgba(182, 95, 36, 0.2), 0 10px 30px rgba(0, 0, 0, 0.4);
}

.pricing-card.mini .badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-primary);
  color: white;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.pricing-card.mini h3 { margin-bottom: 0.5rem; }
.pricing-card.mini .price { font-size: 1.8rem; font-weight: 800; margin-bottom: 1rem; }
.pricing-card.mini .price span { font-size: 0.9rem; font-weight: 400; color: var(--text-secondary); }
.pricing-card.mini p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1.5rem; }

/* Trust Grid */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
}

.trust-card {
  text-align: center;
  padding: 2rem;
}

.trust-icon { font-size: 2.5rem; margin-bottom: 1rem; }

/* Final CTA */
.cta-final {
  padding: 6rem 0;
  background: var(--paper-strong);
  color: var(--text-primary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.cta-final h2 { margin-bottom: 2rem; color: var(--text-primary); }

/* Ensure bg-dark in public portal actually has contrast if needed, 
   but for cta-final we will use themed colors */
.public-section.bg-dark {
  background: var(--paper-strong);
}

body.theme-dark .public-section.bg-dark {
  background: var(--paper-strong);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .comparison-block { grid-template-columns: 1fr; }
  .interactive-tabs-container { border-radius: 0; }
  .tabs-nav { flex-wrap: wrap; }
  .tab-btn { flex: none; width: 50%; }
  .pricing-card.mini.featured { transform: none; margin: 1rem 0; }
}

/* Comparison Table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.comparison-table th {
  padding: 1.5rem 1rem;
  border-bottom: 2px solid var(--border-subtle);
  color: var(--text-primary);
}

.comparison-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* Library Catalog Toolbar */
.library-catalog-toolbar {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 3rem;
  background: var(--surface-secondary);
  padding: 1.75rem;
  border-radius: 1.25rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.library-catalog-toolbar .search-box { flex: 2; }
.library-catalog-toolbar .filter-box { flex: 1; }

.library-catalog-toolbar input,
.library-catalog-toolbar select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-subtle);
  background: var(--surface-primary);
  color: var(--text-primary);
  font-family: inherit;
}

.public-catalog-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  background: var(--surface-primary);
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.public-catalog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  border-color: var(--brand-primary);
  background: var(--surface-secondary);
}

.card-category {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.card-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 600px) {
}

/* Auth Styles */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 2rem;
}

.auth-card {
  background: var(--surface-secondary);
  padding: 3rem;
  border-radius: 2rem;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 450px;
  text-align: center;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.auth-card h1 { margin-bottom: 0.5rem; }
.auth-subtitle { color: var(--text-secondary); margin-bottom: 2.5rem; }

.auth-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.checkbox-field {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.checkbox-field input { margin-top: 0.25rem; }

.plan-indicator {
  background: var(--brand-primary);
  color: white;
  padding: 0.75rem;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.auth-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-footer a { color: var(--brand-primary); font-weight: 700; text-decoration: none; }

.trial-indicator {
  background: #b65f24;
  color: white !important;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  margin-right: 12px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(182, 95, 36, 0.3);
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.2);
}

/* Theme Toggle Public */
.theme-toggle-btn {
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--surface-primary);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
}

.theme-toggle-btn:hover {
  transform: scale(1.1) rotate(15deg);
  background: var(--paper-strong);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Benefit Badge (Situations) */
.benefit-badge {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(var(--accent-rgb, 182, 95, 36), 0.1);
  color: var(--brand-primary);
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid rgba(var(--accent-rgb, 182, 95, 36), 0.2);
}

/* ===== MOBILE MENU ===================================================== */
.mobile-menu-btn {
  display: none !important; /* hidden on desktop; shown only via @media below */
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0.25rem 0.5rem;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--surface-primary);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-menu--open {
  transform: translateX(0);
}

.mobile-menu[hidden] {
  display: flex !important; /* allow transition from hidden state */
  pointer-events: none;
}

.mobile-menu--open[hidden] { pointer-events: auto; }

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-menu-close {
  font-size: 1.3rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.mobile-nav-link {
  display: block;
  padding: 0.9rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: background 0.15s;
}

.mobile-nav-link:hover { background: var(--surface-secondary); }

.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.mobile-try-btn {
  color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
}

body.mobile-menu-active { overflow: hidden; }

@media (max-width: 768px) {
  .public-nav { display: none !important; }
  .header-actions { display: none !important; }
  .mobile-menu-btn { display: flex !important; }
}

/* ===== HERO PRODUCT MOCKUP ============================================= */
.try-app-hero-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: opacity 0.2s;
}
.try-app-hero-link:hover { opacity: 0.75; }

.try-app-hero-link--below {
  display: block;
  margin-top: 1.5rem;
  text-align: center;
}
.try-app-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--brand-primary);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.public-hero-product-mockup {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--surface-secondary);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.4);
  border: 1px solid var(--border-subtle);
  max-width: 520px;
  margin: 2.5rem auto 0;
}

.mockup-doc-card {
  background: var(--surface-primary);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-subtle);
}
.mockup-doc-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: 0.35rem;
  letter-spacing: 0.05em;
}
.mockup-doc-title { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.35rem; }
.mockup-doc-meta  { font-size: 0.75rem; color: var(--text-secondary); }

.mockup-reader {
  background: var(--surface-primary);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.mockup-reader-bar {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.3rem;
}
.mockup-reader-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border-subtle);
  display: inline-block;
}
.mockup-reader-body { padding: 1rem 1.25rem; font-size: 0.8rem; line-height: 1.6; color: var(--text-secondary); }
.mockup-highlight { background: rgba(182,95,36,0.18); color: var(--brand-primary); border-radius: 3px; padding: 0 3px; font-weight: 700; }

.mockup-audio {
  background: var(--surface-primary);
  border-radius: 1rem;
  padding: 0.9rem 1.25rem;
  border: 1px solid var(--border-subtle);
}
.mockup-audio-info { display: flex; gap: 0.5rem; font-size: 0.8rem; color: var(--text-primary); margin-bottom: 0.6rem; }
.mockup-progress-bar { height: 5px; background: var(--border-subtle); border-radius: 999px; overflow: hidden; margin-bottom: 0.4rem; }
.mockup-progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand-primary), #e8954d); border-radius: 999px; }
.mockup-audio-time { font-size: 0.7rem; color: var(--text-secondary); }

/* ===== BILLING TOGGLE ================================================== */
.billing-toggle {
  display: inline-flex;
  gap: 0;
  background: var(--surface-secondary);
  border-radius: 999px;
  padding: 4px;
  margin: 2rem auto;
  border: 1px solid var(--border-subtle);
}

.billing-btn {
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.billing-btn.active {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.billing-badge {
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
}

.billing-btn.active .billing-badge { background: rgba(255,255,255,0.3); }

.yearly-note {
  margin: 1rem auto 0;
  max-width: 600px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--surface-secondary);
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border-subtle);
}

/* ===== PRICING INFO BOX ================================================ */
.pricing-info-box {
  background: var(--surface-secondary);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  text-align: left;
  border: 1px solid var(--border-subtle);
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.pricing-info-box h3 { margin: 0 0 0.5rem; font-size: 1rem; color: var(--text-primary); }
.pricing-info-box p  { margin: 0; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* ===== FAQ LIST ======================================================== */
.faq-list { display: flex; flex-direction: column; gap: 0; }

.faq-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.faq-item h3 { margin: 0 0 0.5rem; font-size: 1.05rem; color: var(--text-primary); }
.faq-item p  { margin: 0; color: var(--text-secondary); line-height: 1.6; font-size: 0.95rem; }

/* ===== CONTACT FORM ==================================================== */
.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }

.field input,
.field select,
.field textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  background: var(--surface-primary);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(182,95,36,0.1);
}

.contact-status {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.contact-status--ok  { background: rgba(81,207,102,0.12); color: #2e7d32; border: 1px solid rgba(81,207,102,0.3); }
.contact-status--err { background: rgba(255,80,80,0.1);   color: #c62828; border: 1px solid rgba(255,80,80,0.25); }

body.theme-dark .contact-status--ok  { color: #69f0ae; background: rgba(81,207,102,0.08); }
body.theme-dark .contact-status--err { color: #ff8a80; background: rgba(255,80,80,0.08);   }

/* ===== 2×2 GRID MODIFIERS ============================================= */
/* For-whom page: 4 cards in 2 columns */
.features-grid-2x2 {
  grid-template-columns: repeat(2, 1fr) !important;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Pricing page: 4 cards in 2 columns */
.pricing-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 2rem auto 0;
  text-align: left;
}

@media (max-width: 700px) {
  .features-grid-2x2,
  .pricing-grid-2x2 {
    grid-template-columns: 1fr !important;
  }
}

/* ===== YEARLY PILL ===================================================== */
.yearly-pill {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.35rem 0.9rem;
  background: rgba(182, 95, 36, 0.08);
  color: var(--brand-primary);
  border: 1px solid rgba(182, 95, 36, 0.2);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  animation: pillFadeIn 0.25s ease;
}

.yearly-pill--featured {
  background: rgba(182, 95, 36, 0.15);
  border-color: rgba(182, 95, 36, 0.35);
}

@keyframes pillFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.yearly-footnote {
  margin: 1rem auto 0;
  max-width: 600px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

/* ===== AUTH FORM INLINE ERRORS ========================================= */
.auth-error-msg {
  margin: 0.75rem 0;
  padding: 0.65rem 1rem;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 0.5rem;
  color: #c62828;
  font-size: 0.875rem;
}

body.theme-dark .auth-error-msg {
  background: rgba(255, 100, 100, 0.1);
  border-color: rgba(255, 100, 100, 0.25);
  color: #ff8a80;
}

.auth-legal-note {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

/* ===== AUTH SEPARATOR & OAUTH ========================================= */
.auth-separator {
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.auth-separator::before,
.auth-separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}
.auth-separator span {
  padding: 0 1rem;
}

.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--surface-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.google-button:hover {
  background: var(--surface-secondary);
  border-color: var(--brand-primary);
}

/* ===== COOKIE BANNER ====================================================== */
#cookieBanner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--surface-primary, #1a1612);
  border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.1));
  padding: 1.25rem 1.5rem;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
}

.cookie-banner__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cookie-banner__text {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-secondary, #a89880);
  margin: 0;
  line-height: 1.5;
}

.cookie-banner__text a {
  color: var(--brand-primary, #b65f24);
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.cookie-banner__actions .ghost-button {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.cookie-settings-panel {
  max-width: 960px;
  margin: 1rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
}

.cookie-settings-panel h3 {
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
  color: var(--text-primary);
}

.cookie-cat {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.cookie-cat input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 0.15rem;
  accent-color: var(--brand-primary, #b65f24);
}

/* ===== LEGAL CONSENTS (Registration) ====================================== */
.legal-consents {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-field input[type="checkbox"] {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  accent-color: var(--brand-primary, #b65f24);
  cursor: pointer;
}

.checkbox-field a {
  color: var(--brand-primary, #b65f24);
  text-decoration: underline;
}

/* ===== F7 AUDIO RECORD & TRANSCRIPTION STYLES ============================== */
.audio-records-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  align-items: start;
  margin-top: 1.5rem;
}

@media (max-width: 1024px) {
  .audio-records-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.audio-upload-card {
  background: var(--panel, rgba(30, 26, 22, 0.4));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-xl, 22px);
  padding: 1.75rem;
  box-shadow: 0 16px 40px rgba(0,0,0,0.15);
  backdrop-filter: blur(12px);
}

.audio-upload-card h3 {
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-size: 1.3rem;
  color: var(--text-main, #fff);
  font-weight: 700;
}

.upload-form-group {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-field-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field-wrapper label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted, #a89880);
}

.form-field-wrapper input[type="text"],
.form-field-wrapper select {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-md, 12px);
  color: var(--text-main, #fff);
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.form-field-wrapper input[type="text"]:focus,
.form-field-wrapper select:focus {
  border-color: var(--brand-primary, #b65f24);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.checkbox-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.consent-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--line, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 12px);
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.file-dropzone-wrapper {
  position: relative;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md, 12px);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s;
}

.file-dropzone-wrapper:hover,
.file-dropzone-wrapper.dragover {
  border-color: var(--brand-primary, #b65f24);
  background: rgba(255, 255, 255, 0.04);
}

.dropzone-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.dropzone-text {
  font-size: 0.9rem;
  color: var(--text-secondary, #a89880);
}

.dropzone-subtext {
  font-size: 0.75rem;
  color: var(--muted, #807060);
  margin-top: 0.25rem;
}

/* Audio Records List */
.audio-records-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.audio-record-item-card {
  background: var(--panel, rgba(30, 26, 22, 0.3));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 16px);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s;
  cursor: pointer;
}

.audio-record-item-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(182, 95, 36, 0.25);
  transform: translateX(4px);
}

.record-meta-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.record-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.record-title-row h4 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-main, #fff);
  font-weight: 600;
}

.record-subtitle-row {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted, #a89880);
}

.record-subtitle-row span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.record-status-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-queued {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #a89880);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.status-processing {
  background: rgba(54, 162, 235, 0.15);
  color: #36a2eb;
  border: 1px solid rgba(54, 162, 235, 0.3);
  animation: pulse-border 1.5s infinite alternate;
}

.status-completed {
  background: rgba(75, 192, 192, 0.15);
  color: #4bc0c0;
  border: 1px solid rgba(75, 192, 192, 0.3);
}

.status-failed {
  background: rgba(255, 99, 132, 0.15);
  color: #ff6384;
  border: 1px solid rgba(255, 99, 132, 0.3);
}

@keyframes pulse-border {
  from { border-color: rgba(54, 162, 235, 0.3); }
  to { border-color: rgba(54, 162, 235, 0.8); }
}

/* Transcription Editor */
.transcript-editor-container {
  background: var(--panel, rgba(30, 26, 22, 0.95));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-xl, 22px);
  padding: 2rem;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: fade-in 0.3s ease-out;
}

.editor-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  padding-bottom: 1.25rem;
  gap: 1rem;
}

.back-link-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: var(--brand-primary, #b65f24);
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
}

.back-link-btn:hover {
  text-decoration: underline;
}

.editor-main-title {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-main, #fff);
  font-weight: 700;
}

.editor-header-buttons {
  display: flex;
  gap: 0.75rem;
}

.editor-player-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 12px);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.editor-player-panel audio {
  flex: 1;
  border-radius: 99px;
}

.segments-list-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.segment-editor-row {
  display: grid;
  grid-template-columns: minmax(100px, 120px) minmax(100px, 140px) 1fr;
  gap: 1rem;
  align-items: start;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-md, 12px);
  padding: 1rem;
  transition: all 0.2s;
}

.segment-editor-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.segment-timestamp {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted, #a89880);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 0.4rem;
  text-align: center;
  align-self: center;
  cursor: pointer;
}

.segment-timestamp:hover {
  color: var(--brand-primary, #b65f24);
  background: rgba(255, 255, 255, 0.08);
}

.segment-speaker-box input {
  width: 100%;
  min-height: 36px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  color: var(--text-main, #fff);
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.segment-speaker-box input:focus {
  border-color: var(--brand-primary, #b65f24);
  outline: none;
}

.segment-text-box textarea {
  width: 100%;
  min-height: 60px;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text-main, #fff);
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  transition: all 0.2s;
}

.segment-text-box textarea:focus {
  border-bottom-color: var(--brand-primary, #b65f24);
  outline: none;
}

.no-segments-notice {
  text-align: center;
  padding: 2.5rem;
  color: var(--muted, #a89880);
  font-size: 1.1rem;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Glassmorphic Live Recorder Modal Styles */
#liveRecorderModal.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: modal-backdrop-fade 0.3s ease-out;
}

#liveRecorderModal .live-recorder-card {
  animation: modal-scale-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-backdrop-fade {
  from { background: rgba(0, 0, 0, 0); }
  to { background: rgba(0, 0, 0, 0.5); }
}

@keyframes modal-scale-in {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#liveRecorderModal .status-recording {
  color: #ff4b2b;
  animation: blinker-status 1.2s infinite alternate;
}

@keyframes blinker-status {
  from { opacity: 1; }
  to { opacity: 0.4; }
}

/* Dark theme specific adjustments */
body.theme-dark #liveRecorderModal .live-recorder-card {
  background: rgba(30, 26, 22, 0.9) !important;
  border-color: rgba(255, 230, 190, 0.15) !important;
  color: #fff1d5 !important;
}

body.theme-dark #liveRecorderModal h3 {
  color: #fff1d5 !important;
}

body.theme-dark #liveRecorderModal .field span {
  color: #ecdab9 !important;
}

body.theme-dark #liveRecorderModal .field input,
body.theme-dark #liveRecorderModal .field select {
  background: #18120d !important;
  border-color: rgba(255, 230, 190, 0.2) !important;
  color: #fff1d5 !important;
}

body.theme-dark #liveRecorderModal .timer-display {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

body.theme-dark #liveRecorderModal .timer-main span {
  color: #fff1d5 !important;
}

body.theme-dark #liveRecorderModal .live-transcript-preview {
  background: #1c1611 !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

body.theme-dark #liveRecorderModal .live-transcript-preview h4 span {
  color: #ecdab9 !important;
}

body.theme-dark #liveRecorderModal #liveTranscriptText {
  color: #e5d1b2 !important;
}

body.theme-dark #liveRecorderModal .btnPauseRecording {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff1d5 !important;
}

body.theme-dark #liveRecorderModal .close-modal-btn {
  color: #a89880 !important;
}

body.theme-dark #liveRecorderModal .close-modal-btn:hover {
  color: #ff4b2b !important;
}

.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  align-items: start;
}

.admin-action-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
}

.admin-action-form h4 {
  margin: 0;
  font-size: 1rem;
}

.admin-action-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-action-form input,
.admin-action-form select,
.admin-action-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.admin-action-form button,
.admin-row-actions button,
.admin-disabled-actions button,
.admin-inline-action {
  border: 1px solid rgba(128, 55, 19, 0.28);
  border-radius: 8px;
  padding: 8px 11px;
  background: rgba(182, 95, 36, 0.12);
  color: var(--accent-strong);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.admin-action-form button:hover,
.admin-row-actions button:hover,
.admin-inline-action:hover {
  background: rgba(182, 95, 36, 0.2);
}

.admin-panel-heading-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-panel-heading-inline h3 {
  margin: 0;
}

.admin-disabled-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.admin-disabled-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 16px;
}

.admin-tab-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.38);
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.admin-detail-grid div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-detail-grid strong {
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-technical-details {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-technical-details summary {
  cursor: pointer;
  font-weight: 700;
}

.admin-technical-details dl {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
}

.admin-technical-details div {
  display: grid;
  grid-template-columns: minmax(110px, 0.45fr) 1fr;
  gap: 8px;
}

.admin-technical-details dt,
.admin-technical-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-muted {
  color: var(--muted);
}

.admin-screen {
  min-height: calc(100vh - 96px);
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.admin-sidebar,
.admin-content,
.admin-panel,
.admin-card,
.admin-forbidden-state,
.admin-loading-state,
.admin-error-state,
.admin-action-note {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 18, 32, 0.72);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.admin-sidebar {
  position: sticky;
  top: 1rem;
  padding: 1rem;
}

.admin-sidebar-title {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.admin-sidebar-title span,
.admin-section-heading .kicker {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.admin-sidebar-title strong {
  color: var(--text-main);
  font-size: 1rem;
}

.admin-section-nav {
  display: grid;
  gap: 0.35rem;
}

.admin-section-button {
  width: 100%;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}

.admin-section-button:hover,
.admin-section-button.is-active {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.admin-content {
  padding: 1rem;
  min-width: 0;
}

.admin-section {
  display: grid;
  gap: 1rem;
}

.admin-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.admin-section-heading h2 {
  margin: 0.15rem 0;
  font-size: 1.55rem;
}

.admin-section-heading p,
.admin-card p,
.admin-action-note p,
.admin-empty-state {
  color: var(--muted);
}

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.admin-card,
.admin-panel,
.admin-action-note,
.admin-forbidden-state,
.admin-loading-state,
.admin-error-state {
  padding: 1rem;
}

.admin-card {
  display: grid;
  gap: 0.55rem;
}

.admin-card h3,
.admin-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.admin-card-value {
  font-size: 1.4rem;
}

.admin-status {
  width: fit-content;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.08);
}

.admin-status.is-ok {
  color: #86efac;
}

.admin-status.is-warning {
  color: #fde68a;
}

.admin-status.is-error {
  color: #fca5a5;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.55rem;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-weight: 600;
}

.admin-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.admin-key-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.admin-key-values div {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.65rem;
}

.admin-key-values dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-key-values dd {
  margin: 0.25rem 0 0;
  font-weight: 700;
}

@media (max-width: 900px) {
  .admin-shell,
  .admin-two-column {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }
}

.classroom-access-box {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  gap: 14px;
}

.classroom-access-box h3 {
  margin: 0;
  font-size: 1.35rem;
}

.classroom-access-box p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}

.classroom-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.public-share-slide-media {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  margin: 12px 0;
  border-radius: 8px;
}

.classroom-export-share-panel {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.28);
}

.classroom-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.classroom-panel-heading h5,
.classroom-export-box h6,
.classroom-share-box h6 {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.25;
}

.classroom-panel-heading p {
  margin: 0;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.86rem;
}

.classroom-export-share-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.classroom-export-box,
.classroom-share-box {
  min-width: 0;
}

.classroom-export-actions,
.classroom-f11-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.classroom-share-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.classroom-share-form button {
  grid-column: 1 / -1;
}

.classroom-f11-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.classroom-f11-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.classroom-f11-row strong,
.classroom-f11-row span,
.classroom-f11-row small {
  display: block;
}

.classroom-f11-row span {
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.84rem;
}

.classroom-f11-row small {
  color: rgba(226, 232, 240, 0.58);
  font-size: 0.76rem;
}

.classroom-share-created {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 8px;
  background: rgba(22, 163, 74, 0.14);
}

.classroom-share-created p,
.classroom-f11-error {
  margin: 6px 0;
}

.classroom-f11-error {
  color: #fecaca;
}

@media (max-width: 900px) {
  .classroom-export-share-grid,
  .classroom-share-form {
    grid-template-columns: 1fr;
  }

  .classroom-f11-row {
    align-items: stretch;
    flex-direction: column;
  }
}


/* Live Recorder shell cleanup: markup is rendered by src/features/live-recorder/live-recorder-render.js. */
.recorder-trigger-btn {
  background: linear-gradient(135deg, #8a2be2, #4a00e0);
  color: #fff;
  border: none;
  font-weight: 600;
}

.recorder-trigger-btn.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}

#liveRecorderMount[hidden] {
  display: none !important;
}

#liveRecorderModal .live-recorder-card {
  width: min(90vw, 600px);
  max-height: min(92vh, 760px);
  overflow: hidden;
  padding: 25px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.85);
  color: #1e1e1e;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  backdrop-filter: blur(20px);
}

#liveRecorderModal .live-recorder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 15px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

#liveRecorderModal .recorder-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

#liveRecorderModal .recorder-title-area h3,
#liveRecorderModal .processing-dashboard h3 {
  margin: 0;
  color: #1e1e1e;
}

#liveRecorderModal .recorder-title-area h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

#liveRecorderModal .close-modal-btn {
  border: none;
  background: transparent;
  color: #666;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

#liveRecorderModal .close-modal-btn:hover,
#liveRecorderModal .close-modal-btn:focus-visible {
  color: #ff4b2b;
}

#liveRecorderModal .live-recorder-body {
  max-height: calc(min(92vh, 760px) - 90px);
  overflow-y: auto;
  padding-right: 4px;
}

#liveRecorderModal .recorder-form-grid,
#liveRecorderModal .recorder-dashboard,
#liveRecorderModal .processing-dashboard {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#liveRecorderModal .recorder-form-grid {
  margin-bottom: 20px;
}

#liveRecorderModal .recorder-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

#liveRecorderModal .recorder-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#liveRecorderModal .recorder-field span {
  color: #444;
  font-size: 0.9rem;
  font-weight: 600;
}

#liveRecorderModal .recorder-field input,
#liveRecorderModal .recorder-field select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #1e1e1e;
  font-size: 1rem;
}

#liveRecorderModal .recorder-options {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

#liveRecorderModal .checkbox-option,
#liveRecorderModal .recorder-consent-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #333;
  cursor: pointer;
  font-size: 0.9rem;
}

#liveRecorderModal .recorder-consent-notice {
  padding: 12px;
  margin-bottom: 20px;
  border-left: 4px solid #4a00e0;
  border-radius: 6px;
  background-color: rgba(74, 0, 224, 0.05);
  color: #444;
  font-size: 0.85rem;
}

#liveRecorderModal .recorder-consent-notice input {
  margin-top: 3px;
}

#liveRecorderModal .recorder-start-button {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #8a2be2, #4a00e0);
  color: #fff;
  box-shadow: 0 4px 15px rgba(74, 0, 224, 0.3);
  font-size: 1.1rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#liveRecorderModal .recorder-start-button:hover,
#liveRecorderModal .recorder-start-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(74, 0, 224, 0.36);
}

#liveRecorderModal .timer-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 12px;
  background: rgba(0,0,0,0.03);
}

#liveRecorderModal .timer-main {
  display: flex;
  flex-direction: column;
}

#liveRecorderModal .timer-main span {
  color: #1e1e1e;
  font-family: monospace;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

#liveRecorderModal .timer-main small {
  margin-top: 4px;
  color: #666;
  font-size: 0.8rem;
}

#liveRecorderModal .timer-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: right;
  font-size: 0.9rem;
}

#liveRecorderModal .visualizer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
}

#liveRecorderModal #recorderVisualizer {
  display: block;
  width: 100%;
  height: 100%;
}

#liveRecorderModal .live-transcript-preview {
  max-height: 150px;
  overflow-y: auto;
  padding: 15px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  background: #fff;
}

#liveRecorderModal .live-transcript-preview h4 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px 0;
  color: #555;
  font-size: 0.9rem;
  font-weight: 600;
}

#liveRecorderModal .live-transcript-preview small {
  color: #888;
  font-weight: 400;
}

#liveRecorderModal #liveTranscriptText {
  color: #444;
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.5;
}

#liveRecorderModal .recorder-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#liveRecorderModal .recorder-controls button {
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
}

#liveRecorderModal .danger-button {
  background: #ff4b2b;
  color: #fff;
}

#liveRecorderModal .danger-text-button {
  background: transparent;
  color: #666;
  font-size: 0.9rem;
}

#liveRecorderModal .processing-dashboard {
  align-items: center;
  padding: 20px 0;
  text-align: center;
}

#liveRecorderModal .processing-dashboard h3 {
  color: #222;
  font-size: 1.15rem;
}

#liveRecorderModal .live-recorder-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(74, 0, 224, 0.1);
  border-top-color: #4a00e0;
  border-radius: 50%;
  animation: live-recorder-spin 1s linear infinite;
}

#liveRecorderModal .progress-bar-container {
  width: 100%;
  height: 8px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 10px;
  background: #eee;
}

#liveRecorderModal .progress-bar-fill {
  width: 15%;
  height: 100%;
  background: linear-gradient(90deg, #8a2be2, #4a00e0);
  transition: width 0.3s ease;
}

#liveRecorderModal #recorderProgressLabel {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

#liveRecorderModal .recorder-processing-tip {
  padding: 15px;
  margin-top: 15px;
  border: 1px dashed rgba(74, 0, 224, 0.2);
  border-radius: 10px;
  background-color: rgba(74, 0, 224, 0.04);
  color: #555;
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: left;
}

#liveRecorderModal .recorder-processing-tip p {
  margin: 0;
}

#liveRecorderModal .pulse-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ff4b2b;
  animation: live-recorder-pulse-glow 1.5s infinite;
}

@keyframes live-recorder-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes live-recorder-pulse-glow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 75, 43, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 75, 43, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 75, 43, 0); }
}

body.theme-dark #liveRecorderModal .live-recorder-card {
  background: rgba(30, 26, 22, 0.92) !important;
  border-color: rgba(255, 230, 190, 0.15) !important;
  color: #fff1d5 !important;
}

body.theme-dark #liveRecorderModal .recorder-title-area h3,
body.theme-dark #liveRecorderModal .processing-dashboard h3 {
  color: #fff1d5 !important;
}

body.theme-dark #liveRecorderModal .recorder-field span,
body.theme-dark #liveRecorderModal .live-transcript-preview h4 span {
  color: #ecdab9 !important;
}

body.theme-dark #liveRecorderModal .recorder-field input,
body.theme-dark #liveRecorderModal .recorder-field select {
  background: #18120d !important;
  border-color: rgba(255, 230, 190, 0.2) !important;
  color: #fff1d5 !important;
}

body.theme-dark #liveRecorderModal .checkbox-option,
body.theme-dark #liveRecorderModal .recorder-consent-notice,
body.theme-dark #liveRecorderModal .timer-main small,
body.theme-dark #liveRecorderModal .timer-details,
body.theme-dark #liveRecorderModal #recorderProgressLabel,
body.theme-dark #liveRecorderModal .recorder-processing-tip {
  color: #e5d1b2 !important;
}

body.theme-dark #liveRecorderModal .recorder-consent-notice,
body.theme-dark #liveRecorderModal .recorder-processing-tip {
  background: rgba(138, 43, 226, 0.12) !important;
  border-color: rgba(138, 43, 226, 0.35) !important;
}

body.theme-dark #liveRecorderModal .timer-display {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

body.theme-dark #liveRecorderModal .timer-main span {
  color: #fff1d5 !important;
}

body.theme-dark #liveRecorderModal .live-transcript-preview {
  background: #1c1611 !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

body.theme-dark #liveRecorderModal .live-transcript-preview small {
  color: #a89880 !important;
}

body.theme-dark #liveRecorderModal #liveTranscriptText {
  color: #e5d1b2 !important;
}

body.theme-dark #liveRecorderModal .secondary-button,
body.theme-dark #liveRecorderModal .ghost-button {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff1d5 !important;
}

body.theme-dark #liveRecorderModal .progress-bar-container {
  background: rgba(255, 255, 255, 0.08) !important;
}

@media (max-width: 680px) {
  #liveRecorderModal .live-recorder-card {
    width: calc(100vw - 24px);
    padding: 18px;
  }

  #liveRecorderModal .recorder-two-column,
  #liveRecorderModal .recorder-controls {
    grid-template-columns: 1fr;
  }

  #liveRecorderModal .timer-display {
    align-items: flex-start;
    flex-direction: column;
  }

  #liveRecorderModal .timer-details {
    text-align: left;
  }
}


/* --- Phase F10 Classroom and Presentations Premium Styling --- */
.classroom-screen {
  padding: 24px;
  background: radial-gradient(circle at top left, rgba(29, 21, 14, 0.03), transparent), #fffdf7;
  min-height: 100vh;
}

body.theme-dark .classroom-screen {
  background: radial-gradient(circle at top left, rgba(255, 179, 110, 0.05), transparent), #120d08;
}

.classroom-screen-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.classroom-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  box-shadow: 0 16px 48px rgba(71, 49, 21, 0.05);
  backdrop-filter: blur(20px);
}

body.theme-dark .classroom-header-bar {
  background: rgba(30, 24, 18, 0.85);
  border-color: rgba(255, 230, 190, 0.15);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.classroom-header-bar h2,
.classroom-empty-state h3,
.classroom-access-box h3 {
  color: var(--ink);
}

.classroom-header-bar p,
.classroom-empty-state p,
.classroom-access-box p {
  color: var(--muted);
}

.primary-button-premium,
.secondary-button-premium {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.primary-button-premium {
  border: 1px solid rgba(142, 61, 21, 0.28);
  background: linear-gradient(135deg, #cf742e, #9a4218);
  color: #fff8ea;
  box-shadow: 0 12px 28px rgba(142, 61, 21, 0.22);
}

.secondary-button-premium {
  border: 1px solid rgba(103, 73, 35, 0.26);
  background: rgba(255, 251, 242, 0.96);
  color: #3a2b1b;
  box-shadow: 0 8px 18px rgba(103, 73, 35, 0.08);
}

.primary-button-premium:hover,
.primary-button-premium:focus-visible {
  border-color: rgba(142, 61, 21, 0.38);
  background: linear-gradient(135deg, #df7d32, #a94919);
  color: #fffdf8;
  box-shadow: 0 16px 34px rgba(142, 61, 21, 0.3);
  transform: translateY(-1px);
}

.secondary-button-premium:hover,
.secondary-button-premium:focus-visible {
  border-color: rgba(182, 95, 36, 0.58);
  background: #f3dfbd;
  color: #6f2f10;
  box-shadow: 0 12px 24px rgba(103, 73, 35, 0.14);
  transform: translateY(-1px);
}

.primary-button-premium:focus-visible,
.secondary-button-premium:focus-visible {
  outline: 3px solid rgba(82, 122, 142, 0.22);
  outline-offset: 3px;
}

.primary-button-premium:active,
.secondary-button-premium:active {
  transform: translateY(0) scale(0.98);
}

.btn-classroom-back {
  flex: 0 0 auto;
}

.classroom-badge {
  background: linear-gradient(135deg, #c76e2b, #8e3d15);
  color: #fff;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: inline-block;
  margin-bottom: 8px;
}

.classroom-empty-state {
  text-align: center;
  padding: 60px 40px;
  border-radius: var(--radius-xl);
  border: 1px dashed var(--line);
  background: rgba(255, 252, 244, 0.78);
  box-shadow: 0 18px 44px rgba(103, 73, 35, 0.07);
}

.classroom-empty-icon {
  color: var(--accent-strong);
  font-size: clamp(2.7rem, 5vw, 4rem);
  margin-bottom: 20px;
}

.classroom-empty-state .primary-button-premium,
.classroom-access-actions .primary-button-premium,
.classroom-access-actions .secondary-button-premium {
  min-width: 148px;
}

.classroom-access-box {
  border: 1px solid rgba(103, 73, 35, 0.2);
  border-radius: var(--radius-xl);
  background: rgba(255, 252, 244, 0.82);
  box-shadow: 0 18px 44px rgba(103, 73, 35, 0.07);
}

.classroom-access-box .classroom-badge {
  justify-self: start;
  width: auto;
}

.classroom-access-actions a {
  color: inherit;
}

.classroom-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.classroom-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.classroom-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(71, 49, 21, 0.12);
}

body.theme-dark .classroom-card {
  background: rgba(34, 27, 20, 0.6);
  border-color: rgba(255, 230, 190, 0.1);
}

body.theme-dark .classroom-header-bar h2,
body.theme-dark .classroom-empty-state h3,
body.theme-dark .classroom-access-box h3 {
  color: #fff1d5;
}

body.theme-dark .classroom-header-bar p,
body.theme-dark .classroom-empty-state p,
body.theme-dark .classroom-access-box p {
  color: #e5d1b2;
}

body.theme-dark .secondary-button-premium {
  border-color: rgba(255, 230, 190, 0.26);
  background: rgba(255, 246, 222, 0.08);
  color: #fff1d5;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

body.theme-dark .secondary-button-premium:hover,
body.theme-dark .secondary-button-premium:focus-visible {
  border-color: rgba(255, 190, 126, 0.52);
  background: rgba(216, 135, 69, 0.2);
  color: #ffe4c0;
}

body.theme-dark .classroom-empty-state,
body.theme-dark .classroom-access-box {
  border-color: rgba(255, 230, 190, 0.14);
  background: rgba(30, 24, 18, 0.74);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
}

@media (max-width: 760px) {
  .classroom-header-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .btn-classroom-back,
  .classroom-empty-state .primary-button-premium,
  .classroom-access-actions .primary-button-premium,
  .classroom-access-actions .secondary-button-premium {
    width: 100%;
  }

  .classroom-access-actions {
    flex-direction: column;
  }
}

/* Audio Timeline synchronized scrubber */
.classroom-timeline-scrubber {
  height: 8px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.1);
  position: relative;
  cursor: pointer;
}

.classroom-timeline-progress {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c76e2b, #df7d32);
  width: 0%;
}

body.theme-dark #liveRecorderModal .close-modal-btn:hover {
  color: #ff4b2b !important;
}
