/* ==========================================================================
   Studijní Portál Albrechtka - Moderní UI/UX Design Systém
   Inspirováno designem Směnového Plánovače + Notion + Apple Notes
   ========================================================================== */

:root {
  /* Barevná paleta - Světlý motiv */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --navbar-bg: #1e293b;
  --navbar-text: #f8fafc;
  --navbar-muted: #94a3b8;
  
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-card-subtle: #f8fafc;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-title: #1e293b;
  
  --border-ui: #e2e8f0;
  --border-subtle: #f1f5f9;
  
  --success: #16a34a;
  --success-light: #dcfce7;
  --success-text: #166534;
  
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --danger-text: #991b1b;
  
  --warning: #d97706;
  --warning-light: #fef3c7;
  --warning-text: #92400e;
  
  --purple: #8b5cf6;
  --purple-light: #f3e8ff;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --reader-font-size: 1.08rem;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   Tmavý motiv (Dark Mode - OLED Friendly)
   ========================================================================== */
body.dark-theme {
  --bg-app: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --bg-card-subtle: #172033;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-title: #f8fafc;
  
  --border-ui: #334155;
  --border-subtle: #1e293b;
  
  --primary-light: #1e3a8a;
  --primary-border: #3b82f6;
  
  --success-light: #064e3b;
  --success-text: #6ee7b7;
  
  --danger-light: #7f1d1d;
  --danger-text: #fca5a5;
  
  --warning-light: #78350f;
  --warning-text: #fde68a;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 30px rgba(0, 0, 0, 0.7);
}

/* Reset a základy */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   1. HLAVNÍ NAVIGAČNÍ LIŠTA (NAVBAR VE STYLU ŠICHTOVNÍKU)
   ========================================================================== */
.navbar {
  background-color: var(--navbar-bg);
  color: var(--navbar-text);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.2rem;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-icon {
  background: #f59e0b; /* Žlutá jako v šichtovníku */
  color: #000;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.brand-title {
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--navbar-muted);
  font-weight: 500;
}

/* Vyhledávání v navbaru */
.nav-search-box {
  flex-grow: 1;
  max-width: 460px;
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem 0.45rem 2.4rem;
  color: #ffffff;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.nav-search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.nav-search-input:focus {
  background: rgba(255, 255, 255, 0.22);
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}

.nav-search-icon {
  position: absolute;
  left: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  pointer-events: none;
}

.nav-search-clear {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 1.1rem;
  display: none;
}

.nav-search-clear.active {
  display: block;
}

/* Akce vpravo */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.nav-btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   2. HLAVNÍ KONTEJNER APLIKACE
   ========================================================================== */
.main-wrapper {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ==========================================================================
   3. HERO SEKCE: EXAM WIDGET (CHYTRÝ ZKOUŠKOVÝ HUB)
   ========================================================================== */
.exam-hero-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body.dark-theme .exam-hero-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid var(--border-ui);
}

/* Dekorační bublina na pozadí */
.exam-hero-card::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.exam-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.exam-badge-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.exam-pill-countdown {
  background: #fef08a;
  color: #854d0e;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.exam-pill-urgent {
  background: #fee2e2;
  color: #991b1b;
  animation: pulsePill 2s infinite;
}

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

.exam-counter-text {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.exam-nav-arrows {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.exam-nav-btn {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.exam-nav-btn:hover:not(:disabled) {
  background: #ffffff;
  color: #1e3a8a;
}

.exam-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Informace o testu */
.exam-main-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.exam-date-title {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.exam-name-sub {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
}

.exam-note-box {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

/* Čipy témat učiva k testu */
.exam-topics-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.exam-topic-chip {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
}

.exam-topic-chip:hover {
  background: #ffffff;
  color: #1e3a8a;
  border-color: #ffffff;
  transform: translateY(-1px);
}

/* Tlačítka zkouškového widgetu */
.exam-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  flex-wrap: wrap;
}

.btn-start-prep {
  background: #ffffff;
  color: #1e3a8a;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.btn-start-prep:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.btn-calendar-view {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-calendar-view:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   4. GLOBÁLNÍ PŘEPÍNAČ ROČNÍKU (SEGMENTED CONTROL)
   ========================================================================== */
.grade-selector-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.grade-selector-pills {
  display: flex;
  background: var(--bg-card);
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-ui);
  box-shadow: var(--shadow-sm);
  gap: 0.25rem;
}

.grade-pill-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.grade-pill-btn:hover:not(.active) {
  color: var(--text-main);
  background: var(--bg-hover);
}

.grade-pill-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.3);
}

.grade-stats-counter {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   5. MŘÍŽKA KARET PŘEDMĚTŮ (SUBJECT CARDS HUB)
   ========================================================================== */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.25rem;
}

.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.subject-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.subject-card-header {
  padding: 1.15rem 1.25rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.subject-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.subject-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: var(--bg-hover);
  color: var(--primary);
}

.subject-title-group h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-title);
  line-height: 1.2;
}

.subject-meta-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.subject-exam-tag {
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Seznam témat uvnitř karty */
.subject-topics-list {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-grow: 1;
}

.topic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  gap: 0.5rem;
}

.topic-row:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.topic-row.learned {
  opacity: 0.85;
}

.topic-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-grow: 1;
  min-width: 0;
}

.topic-check-btn {
  background: none;
  border: 1px solid var(--border-ui);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.topic-row.learned .topic-check-btn {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.topic-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-row:hover .topic-name {
  color: var(--primary);
}

.topic-row.learned .topic-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.topic-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.subject-card-footer {
  padding: 0.65rem 1rem;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.subject-progress-text {
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   6. FOCUS READER (STUDIJNÍ ČTEČKA NOVÉ GENERACE)
   ========================================================================== */
.reader-wrapper {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.reader-wrapper.active {
  display: flex;
}

/* Plovoucí panel čtečky */
.reader-sticky-bar {
  position: sticky;
  top: 60px;
  background: var(--bg-card);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-ui);
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 90;
  backdrop-filter: blur(8px);
}

.reader-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-reader-back {
  background: var(--bg-hover);
  border: 1px solid var(--border-ui);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-reader-back:hover {
  background: var(--border-ui);
}

.reader-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reader-tool-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border-ui);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

.reader-tool-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Článek samotný */
.reader-article-box {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow-sm);
}

.reader-meta-header {
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-ui);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reader-tags {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.tag-badge {
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.reader-title-h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-title);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.reader-est-time {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Typografie učiva */
.reader-content-body {
  font-size: var(--reader-font-size);
  line-height: 1.8;
  color: var(--text-main);
}

.reader-content-body h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 2rem 0 0.85rem;
  color: var(--text-title);
  border-bottom: 2px solid var(--border-subtle);
  padding-bottom: 0.4rem;
}

.reader-content-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.5rem 0 0.6rem;
  color: var(--text-title);
}

.reader-content-body p {
  margin-bottom: 1.15rem;
}

.reader-content-body ul, .reader-content-body ol {
  margin: 0.85rem 0 1.25rem 1.75rem;
}

.reader-content-body li {
  margin-bottom: 0.4rem;
}

.reader-content-body strong {
  font-weight: 700;
  color: var(--text-title);
}

/* Zvýrazněné studijní infoboxy */
.note-box-def {
  background: #eff6ff;
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  font-size: 0.96rem;
}

body.dark-theme .note-box-def {
  background: #1e3a8a30;
  border-color: #60a5fa;
}

.note-box-exam {
  background: #fef2f2;
  border-left: 4px solid var(--danger);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  font-size: 0.96rem;
}

body.dark-theme .note-box-exam {
  background: #7f1d1d25;
  border-color: #f87171;
}

.note-box-tip {
  background: #f0fdf4;
  border-left: 4px solid var(--success);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  font-size: 0.96rem;
}

body.dark-theme .note-box-tip {
  background: #064e3b25;
  border-color: #4ade80;
}

/* Tabulky */
.reader-content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.reader-content-body th {
  background: var(--bg-hover);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  border: 1px solid var(--border-ui);
}

.reader-content-body td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-ui);
}

/* Spodní akce v čtečce */
.reader-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-ui);
  flex-wrap: wrap;
}

