/* =========================================================
   Global layout and theme styles for Rudresh Veerappaji site
   ========================================================= */

/* Basic reset and typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Utility class for elements that should be available to screen readers
   but not visible on screen (e.g., form labels). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth; /* Smooth scrolling for in-page index links */
}

body {
  font-family: Verdana, Arial, sans-serif; /* Default font */
  font-size: 14px; /* Increased base font size for body text */
  line-height: 1.6;
  background-color: #f7f7f7;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Theme modifiers applied to the body element */
body.light-theme {
  background-color: #f7f7f7;
  color: #222;
}

body.dark-theme {
  background-color: #101216;
  color: #e5e7eb;
}

body.dark-theme a {
  color: #60a5fa;
}

/* Temporarily hide the footer view counter */
#view-counter {
  display: none;
}

/* Status labels for To review page */
.status-label {
  font-weight: 600;
}

.status-label.status-pending {
  color: #8b4513; /* dark brown */
}

.status-label.status-complete {
  color: #006400; /* dark green for future use */
}

  /* Bookshelf status styling */
  .book-status {
    font-weight: 700;
  }

  .book-status-reading {
    color: #8b4513; /* dark brown */
  }

  .book-status-read {
    color: #008000; /* green */
  }

  .book-status-yet {
    color: #000000; /* black */
  }

/* Links */
a {
  color: #0077cc;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

/* =====================
   Top navigation bar
   ===================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background-color: #ffffff;
  border-bottom: 1px solid #ddd;
  z-index: 1000;
}

.site-header nav {
  flex: 1 1 auto;
  min-width: 0;
  /* Allow horizontal scroll on small viewports while keeping dropdowns visible below */
  overflow-x: auto;
  overflow-y: visible;
  margin-right: 16px;
  padding-right: 80px; /* reserve space so nav items don't sit under the theme toggle */
  -ms-overflow-style: none; /* IE and old Edge: hide scrollbar */
  scrollbar-width: none;    /* Firefox: hide scrollbar */
}

/* Chrome, Safari and other WebKit-based browsers: hide scrollbar visuals */
.site-header nav::-webkit-scrollbar {
  display: none;
}

body.dark-theme .site-header {
  background-color: #111827;
  border-bottom-color: #1f2933;
}

/* Navigation list (starts from left edge as requested) */
.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 24px;
}

.site-nav > li {
  list-style: none;
  position: relative;
}

.site-nav > li > a {
  font-weight: 600;
  font-size: 14px; /* slightly smaller nav label size */
  padding: 4px 0;
  display: inline-block;
}

/* Dropdown menus */
.nav-dropdown-toggle::after {
  content: " ▾";
  font-size: 11px;
}

.nav-dropdown {
  position: absolute;
  top: 100%; /* align dropdown directly under the parent tab to avoid hover gaps */
  left: 0;
  min-width: 200px;
  background-color: #ffffff;
  border: 1px solid #ddd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  display: none;
  z-index: 1100;
}

body.dark-theme .nav-dropdown {
  background-color: #111827;
  border-color: #1f2933;
}

.nav-dropdown li {
  list-style: none;
}

.nav-dropdown a {
  display: block;
  padding: 6px 16px;
  font-size: 12px;
}

/* Show dropdown when parent is hovered or focused */
.site-nav > li:hover .nav-dropdown,
.site-nav > li:focus-within .nav-dropdown,
.site-nav > li.nav-open .nav-dropdown {
  display: block;
}

/* Active nav link styling */
.nav-link-active {
  border-bottom: 2px solid #111827;
  padding-bottom: 2px;
}

body.dark-theme .nav-link-active {
  border-bottom-color: #e5e7eb;
}

/* Theme toggle button on the right */
.theme-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle span {
  display: none; /* hide "Light mode" / "Dark mode" text; use tooltip instead */
}

.theme-toggle button {
  border: 1px solid #ccc;
  background-color: #ffffff;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}

body.dark-theme .theme-toggle button {
  background-color: #1f2933;
  border-color: #374151;
  color: #e5e7eb;
}

/* =====================
   Main page layout
   ===================== */

.page-wrapper {
  max-width: 1360px; /* allow a wider three-column layout */
  margin: 0 16px; /* reduce outer margins so side panes sit closer to edges */
  padding: 80px 8px 40px; /* keep top padding for header, trim horizontal padding */
  flex: 1 0 auto;
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 180px; /* slightly narrower right index, more room for content */
  gap: 20px; /* reduce space between left/content/right panes */
}

  /* When sidebar is removed, expand content to the left */
  .no-sidebar .layout,
  .layout--no-sidebar {
    grid-template-columns: minmax(0, 1fr) 180px;
  }

  .no-sidebar .content,
  .layout--no-sidebar .content {
    grid-column: 1 / 2;
  }

  .no-sidebar .page-index,
  .layout--no-sidebar .page-index {
    grid-column: 2 / 3;
  }

/* Sidebar on the left (profile area) */
.sidebar {
  position: sticky;
  top: 80px; /* below the header */
}

.sidebar-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 20px;
  text-align: center;
}

body.dark-theme .sidebar-card {
  background-color: #111827;
  border-color: #1f2933;
}

.sidebar-avatar {
  width: 144px;  /* ~20% smaller */
  height: 176px;
  border-radius: 14px; /* rectangle with curved edges */
  background-color: #e5e7eb;
  margin: 0 auto 16px;
  object-fit: cover;
  object-position: center top; /* bias crop so face is nicely centered */
  display: block;
}

.sidebar-name {
  font-weight: 700;
  font-size: 16px; /* slightly larger name */
  margin-bottom: 1px; /* reduce gap above title */
}

