/* ═══════════════════════════════════════════════════
   THUNDER CLOUD FOR DUMMIES — CSS FRAMEWORK
   For Dummies inspired theme: yellow, black, white
   ═══════════════════════════════════════════════════ */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --yellow: #FFD700;
  --yellow-light: #FFF8DC;
  --yellow-dark: #B8960F;
  --black: #1a1a1a;
  --gray-900: #212121;
  --gray-800: #333333;
  --gray-700: #4a4a4a;
  --gray-600: #666666;
  --gray-400: #999999;
  --gray-200: #e0e0e0;
  --gray-100: #f5f5f5;
  --white: #ffffff;
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --green: #16a34a;
  --green-light: #dcfce7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --orange: #ea580c;
  --orange-light: #fff7ed;
  --purple: #7c3aed;
  --purple-light: #ede9fe;
  --sidebar-width: 300px;
  --content-max: 900px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Consolas', monospace;
  --font-serif: Georgia, 'Times New Roman', serif;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  color: var(--black);
  background: var(--white);
  line-height: 1.7;
  display: flex;
  min-height: 100vh;
}

/* ─── Breadcrumb Navigation ─── */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-200);
}

/* ─── Sidebar Navigation ─── */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--gray-900);
  color: var(--white);
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
  padding-bottom: 2rem;
}

#sidebar-header {
  background: var(--yellow);
  color: var(--black);
  padding: 1.5rem 1rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

#sidebar-header h1 {
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

#sidebar-header .subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-700);
}

.nav-part {
  padding: 0.75rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--yellow);
  border-top: 1px solid var(--gray-800);
  margin-top: 0.5rem;
}

.nav-part:first-of-type { margin-top: 0; border-top: none; }

.nav-link {
  display: block;
  padding: 0.4rem 1rem 0.4rem 1.5rem;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255,215,0,0.08);
  border-left-color: var(--yellow);
}

.nav-link.active {
  color: var(--yellow);
  background: rgba(255,215,0,0.12);
  border-left-color: var(--yellow);
  font-weight: 600;
}

.nav-link .ch-num {
  display: inline-block;
  width: 1.8rem;
  color: var(--gray-600);
  font-size: 0.75rem;
}

/* ─── Mobile sidebar toggle ─── */
#sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--yellow);
  color: var(--black);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ─── Main Content ─── */
.content,
#content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
}

.content-wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 2.5rem 4rem;
}

/* ─── Cover Page ─── */
#cover {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, var(--yellow) 0%, #FFC107 100%);
  color: var(--black);
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#cover h1 {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

#cover .cover-for-dummies {
  font-size: 4rem;
  font-weight: 900;
  font-style: italic;
  font-family: var(--font-serif);
  color: var(--red);
  margin-bottom: 1rem;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

#cover .cover-subtitle {
  font-size: 1.3rem;
  font-weight: 500;
  max-width: 600px;
  margin: 0 auto 2rem;
  color: var(--gray-800);
}

#cover .cover-tagline {
  font-size: 1rem;
  font-style: italic;
  color: var(--gray-700);
  max-width: 500px;
}

.cover-features {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 2rem 0;
}

.cover-feature {
  background: rgba(255,255,255,0.9);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ─── Chapter Styling ─── */
.chapter {
  padding: 3rem 0;
  border-bottom: 3px solid var(--gray-200);
}

.chapter:last-child { border-bottom: none; }

.chapter > h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 0.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 4px solid var(--yellow);
  line-height: 1.2;
}

.chapter > h2 .ch-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--yellow-dark);
  margin-bottom: 0.25rem;
}

.chapter h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.chapter h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-700);
  margin: 2rem 0 0.75rem;
}

.chapter p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.chapter ul, .chapter ol {
  margin: 0.75rem 0 1.25rem 1.5rem;
}

.chapter li {
  margin-bottom: 0.4rem;
}

.chapter strong { color: var(--gray-900); }

.chapter a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.3);
}