.btn-mark-learned {
  background: var(--bg-hover);
  color: var(--text-main);
  border: 1px solid var(--border-ui);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-mark-learned.is-learned {
  background: var(--success-light);
  color: var(--success-text);
  border-color: var(--success);
}

.reader-next-prev-group {
  display: flex;
  gap: 0.6rem;
}

.btn-nav-chapter {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  color: var(--text-main);
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-nav-chapter:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-nav-chapter:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ==========================================================================
   7. EXAM PREP MODE (PŘÍPRAVA NA PÍSEMKU - VŠECHNA TÉMATA POHROMADĚ)
   ========================================================================== */
.prep-mode-wrapper {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.prep-mode-wrapper.active {
  display: flex;
}

.prep-header-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #ffffff;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.prep-chapters-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.prep-chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   8. SPOTLIGHT VYHLEDÁVAČ VÝSLEDKŮ
   ========================================================================== */
.search-view-wrapper {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.search-view-wrapper.active {
  display: flex;
}

.search-result-item {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.35rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.search-result-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.search-result-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.search-result-snippet {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.55;
}

mark {
  background-color: #fef08a;
  color: #854d0e;
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
  font-weight: 700;
}

/* ==========================================================================
   9. SPODNÍ NAVIGAČNÍ LIŠTA PRO MOBILNÍ TELEFON (BOTTOM BAR)
   ========================================================================== */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--navbar-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.4rem 0.75rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--navbar-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.bottom-nav-item.active {
  color: #ffffff;
}

.bottom-nav-icon {
  font-size: 1.25rem;
}

/* ==========================================================================
   10. MODÁLNÍ DIALOGY A FORMULÁŘE
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-ui);
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-ui);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-title);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-ui);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-card-subtle);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-title);
}

.form-control {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-row {
  display: flex;
  gap: 0.85rem;
}

.form-row > * {
  flex: 1;
}

.btn {
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: var(--bg-hover); color: var(--text-main); border-color: var(--border-ui); }
.btn-secondary:hover { background: var(--border-ui); }

.btn-danger { background: var(--danger); color: #ffffff; }
.btn-danger:hover { background: #b91c1c; }

/* Editor nástroje */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.5rem;
  background: var(--bg-hover);
  border: 1px solid var(--border-ui);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.toolbar-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
}

.toolbar-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.editor-content-area {
  min-height: 240px;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border-ui);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 1rem;
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
}

.checkbox-list-box {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: var(--bg-card-subtle);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  cursor: pointer;
}

/* ==========================================================================
   11. RESPONZIVNÍ STYLY PRO MOBILNÍ TELEFON
   ========================================================================== */
@media (max-width: 768px) {
  .navbar {
    padding: 0.65rem 0.85rem;
  }

  .nav-search-box {
    display: none; /* Přesunuto do spodního nebo hlavního zobrazení */
  }

  #navTrainerBtn span:last-child {
    display: none; /* Šetří místo v navbaru na mobilu, na spodní liště je plnohodnotné tlačítko */
  }

  #navTrainerBtn {
    padding: 0.45rem 0.65rem;
  }

  .main-wrapper {
    padding: 1rem 0.75rem 6rem;
    gap: 1.15rem;
  }

  .exam-hero-card {
    padding: 1.15rem;
  }

  .exam-date-title {
    font-size: 1.25rem;
  }

  .subjects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .subjects-portal-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .subject-hero-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.15rem;
    gap: 1rem;
  }

  .subject-hero-stats {
    width: 100%;
  }

  .subject-stat-box {
    flex: 1;
  }

  .subject-topic-card {
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

  .topic-card-action {
    display: none;
  }

  .reader-sticky-bar {
    padding: 0.5rem 0.75rem;
    gap: 0.4rem;
  }

  .reader-breadcrumbs {
    display: none; /* Na mobilu šetří místo, ročník i předmět jsou v záhlaví článku */
  }

  #printBtn {
    display: none; /* Tisk z mobilu je zbytečný */
  }

  .reader-article-box {
    padding: 1.25rem 1rem;
  }

  .reader-title-h1 {
    font-size: 1.35rem;
    line-height: 1.3;
  }

  .mobile-bottom-bar {
    display: flex;
  }

  .form-row {
    flex-direction: column;
  }

  .study-callout {
    padding: 0.95rem 1.05rem;
    margin: 1.25rem 0;
  }

  .study-math-card {
    padding: 1rem 1.15rem;
    margin: 1.25rem 0;
  }

  .study-math-card .math-body {
    font-size: 1.1rem;
    flex-wrap: wrap;
    word-break: break-word;
  }

  .study-pre {
    font-size: 0.8rem;
    padding: 0.85rem;
    -webkit-overflow-scrolling: touch;
  }

  .study-table-wrapper {
    -webkit-overflow-scrolling: touch;
  }

  .study-table th, .study-table td {
    padding: 0.65rem 0.75rem;
    font-size: 0.88rem;
  }

  .modal-overlay {
    padding: 0.5rem;
  }

  .modal-box {
    max-height: 94vh;
    border-radius: var(--radius-md);
  }

  .modal-header {
    padding: 1rem 1.15rem;
  }

  .modal-body {
    padding: 1.15rem;
  }
}