.sidebar-title {
  font-size: 12px; /* adjusted slightly smaller */
  margin-bottom: 12px;
}

.sidebar-meta {
  list-style: none;
  text-align: left;
  margin-top: 12px;
  font-size: 13px; /* slightly smaller than body text */
  line-height: 1.4; /* tighter line spacing for contact details */
}

.sidebar-meta li + li {
  margin-top: 2px; /* reduce vertical gap between items */
}

.sidebar-card p:not(.guesswho-disclaimer) {
  font-size: 13px; /* slightly smaller tagline text */
}

/* =====================
   Topic sidebar (Business Administration)
   ===================== */

.topic-sidebar {
  text-align: left;
}

.topic-sidebar-title {
  font-size: 15px;
  margin-bottom: 10px;
  text-align: center;
}

/* Keep the left pane scrollable while the page scrolls independently */
.topic-sidebar .sidebar-card {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.topic-list li + li {
  margin-top: 6px;
}

.topic-entry {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  line-height: 1.3;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.topic-entry:hover,
.topic-entry:focus-visible {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.topic-entry.topic-entry-active {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  font-weight: 600;
}

body.dark-theme .topic-entry {
  background-color: #020617;
  border-color: #1f2937;
  color: #e5e7eb;
}

body.dark-theme .topic-entry:hover,
body.dark-theme .topic-entry:focus-visible,
body.dark-theme .topic-entry.topic-entry-active {
  background-color: #0b1120;
  border-color: #4b5563;
}

/* =====================
   Use case sidebar (AI Prompt Library)
   ===================== */

.usecase-sidebar {
  text-align: left;
}

.usecase-title {
  font-size: 16px;
  margin-bottom: 10px;
  text-align: center; /* center "Usecases" heading in left pane */
}

.usecase-search {
  margin-bottom: 12px;
}

.usecase-search input[type="search"] {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 12px;
}

body.dark-theme .usecase-search input[type="search"] {
  background-color: #111827;
  border-color: #374151;
  color: #e5e7eb;
}

.usecase-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.usecase-category {
  padding: 8px 10px;
  border-radius: 8px;
  background-color: #e5e7eb;
}

body.dark-theme .usecase-category {
  background-color: #000000;
}

.usecase-category h3 {
  font-size: 13px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.usecase-category h3::after {
  content: "▾";
  font-size: 11px;
  color: #6b7280;
}

.usecase-category.collapsed h3::after {
  content: "▸";
}

.usecase-category ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.usecase-category.collapsed ul {
  display: none;
}

.usecase-category li + li {
  margin-top: 4px;
}

.usecase-entry {
  width: 100%;
  text-align: left;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.05s ease;
}

.usecase-entry:hover,
.usecase-entry:focus-visible {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

body.dark-theme .usecase-entry {
  background-color: #020617;
  border-color: #1f2937;
  color: #e5e7eb;
}

body.dark-theme .usecase-entry:hover,
body.dark-theme .usecase-entry:focus-visible {
  background-color: #0b1120;
  border-color: #4b5563;
}

/* Reusable AI/news disclaimer, typically placed at the bottom of content cards */
.ai-news-disclaimer {
  margin-top: 16px;
  font-size: 11px;
  color: #6b7280;
  text-align: right;
}

body.dark-theme .ai-news-disclaimer {
  color: #9ca3af;
}

/* =====================
   Guess Who Said It quiz
   ===================== */

.guesswho-sidebar {
  text-align: left;
}

.guesswho-sidebar .usecase-title {
  text-align: center;
}

.guesswho-sidebar p {
  text-align: justify;
}

.guesswho-progress {
  margin: 6px 0 8px;
}

.guesswho-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background-color: #e5e7eb;
  overflow: hidden;
}

.guesswho-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #9ca3af, #4b5563);
  transition: width 0.25s ease-out;
}

.guesswho-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  color: #374151;
}

body.dark-theme .guesswho-status {
  color: #d1d5db;
}

.guesswho-card {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: radial-gradient(circle at top left, #eef2ff, #ffffff);
  padding: 18px 20px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: hidden;
}

body.dark-theme .guesswho-card {
  background: radial-gradient(circle at top left, #111827, #020617);
  border-color: #1f2933;
}

.guesswho-quote {
  font-size: 16px;
  font-style: italic;
  margin-bottom: 14px;
}

.guesswho-options {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.guesswho-option-button {
  width: 100%;
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    transform 0.05s ease, box-shadow 0.1s ease;
}

.guesswho-option-button:hover,
.guesswho-option-button:focus-visible {
  background-color: #eff6ff;
  border-color: #93c5fd;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}

.guesswho-option-button:disabled {
  cursor: default;
}

.guesswho-option-correct {
  background-color: #ecfdf5;
  border-color: #16a34a;
  color: #065f46;
}

.guesswho-option-wrong {
  background-color: #fef2f2;
  border-color: #f97373;
}

.guesswho-feedback {
  font-weight: 600;
  margin-bottom: 6px;
}

.guesswho-context {
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 10px;
}

body.dark-theme .guesswho-context {
  color: #d1d5db;
}

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

.guesswho-actions--center {
  justify-content: center;
}

.guesswho-actions button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #9ca3af;
  background-color: #e5e7eb;
  font-size: 13px;
  cursor: pointer;
}

#guesswho-end-button,
#techlegends-end-button,
#idioms-end-button,
#imeanwell-end-button {
  margin-left: auto;
}

.guesswho-actions button:hover,
.guesswho-actions button:focus-visible {
  background-color: #d1d5db;
}

.guesswho-scorecard {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

body.dark-theme .guesswho-scorecard {
  border-color: #1f2933;
  background-color: #020617;
}

.guesswho-scorecard button {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #9ca3af;
  background-color: #e5e7eb;
  font-size: 13px;
  cursor: pointer;
}

.guesswho-scorecard button:hover,
.guesswho-scorecard button:focus-visible {
  background-color: #d1d5db;
}

.guesswho-scorecard-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.guesswho-score-timestamp {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
}

body.dark-theme .guesswho-score-timestamp {
  color: #9ca3af;
}

@keyframes guesswho-pop {
  0% {
    transform: scale(1);
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.15);
  }
  40% {
    transform: scale(1.03);
    box-shadow: 0 14px 30px rgba(22, 163, 74, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.15);
  }
}

.guesswho-celebrate {
  animation: guesswho-pop 0.9s ease-out;
}

.guesswho-disclaimer {
  margin-top: 14px;
  font-size: 11px;
  color: #6b7280;
}

body.dark-theme .guesswho-disclaimer {
  color: #9ca3af;
}

/* =====================
   Flashcards (LLM knowledge check)
   ===================== */

/* Light theme accent for the LLM flashcard card */
body.light-theme.flashcard-page .guesswho-card.flashcard-card {
  background: #ffe6d5;
}

body.light-theme.metacognition-practice-page .guesswho-card.flashcard-card {
  background: linear-gradient(160deg, #ffe6d5 0%, #fff3eb 48%, #ffffff 100%);
}

.flashcard-card {
  min-height: 460px;
}

.flashcard-inner {
  position: relative;
  min-height: 380px;
  perspective: 1200px;
}

.flashcard-card.is-flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-inner {
  transform-style: preserve-3d;
  transition: transform 0.55s ease;
}

.flashcard-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  backface-visibility: hidden;
}

.flashcard-front {
  transform: rotateY(0deg);
}

.flashcard-back {
  transform: rotateY(180deg);
}

.flashcard-label {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2px;
  color: #374151;
}

body.dark-theme .flashcard-label {
  color: #d1d5db;
}

.flashcard-content {
  font-size: 16px;
  line-height: 1.6;
  color: #111827;
  padding-right: 8px;
}

.flashcard-front .flashcard-content {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-right: 0;
}

body.dark-theme .flashcard-content {
  color: #e5e7eb;
}

.flashcard-answer {
  overflow-y: auto;
  max-height: 300px;
  padding-right: 10px;
  white-space: pre-wrap;
}

.flashcard-footer {
  margin-top: 14px;
}

.flashcard-flip-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.flashcard-flip-icon {
  flex: none;
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.metacognition-practice-page .flashcard-card {
  min-height: 620px;
}

.metacognition-practice-page .flashcard-inner {
  min-height: 520px;
}

.metacognition-practice-page .flashcard-answer {
  max-height: 420px;
  white-space: normal;
}

.metacognition-practice-page .flashcard-front .flashcard-content,
.metacognition-practice-page .flashcard-back .flashcard-content {
  display: block;
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  overflow-y: auto;
  max-height: 420px;
  padding-right: 10px;
}

.practice-card-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a3412;
  margin-bottom: 6px;
}

body.dark-theme .practice-card-eyebrow {
  color: #fdba74;
}

.practice-card-title {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.2;
}

.practice-card-panel {
  border: 1px solid rgba(154, 52, 18, 0.14);
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.72);
  padding: 14px 16px;
  margin-bottom: 14px;
}

body.dark-theme .practice-card-panel {
  border-color: rgba(251, 191, 36, 0.18);
  background-color: rgba(2, 6, 23, 0.68);
}

.practice-card-panel:last-child {
  margin-bottom: 0;
}

.practice-card-panel-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7c2d12;
}

body.dark-theme .practice-card-panel-title {
  color: #fdba74;
}

.practice-card-panel h3 {
  margin: 14px 0 8px;
  font-size: 16px;
}

.practice-card-panel h3:first-child {
  margin-top: 0;
}

.practice-card-panel p {
  margin: 0 0 10px;
}

.practice-card-panel p:last-child {
  margin-bottom: 0;
}

.practice-card-panel ul {
  margin: 0 0 10px 20px;
}

.practice-card-panel ul:last-child {
  margin-bottom: 0;
}

.practice-card-panel blockquote {
  margin: 0 0 10px;
  padding-left: 14px;
  border-left: 3px solid rgba(154, 52, 18, 0.26);
}

body.dark-theme .practice-card-panel blockquote {
  border-left-color: rgba(251, 191, 36, 0.34);
}

.practice-card-checklist {
  margin: 0;
}

.practice-card-checklist li + li {
  margin-top: 8px;
}

.practice-card-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.practice-card-checklist input[type="checkbox"] {
  margin-top: 3px;
}

.articulate-feeling-page .content-card {
  padding-bottom: 28px;
}

.feeling-exercise-layout {
  display: grid;
  gap: 18px;
}

.feeling-panel {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

body.dark-theme .feeling-panel {
  border-color: #1f2933;
  background: linear-gradient(180deg, #111827 0%, #020617 100%);
}

.feeling-panel h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.feeling-panel p {
  margin-top: 0;
}

.feeling-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.feeling-selector-grid .guesswho-option-button {
  width: 100%;
  min-height: 54px;
  justify-content: center;
  text-align: center;
}

.feeling-option-active {
  background-color: #fff1e6;
  border-color: #fb923c;
  color: #9a3412;
  box-shadow: 0 2px 8px rgba(251, 146, 60, 0.18);
}

body.dark-theme .feeling-option-active {
  background-color: #3f1d0f;
  border-color: #fb923c;
  color: #fed7aa;
}

.feeling-option-copy {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.feeling-option-title {
  font-weight: 700;
}

.feeling-option-caption {
  font-size: 12px;
  color: #6b7280;
}

body.dark-theme .feeling-option-caption {
  color: #9ca3af;
}

.feeling-selection-summary {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #fed7aa;
  background-color: #fff7ed;
}

body.dark-theme .feeling-selection-summary {
  border-color: #7c2d12;
  background-color: #27130a;
}

.feeling-selection-summary p {
  margin-bottom: 8px;
}

.feeling-selection-summary p:last-child {
  margin-bottom: 0;
}

.worksheet-list {
  display: grid;
  gap: 14px;
}

.worksheet-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background-color: #ffffff;
  padding: 14px 16px;
}

body.dark-theme .worksheet-item {
  border-color: #1f2933;
  background-color: #020617;
}

.worksheet-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
}

.worksheet-item input[type="checkbox"] {
  margin-top: 3px;
}

.articulate-feeling-page .worksheet-list textarea,
.articulate-feeling-page .worksheet-list grammarly-desktop-integration,
.articulate-feeling-page .worksheet-list grammarly-extension,
.articulate-feeling-page .worksheet-list [data-grammarly-part] {
  display: none !important;
}

.worksheet-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.worksheet-actions button {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #9ca3af;
  background-color: #e5e7eb;
  cursor: pointer;
}

.worksheet-actions button:hover,
.worksheet-actions button:focus-visible {
  background-color: #d1d5db;
}

.worksheet-status {
  font-size: 13px;
  color: #4b5563;
}

body.dark-theme .worksheet-status {
  color: #d1d5db;
}

/* Main content */
.content {
  min-width: 0;
}

.content-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 8px 28px 20px; /* further reduce top padding to pull titles up across pages */
}

/* Rounded middle pane only for the "Can You Decode This" page */
#shloka-quiz.content-card {
  border-radius: 12px;
}

/* Rounded middle pane only for the Poems page */
#poems-quiz.content-card {
  border-radius: 12px;
}