.chapter a:hover { text-decoration-color: var(--blue); }

/* ─── "In This Chapter" Box ─── */
.chapter-intro {
  background: var(--yellow-light);
  border: 2px solid var(--yellow);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin: 1.5rem 0 2rem;
}

.chapter-intro::before {
  content: "In This Chapter";
  display: block;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--yellow-dark);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chapter-intro ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chapter-intro li {
  padding: 0.35rem 0 0.35rem 1.75rem;
  position: relative;
  font-weight: 500;
}

.chapter-intro li::before {
  content: "▸";
  position: absolute;
  left: 0.5rem;
  color: var(--yellow-dark);
  font-weight: 700;
}

/* ─── Callout Boxes ─── */
.callout {
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-left: 5px solid;
  position: relative;
}

.callout h4 {
  margin: 0 0 0.5rem !important;
  font-size: 1rem !important;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.callout p { margin-bottom: 0.5rem; }
.callout p:last-child { margin-bottom: 0; }

.callout.tip {
  background: var(--green-light);
  border-color: var(--green);
}
.callout.tip h4 { color: var(--green); }
.callout.tip h4::before { content: "💡 "; }

.callout.remember {
  background: var(--blue-light);
  border-color: var(--blue);
}
.callout.remember h4 { color: var(--blue); }
.callout.remember h4::before { content: "✋ "; }

.callout.warning {
  background: var(--red-light);
  border-color: var(--red);
}
.callout.warning h4 { color: var(--red); }
.callout.warning h4::before { content: "💣 "; }

.callout.technical {
  background: var(--purple-light);
  border-color: var(--purple);
}
.callout.technical h4 { color: var(--purple); }
.callout.technical h4::before { content: "🤓 "; }

.callout.try-it {
  background: var(--orange-light);
  border-color: var(--orange);
}
.callout.try-it h4 { color: var(--orange); }
.callout.try-it h4::before { content: "⌨️ "; }

/* ─── Code Blocks ─── */
pre {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  border: 1px solid #313244;
}

pre code {
  font-family: var(--font-mono);
  background: none;
  padding: 0;
  color: inherit;
}

/* Inline code */
code {
  font-family: var(--font-mono);
  background: var(--gray-100);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--gray-800);
  border: 1px solid var(--gray-200);
}

pre code { border: none; background: none; }