@media (max-width: 480px) {
  .brand-sub {
    display: none; /* Pouze "🎓 Studijní Portál" */
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .reader-title-h1 {
    font-size: 1.22rem;
  }

  .trainer-hero-title h2 {
    font-size: 1.25rem;
  }

  .univ-choice-btn {
    padding: 0.75rem 0.95rem;
    font-size: 0.88rem;
  }
}

/* ==========================================================================
   12. TRENA��R ��TOV�N� (INTERAKTIVN� CVI�I�T� PODLE MU BRNO)
   ========================================================================== */
.trainer-wrapper {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.trainer-wrapper.active {
  display: flex;
}

.trainer-hero-header {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: #ffffff;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

body.dark-theme .trainer-hero-header {
  background: linear-gradient(135deg, #115e59 0%, #042f2e 100%);
  border: 1px solid var(--border-ui);
}

.trainer-hero-title h2 {
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trainer-hero-title p {
  font-size: 0.88rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

.trainer-stats-pills {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.18);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  backdrop-filter: blur(4px);
}

/* Kategorie trena��ru */
.trainer-categories-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}

.trainer-cat-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.trainer-cat-btn:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-main);
}

.trainer-cat-btn.active {
  background: #0d9488;
  color: #ffffff;
  border-color: #0d9488;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.3);
}

/* Karta samotn�ho ��etn�ho p��padu */
.trainer-task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.trainer-task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-ui);
}

.doc-badge {
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid #fde68a;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.trainer-task-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-title);
  line-height: 1.45;
}

.trainer-task-amount-highlight {
  color: #0d9488;
  font-weight: 800;
}

/* Interaktivn� T-��et z�na */
.trainer-posting-zone {
  background: var(--bg-card-subtle);
  border: 2px dashed var(--border-ui);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.t-account-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  position: relative;
}

.t-side-box {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.t-side-header {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-title);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border-ui);
  padding-bottom: 0.35rem;
}

.t-side-header.md {
  border-color: #2563eb;
  color: #2563eb;
}

.t-side-header.d {
  border-color: #dc2626;
  color: #dc2626;
}

.account-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.input-account-code {
  width: 90px;
  padding: 0.65rem 0.75rem;
  border: 2px solid var(--border-ui);
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 1.1rem;
  text-align: center;
  outline: none;
  background: var(--bg-card);
  color: var(--text-main);
  transition: all 0.15s ease;
}