/* Can You Decode This: audio icon button */
.guesswho-actions button.decode-audio-btn,
.guesswho-actions button.decode-loop-through-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  background-color: #60a5fa;
  border-color: #60a5fa;
  color: #ffffff;
}

body.dark-theme .guesswho-actions button.decode-audio-btn,
body.dark-theme .guesswho-actions button.decode-loop-through-btn {
  background-color: #60a5fa;
  border-color: #60a5fa;
  color: #ffffff;
}

.guesswho-actions button.decode-audio-btn:hover,
.guesswho-actions button.decode-loop-through-btn:hover {
  filter: brightness(0.95);
}

.guesswho-actions button.decode-audio-btn:focus-visible,
.guesswho-actions button.decode-loop-through-btn:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

body.dark-theme .guesswho-actions button.decode-audio-btn:focus-visible,
body.dark-theme .guesswho-actions button.decode-loop-through-btn:focus-visible {
  outline-color: #e5e7eb;
}

.guesswho-actions button.decode-audio-btn .decode-audio-icon,
.guesswho-actions button.decode-loop-through-btn .decode-loop-icon {
  width: 44px;
  height: 44px;
  display: block;
}

.guesswho-actions button.decode-loop-through-btn[aria-pressed="true"] {
  filter: brightness(0.92);
}

