    .hyguru-bento-grid {
      display: grid !important;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
      grid-auto-flow: row !important;
      gap: 1.25rem;
      margin-bottom: 2rem;
      width: 100%;
      box-sizing: border-box;
    }

    @media (max-width: 640px) {
      .hyguru-bento-grid {
        grid-template-columns: 1fr !important;
        gap: 0.875rem;
      }
    }

    .hyguru-bento-card {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 1.5rem;
      cursor: pointer;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      position: relative;
      overflow: hidden;
      box-shadow: var(--shadow-1);
      min-height: 140px;
      width: 100%;
      box-sizing: border-box;
    }

    .hyguru-bento-card:hover {
      transform: translateY(-4px);
      border-color: var(--accent-blue, #3b82f6);
      box-shadow: var(--shadow-2);
    }

    .hyguru-bento-card__system {
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-secondary, #4b5563);
      margin-bottom: 0.5rem;
      text-align: left;
    }

    .hyguru-bento-card__topic-body {
      font-size: 1rem;
      line-height: 1.4;
      color: var(--text);
      font-weight: 600;
      word-wrap: break-word;
      overflow-wrap: break-word;
      white-space: normal;
      text-align: left;
      margin-bottom: 1rem;
      max-width: 100%;
    }

    .hyguru-bento-card__footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: auto;
      border-top: 1px solid var(--border);
      padding-top: 0.5rem;
    }

    .hyguru-bento-card__subject-tag {
      display: inline-flex;
      align-items: center;
      padding: 3px 8px;
      background-color: var(--bg-surface-alt);
      border: 1px solid var(--border);
      border-radius: var(--radius-pill);
      font-size: 0.725rem;
      font-weight: 600;
      color: var(--text-secondary);
      user-select: none;
      max-width: calc(100% - 28px);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .hyguru-bento-card__footer form {
      margin-left: auto;
    }

    .hyguru-bento-card__platform {
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-muted);
      background: var(--bg-surface-alt);
      padding: 0.25rem 0.5rem;
      border-radius: 4px;
    }

    .hyguru-bento-card__delete-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      transition: all 0.2s ease;
    }

    .hyguru-bento-card__delete-btn:hover {
      color: #ef4444;
      background: rgba(239, 68, 68, 0.1);
    }

    .hyguru-bento-card__delete-btn svg {
      width: 16px;
      height: 16px;
      stroke: currentColor;
    }

    /* Notion-style Modal Styling */
    .notion-style-modal {
      max-width: 550px !important;
      border-radius: var(--radius-lg);
      padding: 2rem 2.5rem 1.5rem !important;
      background: var(--bg-surface) !important;
      box-shadow: var(--shadow-2) !important;
    }

    .notion-page {
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
    }

    .notion-page__title {
      font-size: 2rem;
      font-weight: 800;
      color: var(--text);
      margin: 0;
      line-height: 1.2;
      text-align: left;
    }

    .notion-properties {
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      font-size: 0.95rem;
      margin-top: 0.5rem;
    }

    .notion-property-row {
      display: flex;
      align-items: center;
    }

    .notion-property-label {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      width: 140px;
      color: var(--text-secondary);
      flex-shrink: 0;
      text-align: left;
    }

    .notion-property-label svg {
      color: var(--text-secondary);
      opacity: 0.85;
    }

    .notion-property-value {
      color: var(--text);
      font-weight: 500;
      text-align: left;
    }

    .notion-divider {
      height: 1px;
      background: var(--border);
      margin: 0.25rem 0;
    }

    .notion-content {
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      text-align: left;
    }

    .notion-section-title {
      font-size: 1.1rem;
      font-weight: 700;
      color: var(--text);
      margin: 0;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .notion-objective-box {
      background: var(--bg-surface-alt);
      border-left: 3px solid var(--accent-blue, #3b82f6);
      padding: 1rem 1.25rem;
      border-radius: 0 var(--radius-md) var(--radius-md) 0;
    }

    .notion-objective-box p {
      margin: 0;
      font-size: 1.05rem;
      line-height: 1.6;
      color: var(--text);
    }

    .notion-actions {
      display: flex;
      justify-content: center;
      gap: 0.75rem;
      margin-top: 1rem;
      border-top: 1px solid var(--border);
      padding-top: 1rem;
    }

    .notion-action-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
    }

    /* Notion-style Filters */
    .notion-filter-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.5rem;
      margin-bottom: 1.5rem;
      position: relative;
    }

    .notion-filter-dropdown-container {
      position: relative;
      display: inline-block;
    }

    .notion-filter-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding: 4px 10px;
      height: 32px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg-surface);
      color: var(--text-secondary);
      font-size: 0.875rem;
      font-weight: 500;
      cursor: pointer;
      user-select: none;
      transition: all 0.15s ease;
    }

    .notion-filter-btn:hover {
      background: var(--bg-surface-alt);
      color: var(--text);
      border-color: var(--text-disabled);
    }

    .notion-filter-btn.is-active {
      background: rgba(59, 130, 246, 0.08);
      border-color: rgba(59, 130, 246, 0.3);
      color: var(--accent-blue);
    }

    .notion-filter-btn.is-active .dropdown-chevron {
      color: var(--accent-blue);
    }

    .dropdown-chevron {
      font-size: 0.65rem;
      margin-left: 2px;
      color: var(--text-muted);
      transition: transform 0.15s ease;
    }

    .notion-filter-dropdown-menu {
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      z-index: 100;
      min-width: 240px;
      max-width: calc(100vw - 2rem);
      box-sizing: border-box;
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      box-shadow: var(--shadow-2);
      padding: 0.5rem;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .notion-filter-dropdown-menu.is-hidden {
      display: none !important;
    }

    .notion-dropdown-item {
      display: flex;
      align-items: center;
      width: 100%;
      padding: 6px 8px;
      background: transparent;
      border: none;
      border-radius: var(--radius-4);
      color: var(--text);
      font-size: 0.875rem;
      font-weight: 500;
      text-align: left;
      cursor: pointer;
      transition: background 0.1s ease;
    }

    .notion-dropdown-item:hover {
      background: var(--bg-surface-alt);
    }

    .notion-dropdown-item.active {
      background: rgba(59, 130, 246, 0.08);
      color: var(--accent-blue);
    }

    .notion-dropdown-divider {
      height: 1px;
      background: var(--border);
      margin: 4px 0;
    }

    /* Colored pills inside dropdown */
    .notion-tag-pill {
      display: inline-flex;
      align-items: center;
      padding: 2px 8px;
      border-radius: var(--radius-pill);
      font-size: 0.825rem;
      font-weight: 600;
    }

    .notion-tag-pill[style*="--tag-h"] {
      background-color: hsl(var(--tag-h), var(--tag-s), 95%);
      border: 1px solid hsl(var(--tag-h), var(--tag-s), 85%);
      color: hsl(var(--tag-h), var(--tag-s), 30%);
    }

    [data-theme="dark"] .notion-tag-pill[style*="--tag-h"] {
      background-color: hsla(var(--tag-h), var(--tag-s), 20%, 0.35);
      border: 1px solid hsla(var(--tag-h), var(--tag-s), 40%, 0.25);
      color: hsl(var(--tag-h), var(--tag-s), 80%);
    }

    /* Custom Date inputs section */
    .notion-custom-date-section {
      padding: 6px 8px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .notion-custom-date-label {
      font-size: 0.725rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-secondary);
    }

    .notion-custom-date-inputs {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .notion-custom-date-inputs input[type="date"] {
      height: 28px;
      padding: 4px 8px;
      font-size: 0.825rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg-surface);
      color: var(--text);
    }

    .notion-filter-clear-btn {
      font-size: 0.825rem;
      color: var(--text-muted);
      background: transparent;
      border: none;
      cursor: pointer;
      padding: 4px 8px;
      border-radius: var(--radius-sm);
      font-weight: 500;
    }

    .notion-filter-clear-btn:hover {
      background: var(--bg-surface-alt);
      color: var(--text);
    }

    .notion-filter-clear-btn.is-hidden {
      display: none !important;
    }

    .notion-filter-checkbox {
      width: 14px;
      height: 14px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm, 3px);
      margin-right: 8px;
      accent-color: var(--accent-blue, #3b82f6);
      cursor: pointer;
    }

    /* Tag HSL Styling */
    .hyguru-bento-card__subject-tag[style*="--tag-h"] {
      background-color: hsl(var(--tag-h), var(--tag-s), 95%);
      border-color: hsl(var(--tag-h), var(--tag-s), 85%);
      color: hsl(var(--tag-h), var(--tag-s), 30%);
    }

    [data-theme="dark"] .hyguru-bento-card__subject-tag[style*="--tag-h"] {
      background-color: hsla(var(--tag-h), var(--tag-s), 20%, 0.35);
      border-color: hsla(var(--tag-h), var(--tag-s), 40%, 0.25);
      color: hsl(var(--tag-h), var(--tag-s), 80%);
    }

    .hyguru-bento-grid__empty-match {
      display: none;
      grid-column: 1 / -1;
      text-align: center;
      padding: 3rem 0;
      width: 100%;
      color: var(--text-muted);
    }

    .is-hidden-card {
      display: none !important;
    }

    /* Lead-ins Display Styles */
    .leadins-container {
      margin-top: 0;
      padding-top: 0;
      border-top: none;
    }

    .leadin-vignette-box {
      background: var(--bg-surface-alt);
      border: 1px solid var(--border);
      border-radius: var(--radius-md, 8px);
      padding: 1rem;
      margin-bottom: 1.25rem;
      text-align: left;
    }

    .leadin-label {
      display: inline-block;
      font-size: 0.675rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--accent-blue, #3b82f6);
      margin-bottom: 0.5rem;
    }

    .leadin-vignette-text {
      font-size: 0.95rem;
      line-height: 1.5;
      color: var(--text);
      margin: 0;
    }

    .leadin-cards-list {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .leadin-card {
      background: var(--bg-surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-md, 8px);
      padding: 1.25rem;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
      text-align: left;
    }

    .leadin-card:hover {
      border-color: var(--accent-blue, #3b82f6);
      box-shadow: var(--shadow-1);
    }

    .leadin-question {
      display: flex;
      gap: 0.75rem;
      align-items: flex-start;
      margin-bottom: 0.75rem;
      text-align: left;
    }

    .leadin-number {
      font-size: 0.75rem;
      font-weight: 700;
      background: rgba(59, 130, 246, 0.1);
      color: var(--accent-blue, #3b82f6);
      padding: 2px 6px;
      border-radius: 4px;
      flex-shrink: 0;
      margin-top: 1px;
    }

    .leadin-question-text {
      font-size: 0.925rem;
      line-height: 1.45;
      font-weight: 600;
      color: var(--text);
      margin: 0;
    }

    /* Details Toggle styling */
    .leadin-answer-details {
      border-top: 1px solid var(--border);
      padding-top: 0.75rem;
    }

    .leadin-answer-summary {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--accent-blue, #3b82f6);
      cursor: pointer;
      list-style: none;
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      user-select: none;
      transition: color 0.2s ease;
    }

    .leadin-answer-summary:hover {
      color: var(--text);
    }

    .leadin-answer-summary::-webkit-details-marker {
      display: none;
    }

    .leadin-answer-summary::before {
      content: '▶';
      font-size: 0.65rem;
      transition: transform 0.2s ease;
      display: inline-block;
    }

    .leadin-answer-details[open] .leadin-answer-summary::before {
      transform: rotate(90deg);
    }

    .leadin-answer-content {
      margin-top: 0.5rem;
      padding: 0.75rem;
      background: var(--bg-surface-alt);
      border-radius: 6px;
      border-left: 3px solid var(--accent-blue, #3b82f6);
      animation: slideDown 0.25s ease-out;
    }

    .leadin-answer-text {
      font-size: 0.9rem;
      line-height: 1.4;
      color: var(--text-secondary);
      margin: 0;
      font-weight: 500;
    }

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

/* HyGuru portal study-tool buttons */
.hyguru-portal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hyguru-portal-btn-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--surface, #fff);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  cursor: pointer;
  position: relative;
}

.hyguru-portal-btn-card:hover {
  border-color: var(--accent-blue, #3b82f6);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  color: var(--text);
}

.hyguru-portal-btn-card.btn--primary {
  background: color-mix(in srgb, var(--accent-lavender, #c084fc) 18%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--accent-lavender, #c084fc) 35%, var(--border));
  color: var(--text);
}

.hyguru-portal-btn-card.btn--primary:hover {
  background: color-mix(in srgb, var(--accent-lavender, #c084fc) 28%, var(--bg-surface));
  border-color: var(--accent-lavender, #c084fc);
  color: var(--text);
}

.hyguru-portal-btn-card--paid {
  opacity: 0.92;
}

.hyguru-portal-btn-card__badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill, 999px);
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue, #3b82f6);
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Downloads section */
.downloads-section-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.downloads-section-card__header h2 {
  margin: 0;
}

.downloads-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

.downloads-header-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.video-embed-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border);
  background: #000;
}

.video-embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 720px) {
  .downloads-section-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .downloads-header-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
}

/* Setup Instructions Modal Custom Styling */
.instructions-modal-dialog {
  max-width: 600px !important;
  padding: 2.5rem !important;
  border-radius: var(--radius-lg);
  background: var(--bg-surface) !important;
  box-shadow: var(--shadow-3) !important;
}

.instructions-modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0.5rem 0 1.5rem;
  color: var(--text);
  text-align: left;
}

.setup-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
}

.setup-timeline::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border);
  z-index: 1;
}

.setup-timeline-item {
  display: flex;
  gap: 1.25rem;
  position: relative;
  z-index: 2;
}

.setup-timeline-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface-alt);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  pointer-events: none;
  user-select: none;
}