.input-account-code:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.input-account-name {
  flex-grow: 1;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Zp�tn� vazba a vysv�tlen� */
.trainer-feedback-box {
  display: none;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  animation: fadeIn 0.2s ease;
}

.trainer-feedback-box.correct {
  display: block;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.trainer-feedback-box.incorrect {
  display: block;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

body.dark-theme .trainer-feedback-box.correct {
  background: #064e3b30;
  border-color: #059669;
  color: #6ee7b7;
}

body.dark-theme .trainer-feedback-box.incorrect {
  background: #7f1d1d30;
  border-color: #dc2626;
  color: #fca5a5;
}

.feedback-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.feedback-explanation {
  font-size: 0.92rem;
  line-height: 1.6;
  margin-top: 0.5rem;
  color: var(--text-main);
}

/* Ak�n� tla��tka v trena��ru */
.trainer-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-check-answer {
  background: #0d9488;
  color: #ffffff;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
  transition: all 0.2s ease;
}

.btn-check-answer:hover {
  background: #0f766e;
  transform: translateY(-1px);
}

.btn-next-question {
  background: var(--bg-hover);
  color: var(--text-main);
  border: 1px solid var(--border-ui);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.btn-next-question.active {
  display: inline-flex;
}

.btn-next-question:hover {
  background: var(--border-ui);
}

.btn-open-osnova {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-ui);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-open-osnova:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

@media (max-width: 640px) {
  .t-account-visual {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .trainer-task-card {
    padding: 1.25rem;
  }
  .trainer-task-text {
    font-size: 1.1rem;
  }
}


/* V�cen�sobn� v�b�r t�mat v trena��ru */
.trainer-topic-selector-box {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.trainer-topic-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.65rem;
}

.trainer-topic-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trainer-topic-pill {
  background: var(--bg-hover);
  border: 1.5px solid var(--border-ui);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  user-select: none;
  transition: all 0.15s ease;
}

.trainer-topic-pill:hover {
  background: var(--bg-card);
  border-color: #0d9488;
  color: var(--text-main);
}

.trainer-topic-pill.selected {
  background: #0d9488;
  border-color: #0f766e;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
}

.trainer-topic-pill .pill-check {
  font-size: 0.72rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

body.dark-theme .trainer-topic-pill .pill-check {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.trainer-topic-pill.selected .pill-check {
  background: #ffffff;
  color: #0f766e;
}



/* Volba obtížnosti v trenažéru */
.trainer-difficulty-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.trainer-diff-btn-group {
  display: flex;
  gap: 0.4rem;
  background: var(--bg-hover);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-ui);
}

.trainer-diff-btn {
  border: none;
  background: transparent;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.trainer-diff-btn:hover {
  color: var(--text-main);
}

.trainer-diff-btn.active {
  background: var(--bg-card);
  color: var(--text-title);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

body.dark-theme .trainer-diff-btn.active {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.trainer-diff-btn[data-diff="hard"].active {
  color: #ea580c;
}

/* Složené účetní řádky (pro pokročilou obtížnost) */
.compound-row {
  background: var(--bg-hover);
  border: 1.5px solid var(--border-ui);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.compound-row .row-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.compound-row .row-label {
  font-weight: 700;
  color: var(--text-title);
}

.compound-row .row-amount {
  font-weight: 800;
  color: #0d9488;
  background: rgba(13, 148, 136, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.82rem;
}

body.dark-theme .compound-row .row-amount {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.15);
}


/* Banner návratu do trenažéru ve čtečce */
.reader-trainer-banner {
  background: rgba(13, 148, 136, 0.12);
  border: 1.5px solid #0d9488;
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: slideDown 0.25s ease-out;
}

body.dark-theme .reader-trainer-banner {
  background: rgba(13, 148, 136, 0.2);
  border-color: #14b8a6;
}

/* Odkaz na teorii v rámečku výsledku trenažéru */
.feedback-theory-box {
  margin-top: 0.95rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-ui);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-feedback-theory-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--bg-card);
  border: 1.5px solid #0d9488;
  color: #0d9488;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-feedback-theory-btn:hover {
  background: #0d9488;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
}

/* Tlačítko procvičit na kartě předmětu na dashboardu */
.btn-topic-practice {
  border: 1px solid var(--border-ui);
  background: var(--bg-hover);
  color: var(--text-title);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  transition: all 0.15s ease;
}

.btn-topic-practice:hover {
  background: #0d9488;
  border-color: #0f766e;
  color: #ffffff;
  transform: scale(1.05);
}


/* ========================================================
   ŠKOLNÍ MATERIÁLY A SOUBORY KE STAŽENÍ (124 SOUBORŮ)
   ======================================================== */
.materialy-filter-pill {
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-ui);
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.materialy-filter-pill:hover {
  background: var(--bg-card);
  border-color: #4338ca;
  color: var(--text-title);
}

.materialy-filter-pill.active {
  background: #4338ca;
  border-color: #3730a3;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(67, 56, 202, 0.25);
}

.material-card {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6rem;
  transition: all 0.18s ease;
  position: relative;
}

.material-card:hover {
  border-color: #4338ca;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.material-icon-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-docx { background: #dbeafe; color: #1d4ed8; }
.badge-pptx { background: #ffedd5; color: #c2410c; }
.badge-pdf  { background: #fee2e2; color: #b91c1c; }
.badge-xlsx { background: #dcfce7; color: #15803d; }
.badge-ppt  { background: #fed7aa; color: #9a3412; }
.badge-doc  { background: #e0e7ff; color: #4338ca; }
.badge-jpg  { background: #f3e8ff; color: #7e22ce; }

.material-title-text {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-title);
  line-height: 1.35;
  word-break: break-word;
}

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

.btn-material-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: #4338ca;
  color: #ffffff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.btn-material-dl:hover {
  background: #3730a3;
  color: #ffffff;
}

/* Řádek souboru ve čtečce pod článkem */
.reader-school-file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.85rem;
  background: var(--bg-hover);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
  gap: 0.6rem;
}

.reader-school-file-row:hover {
  background: var(--bg-card);
  border-color: #4338ca;
  transform: translateX(3px);
}


/* ========================================================
   STUDY CONTENT FORMATTING & EDUCATIONAL ENHANCEMENTS
   ======================================================== */

.study-h2 {
  font-size: 1.55rem;
  font-weight: 800;
  margin: 2.2rem 0 1rem;
  color: var(--text-title);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-ui);
}

.study-h2-tag {
  display: inline-block;
  width: 6px;
  height: 1.35rem;
  background: var(--primary);
  border-radius: 3px;
  flex-shrink: 0;
}

.study-h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.8rem 0 0.75rem;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.study-h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 1.3rem 0 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.study-p {
  margin-bottom: 1.25rem;
  line-height: 1.85;
  font-size: 1.02rem;
  color: var(--text-main);
}

.study-divider {
  border: 0;
  height: 2px;
  background: linear-gradient(to right, var(--border-ui), transparent);
  margin: 2.5rem 0;
}

/* Callout Info boxy */
.study-callout {
  margin: 1.75rem 0;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  border-left: 4.5px solid var(--primary);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.study-callout .callout-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
  font-size: 0.96rem;
  color: var(--text-title);
}

.study-callout .callout-icon {
  font-size: 1.2rem;
}

.study-callout .callout-body {
  font-size: 0.98rem;
  line-height: 1.7;
}

/* 1. Definice a klíčové pojmy */
.study-callout.callout-def {
  background: #eff6ff;
  border-left-color: #2563eb;
  border-top: 1px solid #dbeafe;
  border-right: 1px solid #dbeafe;
  border-bottom: 1px solid #dbeafe;
}
body.dark-theme .study-callout.callout-def {
  background: #1e3a8a25;
  border-color: #1e40af;
  border-left-color: #3b82f6;
}

/* 2. Důležitá varování na zkoušku */
.study-callout.callout-warning {
  background: #fffbeb;
  border-left-color: #d97706;
  border-top: 1px solid #fef3c7;
  border-right: 1px solid #fef3c7;
  border-bottom: 1px solid #fef3c7;
}
body.dark-theme .study-callout.callout-warning {
  background: #78350f25;
  border-color: #92400e;
  border-left-color: #f59e0b;
}

/* 3. Příklady z praxe */
.study-callout.callout-example {
  background: #f0fdf4;
  border-left-color: #16a34a;
  border-top: 1px solid #dcfce7;
  border-right: 1px solid #dcfce7;
  border-bottom: 1px solid #dcfce7;
}
body.dark-theme .study-callout.callout-example {
  background: #064e3b25;
  border-color: #166534;
  border-left-color: #22c55e;
}

/* 4. Poznámky ke studiu */
.study-callout.callout-note {
  background: #faf5ff;
  border-left-color: #9333ea;
  border-top: 1px solid #f3e8ff;
  border-right: 1px solid #f3e8ff;
  border-bottom: 1px solid #f3e8ff;
}
body.dark-theme .study-callout.callout-note {
  background: #581c8725;
  border-color: #6b21a8;
  border-left-color: #a855f7;
}

/* Tabulky */
.study-table-wrapper {
  margin: 1.75rem 0;
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-ui);
}

.study-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--bg-card);
}

.study-table th {
  background: var(--bg-hover);
  color: var(--text-title);
  font-weight: 700;
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border-ui);
  white-space: nowrap;
}

.study-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-ui);
  color: var(--text-main);
  vertical-align: top;
}

.study-table tr:last-child td {
  border-bottom: 0;
}

.study-table tr:nth-child(even) {
  background: var(--bg-hover);
}

/* Seznamy */
.study-list, .study-list-ordered {
  margin: 1rem 0 1.5rem 1.8rem;
  line-height: 1.8;
}

.study-list li, .study-list-ordered li {
  margin-bottom: 0.45rem;
  padding-left: 0.2rem;
}

.study-list li::marker {
  color: var(--primary);
}

.study-list-ordered li::marker {
  font-weight: 700;
  color: var(--primary);
}

/* Karty s kódem, účetními deníky a schématy */
.study-card {
  margin: 1.75rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-ui);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.study-card .card-top-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-ui);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-title);
}

.study-card .card-badge {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  background: var(--primary)15;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
}

.study-card-journal .card-top-bar {
  background: #0284c715;
  border-bottom-color: #0284c730;
}

.study-card-diagram .card-top-bar {
  background: #9333ea15;
  border-bottom-color: #9333ea30;
}

.study-pre {
  margin: 0;
  padding: 1.15rem 1.25rem;
  font-family: 'Consolas', 'Fira Code', 'Monaco', monospace;
  font-size: 0.92rem;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--text-main);
  background: var(--bg-card);
}

body.dark-theme .study-pre {
  background: #0f172a;
}

/* Zvýraznění syntaxe v účetním deníku */
.code-md {
  color: #0284c7;
  font-weight: 700;
  background: #0284c715;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
body.dark-theme .code-md {
  color: #38bdf8;
  background: #38bdf820;
}

.code-dal {
  color: #9333ea;
  font-weight: 700;
  background: #9333ea15;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
body.dark-theme .code-dal {
  color: #c084fc;
  background: #c084fc20;
}

.code-doc {
  color: #d97706;
  font-weight: 700;
}
body.dark-theme .code-doc {
  color: #fbbf24;
}

/* Matematické karty / Vzorce */
.study-math-card {
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1.5px dashed var(--border-ui);
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

body.dark-theme .study-math-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-color: #334155;
}

.study-math-card .math-header {
  margin-bottom: 0.6rem;
}

.study-math-card .math-badge {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.study-math-card .math-body {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-title);
  letter-spacing: 0.02em;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Zlomky v matematických vzorcích */
.math-frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  padding: 0 0.35rem;
  font-size: 0.95em;
}

.math-num {
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 0.1rem;
}

.math-denom {
  padding-top: 0.1rem;
}

/* Značky (odznáčky) v textu */
.badge-acc-tag {
  display: inline-block;
  padding: 0.08rem 0.45rem;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  font-size: 0.88rem;
  margin: 0 0.15rem;
  vertical-align: baseline;
}
body.dark-theme .badge-acc-tag {
  background: #0c4a6e40;
  color: #38bdf8;
  border-color: #075985;
}

.badge-md {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  background: #0284c7;
  color: #ffffff;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  margin: 0 0.15rem;
  letter-spacing: 0.03em;
}

.badge-dal {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  background: #9333ea;
  color: #ffffff;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  margin: 0 0.15rem;
  letter-spacing: 0.03em;
}

.badge-law-tag {
  display: inline-block;
  padding: 0.08rem 0.45rem;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.88rem;
  margin: 0 0.15rem;
}
body.dark-theme .badge-law-tag {
  background: #78350f40;
  color: #fbbf24;
  border-color: #92400e;
}

.study-code {
  font-family: 'Consolas', 'Fira Code', monospace;
  background: var(--bg-hover);
  color: var(--primary);
  border: 1px solid var(--border-ui);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88rem;
}

.math-inline {
  font-weight: 700;
  color: var(--primary);
  padding: 0 0.2rem;
}

/* ==========================================================================
   HLAVIČKA VÝBĚRU PŘEDMĚTŮ & MODERNÍ PORTÁLOVÉ KARTY
   ========================================================================== */
.dashboard-subjects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-ui);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dashboard-section-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-title);
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-section-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.dashboard-stats-counter {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Portálové výběrové karty předmětů */
.subjects-portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.subject-portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.subject-portal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-border);
}