/* Can You Decode This: loop-through button hint text */
.decode-loop-hint {
  margin-top: 6px;
  font-size: 11px;
  color: #555;
  text-align: center;
}

body.dark-theme .decode-loop-hint {
  color: #9ca3af;
}

/* Can You Decode This: hover tooltip for loop-through info */
.decode-loop-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #9ca3af;
  background-color: #e5e7eb;
  color: #111827;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

body.dark-theme .decode-loop-info {
  background-color: #111827;
  border-color: #374151;
  color: #e5e7eb;
}

.decode-loop-info::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  max-width: 280px;
  width: max-content;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #111827;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 120ms ease, visibility 120ms ease;
  z-index: 50;
}

body.dark-theme .decode-loop-info::after {
  background: #111827;
  border-color: #1f2933;
  color: #e5e7eb;
}

.decode-loop-info:hover::after,
.decode-loop-info:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

/* Can You Decode This: transliteration word-meaning tooltips */
.decode-transliteration {
  font-size: 16px;
  color: #444;
  margin-bottom: 12px;
  line-height: 1.55;
}

body.dark-theme .decode-transliteration {
  color: #d1d5db;
}

.decode-word {
  position: relative;
  display: inline-block;
  cursor: help;
}

.decode-word[data-meaning]:not([data-meaning=""]) {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  text-decoration-color: #111827;
}

body.dark-theme .decode-word[data-meaning]:not([data-meaning=""]) {
  text-decoration-color: #e5e7eb;
}

.decode-word::after {
  content: attr(data-meaning);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  max-width: 260px;
  width: max-content;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #111827;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 120ms ease, visibility 120ms ease;
  z-index: 40;
}

body.dark-theme .decode-word::after {
  background: #111827;
  border-color: #1f2933;
  color: #e5e7eb;
}

.decode-word:hover::after,
.decode-word.decode-word--active::after {
  opacity: 1;
  visibility: visible;
}

/* Light theme accent for the Can You Decode This shloka pane */
body.light-theme #shloka-quiz.content-card {
  background-color: #ffe6d5;
}

/* Light theme accent for the Poems pane */
body.light-theme #poems-quiz.content-card {
  background-color: #ffe6d5;
}

/* Poems: title font */
.poem-title,
a.poem-title {
  font-family: "Comic Sans MS", "Comic Sans", cursive;
}

/* Poems: body text font (override any per-poem font classes) */
#poem-text-content {
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
}