.setup-timeline-step {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.9rem;
  user-select: none;
}

.setup-timeline-content {
  text-align: left;
}

.setup-timeline-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.setup-timeline-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.inline-setup-btn {
  font-size: 0.8rem !important;
  padding: 0.35rem 0.75rem !important;
  height: auto !important;
  line-height: 1.4 !important;
}

.instructions-video-wrapper {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  text-align: left;
}

.instructions-video-wrapper h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--text);
}

/* Locked Lead-ins / Clinical Vignette Styling for Free Users */
.leadins-container--locked {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.leadin-vignette-box--locked,
.leadin-card--locked {
  opacity: 0.3;
  pointer-events: none;
  filter: blur(2.5px);
  -webkit-filter: blur(2.5px);
}

.leadin-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md, 8px);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 10;
  padding: 1.5rem;
  text-align: center;
}

[data-theme="dark"] .leadin-lock-overlay {
  background: rgba(26, 27, 31, 0.8);
}

.leadin-lock-content {
  max-width: 380px;
  border: 2px solid transparent;
  background: linear-gradient(var(--bg-surface, #ffffff), var(--bg-surface, #ffffff)) padding-box,
              linear-gradient(120deg, #3b82f6, #fb7185, #ffb347) border-box;
  border-radius: var(--radius-card, 20px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.12), 0 4px 16px rgba(255, 179, 71, 0.12);
  padding: var(--space-5, 1.5rem) var(--space-6, 1.75rem);
  text-align: center;
  box-sizing: border-box;
}

.leadin-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(192, 132, 252, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.35);
  color: var(--accent-lavender, #c084fc);
  border-radius: var(--radius-pill, 9999px);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.leadin-lock-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.leadin-lock-content h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.leadin-lock-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 1rem;
  line-height: 1.4;
}

.leadin-answer-summary--locked {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-blue, #3b82f6);
  opacity: 0.7;
  cursor: default;
}

/* ==========================================================================
   HyGuru Flowchart Library (3-Column Layout)
   ========================================================================== */

.hyguru-library-container {
  max-width: 1400px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.hyguru-library-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg, 24px);
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hyguru-library-header__title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text, #111827);
  margin: 0.35rem 0;
  letter-spacing: -0.02em;
}

.hyguru-library-header__sub {
  font-size: 0.95rem;
  margin: 0 0 1rem 0;
}

.hyguru-library-header__stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Stepper Bar */
.hyguru-flow-stepper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-pill, 9999px);
  width: fit-content;
}

.hyguru-flow-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #9ca3af);
  transition: all 0.2s ease;
}

.hyguru-flow-step-pill.is-active {
  color: var(--text, #111827);
}

.hyguru-flow-step-pill .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-surface-alt, #f3f4f6);
  color: var(--text-secondary, #4b5563);
  font-size: 0.75rem;
  font-weight: 700;
}

.hyguru-flow-step-pill.is-active .step-num {
  background: var(--accent-blue, #3b82f6);
  color: #ffffff;
}

.hyguru-flow-step-arrow {
  color: var(--border, #e5e7eb);
  font-weight: 700;
  font-size: 0.9rem;
}

/* Flowchart Layout - Fixed 25% / 25% / 50% Desktop Proportions with no horizontal overflow */
.hyguru-flowchart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 2fr);
  gap: 0.75rem;
  align-items: stretch;
  min-height: 520px;
  width: 100%;
  box-sizing: border-box;
}

.hyguru-flow-col {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md, 20px);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
  transition: all 0.25s ease;
  min-width: 0;
  box-sizing: border-box;
}

.hyguru-flow-col--tag,
.hyguru-flow-col--system,
.hyguru-flow-col--cards {
  width: 100%;
}

.hyguru-flow-col.is-disabled {
  opacity: 0.5;
  background: var(--bg-surface-alt, #f9fafb);
  border: 1.5px dashed var(--border, #d1d5db);
  box-shadow: none;
}

.hyguru-flow-col.is-disabled .hyguru-flow-col__header {
  opacity: 0.7;
}

.hyguru-flow-col__placeholder-text {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  color: var(--text-muted, #9ca3af);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  padding: 1rem;
}

/* Connectors */
.hyguru-flow-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.15rem;
  flex-shrink: 0;
  opacity: 0.3;
  transition: opacity 0.25s ease;
}

.hyguru-flow-connector.is-active {
  opacity: 1;
}

@media (max-width: 768px) {
  .page-hyguru-library .library-toolbar-row {
    display: none !important;
  }

  .page-hyguru-library .hyguru-flowchart-wrapper {
    display: none !important;
  }

  .page-hyguru-library .mobile-library-container {
    display: block !important;
  }

  .hyguru-flowchart {
    flex-direction: column;
    gap: 1rem;
  }

  .hyguru-flow-col,
  .hyguru-flow-col--tag,
  .hyguru-flow-col--system,
  .hyguru-flow-col--cards {
    flex: none;
    width: 100%;
  }

  .hyguru-flow-connector {
    display: none !important;
  }

  .notion-style-modal,
  .deep-learn-modal__dialog.notion-style-modal {
    padding: 1.25rem 1rem !important;
    padding-bottom: 1.25rem !important;
    border-radius: var(--radius-md, 16px) !important;
    width: 95% !important;
  }

  .notion-style-modal .rapid-review-container {
    padding: 0.75rem 0.85rem !important;
    margin-top: 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }
}

.hyguru-flow-col__header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.hyguru-flow-col__badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-blue, #3b82f6);
  margin-bottom: 0.25rem;
}

.hyguru-flow-col__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #111827);
  margin: 0;
}

.hyguru-flow-col__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  max-height: 480px;
  padding-right: 0.25rem;
}

/* Column Items */
.hyguru-flow-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg-surface-alt, #f3f4f6);
  color: var(--text, #111827);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.hyguru-flow-item__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: inline-block;
}