.portal-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.portal-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.portal-card-badges {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge-trainer-shortcut {
  background: #0d9488;
  color: #fff;
  border: none;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.badge-trainer-shortcut:hover {
  opacity: 0.9;
}

.badge-exam-tag {
  background: var(--warning-light);
  color: var(--warning-text);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.badge-count-pill {
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.portal-card-body {
  margin-bottom: 0.85rem;
}

.portal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.portal-subject-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-title);
  margin: 0;
  line-height: 1.25;
}

.portal-code-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.portal-subject-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.portal-grades-breakdown {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.grade-chip {
  flex: 1;
  background: var(--bg-hover);
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.75rem;
}

.chip-label {
  color: var(--text-muted);
}

.chip-val {
  color: var(--text-title);
  font-weight: 800;
}

.portal-card-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.portal-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  margin-bottom: 0.4rem;
}

.progress-lbl {
  color: var(--text-muted);
}

.progress-lbl strong {
  color: var(--text-title);
}

.progress-pct {
  font-weight: 800;
  color: var(--text-title);
}

.portal-progress-bar {
  height: 6px;
  background: var(--border-ui);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.portal-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.portal-card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--primary);
}

.cta-arrow {
  transition: transform 0.2s ease;
}

.subject-portal-card:hover .cta-arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   DETAIL PŘEDMĚTU A TÉMATA DLE ROČNÍKŮ
   ========================================================================== */
.subject-view-wrapper {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.subject-view-wrapper.active {
  display: flex;
}

.subject-sticky-bar {
  position: sticky;
  top: 60px;
  background: var(--bg-card);
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-ui);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
  gap: 1rem;
}

.btn-subject-back {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.btn-subject-back:hover {
  background: var(--bg-hover);
}

.subject-breadcrumb {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumb-sep {
  opacity: 0.5;
}

.subject-breadcrumb strong {
  color: var(--text-title);
  font-weight: 700;
}

.subject-top-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Subject Hero Card */
.subject-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.subject-hero-main {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  min-width: 280px;
}

.subject-hero-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.subject-hero-tags {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.3rem;
}

.subject-code-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.subject-hero-title {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--text-title);
  margin: 0 0 0.35rem 0;
  line-height: 1.2;
}

.subject-hero-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
  max-width: 600px;
}

.subject-hero-stats {
  display: flex;
  gap: 0.85rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.subject-stat-box {
  background: var(--bg-hover);
  padding: 0.75rem 1.15rem;
  border-radius: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.subject-stat-box .stat-num {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text-title);
  line-height: 1.1;
}

.subject-stat-box .stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.15rem;
}

.subject-stat-box.progress-wide {
  min-width: 170px;
  text-align: left;
}

.subject-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-title);
}

.subject-stat-progress-bar {
  height: 8px;
  background: var(--border-ui);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.subject-stat-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Ročníková filtrační lišta */
.subject-grade-filter-bar {
  background: var(--bg-card);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-ui);
}

.subject-grade-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Sekce ročníků */
.subject-grade-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.grade-section-block {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.grade-section-header {
  padding: 1rem 1.35rem;
  background: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-ui);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.section-grade-badge {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
}

.section-title-h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-title);
  margin: 0;
}

.section-count-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.grade-topics-list {
  display: flex;
  flex-direction: column;
}

.subject-topic-card {
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.subject-topic-card:last-child {
  border-bottom: none;
}

.subject-topic-card:hover {
  background: var(--bg-hover);
}

.subject-topic-card.learned {
  background: rgba(22, 163, 74, 0.03);
}

.subject-topic-card.learned .topic-card-title {
  text-decoration: line-through;
  opacity: 0.7;
}

.topic-card-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.topic-check-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border-ui);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  color: transparent;
}

.topic-check-btn:hover {
  border-color: var(--success);
}