/* Poems: per-poem text font override (used via poems-data.js → poemTextClass). */
.poem-text--bernadette {
  font-family: "Bernadette", "Comic Sans MS", "Comic Sans", cursive;
}

.poem-text--lemon {
  font-family: "Segoe Script", "Brush Script MT", "Comic Sans MS", "Comic Sans", cursive;
  font-weight: 400;
  font-size: 17px;
}

body.dark-theme .content-card {
  background-color: #111827;
  border-color: #1f2933;
}

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

.content-header h1 {
  margin-bottom: 0;
}

/* Shlokas list: tighten title-to-play-button spacing */
#shloka-list .content-header {
  margin-bottom: 8px;
}

#shloka-list .content-header + .guesswho-actions {
  margin-top: 0 !important;
}

.last-updated {
  font-size: 11px;
  color: #555;
  white-space: nowrap;
}

body.dark-theme .last-updated {
  color: #9ca3af;
}

.content-card h1 {
  font-size: 21px; /* slightly smaller main page titles */
  margin-bottom: 10px; /* reduce space below main title */
  text-align: center; /* center main page titles */
}

.content-card h2 {
  font-size: 16px; /* slightly smaller section subtitles */
  margin-top: 8px; /* lift section titles closer to top */
  margin-bottom: 10px;
  text-align: center; /* center subsection titles by default */
}

/* First subsection title directly under the page title */
.content-card h1 + section > h2 {
  margin-top: -4px; /* pull first subsection closer to main title without moving the title itself */
  text-align: left; /* keep first subsection title left-aligned */
}

/* Prompt library: left-align section titles on that page */
.prompt-library-page .content-card h2 {
  text-align: left;
}

.prompt-library-page .content-card ol {
  margin-left: 18px;
  margin-bottom: 10px;
}

/* Prompt library: slightly more indentation for the 4-point intro list */
.prompt-library-page .content-card ol.intro-usecase-list {
  margin-left: 28px;
}

.prompt-library-page .content-card ol.alpha-list {
  list-style-type: upper-alpha;
}

/* Prompt library: give References breathing room below textarea blocks */
.prompt-library-page .prompt-block + .framework-source {
  margin-top: 14px;
}

.content-card h3 {
  font-size: 14px;
  margin-top: 12px;
  margin-bottom: 6px;
}

/* On the Blogs page, keep the first blog entry title centered */
.blogs-page .content-card h1 + section > h2 {
  text-align: center;
}

.content-card p {
  margin-bottom: 10px;
}

.content-card ul {
  margin-left: 18px;
  margin-bottom: 10px;
}

/* Numbered lists inside content cards */
.content-card ol {
  padding-left: 1.5rem;
  margin-bottom: 10px;
  list-style-position: outside;
}

.content-card li {
  margin-bottom: 4px;
}

/* Tables inside content cards (markdown-like rendering) */
.content-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 10px;
}

.content-card th,
.content-card td {
  border: 1px solid #d1d5db;
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}

.content-card thead th {
  background-color: #f3f4f6;
  font-weight: 700;
}

.validation-check-col {
  width: 72px;
  text-align: center;
}

.validation-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
}

.reading-checklist {
  list-style: none;
  padding-left: 0;
}

.reading-checklist li {
  margin-bottom: 8px;
}

.reading-checklist label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.reading-checklist input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
}

body.book-reading-page .content-card section ul:not(.reading-checklist) {
  column-count: 2;
  column-gap: 36px;
}

body.book-reading-page .content-card section ul:not(.reading-checklist) li {
  break-inside: avoid;
}

.reading-score-card {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef6ff 100%);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.08);
}

.reading-score-card--start {
  border-color: #93c5fd;
}

.reading-score-card--good {
  border-color: #fbbf24;
  background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
}

.reading-score-card--strong {
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5 0%, #eff6ff 100%);
}

.reading-score-copy h3 {
  margin-bottom: 6px;
}

.reading-score-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.reading-score-button {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.reading-score-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.28);
}

.reading-score-button:disabled {
  opacity: 0.8;
  cursor: default;
  transform: none;
}

.reading-score-button-secondary {
  color: #1d4ed8;
  background: #dbeafe;
  box-shadow: none;
}

.reading-score-button-secondary:hover {
  box-shadow: none;
}

.reading-score-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(37, 99, 235, 0.12);
}

.reading-score-eyebrow {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
}