.hyguru-flow-item:hover {
  background: var(--bg-surface, #ffffff);
  border-color: var(--brand, #ffe5b4);
  transform: translateX(2px);
}

.hyguru-flow-item.is-selected,
.hyguru-flow-item.is-active {
  background: var(--brand, #ffe5b4);
  border-color: var(--brand-hover, #ffdab9);
  color: var(--text-on-brand, #1f2937);
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(255, 218, 185, 0.4);
}

[data-theme="dark"] .hyguru-flow-item.is-selected,
[data-theme="dark"] .hyguru-flow-item.is-active {
  background: var(--brand, #ffe5b4);
  border-color: #ffd180;
  color: #1f2937;
  box-shadow: 0 0 0 2px rgba(255, 229, 180, 0.35);
}

.page-hyguru-library .hyguru-flow-item__count {
  display: none;
}

.hyguru-flow-item__count {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-surface, #ffffff);
  padding: 2px 7px;
  border-radius: var(--radius-pill, 9999px);
  border: 1px solid var(--border, #e5e7eb);
  color: var(--text-secondary, #4b5563);
}

/* Locked Column State */
.hyguru-flow-col--locked {
  position: relative;
  user-select: none;
}

.hyguru-flow-col--locked .hyguru-flow-col__list,
.hyguru-flow-col--locked .hyguru-flow-col__cards-wrapper {
  opacity: 0.2;
  filter: blur(2px);
  pointer-events: none;
}

.hyguru-flow-col__lock-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-top: 10;
  background: rgba(249, 250, 251, 0.85);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}

.hyguru-flow-col--locked .hyguru-flow-col__lock-overlay {
  display: flex;
}

.hyguru-flow-col__lock-content {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  padding: 1.25rem;
  border-radius: var(--radius-md, 20px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
  max-width: 220px;
}

.hyguru-flow-col__lock-content .lock-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.hyguru-flow-col__lock-content p {
  font-size: 0.85rem;
  color: var(--text-secondary, #4b5563);
  margin: 0;
  line-height: 1.4;
}

/* Column 3 Cards Wrapper */
.hyguru-flow-col__cards-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  overflow-y: auto;
  max-height: 480px;
  padding-right: 0.25rem;
}

.hyguru-flow-card {
  margin: 0;
  padding: 1.25rem;
  border-radius: var(--radius-md, 20px);
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg-surface, #ffffff);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.hyguru-flow-card:hover {
  border-color: var(--accent-blue, #3b82f6);
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,0.1));
}

.hyguru-flow-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.hyguru-flow-card__tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.hyguru-flow-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #111827);
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

.hyguru-flow-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  align-items: center;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #e5e7eb);
}

/* Responsive Stacking */
@media (max-width: 960px) {
  .hyguru-flowchart {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .hyguru-flow-connector {
    display: none;
  }
  .hyguru-flow-col__list,
  .hyguru-flow-col__cards-wrapper {
    max-height: 320px;
  }
}

/* openQbank-CSS Compliant HyGuru Library Loading Modal */
.hyguru-library-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hyguru-library-loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hyguru-library-loading-dialog {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-lg, 24px);
  box-shadow: var(--shadow-2, 0 10px 25px -5px rgba(0, 0, 0, 0.1));
  padding: 2.25rem 2rem 1.75rem 2rem;
  width: 100%;
  max-width: 440px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* Hopping Mascot Stage directly above the progress track with 14px breathing room */
.hyguru-library-loading-stage {
  position: relative;
  width: 100%;
  height: 76px;
  margin: 0 auto 14px auto;
  pointer-events: none;
}

/* Horizontal travel runner - 4.5s (Run in -> Trip -> Fall & Skid -> Dazed -> Get up -> Dust off -> Sprint off) */
.mascot-runner-x {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 64px;
  animation: mascotRunX 4.5s linear infinite;
  will-change: transform;
}

/* Vertical parabolic hopping, trip stumble, floor contact, and sprint leaps */
.mascot-hopper-y {
  width: 100%;
  height: 100%;
  animation: mascotHopY 4.5s ease-in-out infinite;
  will-change: transform;
}

/* Squash, stretch, stumble pitch, faceplant slide, get-up rotation, dust-off shake, sprint lean */
.mascot-body-squash {
  width: 100%;
  height: 100%;
  transform-origin: 50% 80%;
  animation: mascotSquashAndRoll 4.5s cubic-bezier(0.35, 0, 0.25, 1) infinite;
  will-change: transform;
}

/* Soft contact shadow on the floor */
.mascot-shadow {
  position: absolute;
  bottom: -3px;
  left: 10px;
  width: 44px;
  height: 6px;
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.40) 0%, rgba(15, 23, 42, 0) 75%);
  border-radius: 50%;
  transform-origin: center center;
  animation: mascotShadow 4.5s ease-in-out infinite;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Landing and dust-off puffs */
.mascot-puffs {
  position: absolute;
  bottom: 0;
  left: 14px;
  width: 36px;
  height: 12px;
  pointer-events: none;
}

.mascot-puff {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: mascotPuffBurst 4.5s ease-out infinite;
}

.mascot-puff--1 {
  left: 0px;
  bottom: 2px;
  width: 5px;
  height: 5px;
  background: #5080ee;
}

.mascot-puff--2 {
  left: 12px;
  bottom: 4px;
  width: 4px;
  height: 4px;
  background: #fde6b8;
  animation-delay: 0.02s;
}

.mascot-puff--3 {
  right: 0px;
  bottom: 2px;
  width: 5px;
  height: 5px;
  background: #5080ee;
}

/* Theme-aware limb styling (dark in light mode, white in dark mode) */
.openq-mascot-limb {
  fill: none;
  stroke: #232a38;
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-theme="dark"] .openq-mascot-limb,
.dark-mode .openq-mascot-limb {
  stroke: #ffffff;
}

/* Layer follow-through and micro-interactions */
.openq-layer-blue-card {
  transform-box: view-box;
  transform-origin: 260px 180px;
  animation: mascotBlueLag 4.5s ease-in-out infinite;
}

.openq-layer-checkmark {
  transform-box: view-box;
  transform-origin: 236px 278px;
  animation: mascotCheckPop 4.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

.openq-layer-arrow {
  transform-box: view-box;
  transform-origin: 435px 435px;
  animation: mascotArrowWiggle 4.5s ease-in-out infinite;
}

/* Running & Tumbling Limbs */
.openq-layer-leg-left {
  transform-box: view-box;
  transform-origin: 175px 410px;
  animation: mascotLegLeft 4.5s ease-in-out infinite;
  will-change: transform;
}

.openq-layer-leg-right {
  transform-box: view-box;
  transform-origin: 295px 400px;
  animation: mascotLegRight 4.5s ease-in-out infinite;
  will-change: transform;
}

.openq-layer-arm-left {
  transform-box: view-box;
  transform-origin: 55px 270px;
  animation: mascotArmLeft 4.5s ease-in-out infinite;
  will-change: transform;
}

.openq-layer-arm-right {
  transform-box: view-box;
  transform-origin: 390px 250px;
  animation: mascotArmRight 4.5s ease-in-out infinite;
  will-change: transform;
}

/* Backwards-compatible class for existing small instances */
.hyguru-library-loading-dialog__cute-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  animation: mascotBodyPulse 2s ease-in-out infinite;
}

/* Horizontal Run Keyframes: Run in -> Trip -> Skid -> Dazed -> Dust off -> Sprint */
@keyframes mascotRunX {
  0%   { transform: translateX(-70px); }
  18%  { transform: translateX(90px); }
  21%  { transform: translateX(110px); }
  24%  { transform: translateX(120px); }
  35%  { transform: translateX(175px); }
  74%  { transform: translateX(175px); }
  76%  { transform: translateX(180px); }
  92%  { transform: translateX(455px); }
  100% { transform: translateX(455px); }
}

/* Vertical Hops, Trip, Floor Landing, and Sprint Leaps */
@keyframes mascotHopY {
  /* Run in */
  0%, 9%, 18%      { transform: translateY(0); }
  4.5%, 13.5%      { transform: translateY(-20px); }
  /* Trip stumble leap */
  21%              { transform: translateY(-8px); }
  24%              { transform: translateY(4px); }
  /* Skid & Dazed - resting cleanly on floor track */
  24%, 35%, 44%    { transform: translateY(4px); }
  /* Getting up */
  48%              { transform: translateY(3px); }
  52%              { transform: translateY(1px); }
  56%, 74%         { transform: translateY(0); }
  /* Sprint off */
  77%, 83%, 89%    { transform: translateY(-22px); }
  80%, 86%, 92%    { transform: translateY(0); }
  100%             { transform: translateY(0); }
}

/* Body Squash, Pitch, Faceplant Slide, Getting Up, Dust-off, and Sprint Lean */
@keyframes mascotSquashAndRoll {
  /* Run in */
  0%   { transform: scale(1, 1) rotate(0deg); }
  4.5% { transform: scale(0.95, 1.05) rotate(6deg); }
  9%   { transform: scale(1.12, 0.88) rotate(-2deg); }
  13.5%{ transform: scale(0.95, 1.05) rotate(6deg); }
  18%  { transform: scale(1.12, 0.88) rotate(-2deg); }
  /* Trip! */
  19%  { transform: scale(1.05, 0.95) rotate(-10deg); }
  21%  { transform: scale(0.92, 1.10) rotate(42deg); }
  23%  { transform: scale(0.90, 1.12) rotate(70deg); }
  /* Fall & Skid */
  24%  { transform: scale(1.28, 0.65) rotate(88deg); }
  26%  { transform: scale(1.18, 0.75) rotate(87deg); }
  30%  { transform: scale(1.22, 0.72) rotate(87deg); }
  35%  { transform: scale(1.20, 0.74) rotate(86deg); }
  /* Dazed */
  39%  { transform: scale(1.18, 0.76) rotate(84deg); }
  42%  { transform: scale(1.20, 0.74) rotate(86deg); }
  /* Getting up */
  44%  { transform: scale(1.15, 0.80) rotate(84deg); }
  48%  { transform: scale(1.05, 0.92) rotate(60deg); }
  52%  { transform: scale(0.98, 1.02) rotate(30deg); }
  55%  { transform: scale(0.95, 1.05) rotate(-5deg); }
  58%  { transform: scale(1, 1) rotate(0deg); }
  /* Dusting off */
  60%  { transform: scale(1, 1) rotate(0deg); }
  63.5%{ transform: scale(1.04, 0.96) rotate(3deg); }
  66%  { transform: scale(1, 1) rotate(0deg); }
  69.5%{ transform: scale(1.04, 0.96) rotate(3deg); }
  72%  { transform: scale(0.96, 1.04) rotate(-4deg); }
  74%  { transform: scale(1, 1) rotate(0deg); }
  /* Sprint */
  75%  { transform: scale(0.90, 1.12) rotate(18deg); }
  77%  { transform: scale(0.94, 1.08) rotate(16deg); }
  80%  { transform: scale(1.10, 0.90) rotate(14deg); }
  83%  { transform: scale(0.94, 1.08) rotate(16deg); }
  86%  { transform: scale(1.10, 0.90) rotate(14deg); }
  89%  { transform: scale(0.94, 1.08) rotate(16deg); }
  92%  { transform: scale(1, 1) rotate(0deg); }
  100% { transform: scale(1, 1) rotate(0deg); }
}

/* Left Leg: Run strides, trip kick-up, skid trailing, getting up, dust-off, sprint */
@keyframes mascotLegLeft {
  /* Run in */
  0%, 9%, 18%  { transform: rotate(0deg); }
  4.5%         { transform: rotate(35deg) scaleY(1.05); }
  13.5%        { transform: rotate(35deg) scaleY(1.05); }
  /* Trip */
  19%          { transform: rotate(20deg); }
  21%          { transform: rotate(-65deg) scaleY(1.1); }
  23%          { transform: rotate(-75deg); }
  /* Skid & Dazed */
  24%, 35%, 44%{ transform: rotate(-78deg) scaleY(0.92); }
  /* Get up */
  48%          { transform: rotate(-40deg); }
  52%          { transform: rotate(-15deg); }
  55%          { transform: rotate(5deg); }
  58%, 74%     { transform: rotate(0deg) scaleY(1); }
  /* Sprint */
  77%, 83%, 89%{ transform: rotate(45deg) scaleY(1.08); }
  80%, 86%     { transform: rotate(-35deg) scaleY(0.92); }
  92%, 100%    { transform: rotate(0deg) scaleY(1); }
}

/* Right Leg: Contralateral run strides, trip catch, skid trailing, getting up, sprint */
@keyframes mascotLegRight {
  /* Run in */
  0%, 9%, 18%  { transform: rotate(0deg); }
  4.5%         { transform: rotate(-35deg) scaleY(0.95); }
  13.5%        { transform: rotate(-35deg) scaleY(0.95); }
  /* Trip */
  19%          { transform: rotate(-20deg); }
  21%          { transform: rotate(45deg) scaleY(0.85); }
  23%          { transform: rotate(-65deg); }
  /* Skid & Dazed */
  24%, 35%, 44%{ transform: rotate(-72deg) scaleY(0.90); }
  /* Get up */
  48%          { transform: rotate(-35deg); }
  52%          { transform: rotate(-10deg); }
  55%          { transform: rotate(-4deg); }
  58%, 74%     { transform: rotate(0deg) scaleY(1); }
  /* Sprint */
  77%, 83%, 89%{ transform: rotate(-35deg) scaleY(0.92); }
  80%, 86%     { transform: rotate(45deg) scaleY(1.08); }
  92%, 100%    { transform: rotate(0deg) scaleY(1); }
}

/* Left Arm: Run pump, panic flail, skid splat, push-up, dust-off brush, sprint pump */
@keyframes mascotArmLeft {
  /* Run in */
  0%, 9%, 18%  { transform: rotate(0deg); }
  4.5%, 13.5%  { transform: rotate(40deg); }
  /* Trip */
  19%          { transform: rotate(-65deg); }
  21%          { transform: rotate(75deg); }
  23%          { transform: rotate(-45deg); }
  /* Skid & Dazed */
  24%, 35%, 44%{ transform: rotate(-80deg); }
  /* Get up */
  48%          { transform: rotate(65deg); }
  52%          { transform: rotate(35deg); }
  55%          { transform: rotate(-10deg); }
  58%          { transform: rotate(0deg); }
  /* Dusting off */
  61%          { transform: rotate(85deg); }
  63.5%        { transform: rotate(-25deg); }
  66%          { transform: rotate(75deg); }
  69.5%        { transform: rotate(-20deg); }
  72%          { transform: rotate(20deg); }
  74%          { transform: rotate(0deg); }
  /* Sprint */
  77%, 83%, 89%{ transform: rotate(55deg); }
  80%, 86%     { transform: rotate(-45deg); }
  92%, 100%    { transform: rotate(0deg); }
}

/* Right Arm: Contralateral run pump, panic flail, skid splat, push-up, balance, sprint pump */
@keyframes mascotArmRight {
  /* Run in */
  0%, 9%, 18%  { transform: rotate(0deg); }
  4.5%, 13.5%  { transform: rotate(-35deg); }
  /* Trip */
  19%          { transform: rotate(65deg); }
  21%          { transform: rotate(-70deg); }
  23%          { transform: rotate(45deg); }
  /* Skid & Dazed */
  24%, 35%, 44%{ transform: rotate(-65deg); }
  /* Get up */
  48%          { transform: rotate(55deg); }
  52%          { transform: rotate(25deg); }
  55%          { transform: rotate(-5deg); }
  58%          { transform: rotate(0deg); }
  /* Dusting off */
  61%          { transform: rotate(-15deg); }
  63.5%        { transform: rotate(10deg); }
  69.5%        { transform: rotate(10deg); }
  74%          { transform: rotate(0deg); }
  /* Sprint */
  77%, 83%, 89%{ transform: rotate(-45deg); }
  80%, 86%     { transform: rotate(55deg); }
  92%, 100%    { transform: rotate(0deg); }
}

/* Floor Shadow Scaling & Flattening */
@keyframes mascotShadow {
  0%, 9%, 18%  { transform: scale(1.1, 1); opacity: 0.6; }
  4.5%, 13.5%  { transform: scale(0.5, 0.5); opacity: 0.2; }
  21%          { transform: scale(0.7, 0.7); opacity: 0.3; }
  24%          { transform: scale(1.6, 1.2); opacity: 0.85; }
  28%          { transform: scale(1.5, 0.7); opacity: 0.70; }
  35%, 44%     { transform: scale(1.4, 0.7); opacity: 0.60; }
  52%          { transform: scale(1.1, 0.9); opacity: 0.55; }
  58%, 74%     { transform: scale(1.05, 1); opacity: 0.55; }
  77%, 83%, 89%{ transform: scale(0.5, 0.5); opacity: 0.2; }
  80%, 86%, 92%{ transform: scale(1.1, 1); opacity: 0.6; }
  100%         { transform: scale(1, 1); opacity: 0.55; }
}

/* Blue Card Follow-through Lag */
@keyframes mascotBlueLag {
  0%, 18%, 58%, 74%, 92%, 100% { transform: rotate(0deg); }
  4.5%, 13.5%                  { transform: rotate(3deg) translateY(-2px); }
  21%                          { transform: rotate(8deg); }
  24%, 35%, 44%                { transform: rotate(4deg) translateY(-1px); }
  77%, 83%, 89%                { transform: rotate(5deg) translateY(-2px); }
}

/* Checkmark Pop, Dazed Wobble, and Proud Pop */
@keyframes mascotCheckPop {
  0%, 23%      { transform: scale(1) rotate(0deg); }
  24%          { transform: scale(0.85); }
  39%          { transform: rotate(-20deg) scale(0.9); }
  42%          { transform: rotate(15deg) scale(0.9); }
  48%          { transform: rotate(0deg) scale(1); }
  72%          { transform: scale(1.28); }
  74%, 100%    { transform: scale(1); }
}

/* Arrow Wiggle, Droop on Fall, and Perk Up */
@keyframes mascotArrowWiggle {
  0%, 23%      { transform: translate(0, 0) rotate(0deg); }
  24%, 44%     { transform: translate(1px, 2px) rotate(-10deg); }
  58%          { transform: translate(0, 0) rotate(0deg); }
  72%          { transform: translate(2px, -2px) rotate(8deg); }
  74%, 100%    { transform: translate(0, 0) rotate(0deg); }
}

/* Landing & Dust-off Puffs */
@keyframes mascotPuffBurst {
  0%, 23%      { opacity: 0; transform: scale(0.5); }
  24%          { opacity: 0.95; transform: scale(1.6) translate(-6px, -4px); }
  27%          { opacity: 0; transform: scale(1.8) translate(-12px, -8px); }
  63%          { opacity: 0; transform: scale(0.5); }
  64%          { opacity: 0.85; transform: scale(1.1) translate(4px, -6px); }
  65.5%        { opacity: 0; transform: scale(1.3) translate(8px, -10px); }
  69%          { opacity: 0; transform: scale(0.5); }
  70%          { opacity: 0.85; transform: scale(1.1) translate(4px, -6px); }
  71.5%        { opacity: 0; transform: scale(1.3) translate(8px, -10px); }
  74%, 100%    { opacity: 0; }
}

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

.hyguru-library-loading-dialog__title {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted, #6b7280);
  margin: 0.75rem 0 0 0;
  text-align: left;
  width: 100%;
  line-height: 1.4;
  letter-spacing: normal;
  animation: textOpacityPulse 2s ease-in-out infinite;
  transition: opacity 0.25s ease;
}

@keyframes textOpacityPulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1.0; }
}

.hyguru-library-loading-dialog__progress-track {
  width: 100%;
  height: 7px;
  background: var(--bg-surface-alt, #f3f4f6);
  border-radius: var(--radius-pill, 9999px);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-subtle, rgba(15,23,42,0.08));
}

.hyguru-library-loading-dialog__progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffe5b4, #ffb347, #3b82f6, #ffe5b4);
  background-size: 200% 100%;
  animation: progressShimmer 2.2s linear infinite;
  border-radius: var(--radius-pill, 9999px);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.45);
  transition: width 0.25s ease-out;
}

@keyframes progressShimmer {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-runner-x {
    animation: none;
    left: 50%;
    transform: translateX(-50%);
  }
  .mascot-hopper-y,
  .openq-layer-blue-card,
  .openq-layer-checkmark,
  .openq-layer-arrow,
  .openq-layer-leg-left,
  .openq-layer-leg-right,
  .openq-layer-arm-left,
  .openq-layer-arm-right,
  .mascot-puffs,
  .mascot-puff {
    animation: none;
  }
  .mascot-body-squash {
    animation: mascotReducedMotionPulse 2.4s ease-in-out infinite;
  }
  .mascot-shadow {
    animation: none;
    transform: scale(1);
    opacity: 0.4;
  }
  .hyguru-library-loading-dialog__progress-bar {
    animation: none;
  }
  .hyguru-library-loading-dialog__title {
    animation: none;
    opacity: 0.85;
  }
  @keyframes mascotReducedMotionPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50%      { transform: scale(1.04); opacity: 1; }
  }
}

/* Responsive Visibility Utilities */
@media (max-width: 768px) {
  .desktop-only,
  button.desktop-only,
  a.desktop-only,
  div.desktop-only,
  span.desktop-only {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .mobile-only,
  button.mobile-only,
  a.mobile-only,
  div.mobile-only,
  span.mobile-only {
    display: none !important;
  }
}

.page-dashboard .container {
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ==========================================================================
   Structured Medical Tables & Video Embeds (/openqbank-css compliant)
   ========================================================================== */
.uworld-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm, 12px);
  background: var(--bg-surface, #ffffff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.uworld-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text, #111827);
}

.uworld-table-title {
  background: var(--bg-surface-alt, #f3f4f6);
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text, #111827);
  text-align: left;
  border-bottom: 1px solid var(--border, #e5e7eb);
  letter-spacing: -0.01em;
}

.uworld-table-header-cell {
  width: 32%;
  min-width: 140px;
  max-width: 220px;
  vertical-align: top;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text, #111827);
  background: var(--bg-surface-alt, #f9fafb);
  border-bottom: 1px solid var(--border, #e5e7eb);
  border-right: 1px solid var(--border, #e5e7eb);
}

.uworld-table-body-cell {
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  color: var(--text, #111827);
}

.uworld-table tr:last-child .uworld-table-header-cell,
.uworld-table tr:last-child .uworld-table-body-cell {
  border-bottom: none;
}

.uworld-table-bullet-list {
  margin: 0;
  padding-left: 1.2rem;
  list-style-type: disc;
}

.uworld-table-bullet-list li {
  margin-bottom: 4px;
  line-height: 1.45;
}

.uworld-table-bullet-list li:last-child {
  margin-bottom: 0;
}

.uworld-table-footnote {
  font-size: 0.8rem;
  color: var(--text-secondary, #4b5563);
  padding: 8px 14px;
  background: var(--bg-surface, #ffffff);
  border-top: 1px dashed var(--border, #e5e7eb);
  font-style: italic;
  line-height: 1.4;
}

/* ==========================================================================
   Gradient Cutout Pro Upgrade & Web App Download Cards
   ========================================================================== */
.pro-upgrade-card,
.web-app-download-card {
  width: 100%;
  text-align: center;
  padding: 1.75rem 1.5rem;
  margin: 1.25rem 0 1.25rem;
  border-radius: var(--radius-card, 16px);
  border: 2px solid transparent;
  background: linear-gradient(var(--bg-surface, #fff), var(--bg-surface, #fff)) padding-box,
              linear-gradient(120deg, #3b82f6, #fb7185, #ffb347) border-box;
  box-shadow: 0 12px 36px -8px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
}

[data-theme="dark"] .pro-upgrade-card,
[data-theme="dark"] .web-app-download-card {
  background: linear-gradient(var(--bg-surface, #1e293b), var(--bg-surface, #1e293b)) padding-box,
              linear-gradient(120deg, #3b82f6, #fb7185, #ffb347) border-box;
  box-shadow: 0 12px 36px -8px rgba(0, 0, 0, 0.45);
}

.pro-upgrade-badge,
.web-app-download-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(251, 113, 133, 0.12));
  color: #2563eb;
  padding: 3px 10px;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .pro-upgrade-badge,
[data-theme="dark"] .web-app-download-badge {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(251, 113, 133, 0.25));
  color: #93c5fa;
  border-color: rgba(59, 130, 246, 0.4);
}

.pro-upgrade-title,
.web-app-download-title {
  font-family: var(--font-display, inherit);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text, #111827);
  margin: 0 0 0.5rem;
}

.pro-upgrade-desc,
.web-app-download-desc {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary, #4b5563);
  margin: 0 auto 1rem;
  max-width: 480px;
}

.pro-upgrade-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  max-width: 440px;
  margin: 0 auto 1.25rem;
}

.pro-upgrade-feature-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.825rem;
  color: var(--text, #111827);
  font-weight: 500;
  line-height: 1.4;
}

.pro-upgrade-feature-row svg {
  color: #10b981;
  flex-shrink: 0;
  margin-top: 1px;
}

.web-app-download-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: 440px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .web-app-download-actions {
    grid-template-columns: 1fr;
  }
}

/* Question Breakdown Extras */
.rapid-review-container {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface, #ffffff);
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--border, #e5e7eb);
  border-left: 4px solid #10b981;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.rapid-review-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #065f46;
  margin-top: 0;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .rapid-review-title {
  color: #34d399;
}

.rapid-review-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text, #374151);
}

.educational-objective-container {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface, #ffffff);
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--border, #e5e7eb);
  border-left: 4px solid var(--accent-blue, #3b82f6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.educational-objective-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-blue, #1d4ed8);
  margin-top: 0;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .educational-objective-title {
  color: #60a5fa;
}

.educational-objective-body {
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--text, #374151);
  font-weight: 500;
}

.video-rec-section {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}

.video-rec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.video-rec-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #111827);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.video-embed-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--border, #e5e7eb);
  background: #000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.video-embed-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.learn-more-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface, #ffffff);
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.learn-more-link-item__title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text, #111827);
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hyguru-rec-card--linked {
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hyguru-rec-card--linked:hover,
.hyguru-rec-card--linked:focus-visible {
  border-color: var(--accent-blue-deep, #3b82f6);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
  outline: none;
}

/* Setup Modal Classes */
.setup-modal__dialog {
  max-width: 620px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  border-radius: var(--radius-lg, 24px);
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
}

.setup-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 42px;
  font-size: 0.875rem;
  padding: 0 1rem;
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
}

.setup-modal__preview {
  border-radius: var(--radius-md, 16px);
  overflow: hidden;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg-surface-alt, #f3f4f6);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.setup-modal__preview-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: inherit;
}

/* HyGuru Review Co-Branding Banner */
.hyguru-review-cobrand-banner {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0.75rem 0 0.5rem;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.hyguru-cobrand-wide-logo {
  width: 100%;
  max-width: 294px;
  height: auto;
  display: block;
  object-fit: contain;
}

.hyguru-cobrand-wide-logo--dark {
  display: none !important;
}

.hyguru-cobrand-wide-logo--light {
  display: block !important;
}

[data-theme="dark"] .hyguru-cobrand-wide-logo--light,
[data-theme-resolved="dark"] .hyguru-cobrand-wide-logo--light {
  display: none !important;
}

[data-theme="dark"] .hyguru-cobrand-wide-logo--dark,
[data-theme-resolved="dark"] .hyguru-cobrand-wide-logo--dark {
  display: block !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .hyguru-cobrand-wide-logo--light,
  :root[data-theme="system"] .hyguru-cobrand-wide-logo--light,
  [data-theme="system"] .hyguru-cobrand-wide-logo--light {
    display: none !important;
  }
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .hyguru-cobrand-wide-logo--dark,
  :root[data-theme="system"] .hyguru-cobrand-wide-logo--dark,
  [data-theme="system"] .hyguru-cobrand-wide-logo--dark {
    display: block !important;
  }
}

[data-theme="light"] .hyguru-cobrand-wide-logo--dark,
[data-theme-resolved="light"] .hyguru-cobrand-wide-logo--dark {
  display: none !important;
}

[data-theme="light"] .hyguru-cobrand-wide-logo--light,
[data-theme-resolved="light"] .hyguru-cobrand-wide-logo--light {
  display: block !important;
}

.hyguru-review-cobrand-inner {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1.1rem);
  row-gap: 0.4rem;
  max-width: 100%;
  font-family: var(--font-display, 'DM Sans', sans-serif);
}

.hyguru-cobrand-left {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.35rem, 1.5vw, 0.85rem);
  min-width: 0;
}

.hyguru-cobrand-dot-logo {
  width: clamp(28px, 8vw, 52px);
  height: clamp(28px, 8vw, 52px);
  object-fit: contain;
  flex-shrink: 0;
}

.hyguru-cobrand-name {
  font-family: var(--font-display, 'DM Sans', sans-serif);
  font-weight: 800;
  font-size: clamp(1.1rem, 5.2vw, 2.1rem);
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}

.hyguru-cobrand-name::after {
  content: none !important;
}

.hyguru-cobrand-x {
  font-size: clamp(1rem, 4.8vw, 2rem);
  font-weight: 300;
  color: var(--text-muted, #9ca3af);
  user-select: none;
  line-height: 1;
  flex-shrink: 0;
}

.hyguru-cobrand-partner-logo {
  width: clamp(80px, 22vw, 164px);
  height: auto;
  max-width: 40vw;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Navbar Cobrand */
.site-header__brand--hyguru {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.site-header__brand--hyguru > span:first-child::after {
  content: none !important;
}

.site-header__brand--hyguru .hyguru-cobrand-left {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.site-header__brand--hyguru .hyguru-cobrand-dot-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.site-header__brand--hyguru .hyguru-cobrand-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.site-header__brand--hyguru .hyguru-cobrand-x {
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--text-muted, #9ca3af);
  margin: 0 0.25rem;
}

.site-header__brand--hyguru .hyguru-cobrand-partner-logo {
  height: 32px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

/* Auth Cobrand */
.auth-hyguru-cobrand-header .hyguru-cobrand-left {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.auth-hyguru-cobrand-header .hyguru-cobrand-dot-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.auth-hyguru-cobrand-header .hyguru-cobrand-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.auth-hyguru-cobrand-header .hyguru-cobrand-x {
  font-size: 1.35rem;
  font-weight: 300;
  color: var(--text-muted, #9ca3af);
  margin: 0 0.4rem;
}

.auth-hyguru-cobrand-header .hyguru-cobrand-partner-logo {
  height: 38px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

/* Library Date Filter Popover */
.library-date-filter-wrap {
  position: relative;
}

.library-date-btn.is-active {
  background-color: var(--bg-surface-warm, #fff7ed);
  border-color: var(--brand, #ffe5b4);
  color: var(--amber-on-brand, #b45309);
  font-weight: 600;
}

.library-date-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  width: 310px;
  background-color: var(--bg-surface, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md, 16px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.library-date-popover.is-hidden {
  display: none !important;
}

.library-date-popover__title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text, #111827);
  margin-bottom: 0.1rem;
}

.library-date-popover__row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.library-date-popover__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.library-date-popover__field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #4b5563);
}

.library-date-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.8rem;
  font-family: inherit;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm, 12px);
  background-color: var(--bg-surface-alt, #f9fafb);
  color: var(--text, #111827);
  outline: none;
  box-sizing: border-box;
}

.library-date-input:focus {
  border-color: var(--accent-blue, #3b82f6);
  background-color: var(--bg-surface, #ffffff);
}

.library-date-popover__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border, #e5e7eb);
}

.library-date-btn.is-active,
.library-date-preset-btn.is-active {
  background-color: var(--brand, #ffe5b4) !important;
  color: #111827 !important;
  border-color: var(--brand, #ffe5b4) !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .library-date-btn.is-active,
[data-theme="dark"] .library-date-preset-btn.is-active,
:root[data-theme="dark"] .library-date-btn.is-active,
:root[data-theme="dark"] .library-date-preset-btn.is-active {
  background-color: var(--brand, #ffe5b4) !important;
  color: #0b1220 !important;
  border-color: var(--brand, #ffe5b4) !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .library-date-btn.is-active svg,
[data-theme="dark"] .library-date-btn.is-active .dropdown-chevron,
[data-theme="dark"] .library-date-btn.is-active .library-date-clear-icon,
[data-theme="dark"] .library-date-preset-btn.is-active .preset-clear-x,
:root[data-theme="dark"] .library-date-btn.is-active svg,
:root[data-theme="dark"] .library-date-btn.is-active .dropdown-chevron,
:root[data-theme="dark"] .library-date-btn.is-active .library-date-clear-icon,
:root[data-theme="dark"] .library-date-preset-btn.is-active .preset-clear-x {
  color: #0b1220 !important;
}

.library-date-clear-icon,
.preset-clear-x {
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.library-date-clear-icon:hover,
.preset-clear-x:hover {
  opacity: 0.7;
  transform: scale(1.15);
}

/* Dark mode inversion for recommendation / video icon (matches about.html feature-card icon) */
[data-theme="dark"] .dark-invert-icon,
[data-theme-resolved="dark"] .dark-invert-icon,
[data-theme="dark"] .hyguru-rec-icon,
[data-theme-resolved="dark"] .hyguru-rec-icon,
[data-theme="dark"] .hyguru-vid-recs-container img,
[data-theme-resolved="dark"] .hyguru-vid-recs-container img {
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .dark-invert-icon,
  [data-theme="system"] .dark-invert-icon,
  :root:not([data-theme]) .dark-invert-icon,
  :root[data-theme="system"] .hyguru-rec-icon,
  [data-theme="system"] .hyguru-rec-icon,
  :root:not([data-theme]) .hyguru-rec-icon,
  :root[data-theme="system"] .hyguru-vid-recs-container img,
  [data-theme="system"] .hyguru-vid-recs-container img,
  :root:not([data-theme]) .hyguru-vid-recs-container img {
    filter: invert(1);
  }
}

/* Dark mode: upgrade/lock overlay in question modal */
[data-theme="dark"] .leadins-container--locked,
[data-theme-resolved="dark"] .leadins-container--locked {
  background: var(--bg-surface-alt, #1a1d2e);
}

[data-theme="dark"] .leadin-lock-content,
[data-theme-resolved="dark"] .leadin-lock-content {
  background: linear-gradient(var(--bg-surface, #1e2130), var(--bg-surface, #1e2130)) padding-box,
              linear-gradient(120deg, #3b82f6, #fb7185, #ffb347) border-box !important;
  color: var(--text, #f1f5f9);
}

[data-theme="dark"] .leadin-lock-content h4,
[data-theme-resolved="dark"] .leadin-lock-content h4,
[data-theme="dark"] .leadin-lock-content p,
[data-theme-resolved="dark"] .leadin-lock-content p {
  color: var(--text, #f1f5f9);
}

[data-theme="dark"] .leadin-vignette-box--locked,
[data-theme-resolved="dark"] .leadin-vignette-box--locked,
[data-theme="dark"] .leadin-card--locked,
[data-theme-resolved="dark"] .leadin-card--locked {
  background: var(--bg-surface-alt, #252838);
  border-color: var(--border, #2e3347);
  color: var(--text-muted, #94a3b8);
}

[data-theme="dark"] .leadin-vignette-text,
[data-theme-resolved="dark"] .leadin-vignette-text,
[data-theme="dark"] .leadin-question-text,
[data-theme-resolved="dark"] .leadin-question-text,
[data-theme="dark"] .leadin-answer-summary--locked,
[data-theme-resolved="dark"] .leadin-answer-summary--locked {
  color: var(--text-muted, #94a3b8);
}

/* System dark preference variants */
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .leadins-container--locked,
  [data-theme="system"] .leadins-container--locked,
  :root:not([data-theme]) .leadins-container--locked {
    background: var(--bg-surface-alt, #1a1d2e);
  }

  :root[data-theme="system"] .leadin-lock-content,
  [data-theme="system"] .leadin-lock-content,
  :root:not([data-theme]) .leadin-lock-content {
    background: linear-gradient(var(--bg-surface, #1e2130), var(--bg-surface, #1e2130)) padding-box,
                linear-gradient(120deg, #3b82f6, #fb7185, #ffb347) border-box !important;
    color: var(--text, #f1f5f9);
  }

  :root[data-theme="system"] .leadin-lock-content h4,
  [data-theme="system"] .leadin-lock-content h4,
  :root:not([data-theme]) .leadin-lock-content h4,
  :root[data-theme="system"] .leadin-lock-content p,
  [data-theme="system"] .leadin-lock-content p,
  :root:not([data-theme]) .leadin-lock-content p {
    color: var(--text, #f1f5f9);
  }

  :root[data-theme="system"] .leadin-vignette-box--locked,
  [data-theme="system"] .leadin-vignette-box--locked,
  :root:not([data-theme]) .leadin-vignette-box--locked,
  :root[data-theme="system"] .leadin-card--locked,
  [data-theme="system"] .leadin-card--locked,
  :root:not([data-theme]) .leadin-card--locked {
    background: var(--bg-surface-alt, #252838);
    border-color: var(--border, #2e3347);
    color: var(--text-muted, #94a3b8);
  }

  :root[data-theme="system"] .leadin-vignette-text,
  [data-theme="system"] .leadin-vignette-text,
  :root:not([data-theme]) .leadin-vignette-text,
  :root[data-theme="system"] .leadin-question-text,
  [data-theme="system"] .leadin-question-text,
  :root:not([data-theme]) .leadin-question-text,
  :root[data-theme="system"] .leadin-answer-summary--locked,
  [data-theme="system"] .leadin-answer-summary--locked,
  :root:not([data-theme]) .leadin-answer-summary--locked {
    color: var(--text-muted, #94a3b8);
  }
}

/* Dark mode: JS-rendered recommendation card backgrounds */
[data-theme="dark"] .learn-more-link-item,
[data-theme-resolved="dark"] .learn-more-link-item {
  background: var(--bg-surface, #1e2130) !important;
  border-color: var(--border, #2e3347) !important;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .learn-more-link-item,
  [data-theme="system"] .learn-more-link-item,
  :root:not([data-theme]) .learn-more-link-item {
    background: var(--bg-surface, #1e2130) !important;
    border-color: var(--border, #2e3347) !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   OPENHYGURU MARKETING OVERHAUL STYLES
   ══════════════════════════════════════════════════════════════ */

/* Bundle Ribbon: Included with Every Pass */
.openhyguru-bundle-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.85rem 1.75rem;
  margin: 1.5rem auto 0;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--bg-surface-warm, rgba(59, 130, 246, 0.05));
  border: 1px solid var(--border);
  max-width: fit-content;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.bundle-ribbon-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.bundle-ribbon-item svg {
  color: var(--accent-blue, #3b82f6);
  flex-shrink: 0;
}

.bundle-ribbon-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* 3-Pillar Side-by-Side Sections */
.openhyguru-pillar-section {
  padding-block: 4.5rem;
  border-bottom: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.06));
}

[data-theme="dark"] .openhyguru-pillar-section {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.openhyguru-pillar-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 3.5rem !important;
  align-items: center !important;
  max-width: 1080px;
  margin: 0 auto;
}

.openhyguru-pillar-grid--reversed {
  grid-template-columns: 1fr 1fr !important;
}

.openhyguru-pillar-grid--reversed .openhyguru-pillar-visual {
  order: 1 !important;
}

.openhyguru-pillar-grid--reversed .openhyguru-pillar-copy {
  order: 2 !important;
}

.openhyguru-pillar-copy {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  text-align: left;
}

.pillar-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  width: fit-content;
  line-height: 1;
}

.pillar-step-badge--blue {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue, #3b82f6);
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.pillar-step-badge--amber {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.pillar-step-badge--emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.openhyguru-pillar-title {
  font-size: clamp(1.6rem, 2.75vw, 2.2rem);
  font-weight: 800;
  line-height: 1.22;
  color: var(--text);
  letter-spacing: -0.025em;
  margin: 0;
}

.openhyguru-pillar-lead {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
}

.openhyguru-pillar-features {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.openhyguru-pillar-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

.feature-check-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  flex-shrink: 0;
}

.openhyguru-pillar-visual {
  position: relative;
  width: 100%;
}

/* Floating Window Bar Details */
.window-floating-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--bg-surface-alt, #f8fafc);
  border-top: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 600;
  flex-wrap: wrap;
  gap: 0.5rem;
}

[data-theme="dark"] .window-floating-bar {
  background: #191b26;
}

.kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.kbd-hint kbd {
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: ui-monospace, monospace;
  color: var(--text);
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: statusDotPulseHyguru 2s infinite;
}

@keyframes statusDotPulseHyguru {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Interactive Medical Library Bento Widget */
.interactive-library-preview {
  background: var(--bg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.lib-preview-tabs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: none;
}

.lib-preview-tab {
  padding: 0.42rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 160ms ease;
}

.lib-preview-tab:hover {
  border-color: var(--accent-blue, #3b82f6);
  color: var(--text);
}

.lib-preview-tab.is-active {
  background: var(--accent-blue, #3b82f6);
  color: #ffffff;
  border-color: var(--accent-blue, #3b82f6);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.lib-preview-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lib-bento-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: default;
  text-align: left;
}

.lib-bento-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue, #3b82f6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.lib-bento-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lib-bento-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue, #3b82f6);
}

.lib-bento-duration {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.lib-bento-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.35;
}

.lib-bento-desc {
  font-size: 0.79rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0;
}

.lib-bento-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  font-size: 0.72rem;
  color: var(--text-muted);
}

.lib-bento-play {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ef4444;
  font-weight: 700;
  font-size: 0.74rem;
}

.lib-bento-card-count {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-alt, rgba(0, 0, 0, 0.04));
  padding: 1px 6px;
  border-radius: 4px;
}

/* AnKing / Anki vs openHyGuru Live Comparison Widget */
/* Gradient Utility (Matching templates/about.html .mkt-ai-gradient) */
.mkt-ai-gradient {
  background: linear-gradient(90deg, #ffb347, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

#anki-comparison-title .mkt-ai-gradient {
  font-weight: 800;
}

.anki-vs-hyguru-section {
  padding-block: 3.5rem;
  background: var(--bg-surface-warm, rgba(0, 0, 0, 0.02));
  border-radius: var(--radius-card, 20px);
  margin-block: 2.5rem;
  padding-inline: 1.5rem;
  border: 1px solid var(--border);
}

.anki-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 1.5rem 1.75rem;
  max-width: 1040px;
  margin: 2rem auto 0;
  align-items: stretch;
}

@media (min-width: 821px) {
  .comparison-column {
    display: contents;
  }

  .comparison-study-card--anki {
    grid-column: 1;
    grid-row: 1;
  }

  .comparison-study-card--hyguru {
    grid-column: 2;
    grid-row: 1;
  }

  .comparison-points-wrap--anki {
    grid-column: 1;
    grid-row: 2;
  }

  .comparison-points-wrap--hyguru {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 820px) {
  .anki-comparison-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 2rem;
  }

  .comparison-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .comparison-study-card--anki,
  .comparison-study-card--hyguru,
  .comparison-points-wrap--anki,
  .comparison-points-wrap--hyguru {
    grid-column: auto;
    grid-row: auto;
  }
}

.comparison-study-card {
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: var(--radius-card, 16px);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.comparison-study-card--anki #anki-demo-question-state {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.comparison-study-card--anki #anki-demo-question-state .question-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.comparison-study-card--anki #anki-demo-answer-state,
.comparison-study-card--hyguru #hyguru-demo-answer-state {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.comparison-study-card--anki #anki-demo-answer-state .rating-section,
.comparison-study-card--hyguru #hyguru-demo-answer-state .rating-section {
  margin-top: auto;
}

.comparison-study-card--anki {
  border: 1px solid var(--border);
}

.comparison-study-card--hyguru {
  border: 1.5px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.08);
}

.comparison-study-card .card-meta-bar {
  padding: 0.85rem 1.25rem;
}

.comparison-study-card .vignette-panel {
  padding: 1.15rem 1.25rem;
}

.comparison-study-card .vignette-content {
  white-space: normal;
  text-align: left;
}

.comparison-study-card .question-section,
.comparison-study-card .answer-section {
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.comparison-study-card .question-text,
.comparison-study-card .answer-text {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  text-align: center;
  margin: 0 auto;
  white-space: normal;
}

.comparison-study-card .show-answer-wrapper {
  margin-top: 1.5rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.comparison-study-card .show-answer-btn {
  height: 46px !important;
  padding: 0 28px !important;
  min-width: 160px;
  font-weight: 700 !important;
  font-size: 0.88rem;
  cursor: pointer;
  border-radius: 8px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.comparison-study-card .pearl-section {
  padding: 1rem 1.25rem;
}

.comparison-study-card .rating-section {
  padding: 1rem 1.25rem 1.25rem;
}

.comparison-study-card .rating-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

/* ══════════════════════════════════════════════════════════════════
   AnKing & openHyGuru Comparison Rating Buttons
   ══════════════════════════════════════════════════════════════════ */
.comparison-study-card .rating-btn {
  flex: 1;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-btn, 10px);
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid transparent;
  transition: all var(--duration-fast, 150ms) var(--ease-standard, ease);
}

.comparison-study-card .rating-btn-label {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
}

.comparison-study-card .rating-btn-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

/* Light Mode: AnKing (Again / Good) */
.comparison-study-card .rating-btn--again {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
}
.comparison-study-card .rating-btn--again .rating-btn-label {
  color: #dc2626;
}
.comparison-study-card .rating-btn--again .rating-btn-kbd {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
}

.comparison-study-card .rating-btn--good {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
}
.comparison-study-card .rating-btn--good .rating-btn-label {
  color: #2563eb;
}
.comparison-study-card .rating-btn--good .rating-btn-kbd {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #2563eb;
}

/* Light Mode: openHyGuru (Flag / Reviewed) */
.comparison-study-card .rating-btn--flag {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #d97706;
}
.comparison-study-card .rating-btn--flag .rating-btn-label {
  color: #d97706;
}
.comparison-study-card .rating-btn--flag .rating-btn-kbd {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #b45309;
}

.comparison-study-card .rating-btn--reviewed {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669;
}
.comparison-study-card .rating-btn--reviewed .rating-btn-label {
  color: #059669;
}
.comparison-study-card .rating-btn--reviewed .rating-btn-kbd {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #047857;
}

/* ── Dark Mode Anki Buttons: High Contrast & Authentic Native Aesthetic ── */
[data-theme="dark"] .comparison-study-card .rating-btn--again,
[data-theme-resolved="dark"] .comparison-study-card .rating-btn--again {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  color: #fca5a5 !important;
}
[data-theme="dark"] .comparison-study-card .rating-btn--again .rating-btn-label,
[data-theme-resolved="dark"] .comparison-study-card .rating-btn--again .rating-btn-label {
  color: #fca5a5 !important;
}
[data-theme="dark"] .comparison-study-card .rating-btn--again .rating-btn-kbd,
[data-theme-resolved="dark"] .comparison-study-card .rating-btn--again .rating-btn-kbd {
  background: rgba(239, 68, 68, 0.25) !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  color: #fca5a5 !important;
}

[data-theme="dark"] .comparison-study-card .rating-btn--good,
[data-theme-resolved="dark"] .comparison-study-card .rating-btn--good {
  background: rgba(59, 130, 246, 0.15) !important;
  border: 1px solid rgba(59, 130, 246, 0.45) !important;
  color: #93c5fd !important;
}
[data-theme="dark"] .comparison-study-card .rating-btn--good .rating-btn-label,
[data-theme-resolved="dark"] .comparison-study-card .rating-btn--good .rating-btn-label {
  color: #93c5fd !important;
}
[data-theme="dark"] .comparison-study-card .rating-btn--good .rating-btn-kbd,
[data-theme-resolved="dark"] .comparison-study-card .rating-btn--good .rating-btn-kbd {
  background: rgba(59, 130, 246, 0.25) !important;
  border: 1px solid rgba(59, 130, 246, 0.45) !important;
  color: #93c5fd !important;
}

/* Dark Mode: openHyGuru (Flag / Reviewed) */
[data-theme="dark"] .comparison-study-card .rating-btn--flag,
[data-theme-resolved="dark"] .comparison-study-card .rating-btn--flag {
  background: rgba(245, 158, 11, 0.15) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  color: #fcd34d !important;
}
[data-theme="dark"] .comparison-study-card .rating-btn--flag .rating-btn-label,
[data-theme-resolved="dark"] .comparison-study-card .rating-btn--flag .rating-btn-label {
  color: #fcd34d !important;
}
[data-theme="dark"] .comparison-study-card .rating-btn--flag .rating-btn-kbd,
[data-theme-resolved="dark"] .comparison-study-card .rating-btn--flag .rating-btn-kbd {
  background: rgba(245, 158, 11, 0.25) !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
  color: #fcd34d !important;
}

[data-theme="dark"] .comparison-study-card .rating-btn--reviewed,
[data-theme-resolved="dark"] .comparison-study-card .rating-btn--reviewed {
  background: rgba(16, 185, 129, 0.15) !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  color: #6ee7b7 !important;
}
[data-theme="dark"] .comparison-study-card .rating-btn--reviewed .rating-btn-label,
[data-theme-resolved="dark"] .comparison-study-card .rating-btn--reviewed .rating-btn-label {
  color: #6ee7b7 !important;
}
[data-theme="dark"] .comparison-study-card .rating-btn--reviewed .rating-btn-kbd,
[data-theme-resolved="dark"] .comparison-study-card .rating-btn--reviewed .rating-btn-kbd {
  background: rgba(16, 185, 129, 0.25) !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  color: #6ee7b7 !important;
}

/* System dark fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .comparison-study-card .rating-btn--again {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    color: #fca5a5 !important;
  }
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .comparison-study-card .rating-btn--again .rating-btn-label {
    color: #fca5a5 !important;
  }
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .comparison-study-card .rating-btn--again .rating-btn-kbd {
    background: rgba(239, 68, 68, 0.25) !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    color: #fca5a5 !important;
  }
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .comparison-study-card .rating-btn--good {
    background: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.45) !important;
    color: #93c5fd !important;
  }
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .comparison-study-card .rating-btn--good .rating-btn-label {
    color: #93c5fd !important;
  }
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .comparison-study-card .rating-btn--good .rating-btn-kbd {
    background: rgba(59, 130, 246, 0.25) !important;
    border: 1px solid rgba(59, 130, 246, 0.45) !important;
    color: #93c5fd !important;
  }
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .comparison-study-card .rating-btn--flag {
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    color: #fcd34d !important;
  }
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .comparison-study-card .rating-btn--flag .rating-btn-label {
    color: #fcd34d !important;
  }
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .comparison-study-card .rating-btn--flag .rating-btn-kbd {
    background: rgba(245, 158, 11, 0.25) !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    color: #fcd34d !important;
  }
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .comparison-study-card .rating-btn--reviewed {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    color: #6ee7b7 !important;
  }
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .comparison-study-card .rating-btn--reviewed .rating-btn-label {
    color: #6ee7b7 !important;
  }
  :root:not([data-theme="light"]):not([data-theme-resolved="light"]) .comparison-study-card .rating-btn--reviewed .rating-btn-kbd {
    background: rgba(16, 185, 129, 0.25) !important;
    border: 1px solid rgba(16, 185, 129, 0.45) !important;
    color: #6ee7b7 !important;
  }
}

.comparison-points-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card, 16px);
  box-shadow: var(--shadow-sm);
}

.comparison-points-header {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.anki-cloze-card {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
}

.anki-cloze-bracket {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
}

[data-theme="dark"] .anki-cloze-bracket {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.25);
}

.comparison-critique-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.comparison-critique-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.critique-bad {
  color: #dc2626;
  flex-shrink: 0;
  margin-top: 1px;
}

.critique-good {
  color: #16a34a;
  flex-shrink: 0;
  margin-top: 1px;
}

.comparison-matrix-table {
  width: 100%;
  max-width: 960px;
  margin: 2rem auto 0;
  border-collapse: collapse;
  background: var(--bg-surface);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: 0.84rem;
}

.comparison-matrix-table th,
.comparison-matrix-table td {
  padding: 0.85rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.06));
}

.comparison-matrix-table th {
  background: var(--bg-surface-alt, #f8fafc);
  font-weight: 700;
  color: var(--text);
}

[data-theme="dark"] .comparison-matrix-table th {
  background: #191b26;
}

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

/* Library Demo Detail View (Vignette & Lead-in Inspection) */
.lib-preview-view {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lib-preview-view.is-hidden {
  display: none !important;
}

.lib-detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
}

[data-theme="dark"] .lib-detail-nav {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.lib-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lib-back-btn:hover {
  background: var(--bg-surface-alt, #f8fafc);
  border-color: var(--accent-blue, #3b82f6);
  color: var(--accent-blue, #3b82f6);
}

.lib-vignette-box {
  background: var(--bg-surface-alt, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.95rem 1.1rem;
  margin-bottom: 0.85rem;
  text-align: left;
}

[data-theme="dark"] .lib-vignette-box {
  background: #141620;
}

.lib-vignette-box .leadin-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-blue, #3b82f6);
  margin-bottom: 0.35rem;
}

.lib-vignette-box .leadin-vignette-text {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}

.lib-detail-leadins {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.lib-leadin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  text-align: left;
}

.lib-leadin-question {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.lib-leadin-number {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue, #3b82f6);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}

.lib-leadin-qtext {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin: 0;
}

.lib-leadin-toggle {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-blue, #3b82f6);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border-subtle, rgba(0, 0, 0, 0.08));
}

.lib-leadin-toggle::-webkit-details-marker {
  display: none;
}

.lib-leadin-toggle::before {
  content: '▶';
  font-size: 0.6rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

details[open] > .lib-leadin-toggle::before {
  transform: rotate(90deg);
}

.lib-leadin-answer {
  margin-top: 0.4rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-surface-alt, #f8fafc);
  border-radius: 6px;
  border-left: 3px solid var(--accent-blue, #3b82f6);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

[data-theme="dark"] .lib-leadin-answer {
  background: #141620;
}

.lib-video-rec-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  text-align: left;
}

.lib-video-rec-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.lib-video-rec-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lib-video-rec-label {
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ef4444;
}

.lib-video-rec-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.lib-bento-card[role="button"] {
  cursor: pointer;
}

.lib-bento-card:hover .lib-bento-title {
  color: var(--accent-blue, #3b82f6);
}

/* Authentic Library Demo Bento Cards & Click Hint (Screenshot 3) */
.demo-library-card {
  cursor: pointer;
  border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.demo-library-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-blue, #3b82f6);
  box-shadow: 0 14px 30px -8px rgba(59, 130, 246, 0.2), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.demo-card-click-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-blue, #3b82f6);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
  transition: all 0.15s ease;
  user-select: none;
}

.demo-library-card:hover .demo-card-click-hint {
  background: var(--accent-blue, #3b82f6);
  color: #fff;
  border-color: var(--accent-blue, #3b82f6);
}

.demo-card-click-hint .status-dot-pulse {
  background: var(--accent-blue, #3b82f6);
}

.demo-library-card:hover .demo-card-click-hint .status-dot-pulse {
  background: #fff;
}

/* Question modal enhancements for openHyGuru demo */
.hyguru-question-modal .notion-style-modal {
  max-width: 580px !important;
  width: 94%;
}

[data-theme="dark"] .demo-library-card {
  background: #141724;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .demo-library-card:hover {
  border-color: var(--accent-blue, #3b82f6);
  box-shadow: 0 14px 30px -8px rgba(59, 130, 246, 0.35);
}

[data-theme="dark"] .hyguru-question-modal .notion-style-modal {
  background: #141724 !important;
}

[data-theme="dark"] .hyguru-question-modal .leadin-vignette-box {
  background: #1a1d2e !important;
}

[data-theme="dark"] .hyguru-question-modal .leadin-card {
  background: #141724 !important;
}

[data-theme="dark"] .hyguru-question-modal .leadin-answer-content {
  background: #1a1d2e !important;
}

[data-theme="dark"] .hyguru-question-modal .learn-more-link-item {
  background: #1a1d2e !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ─── Navigation Styling ─── */
.site-header__nav a {
  text-decoration: none !important;
  color: var(--text-secondary);
}

.site-header__nav a:hover,
.site-header__nav a.active {
  text-decoration: none !important;
  color: var(--accent-blue-ink);
  background-color: var(--accent-blue-baby);
  transform: translateY(-1px);
}

[data-theme="dark"] .site-header__nav a,
[data-theme-resolved="dark"] .site-header__nav a {
  text-decoration: none !important;
  color: var(--text-secondary);
}

[data-theme="dark"] .site-header__nav a:hover,
[data-theme-resolved="dark"] .site-header__nav a:hover,
[data-theme="dark"] .site-header__nav a.active,
[data-theme-resolved="dark"] .site-header__nav a.active {
  text-decoration: none !important;
  color: #ffffff;
  background-color: rgba(59, 130, 246, 0.25);
}

/* ─── Hero Disclaimer Superscript ─── */
.disclaimer-sup {
  font-size: 0.7em !important;
  vertical-align: super !important;
  line-height: 0 !important;
}

.disclaimer-ref {
  font-size: 0.7em !important;
  vertical-align: super !important;
  line-height: 0 !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  color: var(--accent-blue, #3b82f6) !important;
  padding: 0 1px !important;
  cursor: pointer !important;
}

.disclaimer-ref:hover {
  text-decoration: underline !important;
}

/* ─── Disclaimers List View Formatting ─── */
.marketing-disclaimers-section {
  padding-top: var(--space-6, 1.5rem);
  padding-bottom: var(--space-8, 2rem);
}

.disclaimers-container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.disclaimers-divider {
  border: 0;
  height: 1px;
  background: var(--border, rgba(0, 0, 0, 0.08));
  margin: 0 0 1.5rem;
}

[data-theme="dark"] .disclaimers-divider,
[data-theme-resolved="dark"] .disclaimers-divider {
  background: var(--border, rgba(255, 255, 255, 0.08));
}

.disclaimers-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #64748b);
  margin: 0 0 1rem;
}

.disclaimers-list {
  list-style: none !important;
  list-style-type: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.85rem !important;
}

.disclaimer-entry {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.5rem !important;
  scroll-margin-top: 5rem !important;
  list-style: none !important;
  list-style-type: none !important;
}

.disclaimer-entry::marker {
  display: none !important;
  content: "" !important;
}

.disclaimer-num {
  flex-shrink: 0 !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  color: var(--text-muted, #94a3b8) !important;
  min-width: 1.2rem !important;
  line-height: 1.55 !important;
}

.disclaimer-text {
  font-size: 0.75rem !important;
  line-height: 1.55 !important;
  color: var(--text-muted, #64748b) !important;
  margin: 0 !important;
}

.disclaimer-text strong {
  font-weight: 600 !important;
  color: var(--text-secondary, #475569) !important;
}

[data-theme="dark"] .disclaimer-text strong,
[data-theme-resolved="dark"] .disclaimer-text strong {
  color: var(--text-secondary, #94a3b8) !important;
}

.disclaimer-text a {
  color: var(--accent-blue, #3b82f6) !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}