.subject-topic-card.learned .topic-check-btn {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.topic-index-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.topic-card-body {
  flex: 1;
  min-width: 0;
}

.topic-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-title);
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.topic-card-preview {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0 0 0.45rem 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topic-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.meta-time {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-topic-practice {
  background: #0d9488;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-topic-practice:hover {
  opacity: 0.9;
}

.topic-card-action {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.action-arrow {
  transition: transform 0.2s ease;
}

.subject-topic-card:hover .action-arrow {
  transform: translateX(4px);
}

.empty-grade-notice {
  padding: 2.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Dark mode doladění */
body.dark-theme .grade-chip {
  background: #1e293b;
}

body.dark-theme .subject-topic-card.learned {
  background: rgba(34, 197, 94, 0.05);
}

/* ==========================================================================
   MULTI-PŘEDMĚTOVÝ TRENAŽÉR – PŘEPÍNAČ PŘEDMĚTŮ & VÝPOČETNÍ FORMULÁŘE
   ========================================================================== */
.trainer-subject-tabs-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.trainer-tabs-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-title);
}

.trainer-subject-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.trainer-subject-tab {
  background: var(--bg-hover);
  border: 1.5px solid var(--border-ui);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.84rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.22s ease;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.trainer-subject-tab:hover {
  transform: translateY(-1px);
}

/* Individuální barevné rozlišení předmětů v trenažéru */
.trainer-subject-tab[data-subject="uct"] {
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.08);
  color: #93c5fd;
}
.trainer-subject-tab[data-subject="uct"]:hover,
.trainer-subject-tab[data-subject="uct"].active {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
  color: #ffffff !important;
  border-color: #60a5fa !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

.trainer-subject-tab[data-subject="cj"] {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}
.trainer-subject-tab[data-subject="cj"]:hover,
.trainer-subject-tab[data-subject="cj"].active {
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%) !important;
  color: #ffffff !important;
  border-color: #f87171 !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);
}

.trainer-subject-tab[data-subject="eko"] {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  color: #fcd34d;
}
.trainer-subject-tab[data-subject="eko"]:hover,
.trainer-subject-tab[data-subject="eko"].active {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
  color: #ffffff !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45);
}

.trainer-subject-tab[data-subject="pra"] {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
  color: #6ee7b7;
}
.trainer-subject-tab[data-subject="pra"]:hover,
.trainer-subject-tab[data-subject="pra"].active {
  background: linear-gradient(135deg, #047857 0%, #10b981 100%) !important;
  color: #ffffff !important;
  border-color: #34d399 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
}

.trainer-subject-tab[data-subject="mm"] {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.08);
  color: #c4b5fd;
}
.trainer-subject-tab[data-subject="mm"]:hover,
.trainer-subject-tab[data-subject="mm"].active {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%) !important;
  color: #ffffff !important;
  border-color: #a78bfa !important;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.45);
}

.trainer-subject-tab[data-subject="anj"] {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(6, 182, 212, 0.08);
  color: #67e8f9;
}
.trainer-subject-tab[data-subject="anj"]:hover,
.trainer-subject-tab[data-subject="anj"].active {
  background: linear-gradient(135deg, #0e7490 0%, #06b6d4 100%) !important;
  color: #ffffff !important;
  border-color: #22d3ee !important;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.45);
}

.trainer-subject-tab[data-subject="fig"] {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(217, 119, 6, 0.08);
  color: #fde68a;
}
.trainer-subject-tab[data-subject="fig"]:hover,
.trainer-subject-tab[data-subject="fig"].active {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%) !important;
  color: #ffffff !important;
  border-color: #f59e0b !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.45);
}

/* Zvýrazněný text zadání (věta / rozbor) */
.univ-highlight-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-ui);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text-title);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.task-emphasized {
  background: #fef08a;
  color: #854d0e;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 800;
  border-bottom: 2px solid #ca8a04;
}

body.dark-theme .task-emphasized {
  background: #854d0e;
  color: #fef08a;
  border-bottom-color: #facc15;
}

/* Výběrová tlačítka možností (Multiple Choice) */
.univ-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.univ-choice-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border-ui);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.15rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  color: var(--text-title);
  font-weight: 600;
}

.univ-choice-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.univ-choice-btn.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.univ-choice-btn.correct {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #166534 !important;
}

.univ-choice-btn.incorrect {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #991b1b !important;
}

body.dark-theme .univ-choice-btn.correct {
  background: #052e16 !important;
  border-color: #16a34a !important;
  color: #86efac !important;
}

body.dark-theme .univ-choice-btn.incorrect {
  background: #450a0a !important;
  border-color: #dc2626 !important;
  color: #fca5a5 !important;
}

.choice-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border-ui);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
}

.univ-choice-btn.selected .choice-letter {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Formuláře pro ekonomické výpočty (Mzdy, DPH, Odpisy) */
.univ-calc-form {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.calc-form-instruction {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.calc-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.calc-fields-grid.single-row {
  grid-template-columns: 1fr;
  max-width: 400px;
}

.calc-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calc-field-group.result-group {
  background: var(--bg-card);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-ui);
}

.calc-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-title);
}

.calc-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border-ui);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.calc-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.calc-input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  width: 100%;
}

.calc-input.highlight {
  font-size: 1.15rem;
  color: var(--primary);
}

.calc-input-unit {
  padding: 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-hover);
  border-left: 1px solid var(--border-ui);
  height: 100%;
  display: flex;
  align-items: center;
}

.input-correct {
  border-color: #16a34a !important;
  background: #f0fdf4 !important;
}

.input-incorrect {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
}

body.dark-theme .input-correct {
  background: #052e16 !important;
}

body.dark-theme .input-incorrect {
  background: #450a0a !important;
}

/* ==========================================================================
   14. INTERAKTIVNÍ VĚTNÝ ROZBOR (PROCVIČOVÁNÍ CELÝCH VĚT V ČJ)
   ========================================================================== */
.sent-analysis-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.sent-instruction-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  flex-wrap: wrap;
}

.sent-tokens-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 0.6rem;
  padding: 1.4rem 1.25rem;
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-ui);
  border-radius: var(--radius-lg);
  align-items: flex-end;
  min-height: 120px;
}

.sent-token-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  border: 2px solid var(--border-ui);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem 0.55rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  min-width: 68px;
}

.sent-token-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.sent-token-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  transform: translateY(-3px);
  background: var(--primary-light);
}

body.dark-theme .sent-token-card.active {
  background: rgba(37, 99, 235, 0.15);
}

.sent-token-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-title);
  text-align: center;
  max-width: 170px;
  line-height: 1.25;
}

.sent-token-slot {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-align: center;
  transition: all 0.15s ease;
  min-width: 48px;
}

.sent-token-slot.empty {
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 1.5px dashed var(--border-ui);
}

