/* Application-specific use of /brand-style.html. Lesson content and progress keys stay stable. */
:root { --header-height: 88px; --content-max-width: 880px; }
body { line-height: 1.65; }
.app-header { background: var(--bg-primary); padding-inline: 28px; }
.header-logo { gap: 10px; }
.header-pa-mark { width: 42px; height: 42px; flex-shrink: 0; }
.header-logo-brand { font-size: 17px; font-weight: 800; letter-spacing: -.6px; color: var(--text-primary); }
.header-logo-sub { font-family: var(--font-mono); font-size: 12px; margin-top: 4px; color: var(--text-secondary); }
.header-btn, .header-search { min-width: 44px; min-height: 44px; border-radius: 7px; }
.header-search { border: 1px solid var(--border-primary); }
.app-main { padding: 40px 40px 64px; }
.dashboard-hero { text-align: left; padding: 16px 0 32px; }
.dashboard-eyebrow { background: none; color: var(--text-tertiary); padding: 0; border-radius: 0; font-family: var(--font-mono); font-weight: 400; letter-spacing: .06em; }
.dashboard-title { font-size: clamp(32px, 3.7vw, 48px); font-weight: 750; line-height: 1.08; letter-spacing: -.05em; max-width: 680px; margin: 12px 0 20px; }
.dashboard-subtitle { max-width: 600px; font-size: 18px; }
.dashboard-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 24px 0; margin-top: 28px; border-block: 1px solid var(--border-primary); }
.dashboard-stat { align-items: flex-start; }
.dashboard-stat-value, [data-theme='dark'] .dashboard-stat-value { color: var(--text-primary); font-size: 28px; font-weight: 750; letter-spacing: -.04em; }
.dashboard-stat-label, .module-card-number, .topic-module-badge, .topic-time,
.sidebar-progress-label, .sidebar-module-number, .topic-nav-label, .quiz-badge, .exercise-badge {
  font-family: var(--font-mono); font-weight: 400; font-size: 12px;
}
.dashboard-section-title { font-weight: 750; letter-spacing: -.03em; }
.module-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.module-card { display: flex; flex-direction: column; border-radius: 12px; box-shadow: none; }
.module-card:hover { transform: none; box-shadow: none; border-color: var(--text-primary); }
.module-card-icon { background: var(--yellow); color: var(--ink); border-radius: 7px; }
.module-card-title { font-size: 19px; font-weight: 750; letter-spacing: -.025em; }
.module-card-desc { font-size: 14px; line-height: 1.65; }
.module-card-footer { margin-top: auto; padding-top: 20px; }
.module-card-progress-fill { background: var(--text-primary); }
.dashboard-cta { text-align: left; border-top: 1px solid var(--border-primary); margin-top: 32px; }
.dashboard-cta-text { max-width: 640px; margin: 0; }
.sidebar-module-header { min-height: 72px; }
.sidebar-topic { min-height: 44px; }
.sidebar-topic.active, [data-theme='dark'] .sidebar-topic.active { background: var(--yellow); color: var(--ink); border-left-color: var(--ink); }
.sidebar-topic.active .sidebar-topic-dot { background: var(--ink); }
.topic-title { font-size: clamp(28px, 3.5vw, 40px); font-weight: 750; letter-spacing: -.045em; }
.topic-module-badge, .quiz-badge, .exercise-badge { border-radius: 4px; }
.concept-section, .quiz-block, .exercise-block, .takeaway { border-radius: 12px; }
.quiz-option { border-radius: 7px; border-color: var(--border-secondary); min-height: 48px; }
.quiz-option.selected:not(.correct):not(.incorrect) { background: var(--yellow-light); border-color: var(--ink); color: var(--ink); }
.quiz-option.selected:not(.correct):not(.incorrect) .quiz-option-letter { background: var(--ink); color: var(--white, #fff); }
.quiz-check-btn, .quiz-retry-btn, .topic-complete-btn, .exercise-reset-btn, .exercise-hints-toggle, .fc-rate-btn { min-height: 44px; border-radius: 7px; }
.quiz-check-btn, .topic-complete-btn { background: var(--text-primary); color: var(--bg-primary); }
.quiz-check-btn:hover:not(:disabled), .topic-complete-btn:hover { background: var(--text-secondary); color: var(--bg-primary); box-shadow: none; transform: none; }
.exercise-textarea, .chat-input, .chat-key-input, .search-input-wrap input { font-size: 16px; }
.callout--key-insight, .callout--tip { background: var(--bg-tertiary); border-color: var(--border-secondary); }
.takeaway { background: var(--bg-tertiary); border-color: var(--border-primary); }
.takeaway-header, [data-theme='dark'] .takeaway-header { color: var(--text-primary); }
.flashcard-close-btn, .chat-header-btn, .chat-send-btn { min-width: 44px; min-height: 44px; border-radius: 7px; }
.flashcard-front, .flashcard-back { border-radius: 12px; }
.flashcard-overlay { overflow-y: auto; }
#chat-panel { visibility: hidden; }
#chat-panel.open { visibility: visible; }
.chat-msg--user, [data-theme='dark'] .chat-msg--user { background: var(--bg-tertiary); color: var(--text-primary); }
.chat-send-btn, .chat-key-save, #selection-popup, [data-theme='dark'] #selection-popup { background: var(--ink); color: #fff; border: 1px solid var(--border-secondary); }
#selection-popup::after, [data-theme='dark'] #selection-popup::after { border-top-color: var(--ink); }
[data-theme='dark'] #selection-popup:hover { background: #383d35; }
[data-theme='dark'] a { color: var(--text-primary); }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 5px; }
[data-theme='dark'] :focus-visible { outline-color: var(--yellow); }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 500; background: var(--yellow); color: var(--ink); padding: 12px 20px; border-radius: 7px; }
.skip-link:focus { top: 12px; }
@media (max-width: 1000px) { .module-cards { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  :root { --header-height: 76px; }
  .app-header { padding-inline: 16px; }
  .app-main { padding: 28px 20px 48px; }
  .dashboard-hero { padding-top: 8px; }
  .dashboard-subtitle { font-size: 16px; }
  .dashboard-stats { gap: 8px; }
  .dashboard-stat-value { font-size: 24px; }
  .dashboard-stat-label { font-size: 12px; }
  .exercise-textarea { font-size: 16px; }
  .sidebar-overlay { top: var(--header-height); }
}
@media (max-width: 540px) {
  :root { --header-height: 124px; }
  .app-header { display: grid; grid-template-columns: 1fr; align-content: center; gap: 8px; }
  .header-left { gap: 8px; }
  .header-right { justify-content: space-between; gap: 8px; }
  .header-logo-sub { display: block; }
  .header-search { flex: 1; min-width: 0; }
  .header-search span { display: inline; }
  .header-search kbd { display: none; }
  .header-pa-mark { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

.quiz-option.correct .quiz-option-letter, .quiz-option.incorrect .quiz-option-letter { color: var(--bg-primary); }
.flow-node { color: var(--bg-primary); border-radius: 7px; }
.stack-layer { background: var(--bg-tertiary); border-left-color: var(--text-primary); border-radius: 7px; }
.stack-layer:nth-child(even) { background: var(--bg-elevated); }
.comparison-column { border: 1px solid var(--border-primary); border-top: 3px solid var(--text-primary); }
.comparison-column-header { color: var(--text-primary); background: var(--bg-tertiary); }
/* Long answers stay inside the card on small screens. */
.flashcard-card { height: 380px; }
.flashcard-front, .flashcard-back { overflow-y: auto; }
.flashcard-front p, .flashcard-back p { font-size: 16px; line-height: 1.65; margin-block: auto; }
.flashcard-meta { flex-wrap: wrap; gap: 4px 12px; }
@media (max-width: 540px) {
  .flashcard-card { height: 420px; max-height: 54dvh; min-height: 280px; }
  .flashcard-front, .flashcard-back { padding: 20px; }
  .flashcard-progress { white-space: nowrap; }
}
.flashcard-card-inner { height: 100%; }
@media (max-width: 540px) {
  .flashcard-header { flex-wrap: wrap; gap: 8px; }
  .flashcard-header h2 { font-size: 20px; }
  .flashcard-close-btn { margin-left: auto; }
  .flashcard-progress { order: 3; flex-basis: 100%; }
  .flashcard-rating-btns { gap: 8px; }
  .fc-rate-btn { flex: 1; min-width: 0; padding: 10px 6px; font-size: 13px; }
}
@media (max-width: 540px) {
  .flashcard-overlay { padding: 0; }
  .flashcard-container { padding: 20px; }
}