/* Syntax highlighting (Catppuccin Mocha inspired) */
.kw { color: #cba6f7; }      /* keywords: fn, let, struct, impl, match, use, pub */
.type { color: #f9e2af; }    /* types: String, u64, Vec */
.str { color: #a6e3a1; }     /* strings */
.num { color: #fab387; }     /* numbers */
.comment { color: #6c7086; font-style: italic; }  /* comments */
.fn-name { color: #89b4fa; } /* function names */
.macro { color: #f38ba8; }   /* macros */
.attr { color: #f5c2e7; }    /* attributes */
.op { color: #89dceb; }      /* operators */

/* ─── Tables ─── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.92rem;
}

thead {
  background: var(--gray-900);
  color: var(--white);
}

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}

tbody tr:hover { background: var(--gray-100); }

/* ─── Part Dividers ─── */
.part-divider {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--yellow);
  color: var(--black);
  margin: 2rem 0;
  border-radius: 12px;
}

.part-divider h2 {
  font-size: 2rem;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  border: none !important;
}

.part-divider p {
  font-size: 1.1rem;
  color: var(--gray-700);
}

/* ─── Chapter/Page Navigation ─── */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--gray-200);
}

.chapter-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--gray-100);
  color: var(--gray-800);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.chapter-nav a:hover {
  background: var(--yellow);
  color: var(--black);
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  :root { --sidebar-width: 260px; }
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.open { transform: translateX(0); }
  #sidebar-toggle { display: block; }
  .content,
  #content { margin-left: 0; }
  .content-wrapper { padding: 1.5rem 1.25rem; }
}

@media (max-width: 768px) {
  #cover h1 { font-size: 2.2rem; }
  #cover .cover-for-dummies { font-size: 2.8rem; }
  .chapter > h2 { font-size: 1.6rem; }
  .cover-features { flex-direction: column; align-items: center; }
}

/* ─── Print Styles ─── */
@media print {
  #sidebar, #sidebar-toggle, .chapter-nav { display: none !important; }
  .content,
  #content { margin-left: 0 !important; }
  .content-wrapper { max-width: 100%; padding: 0; }

  body { font-size: 11pt; line-height: 1.5; color: #000; }

  .chapter { page-break-before: always; border: none; }
  .chapter:first-child { page-break-before: avoid; }
  .part-divider { page-break-before: always; }

  #cover { min-height: auto; padding: 3rem; page-break-after: always; }

  pre { border: 1px solid #ccc; background: #f5f5f5 !important; color: #000 !important; }
  .callout { break-inside: avoid; }

  h2, h3, h4 { page-break-after: avoid; }

  a { color: #000; text-decoration: none; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
  a[href^="#"]::after { content: ""; }
}

/* ─── Scroll progress indicator ─── */
#progress-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: 3px;
  background: var(--yellow);
  z-index: 99;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.1s;
}

@media (max-width: 768px) {
  #progress-bar { left: 0; }
}

/* ─── Back to top ─── */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--yellow);
  color: var(--black);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 50;
}

#back-to-top.visible { opacity: 1; }
#back-to-top:hover { background: var(--yellow-dark); color: var(--white); }

/* ─── Search ─── */
#search-container {
  padding: 0.75rem 1rem;
  background: var(--gray-800);
  position: sticky;
  top: 0;
  z-index: 5;
}

#search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--gray-700);
  border: 1px solid var(--gray-600);
  border-radius: 6px;
  color: var(--white);
  font-size: 0.85rem;
  outline: none;
}

#search-input::placeholder { color: var(--gray-400); }
#search-input:focus { border-color: var(--yellow); }

/* ─── Dark Mode ─── */
[data-theme="dark"] {
  --yellow: #FFC107;
  --yellow-light: #3a3520;
  --yellow-dark: #FFD54F;
  --black: #e8e8e8;
  --gray-900: #1a1a1a;
  --gray-800: #2a2a2a;
  --gray-700: #3a3a3a;
  --gray-600: #999999;
  --gray-400: #666666;
  --gray-200: #3a3a3a;
  --gray-100: #2a2a2a;
  --white: #121212;
  --blue: #60a5fa;
  --blue-light: #1e3a5f;
  --green: #4ade80;
  --green-light: #1e3a2f;
  --red: #f87171;
  --red-light: #3a1e1e;
  --orange: #fb923c;
  --orange-light: #3a2a1e;
  --purple: #a78bfa;
  --purple-light: #2a1e3a;
}

[data-theme="dark"] body {
  background: var(--white);
  color: var(--black);
}

[data-theme="dark"] #sidebar {
  background: #0a0a0a;
}

[data-theme="dark"] #sidebar-header {
  background: var(--yellow);
  color: #000;
}

[data-theme="dark"] pre {
  background: #0a0a0a;
  border-color: #2a2a2a;
}

[data-theme="dark"] code {
  background: var(--gray-100);
  color: var(--black);
  border-color: var(--gray-200);
}

[data-theme="dark"] table thead {
  background: #0a0a0a;
}

[data-theme="dark"] tbody tr:hover {
  background: var(--gray-100);
}

[data-theme="dark"] .chapter-intro {
  background: var(--yellow-light);
  border-color: var(--yellow);
}

/* ─── Font Size Controls ─── */
[data-font-size="small"] {
  font-size: 14px;
}

[data-font-size="medium"] {
  font-size: 16px;
}

[data-font-size="large"] {
  font-size: 18px;
}

/* ─── Reading Width Controls ─── */
[data-width="narrow"] .content-wrapper {
  max-width: 700px;
}

[data-width="medium"] .content-wrapper {
  max-width: 900px;
}

[data-width="wide"] .content-wrapper {
  max-width: 1200px;
}

/* ─── Header Bar ─── */
#header-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: 60px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  z-index: 98;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

[data-theme="dark"] #header-bar {
  background: var(--white);
  border-bottom-color: var(--gray-200);
}