/* Barevné role pro větné členy */
.slot-po      { background: #0284c7; color: #ffffff; } /* Podmět - modrá */
.slot-pr      { background: #dc2626; color: #ffffff; } /* Přísudek - červená */
.slot-pt      { background: #16a34a; color: #ffffff; } /* Předmět - zelená */
.slot-pks     { background: #d97706; color: #ffffff; } /* Přívlastek shodný - jantarová */
.slot-pkn     { background: #ea580c; color: #ffffff; } /* Přívlastek neshodný - oranžová */
.slot-pu      { background: #9333ea; color: #ffffff; } /* Příslovečné určení obecné */
.slot-puc     { background: #7e22ce; color: #ffffff; } /* PU času */
.slot-pum     { background: #9333ea; color: #ffffff; } /* PU místa */
.slot-puz     { background: #a855f7; color: #ffffff; } /* PU způsobu */
.slot-pumiry  { background: #c026d3; color: #ffffff; } /* PU míry */
.slot-pupric  { background: #86198f; color: #ffffff; } /* PU příčiny */
.slot-puuc    { background: #6b21a8; color: #ffffff; } /* PU účelu */
.slot-do      { background: #0891b2; color: #ffffff; } /* Doplněk - tyrkysová */

/* Paleta větných členů */
.sent-palette-bar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-ui);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
}

.sent-palette-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sent-palette-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-title);
}

.sent-palette-active-hint {
  font-size: 0.84rem;
  color: var(--primary);
  font-weight: 700;
}

.sent-palette-subgroup-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  display: block;
}

.sent-palette-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.sent-palette-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #ffffff;
}

.sent-palette-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  filter: brightness(1.1);
}

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

.btn-role-po      { background: #0284c7; }
.btn-role-po-unexpressed {
  background: #0369a1;
  border: 1.5px dashed #7dd3fc;
  color: #ffffff;
}
.btn-role-po-unexpressed:hover {
  background: #0284c7;
  border-color: #ffffff;
}
.btn-role-pr      { background: #dc2626; }
.btn-role-pt      { background: #16a34a; }
.btn-role-pks     { background: #d97706; }
.btn-role-pkn     { background: #ea580c; }
.btn-role-pu      { background: #9333ea; }
.btn-role-puc     { background: #7e22ce; }
.btn-role-pum     { background: #9333ea; }
.btn-role-puz     { background: #a855f7; }
.btn-role-pumiry  { background: #c026d3; }
.btn-role-pupric  { background: #86198f; }
.btn-role-puuc    { background: #6b21a8; }
.btn-role-do      { background: #0891b2; }

/* Výběr nevyjádřeného podmětu */
.unexpressed-sub-drawer {
  background: var(--bg-card);
  border: 1.5px solid #0284c7;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  animation: fadeIn 0.2s ease;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.unexpressed-sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-title);
  gap: 0.5rem;
}

.unexpressed-sub-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
}
.unexpressed-sub-close:hover {
  color: var(--danger);
}

.unexpressed-sub-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.btn-sub-pronoun {
  padding: 0.45rem 0.8rem;
  background: var(--bg-hover);
  border: 1.5px solid var(--border-ui);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-title);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-sub-pronoun:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  transform: translateY(-1px);
}
.btn-sub-pronoun.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.sent-token-card.unexpressed-card {
  border: 2px dashed #0284c7 !important;
  background: rgba(2, 132, 199, 0.08) !important;
  position: relative;
}
body.dark-theme .sent-token-card.unexpressed-card {
  background: rgba(2, 132, 199, 0.18) !important;
}

.sent-unexpressed-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dc2626;
  color: #ffffff;
  border: 1.5px solid #ffffff;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: transform 0.15s ease;
}
.sent-unexpressed-remove:hover {
  transform: scale(1.15);
}

.btn-role-clear {
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1.5px solid var(--border-ui);
}
.btn-role-clear:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* Stavy po vyhodnocení */
.sent-token-card.evaluated-correct {
  border-color: #16a34a !important;
  background: #f0fdf4 !important;
}
body.dark-theme .sent-token-card.evaluated-correct {
  background: #052e16 !important;
  border-color: #16a34a !important;
}

.sent-token-card.evaluated-incorrect {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
}
body.dark-theme .sent-token-card.evaluated-incorrect {
  background: #450a0a !important;
  border-color: #dc2626 !important;
}

.sent-badge-verdict {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.8rem;
}

.sent-correct-reveal {
  font-size: 0.72rem;
  font-weight: 800;
  color: #16a34a;
  margin-top: 2px;
  background: rgba(22, 163, 74, 0.12);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}
body.dark-theme .sent-correct-reveal {
  color: #86efac;
  background: rgba(22, 163, 74, 0.25);
}

.sent-token-tooltip {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-align: center;
  max-width: 140px;
}

@media (max-width: 640px) {
  .sent-tokens-flow {
    padding: 0.95rem 0.75rem;
    gap: 0.5rem 0.4rem;
  }
  .sent-token-card {
    padding: 0.45rem 0.6rem 0.35rem;
    min-width: 58px;
  }
  .sent-token-text {
    font-size: 1.05rem;
  }
  .sent-palette-btns {
    gap: 0.4rem;
  }
  .sent-palette-btn {
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
  }
}



/* ==========================================================================
   VÝPOČETNÍ TRENAŽÉR ÚČETNICTVÍ (MZDY & ODPISY DLOUHODOBÉHO MAJETKU)
   ========================================================================== */

.trainer-mode-switch-bar {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  background: rgba(15, 23, 42, 0.75);
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.trainer-mode-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(30, 41, 59, 0.6);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.22s ease;
}

.trainer-mode-tab-btn:hover {
  color: #ffffff;
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.trainer-mode-tab-btn.active {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
  color: #ffffff !important;
  border-color: #60a5fa !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45) !important;
  font-weight: 800;
}

.trainer-mode-badge-new {
  background: #f59e0b;
  color: #111827;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-submode-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.calc-topic-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.7);
  color: var(--text-normal);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calc-topic-btn:hover {
  border-color: #3b82f6;
  color: #ffffff;
  background: rgba(51, 65, 85, 0.85);
  transform: translateY(-1px);
}

.calc-topic-btn.active {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4) !important;
}

.calc-task-header-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.calc-presets-btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.calc-rule-accordion {
  margin-top: 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: var(--bg-hover);
}

.calc-rule-accordion summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--primary);
  outline: none;
}

.calc-table-responsive-box {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  background: var(--card-bg);
}

.calc-worksheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.calc-worksheet-table th,
.calc-worksheet-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.calc-worksheet-table th {
  background: var(--bg-hover);
  color: var(--text-title);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.calc-worksheet-table tr.highlight td {
  background: rgba(99, 102, 241, 0.08);
  font-weight: 700;
}

.calc-table-val-static {
  font-weight: 700;
  color: var(--text-title);
}

.calc-table-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Odstranění šipek nahoru a dolů u číselných vstupů */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button,
.calc-table-num-input::-webkit-outer-spin-button,
.calc-table-num-input::-webkit-inner-spin-button,
.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
  display: none !important;
}

input[type="number"],
.calc-table-num-input,
.calc-input {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

.calc-table-num-input {
  width: 115px;
  padding: 0.35rem 0.5rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg-main);
  color: var(--text-title);
  font-weight: 700;
  text-align: right;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

.calc-acc-input {
  width: 65px;
  padding: 0.35rem 0.4rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg-main);
  color: var(--text-title);
  font-weight: 800;
  text-align: center;
  font-family: inherit;
  text-transform: uppercase;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.calc-table-num-input:focus,
.calc-acc-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.calc-input-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.calc-cell-hint {
  font-size: 0.78rem;
  margin-top: 0.25rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.calc-cell-hint.correct {
  color: var(--success);
  font-weight: 600;
}

.calc-cell-hint.wrong {
  color: var(--danger);
  font-weight: 600;
}

.calc-table-num-input.calc-input-correct,
.calc-acc-input.calc-input-correct {
  border-color: var(--success) !important;
  background: rgba(16, 185, 129, 0.1) !important;
}

.calc-table-num-input.calc-input-wrong,
.calc-acc-input.calc-input-wrong {
  border-color: var(--danger) !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

.calc-action-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
}

.calc-verdict-box {
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  margin-top: 1rem;
  display: none;
  font-size: 0.92rem;
  line-height: 1.45;
}

.calc-verdict-box.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--success);
  color: var(--text-title);
}

.calc-verdict-box.warning {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid var(--danger);
  color: var(--text-title);
}

@media (max-width: 640px) {
  .trainer-mode-switch-bar {
    flex-direction: column;
    padding: 4px;
  }
  .trainer-mode-tab-btn {
    padding: 0.6rem;
    font-size: 0.88rem;
  }
  .calc-submode-bar {
    flex-direction: column;
  }
  .calc-topic-btn {
    width: 100%;
    justify-content: flex-start;
  }
  .calc-table-num-input {
    width: 95px;
    font-size: 0.82rem;
    padding: 0.3rem 0.4rem;
  }
  .calc-acc-input {
    width: 55px;
    font-size: 0.82rem;
    padding: 0.3rem 0.35rem;
  }
  .calc-worksheet-table th,
  .calc-worksheet-table td {
    padding: 0.45rem 0.5rem;
    font-size: 0.82rem;
  }
}


/* ==========================================================================
   ŠKOLNÍ ÚČETNÍ DENÍKY (VARIANTA A - PŘESNÉ PŘEDLOHY Z HODIN ALBRECHTKY)
   ========================================================================== */

.school-journal-tabs-scroll {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 4px 2px 10px 2px;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.school-journal-tab-btn {
  flex: 0 0 250px;
  background: rgba(30, 41, 59, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.school-journal-tab-btn:hover {
  border-color: #3b82f6;
  background: rgba(51, 65, 85, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.school-journal-tab-btn.active {
  border-color: #3b82f6 !important;
  border-width: 2px !important;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35) !important;
  transform: translateY(-2px);
}

.school-journal-tab-btn.active::before {
  content: "✓ AKTIVNÍ";
  position: absolute;
  top: 0;
  right: 0;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 8px;
  border-bottom-left-radius: 8px;
  letter-spacing: 0.5px;
}

.journal-tab-grade {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #60a5fa;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.school-journal-tab-btn.active .journal-tab-grade {
  color: #93c5fd;
}

.journal-tab-score {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.journal-tab-score.done {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.journal-tab-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-title);
  line-height: 1.25;
}

.school-journal-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

.school-journal-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.school-journal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-title);
  margin: 0.25rem 0 0.4rem 0;
}

.school-journal-prompt {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

.school-journal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.school-journal-table th {
  background: var(--bg-hover);
  color: var(--text-title);
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 0.65rem;
  border-bottom: 2px solid var(--border);
}

.school-journal-table td {
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.school-journal-row:hover td {
  background: rgba(99, 102, 241, 0.03);
}

.journal-num-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.8rem;
  background: var(--bg-hover);
  color: var(--text-title);
}

.journal-op-text {
  font-weight: 600;
  color: var(--text-title);
  line-height: 1.4;
}

.journal-row-hint {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #d97706;
  background: rgba(245, 158, 11, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
  line-height: 1.35;
}

.journal-amount-badge {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text-title);
  white-space: nowrap;
}

.journal-input-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.input-journal-acc {
  width: 75px;
  padding: 0.4rem 0.35rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg-main);
  color: var(--text-title);
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
  font-family: inherit;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.15s ease;
}

.input-journal-acc:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.input-journal-acc.acc-correct {
  border-color: var(--success) !important;
  background: rgba(16, 185, 129, 0.12) !important;
  color: var(--success) !important;
}

.input-journal-acc.acc-wrong {
  border-color: var(--danger) !important;
  background: rgba(239, 68, 68, 0.12) !important;
  color: var(--danger) !important;
}

.journal-acc-name-preview {
  font-size: 0.68rem;
  color: var(--text-muted);
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  min-height: 14px;
}

.journal-acc-name-preview.known {
  color: var(--primary);
  font-weight: 600;
}

.school-journal-verdict-box {
  padding: 0.9rem 1.25rem;
  border-radius: 8px;
  margin-top: 1.25rem;
  font-size: 0.94rem;
  line-height: 1.45;
}

.school-journal-verdict-box.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--success);
  color: var(--text-title);
}

.school-journal-verdict-box.warning {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid var(--danger);
  color: var(--text-title);
}

.school-journal-action-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .school-journal-tab-btn {
    flex: 0 0 200px;
    padding: 0.5rem 0.7rem;
  }
  .input-journal-acc {
    width: 60px;
    font-size: 0.85rem;
    padding: 0.3rem 0.25rem;
  }
  .school-journal-table th,
  .school-journal-table td {
    padding: 0.5rem 0.35rem;
    font-size: 0.82rem;
  }
  .journal-amount-badge {
    font-size: 0.82rem;
  }
  .school-journal-action-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .school-journal-action-bar button {
    width: 100%;
  }
}


/* =========================================================
   T-ÚČTY: TĚŽKÁ OBTÍŽNOST (SLOVNÍ ÚLOHY & VÝPOČET ČÁSTEK)
   ========================================================= */

.hard-task-slovni-uloha {
  background: var(--bg-hover);
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.hard-task-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

body.dark-theme .hard-task-badge {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.25);
}

.hard-task-story {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-title);
  margin-bottom: 0.75rem;
}

.hard-task-calc-instructions {
  font-size: 0.87rem;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px dashed var(--border-ui);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.95rem;
}

.hard-task-calc-instructions ol {
  margin: 0.35rem 0 0 1.25rem;
  padding: 0;
}

.hard-task-calc-instructions li {
  margin-bottom: 0.25rem;
  line-height: 1.45;
}

.hard-row-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  width: 100%;
}

@media (max-width: 600px) {
  .hard-row-inputs-grid {
    grid-template-columns: 1fr;
  }
}

.hard-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hard-input-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.input-account-amount {
  width: 100%;
  padding: 0.52rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-title);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-ui);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.15s ease;
}

.input-account-amount:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.input-account-amount.amount-correct {
  border-color: var(--success) !important;
  background: rgba(34, 197, 94, 0.08) !important;
  color: var(--success) !important;
}

.input-account-amount.amount-wrong {
  border-color: var(--danger) !important;
  background: rgba(239, 68, 68, 0.08) !important;
  color: var(--danger) !important;
}

.row-hard-calc-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

body.dark-theme .row-hard-calc-badge {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.22);
}