.reading-score-value {
  margin-bottom: 2px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.reading-score-percent {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
}

.reading-score-message {
  margin-bottom: 0;
}

.reading-score-celebration {
  position: relative;
  min-width: 180px;
  text-align: center;
}

.reading-score-badge {
  display: inline-block;
  position: relative;
  z-index: 1;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 800;
  color: #065f46;
  background: rgba(16, 185, 129, 0.16);
}

.reading-score-burst {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 140px;
  height: 140px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.reading-score-burst span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 28px;
  border-radius: 999px;
  opacity: 0;
  transform-origin: center -26px;
  --rotation: 0deg;
}

.reading-score-burst span:nth-child(1) { --rotation: 0deg; transform: translate(-50%, -50%) rotate(0deg); background: #2563eb; }
.reading-score-burst span:nth-child(2) { --rotation: 45deg; transform: translate(-50%, -50%) rotate(45deg); background: #10b981; }
.reading-score-burst span:nth-child(3) { --rotation: 90deg; transform: translate(-50%, -50%) rotate(90deg); background: #f59e0b; }
.reading-score-burst span:nth-child(4) { --rotation: 135deg; transform: translate(-50%, -50%) rotate(135deg); background: #ef4444; }
.reading-score-burst span:nth-child(5) { --rotation: 180deg; transform: translate(-50%, -50%) rotate(180deg); background: #8b5cf6; }
.reading-score-burst span:nth-child(6) { --rotation: 225deg; transform: translate(-50%, -50%) rotate(225deg); background: #06b6d4; }
.reading-score-burst span:nth-child(7) { --rotation: 270deg; transform: translate(-50%, -50%) rotate(270deg); background: #22c55e; }
.reading-score-burst span:nth-child(8) { --rotation: 315deg; transform: translate(-50%, -50%) rotate(315deg); background: #f97316; }

.reading-score-celebration--active .reading-score-badge {
  animation: reading-score-badge-pop 0.7s ease;
}

.reading-score-celebration--active .reading-score-burst span {
  animation: reading-score-burst 1s ease-out;
}

@keyframes reading-score-badge-pop {
  0% { transform: scale(0.9); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes reading-score-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(var(--rotation, 0deg));
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.1) rotate(var(--rotation, 0deg));
  }
}

body.dark-theme .reading-score-card {
  border-color: #334155;
  background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.45);
}

body.dark-theme .reading-score-card--good {
  border-color: #b45309;
  background: linear-gradient(135deg, #1f2937 0%, #2b2113 100%);
}

body.dark-theme .reading-score-card--strong {
  border-color: #10b981;
  background: linear-gradient(135deg, #052e2b 0%, #0f172a 100%);
}

body.dark-theme .reading-score-eyebrow {
  color: #93c5fd;
}

body.dark-theme .reading-score-button-secondary {
  color: #bfdbfe;
  background: #1e3a8a;
}

body.dark-theme .reading-score-badge {
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.22);
}

body.dark-theme .reading-score-result {
  border-top-color: rgba(147, 197, 253, 0.18);
}

@media (max-width: 700px) {
  body.book-reading-page .content-card section ul:not(.reading-checklist) {
    column-count: 1;
  }

  .reading-score-result {
    grid-template-columns: 1fr;
  }

  .reading-score-celebration {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reading-score-button {
    transition: none;
  }

  .reading-score-celebration--active .reading-score-badge,
  .reading-score-celebration--active .reading-score-burst span {
    animation: none;
  }
}

body.dark-theme .content-card th,
body.dark-theme .content-card td {
  border-color: #374151;
}

body.dark-theme .content-card thead th {
  background-color: #1f2933;
}

/* =====================
   Analyst reports: trend chart
   ===================== */

.trend-chart {
  margin-top: 6px;
}

/* Override the "first subsection left-aligned" rule for this page section. */
.content-card h1 + section.trend-chart > h2 {
  text-align: center;
  margin-top: 2px;
}

.trend-chart-subtitle {
  font-size: 12px;
  color: #555;
  text-align: center;
}

body.dark-theme .trend-chart-subtitle {
  color: #9ca3af;
}

.trend-chart-canvas-wrap {
  max-width: 860px;
  height: 380px;
  margin: 10px auto 8px;
}

.trend-chart-warning {
  margin: 8px auto;
  padding: 8px 10px;
  max-width: 860px;
  border: 1px solid #d1d5db;
  background-color: #f9fafb;
  font-size: 12px;
  color: #111827;
}

body.dark-theme .trend-chart-warning {
  border-color: #374151;
  background-color: #020617;
  color: #e5e7eb;
}

.trend-chart-meta {
  font-size: 11px;
  color: #6b7280;
  text-align: center;
}

body.dark-theme .trend-chart-meta {
  color: #9ca3af;
}

.trend-chart-collapsible {
  max-width: 860px;
  margin: 8px auto 0;
}

.trend-chart-collapsible summary {
  cursor: pointer;
  font-weight: 600;
}

.trend-chart-collapsible[open] summary {
  margin-bottom: 6px;
}

.trend-chart-sources {
  margin-left: 18px;
  margin-bottom: 10px;
}

.trend-chart-source-meta {
  font-size: 11px;
  color: #6b7280;
}

body.dark-theme .trend-chart-source-meta {
  color: #9ca3af;
}

/* String theory: 3-second intro animation (page-scoped via injected DOM)
   Wavy ring inspired by the provided example. */
.string-theory-intro {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  overflow: hidden;
  display: grid;
  place-items: center;
  opacity: 0;
  filter: blur(10px);
  will-change: opacity, filter;
  animation: string-theory-intro-dismiss 5000ms ease-out forwards;
}

@keyframes string-theory-intro-dismiss {
  0% {
    opacity: 0;
    filter: blur(10px);
  }
  14% {
    opacity: 1;
    filter: blur(0px);
  }
  82% {
    opacity: 1;
    filter: blur(0px);
  }
  100% {
    opacity: 0;
    filter: blur(10px);
  }
}

/* Use only existing site colors */
body.light-theme .string-theory-intro {
  --string-theory-ring-a: #0077cc; /* link blue */
  --string-theory-ring-b: #008000; /* green */
}

body.dark-theme .string-theory-intro {
  --string-theory-ring-a: #60a5fa; /* dark-theme link */
  --string-theory-ring-b: #008000; /* green */
}

.string-theory-intro__wrap {
  position: relative;
  width: min(280px, 70vw);
  aspect-ratio: 1 / 1;
}

.string-theory-intro__canvas {
  width: 100%;
  height: 100%;
  display: block;
}


@media (prefers-reduced-motion: reduce) {
  .string-theory-intro {
    display: none;
  }
}

/* Cosmology: 5-second intro star animation (page-scoped via injected DOM) */
.cosmology-intro {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  overflow: hidden;
  display: grid;
  place-items: center;
  background-color: rgba(16, 18, 22, 0.46);

  opacity: 0;
  filter: blur(10px);
  will-change: opacity, filter;
  transition: opacity 700ms ease-out, filter 700ms ease-out;
}

.cosmology-intro.cosmology-intro--visible {
  opacity: 1;
  filter: blur(0px);
}

.cosmology-intro.cosmology-intro--exit {
  opacity: 0;
  filter: blur(10px);
}

.cosmology-intro__canvas {
  width: 100%;
  height: 100%;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .cosmology-intro {
    display: none;
  }
}

/* Prompt toolbar above editable textareas */
.prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

/* Prompt library editable blocks */
.prompt-textarea {
  width: 100%;
  min-height: 220px; /* make textarea taller by default */
  background-color: #f3f4f6; /* light gray background inside editable area */
  border: 1px solid #d1d5db;
  border-radius: 8px; /* smooth rounded corners for editable block */
  padding: 10px 10px 10px 14px; /* add top and left padding for breathing room */
}

.prompt-block {
  border-radius: 6px;
}

.skills-overview-rendered {
  white-space: normal;
}

.skills-overview-rendered pre {
  margin: 10px 0;
}

/* Overview pages reuse .prompt-textarea styles for code blocks.
   Remove the large min-height meant for editable textareas. */
.skills-overview-rendered pre.prompt-textarea {
  min-height: 0;
}

/* AI Skills Library: folder structure reference block */
#skills-folder-structure pre.prompt-textarea {
  min-height: 0;
}

.skills-overview-rendered pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

/* AI Skills Library: remove the divider line above the SKILL.md section */
#skill-md-section {
  border-top: none;
  margin-top: 10px;
  padding-top: 0;
}

.prompt-selected-usecase-label {
  font-size: 13px; /* slightly larger label text */
  color: #000000; /* black for clearer emphasis */
  font-style: italic;
}

.prompt-textarea:focus {
  outline: none; /* remove default blue focus outline */
  border-color: #000000; /* keep same border color on focus */
  box-shadow: none;
}

/* Copy button styling for prompt/agent sections */
.copy-button {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 16px;
  border: 1px solid #9ca3af;
  background-color: #e5e7eb; /* lighter grey pill */
  color: #000000; /* black text on grey background */
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease,
    transform 0.05s ease;
}

.copy-button:hover,
.copy-button:focus-visible {
  background-color: #e5e7eb; /* keep same color on hover */
  border-color: #9ca3af;
  color: #000000;
}

.copy-button.copy-button--copied {
  background-color: #059669;
  border-color: #047857;
}

/* Subsection separators inside main content cards */
.content-card section + section {
  border-top: 1px solid #d1d5db;
  margin-top: 26px;
  padding-top: 8px; /* reduce space below the divider line */
}

/* When a section starts with a heading after a divider, tighten the top margin
   so space below the divider matches the space above more closely. */
.content-card section + section > h2:first-child {
  margin-top: 6px;
}

body.dark-theme .content-card section + section {
  border-top-color: #374151;
}

/* Effective speaking example page */
body.effective-speaking-page .content-card h2 {
  text-align: left;
}

body.effective-speaking-page .content-card h1 + section > h2 {
  text-align: left;
}

.effective-speaking-hero {
  padding: 18px 20px 20px;
  border: 1px solid #d7e2f0;
  background: linear-gradient(135deg, #f8fbff 0%, #eef5fb 100%);
}

body.dark-theme .effective-speaking-hero {
  border-color: #314156;
  background: linear-gradient(135deg, #111827 0%, #182433 100%);
}

/* Effective communication checklist page */
body.effective-communication-checklist-page .content-card h2 {
  text-align: left;
}

.checklist-hero,
.checklist-scoreboard {
  border: 1px solid #d7e2f0;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef5fb 100%);
}

body.dark-theme .checklist-hero,
body.dark-theme .checklist-scoreboard {
  border-color: #314156;
  background: linear-gradient(135deg, #111827 0%, #182433 100%);
}

.checklist-hero {
  padding: 22px;
}

.checklist-kicker {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #355070;
}

body.dark-theme .checklist-kicker {
  color: #9cc1e5;
}

.checklist-lead {
  font-size: 16px;
  line-height: 1.65;
}

.checklist-legend {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checklist-legend span {
  border: 1px solid #c7d8ec;
  border-radius: 999px;
  background-color: #ffffff;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #355070;
}

body.dark-theme .checklist-legend span {
  border-color: #314156;
  background-color: #0f1724;
  color: #dbeafe;
}

.checklist-scoreboard {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.checklist-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.checklist-stat {
  border: 1px solid #d7e2f0;
  border-radius: 12px;
  background-color: #ffffff;
  padding: 14px;
  text-align: center;
}

body.dark-theme .checklist-stat {
  border-color: #314156;
  background-color: #0f1724;
}

.checklist-stat-label {
  display: block;
  font-size: 12px;
  color: #4b5563;
}

body.dark-theme .checklist-stat-label {
  color: #cbd5e1;
}

.checklist-stat-value {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: #0f172a;
}

body.dark-theme .checklist-stat-value {
  color: #f8fafc;
}

.checklist-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background-color: #dbeafe;
}

body.dark-theme .checklist-progress {
  background-color: #243244;
}

.checklist-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
  transition: width 180ms ease;
}

.checklist-feedback {
  border-left: 4px solid #60a5fa;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.88);
  padding: 14px 16px;
}

body.dark-theme .checklist-feedback {
  border-left-color: #93c5fd;
  background-color: rgba(15, 23, 36, 0.92);
}

.checklist-section-intro {
  margin-bottom: 14px;
}

.checklist-section-grid {
  display: grid;
  gap: 14px;
}

.checklist-card {
  border: 1px solid #d7e2f0;
  border-radius: 14px;
  background-color: #fbfdff;
  padding: 16px;
}

body.dark-theme .checklist-card {
  border-color: #314156;
  background-color: #0f1724;
}

.checklist-card h3 {
  margin-bottom: 8px;
}

.checklist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.checklist-list label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checklist-list input[type="checkbox"] {
  margin-top: 3px;
  flex: 0 0 auto;
  accent-color: #2563eb;
}

.checklist-note {
  border-left: 4px solid #94a3b8;
  border-radius: 10px;
  background-color: #f8fafc;
  padding: 12px 14px;
  font-size: 13px;
}

body.dark-theme .checklist-note {
  border-left-color: #64748b;
  background-color: #111827;
}

@media (max-width: 900px) {
  .checklist-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .checklist-stat-grid {
    grid-template-columns: 1fr;
  }
}

.effective-speaking-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 20px;
  align-items: center;
}

.effective-speaking-kicker {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #355070;
}

body.dark-theme .effective-speaking-kicker {
  color: #9cc1e5;
}

.effective-speaking-lead {
  font-size: 16px;
  line-height: 1.65;
}

.effective-speaking-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.effective-speaking-summary-card,
.effective-speaking-card,
.effective-speaking-note,
.effective-speaking-flow-step {
  border: 1px solid #d7e2f0;
  background-color: #ffffff;
}

body.dark-theme .effective-speaking-summary-card,
body.dark-theme .effective-speaking-card,
body.dark-theme .effective-speaking-note,
body.dark-theme .effective-speaking-flow-step {
  border-color: #314156;
  background-color: #0f1724;
}

.effective-speaking-summary-card {
  padding: 12px 14px;
  border-radius: 12px;
}

.effective-speaking-summary-card strong {
  display: block;
  margin-bottom: 4px;
}

.effective-speaking-visual {
  padding: 12px;
  border: 1px solid #d7e2f0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

body.dark-theme .effective-speaking-visual {
  border-color: #314156;
  background: rgba(15, 23, 36, 0.78);
}

.effective-speaking-visual svg {
  width: 100%;
  height: auto;
  display: block;
}

.effective-speaking-quote {
  margin: 12px 0 16px;
  padding: 14px 16px;
  border-left: 4px solid #6b8db3;
  background-color: #f8fbff;
  font-style: italic;
}

body.dark-theme .effective-speaking-quote {
  border-left-color: #8cb3da;
  background-color: #101927;
}

.effective-speaking-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
}

.effective-speaking-note strong {
  display: inline-block;
  margin-right: 6px;
}

.effective-speaking-bias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0 6px;
}

.effective-speaking-card {
  padding: 14px 16px;
  border-radius: 12px;
}

.effective-speaking-card h3 {
  margin-top: 0;
}

.effective-speaking-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 14px 0 8px;
}

.effective-speaking-flow-step {
  position: relative;
  padding: 12px 14px;
  border-radius: 12px;
}

.effective-speaking-flow-step strong {
  display: block;
  margin-bottom: 4px;
}

.effective-speaking-flow-step::after {
  content: "->";
  position: absolute;
  top: 50%;
  right: -9px;
  transform: translateY(-50%);
  color: #6b7280;
  font-weight: 700;
}

.effective-speaking-flow-step:last-child::after {
  display: none;
}

.effective-speaking-section-label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background-color: #edf4fb;
  color: #355070;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.dark-theme .effective-speaking-section-label {
  background-color: #182433;
  color: #9cc1e5;
}

@media (max-width: 960px) {
  .effective-speaking-hero-grid {
    grid-template-columns: 1fr;
  }

  .effective-speaking-flow-step::after {
    display: none;
  }
}

/* Right side index (on this page) */
.page-index {
  position: sticky;
  top: 80px; /* below header */
  align-self: flex-start;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

.index-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 16px 18px;
}

body.dark-theme .index-card {
  background-color: #111827;
  border-color: #1f2933;
}

.index-card h2 {
  font-size: 14px;
  margin-bottom: 10px;
}

.index-card ul {
  list-style: none;
}

.index-card li + li {
  margin-top: 6px;
}

.index-card a {
  font-size: 12px;
}

.index-card a.index-link--active {
  font-weight: 600;
  text-decoration: underline;
}

.index-card a.index-link--emphasis {
  font-weight: 600;
}

/* =====================
   Publications layout
   ===================== */

.publication-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.publication-item {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 12px;
}

.publication-media {
  width: 160px;
  height: 100px;
  background-color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  text-align: center;
}

.publication-media.publication-media--fortinet {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
}

.publication-media.publication-media--cisco {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
}

.publication-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.publication-meta h3 {
  margin-bottom: 4px;
}

.publication-tags {
  font-size: 11px;
  color: #555;
  margin-top: 4px;
}

/* =====================
   Footer
   ===================== */

.site-footer {
  border-top: 1px solid #e5e7eb;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  font-size: 11px;
  margin-top: auto;
}

body.dark-theme .site-footer {
  border-top-color: #1f2933;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-right a {
  font-weight: 600;
}

/* View counter text */
#view-counter {
  font-variant-numeric: tabular-nums;
}

/* =====================
   Responsive adjustments
   ===================== */

@media (max-width: 960px) {
  /* Stack the three panes vertically instead of hiding them */
  .layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Let sidebar and index scroll naturally on small screens */
  .sidebar,
  .page-index {
    position: static;
    top: auto;
    max-height: none;
  }

  /* Reorder so profile/sidebar appears first, then index, then main content */
  .sidebar {
    order: 1;
  }

  .page-index {
    order: 2;
  }

  .content {
    order: 3;
  }

  .page-wrapper {
    padding: 80px 16px 32px;
    margin: 0 8px;
  }

  .topic-sidebar .sidebar-card {
    max-height: none;
  }
}