#header-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
}

[data-theme="dark"] #header-title {
  color: var(--black);
}

#header-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.header-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-800);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-btn:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--black);
}

[data-theme="dark"] .header-btn {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--black);
}

#reading-time {
  font-size: 0.85rem;
  color: var(--gray-600);
  padding: 0.5rem 1rem;
}

/* Adjust content for fixed header */
.content,
#content {
  margin-top: 60px;
}

@media (max-width: 768px) {
  #header-bar {
    left: 0;
    padding: 0 1rem 0 60px;
  }
  #header-title {
    font-size: 0.9rem;
  }
  #reading-time {
    display: none;
  }
}

/* ─── Search Modal ─── */
#search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

#search-modal.visible {
  display: flex;
}

#search-modal-content {
  background: var(--white);
  border-radius: 12px;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

[data-theme="dark"] #search-modal-content {
  background: var(--gray-900);
}

#search-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  gap: 1rem;
  align-items: center;
}

#search-modal-input {
  flex: 1;
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--black);
  outline: none;
}

#search-modal-input:focus {
  border-color: var(--yellow);
}

#search-close-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-700);
}

#search-close-btn:hover {
  background: var(--gray-200);
}

#search-results {
  display: none;
  overflow-y: auto;
  max-height: 60vh;
}

#search-results.visible {
  display: block;
}

#search-results-content {
  padding: 1rem;
}

.search-results-header {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 1rem;
}

.search-result-item {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.search-result-item:hover {
  background: var(--yellow-light);
  border-color: var(--yellow);
}

.search-result-title {
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

[data-theme="dark"] .search-result-title {
  color: var(--black);
}

.search-result-part {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.search-result-preview {
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.5;
}

[data-theme="dark"] .search-result-preview {
  color: var(--gray-400);
}

.search-result-preview mark {
  background: var(--yellow);
  color: var(--black);
  padding: 0.1em 0.2em;
  border-radius: 2px;
  font-weight: 600;
}

.search-no-results {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--gray-600);
}

.search-hint {
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.search-status {
  text-align: center;
  padding: 2rem;
  color: var(--gray-600);
}

/* ─── Settings Panel ─── */
#settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: var(--white);
  border-left: 1px solid var(--gray-200);
  box-shadow: -2px 0 8px rgba(0,0,0,0.1);
  z-index: 998;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

[data-theme="dark"] #settings-panel {
  background: var(--gray-900);
  border-left-color: var(--gray-800);
}

#settings-panel.visible {
  transform: translateX(0);
}

#settings-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#settings-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

#settings-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-600);
  padding: 0;
  width: 32px;
  height: 32px;
}

#settings-content {
  padding: 1.5rem;
}

.settings-section {
  margin-bottom: 2rem;
}

.settings-section h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.settings-control {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.settings-btn {
  flex: 1;
  padding: 0.75rem;
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  text-align: center;
}

.settings-btn:hover {
  background: var(--gray-200);
}

.settings-btn.active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--black);
  font-weight: 600;
}

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

/* ─── Keyboard Shortcuts Help ─── */
.keyboard-shortcuts {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.keyboard-shortcuts h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.85rem;
}

.shortcut-key {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gray-700);
}

/* ─── Responsive Adjustments ─── */
@media (max-width: 768px) {
  #settings-panel {
    width: 100%;
  }
}

/* ─── Print: Hide all controls ─── */
@media print {
  #header-bar,
  #search-modal,
  #settings-panel,
  #back-to-top,
  #progress-bar,
  .header-btn {
    display: none !important;
  }
}
