/* ============================================================================
   GovExamPass ก.พ. ภาค ก. 2570 — Warm Brown & Gold Study Suite Stylesheet (Light / Sepia / Dark)
   ============================================================================ */

:root {
  --ocsc-950: #2D1B0E;
  --ocsc-900: #4A2C14;
  --ocsc-800: #6B3E1B;
  --ocsc-700: #854D1E;
  --ocsc-600: #A16207;
  --ocsc-gold: #F59E0B;
  --ocsc-gold-soft: #FEF3C7;
  --bg-body: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --text-main: #0F172A;
  --text-muted: #475569;
  --border-subtle: #E2E8F0;
  --font-size-base: 16px;
}

body[data-theme="sepia"] {
  --bg-body: #F5F0E6;
  --bg-card: #FFFDF8;
  --bg-subtle: #EFE7D8;
  --text-main: #2D241E;
  --text-muted: #5C4E44;
  --border-subtle: #DECBB4;
}

body[data-theme="dark"] {
  --bg-body: #090D16;
  --bg-card: #111827;
  --bg-subtle: #1E293B;
  --text-main: #F1F5F9;
  --text-muted: #CBD5E1;
  --border-subtle: #334155;
}

body[data-font-scale="normal"] { --font-size-base: 16px; }
body[data-font-scale="large"]  { --font-size-base: 18px; }
body[data-font-scale="xlarge"] { --font-size-base: 20px; }

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  max-width: 100%;
  font-family: "Sarabun", system-ui, -apple-system, sans-serif;
  font-size: var(--font-size-base);
  background-color: var(--bg-body);
  color: var(--text-main);
  transition: background-color 0.2s ease, color 0.2s ease;
}

@media (max-width: 767px) {
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

.font-heading,
h1, h2, h3, h4 {
  font-family: "Prompt", "Sarabun", sans-serif;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.ocsc-ico {
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.pc-only-block,
.pc-only-flex,
.pc-only-inline,
.pc-only-inline-flex,
.pc-only-grid {
  display: none !important;
}

@media (min-width: 1024px) {
  .pc-only-block { display: block !important; }
  .pc-only-flex { display: flex !important; }
  .pc-only-inline { display: inline !important; }
  .pc-only-inline-flex { display: inline-flex !important; }
  .pc-only-grid { display: grid !important; }
}

details > summary.docs-summary-clean,
.pos-qual-details > summary {
  list-style: none;
}

details > summary.docs-summary-clean::-webkit-details-marker,
.pos-qual-details > summary::-webkit-details-marker {
  display: none;
}

details[open] > summary .docs-drawer-caret {
  transform: rotate(180deg);
}

/* ============================================================================
   TOP PORTAL SWITCHER (Single-Button Ecosystem Dropdown)
   ============================================================================ */
.portal-switcher-bar {
  position: relative;
  z-index: 45;
  background: #1F1209;
  border-bottom: 1px solid rgba(245, 158, 11, 0.30);
  color: #E2E8F0;
}

.portal-label {
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #FCD34D;
  white-space: nowrap;
  flex-shrink: 0;
}

.portal-current-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #6B3E1B 0%, #2D1B0E 100%);
  border: 1px solid rgba(251, 191, 36, 0.60);
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: #FDE68A;
  white-space: nowrap;
}

.portal-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #FACC15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.28);
  flex-shrink: 0;
}

.portal-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #F8FAFC;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.16s ease;
}

.portal-dropdown-btn:hover,
.portal-dropdown-btn[aria-expanded="true"] {
  background: rgba(107, 62, 27, 0.92);
  border-color: #FBBF24;
  color: #FEF3C7;
}

.portal-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  background: #FBBF24;
  color: #2D1B0E;
  font-family: "Prompt", sans-serif;
  font-size: 10.5px;
  font-weight: 800;
}

.portal-chevron {
  transition: transform 0.18s ease;
}

.portal-dropdown-btn[aria-expanded="true"] .portal-chevron {
  transform: rotate(180deg);
}

.portal-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 340px;
  max-width: calc(100vw - 24px);
  padding: 12px;
  border-radius: 16px;
  background: #FFFFFF;
  border: 1.5px solid #FDE68A;
  box-shadow: 0 22px 45px -12px rgba(45, 27, 14, 0.36);
  z-index: 65;
  color: #0F172A;
}

@media (max-width: 639px) {
  .portal-dropdown-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 44px;
    width: auto;
    max-width: none;
  }
}

.portal-menu-head {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #E2E8F0;
}

.portal-menu-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.portal-arena-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  text-decoration: none;
  color: inherit;
  transition: all 0.16s ease;
}

a.portal-arena-card:hover {
  background: #FFFFFF;
  border-color: #6B3E1B;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -8px rgba(15, 23, 42, 0.25);
}

.portal-arena-card.is-current {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1.5px solid #6B3E1B;
}

.portal-arena-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #FFFFFF;
}

.portal-arena-badge.is-ago {
  background: linear-gradient(135deg, #9F1239 0%, #7F1D1D 100%);
  border: 1px solid #F59E0B;
  color: #FDE68A;
}

.portal-arena-badge.is-coj {
  background: linear-gradient(135deg, #1E40AF 0%, #0F172A 100%);
  border: 1px solid rgba(251, 191, 36, 0.65);
  color: #FDE68A;
}

.portal-arena-badge.is-rd {
  background: linear-gradient(135deg, #14634C 0%, #06281E 100%);
  border: 1px solid rgba(251, 191, 36, 0.65);
  color: #FDE68A;
}

.portal-arena-title {
  display: block;
  font-family: "Prompt", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.25;
}

.portal-arena-sub {
  display: block;
  font-family: "Sarabun", sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #475569;
  line-height: 1.3;
  margin-top: 2px;
}

.portal-arena-tag.is-active {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 9999px;
  background: #6B3E1B;
  color: #FDE68A;
  font-family: "Prompt", sans-serif;
  font-size: 10px;
  font-weight: 700;
}

.portal-arena-ext {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
}

body[data-theme="sepia"] .portal-dropdown-menu {
  background: #FBF7EC;
  border-color: #C7B28A;
  color: #2D241E;
}

body[data-theme="sepia"] .portal-arena-card {
  background: #F3EAD8;
  border-color: #D6C5A3;
}

body[data-theme="dark"] .portal-dropdown-menu {
  background: #0F172A;
  border-color: #334155;
  color: #F1F5F9;
}

body[data-theme="dark"] .portal-menu-head {
  border-bottom-color: #334155;
}

body[data-theme="dark"] .portal-menu-head .text-slate-900 {
  color: #F8FAFC;
}

body[data-theme="dark"] .portal-menu-head .text-slate-500 {
  color: #94A3B8;
}

body[data-theme="dark"] .portal-arena-card {
  background: #1E293B;
  border-color: #334155;
}

body[data-theme="dark"] .portal-arena-card.is-current {
  background: linear-gradient(135deg, #6B3E1B 0%, #2D1B0E 100%);
  border-color: #F59E0B;
}

body[data-theme="dark"] .portal-arena-title {
  color: #F8FAFC;
}

body[data-theme="dark"] .portal-arena-sub,
body[data-theme="dark"] .portal-arena-ext {
  color: #CBD5E1;
}

/* ============================================================================
   STICKY HEADER + DESKTOP NAV + SETTINGS DROPDOWN
   ============================================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(45, 27, 14, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.18);
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 9px;
  color: #FDE68A;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}

@media (min-width: 1024px) {
  .nav-tab {
    font-size: 13px;
    padding: 6px 12px;
  }
}

@media (max-width: 1023px) {
  #vip-header-badge {
    display: none !important;
  }
}

.nav-tab:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
}

.nav-tab.active {
  color: #0F172A;
  background: #FBBF24;
  border-color: #FDE68A;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.header-vip-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  color: #1E1B18;
  border: 1px solid #FDE68A;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.header-vip-pill:hover {
  filter: brightness(1.05);
}

.header-vip-pill.is-vip-active {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border-color: #6EE7B7;
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

.settings-wrap,
.updates-wrap {
  position: relative;
}

.header-updates-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #F8FAFC;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.header-updates-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.updates-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #F43F5E;
  box-shadow: 0 0 0 2px #2D1B0E;
}

.updates-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(370px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: 74vh;
  max-height: 74dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  white-space: normal;
  box-sizing: border-box;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  box-shadow: 0 18px 40px -12px rgba(15, 23, 42, 0.35);
  color: var(--text-main);
  z-index: 80;
}

.settings-pill-btn {
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #F8FAFC;
  cursor: pointer;
  white-space: nowrap;
}

.settings-pill-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.settings-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(260px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 90px);
  max-height: calc(100dvh - 90px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 18px 40px -12px rgba(15, 23, 42, 0.35);
  color: var(--text-main);
  z-index: 80;
}

.updates-panel.hidden,
.settings-panel.hidden,
.settings-dropdown.hidden,
#ocsc-web-alert-banner.hidden,
.ocsc-changelog-strip.hidden {
  display: none !important;
}

.setting-chip {
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.setting-chip.active {
  background: #6B3E1B;
  border-color: #6B3E1B;
  color: #FDE68A;
  font-weight: 700;
}

/* ============================================================================
   INNER SUB-PAGE POSITION BAR (LOCKED CONTEXT CARD + DRAWER)
   ============================================================================ */
.inner-pos-bar {
  position: sticky;
  top: 3.5rem;
  z-index: 30;
  background: var(--bg-body);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.locked-pos-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid #6B3E1B;
  background: var(--bg-card);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.locked-pos-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(107, 62, 27, 0.1);
  border: 1px solid rgba(107, 62, 27, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

@media (max-width: 639px) {
  .inner-pos-bar > div {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .locked-pos-card {
    padding: 6px 10px;
    border-radius: 12px;
    gap: 8px;
  }
  .locked-pos-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }
}

.locked-pos-change-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1.5px solid rgba(107, 62, 27, 0.25);
  background: rgba(107, 62, 27, 0.08);
  color: #6B3E1B;
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.locked-pos-change-btn:hover,
.locked-pos-change-btn[aria-expanded="true"] {
  background: #6B3E1B;
  border-color: #6B3E1B;
  color: #FDE68A;
}

.locked-pos-caret {
  display: inline-block;
  font-size: 11px;
  transition: transform 0.18s ease;
}

.locked-pos-change-btn[aria-expanded="true"] .locked-pos-caret {
  transform: rotate(180deg);
}

.pos-drawer-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pos-drawer-item.active {
  background: #6B3E1B;
  border-color: #6B3E1B;
  color: #FEF3C7;
  font-weight: 700;
}

body[data-theme="dark"] .locked-pos-icon {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.28);
}

body[data-theme="dark"] .locked-pos-change-btn {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.35);
  color: #FDE68A;
}

.pos-chip-sm {
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pos-chip-sm.active {
  background: #6B3E1B;
  border-color: #6B3E1B;
  color: #FEF3C7;
}

/* ============================================================================
   CARDS, HERO & COUNTDOWN
   ============================================================================ */
.saas-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  box-shadow: 0 8px 24px -10px rgba(15, 23, 42, 0.08);
}

.hero-card {
  background: radial-gradient(circle at top right, #854D1E 0%, #42240E 50%, #1F1209 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 1.15rem;
  padding: 1rem;
  color: #FFFFFF;
  box-shadow: 0 16px 36px -16px rgba(45, 27, 14, 0.55);
}

@media (min-width: 640px) {
  .hero-card {
    padding: 1.25rem 1.5rem;
  }
}

.hero-stat-tile {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.7rem;
  padding: 0.42rem 0.5rem;
  backdrop-filter: blur(6px);
}

.hero-stat-num {
  font-family: "Prompt", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.15;
}

@media (min-width: 640px) {
  .hero-stat-num {
    font-size: 1.08rem;
  }
}

.hero-stat-sub {
  font-size: 10px;
  color: #FEF3C7;
  opacity: 0.9;
  margin-top: 1px;
}

/* Slim Compact Countdown Strip */
.countdown-strip {
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(251, 191, 36, 0.42);
  border-radius: 0.9rem;
  padding: 0.55rem 0.75rem;
  backdrop-filter: blur(8px);
}

.cd-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 6px;
}

.cd-pill {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  padding: 5px 4px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.cd-pill--sec {
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(245, 158, 11, 0.14);
}

.cd-num {
  font-family: "Prompt", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: #FFFFFF;
}

@media (min-width: 640px) {
  .cd-num {
    font-size: 1.15rem;
  }
}

.cd-lbl {
  font-size: 10px;
  font-weight: 600;
  color: #FEF3C7;
}

.cd-sep {
  font-family: "Prompt", sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: rgba(253, 230, 138, 0.65);
  flex-shrink: 0;
}

/* ============================================================================
   HOME 3-POSITION SELECTOR (COJ Parity Compact Grid & Contrast)
   ============================================================================ */
.pos-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 7px 9px;
  border-radius: 12px;
  border: 1.5px solid #CBD5E1;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFAFB 100%);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  min-width: 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  transition: all 0.16s ease;
}

body[data-theme="sepia"] .pos-card {
  background: linear-gradient(180deg, #FDFAF3 0%, #F5EBD6 100%);
  border-color: #D6C5A3;
  color: #2D241E;
}

body[data-theme="dark"] .pos-card {
  background: linear-gradient(180deg, #162235 0%, #0F172A 100%);
  border-color: #334155;
  color: #F1F5F9;
}

@media (min-width: 640px) {
  .pos-card {
    padding: 9px 11px;
    gap: 8px;
    min-height: 52px;
  }
}

.pos-card:hover {
  border-color: #854D1E;
  transform: translateY(-1px);
}

.pos-card.active,
body[data-theme="sepia"] .pos-card.active,
body[data-theme="dark"] .pos-card.active {
  background: linear-gradient(135deg, #6B3E1B 0%, #42240E 100%);
  border-color: #FBBF24;
  color: #FFFFFF;
  box-shadow: 0 8px 20px -8px rgba(107, 62, 27, 0.65);
}

.pos-card.active .pos-card-title span,
body[data-theme="sepia"] .pos-card.active .pos-card-title span,
body[data-theme="dark"] .pos-card.active .pos-card-title span {
  color: #FDE68A !important;
}

.pos-card-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(107, 62, 27, 0.09);
  color: #6B3E1B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

@media (min-width: 640px) {
  .pos-card-icon {
    width: 28px;
    height: 28px;
  }
}

body[data-theme="dark"] .pos-card-icon {
  background: rgba(251, 191, 36, 0.14);
  color: #FDE68A;
}

.pos-card.active .pos-card-icon,
body[data-theme="sepia"] .pos-card.active .pos-card-icon,
body[data-theme="dark"] .pos-card.active .pos-card-icon {
  background: rgba(251, 191, 36, 0.2);
  color: #FDE68A;
}

.pos-card-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.pos-card-title {
  display: block;
  font-family: "Prompt", sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.28;
  min-width: 0;
}

.pos-card-mob-meta {
  display: block;
  font-family: "Sarabun", sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  opacity: 1;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-theme="sepia"] .pos-card-mob-meta {
  color: #5C4D3C;
}

body[data-theme="dark"] .pos-card-mob-meta {
  color: #94A3B8;
}

.pos-card.active .pos-card-mob-meta {
  color: #FDE68A !important;
  opacity: 0.96;
}

.pos-card-pc-meta {
  font-family: "Sarabun", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  opacity: 1;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-theme="dark"] .pos-card-pc-meta {
  color: #CBD5E1;
}

.pos-card.active .pos-card-pc-meta {
  color: #FDE68A !important;
  opacity: 0.95;
}

.pos-card-mob-chip {
  flex-shrink: 0;
  white-space: nowrap;
  font-family: "Prompt", sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  color: #6B3E1B;
}

.pos-card.active .pos-card-mob-chip {
  background: rgba(251, 191, 36, 0.22);
  border-color: rgba(251, 191, 36, 0.55);
  color: #FDE68A;
}

@media (min-width: 640px) {
  .pos-card-title {
    font-size: 14px;
  }
}

@media (min-width: 1024px) {
  .pos-card-mob-meta {
    display: none !important;
  }
}

@media (min-width: 1280px) {
  .pos-card-title {
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Home 2-Column PC Workspace (<1024px vertical stack -> >=1024px 4:8 grid) */
.home-pc-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 1024px) {
  .home-pc-workspace {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
  }
  #home-pc-sidebar {
    grid-column: span 4 / span 4;
    position: sticky;
    top: 4.5rem;
  }
  #home-pc-main {
    grid-column: span 8 / span 8;
    min-width: 0;
  }
}

.pos-summary-banner {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-main);
}

@media (min-width: 1024px) {
  #active-pos-summary.pos-summary-banner {
    background: linear-gradient(160deg, #3A2210 0%, #2D1B0E 56%, #0F172A 100%);
    border: 1px solid rgba(251, 191, 36, 0.38);
    color: #F8FAFC;
    padding: 14px 15px;
    border-radius: 1rem;
    box-shadow: 0 16px 34px -16px rgba(45, 27, 14, 0.55);
  }
  #active-pos-summary .pos-meta-chip {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.16);
    color: #FDE68A;
  }
  #active-pos-summary .pos-qual-details summary {
    color: #FCD34D;
  }
  #active-pos-summary .pos-qual-details p {
    color: #E2E8F0 !important;
  }
}

.exec-kicker-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9999px;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.38);
  color: #FDE68A;
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.exec-stat-box {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  padding: 9px 10px;
}

.score-split-track {
  display: flex;
  height: 7px;
  width: 100%;
  border-radius: 9999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
}

.score-split-core {
  background: linear-gradient(90deg, #F59E0B, #D97706);
  height: 100%;
}

.score-split-spec {
  background: linear-gradient(90deg, #F59E0B, #FDE047);
  height: 100%;
}

.readiness-track {
  position: relative;
  height: 10px;
  border-radius: 9999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  overflow: visible;
}

.readiness-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #854D1E 0%, #F59E0B 60%, #10B981 100%);
  transition: width 0.35s ease;
}

.readiness-pass-marker {
  position: absolute;
  left: 60%;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: #0F172A;
}

body[data-theme="dark"] .readiness-pass-marker {
  background: #FDE68A;
}

.readiness-kpi-tile {
  padding: 8px 6px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.home-quote-card {
  border-radius: 1rem;
  border: 1px solid rgba(217, 119, 6, 0.32);
  background: linear-gradient(145deg, #FFFBEB 0%, #FFFBEB 100%);
  color: #2D1B0E;
  box-shadow: 0 8px 22px -14px rgba(107, 62, 27, 0.25);
}

body[data-theme="sepia"] .home-quote-card {
  background: linear-gradient(145deg, #FBF3E0 0%, #F6E9D8 100%);
}

body[data-theme="dark"] .home-quote-card {
  background: linear-gradient(145deg, rgba(120, 53, 15, 0.28) 0%, rgba(45, 27, 14, 0.42) 100%);
  border-color: rgba(251, 191, 36, 0.28);
  color: #FEF3C7;
}

.pos-summary-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pos-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-weight: 600;
}

.pos-qual-details summary {
  cursor: pointer;
  margin-top: 6px;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: #6B3E1B;
  user-select: none;
}

body[data-theme="dark"] .pos-qual-details summary {
  color: #FBBF24;
}

.part-seg-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  gap: 3px;
}

@media (min-width: 640px) {
  .part-seg-group {
    display: inline-flex;
  }
}

.part-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 9px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.part-seg-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 10.5px;
  font-weight: 700;
}

.part-seg-btn.active {
  background: #6B3E1B;
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(107, 62, 27, 0.25);
}

.part-seg-btn.active .part-seg-cnt {
  background: rgba(251, 191, 36, 0.24);
  color: #FDE68A;
}

body[data-theme="dark"] .part-seg-cnt {
  background: rgba(255, 255, 255, 0.12);
}

/* Distinct 2-Zone Subject Cards — Clean Compact Divided Rows */
.subject-zone-card {
  border-radius: 1rem;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: 0 10px 26px -12px rgba(15, 23, 42, 0.15);
}

.subject-zone-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 13px;
  color: #FFFFFF;
}

.subject-zone-head--core {
  background: linear-gradient(135deg, #6B3E1B 0%, #2D1B0E 100%);
  border-bottom: 2px solid #F59E0B;
}

.subject-zone-head--spec {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  border-bottom: 2px solid #F59E0B;
}

.subject-zone-body--core,
.subject-zone-body--spec {
  background: var(--bg-card);
  padding: 0;
  display: block;
}

.subject-clean-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8.5px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  transition: background-color 0.14s ease;
}

.subject-clean-row:last-child {
  border-bottom: none;
}

.subject-clean-row:hover {
  background: var(--bg-subtle);
}

.subject-clean-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.subject-code-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 7px;
  border-radius: 7px;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.subject-code-pill--core {
  background: #F5E6D3;
  color: #6B3E1B;
  border: 1px solid rgba(107, 62, 27, 0.25);
}

.subject-code-pill--spec {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid rgba(180, 83, 9, 0.28);
}

body[data-theme="dark"] .subject-code-pill--core {
  background: rgba(146, 64, 14, 0.35);
  color: #FCD34D;
  border-color: rgba(251, 191, 36, 0.4);
}

body[data-theme="dark"] .subject-code-pill--spec {
  background: rgba(217, 119, 6, 0.32);
  color: #FDE68A;
  border-color: rgba(251, 191, 36, 0.4);
}

.subject-clean-info {
  flex: 1 1 auto;
  min-width: 0;
}

.subject-clean-title {
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-main);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 640px) {
  .subject-clean-title {
    -webkit-line-clamp: 1;
    font-size: 13.5px;
  }
}

.subject-inline-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.subject-inline-range {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.78;
}

.subject-inline-bar {
  width: 68px;
  height: 5px;
  border-radius: 9999px;
  background: var(--border-subtle);
  overflow: hidden;
  flex-shrink: 0;
}

.subject-inline-bar > span {
  display: block;
  height: 100%;
  border-radius: 9999px;
}

.subject-inline-fill--core {
  background: linear-gradient(90deg, #854D1E, #F59E0B);
}

.subject-inline-fill--spec {
  background: linear-gradient(90deg, #D97706, #FBBF24);
}

.subject-clean-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.subject-quiz-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 9999px;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.subject-quiz-pill:hover {
  transform: translateY(-1px);
  filter: brightness(0.97);
}

.subject-quiz-pill--core {
  background: #FFFBEB;
  color: #6B3E1B;
  border: 1px solid rgba(107, 62, 27, 0.25);
}

.subject-quiz-pill--spec {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid rgba(217, 119, 6, 0.35);
}

body[data-theme="dark"] .subject-quiz-pill--core {
  background: rgba(107, 62, 27, 0.45);
  color: #FDE68A;
  border-color: rgba(251, 191, 36, 0.45);
}

body[data-theme="dark"] .subject-quiz-pill--spec {
  background: rgba(180, 83, 9, 0.4);
  color: #FDE68A;
  border-color: rgba(251, 191, 36, 0.45);
}

.subject-chevron-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* Sequential Reader Control Hub & Collapsible Tools Drawer */
.seq-control-hub {
  border-left: 4px solid #6B3E1B;
}

.seq-subject-banner {
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
}

.seq-banner-bar {
  height: 5px;
  width: 100%;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  overflow: hidden;
}

body[data-theme="dark"] .seq-banner-bar {
  background: rgba(255, 255, 255, 0.14);
}

.seq-banner-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6B3E1B, #F59E0B);
}

.seq-law-select {
  width: 100%;
  padding: 9px 34px 9px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border-subtle);
  background-color: var(--bg-subtle);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 14px 14px;
  -webkit-appearance: none;
  appearance: none;
  text-overflow: ellipsis;
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.seq-action-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

@media (max-width: 639px) {
  .seq-action-row .seq-reset-label {
    display: none;
  }
  .seq-action-row .seq-btn-tools,
  .seq-action-row .seq-btn-continue,
  .seq-action-row .seq-btn-practice,
  .seq-action-row .seq-btn-reset {
    padding: 8px 8px;
    font-size: 11.5px;
  }
}

@media (min-width: 1024px) {
  .seq-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }
}

.seq-btn-tools {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 11px;
  border: 1.5px solid #1E293B;
  background: #1E293B;
  color: #FFFFFF;
  font-family: "Prompt", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seq-btn-tools[aria-expanded="true"] {
  background: #6B3E1B;
  border-color: #6B3E1B;
  color: #FDE68A;
}

.seq-tools-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #F59E0B;
  color: #0F172A;
  font-size: 11px;
  font-weight: 800;
}

.seq-btn-practice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1.5px solid #F59E0B;
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  color: #111827;
  font-family: "Prompt", sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 3px 10px -4px rgba(245, 158, 11, 0.55);
  transition: transform 0.15s ease;
}

.seq-btn-practice:hover {
  transform: translateY(-1px);
}

.seq-btn-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1.5px solid rgba(225, 29, 72, 0.25);
  background: rgba(255, 251, 235, 0.85);
  color: #854D1E;
  font-family: "Prompt", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seq-btn-reset:hover {
  background: #FEF3C7;
}

body[data-theme="dark"] .seq-btn-reset {
  background: rgba(133, 77, 30, 0.24);
  border-color: rgba(251, 191, 36, 0.35);
  color: #FCD34D;
}

.seq-btn-official,
.seq-btn-focus {
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seq-btn-official:hover,
.seq-btn-focus:hover {
  border-color: #6B3E1B;
  color: #6B3E1B;
}

.seq-btn-focus[aria-pressed="true"] {
  background: #0F172A;
  border-color: #0F172A;
  color: #FDE68A;
}

body[data-theme="dark"] .seq-btn-official:hover,
body[data-theme="dark"] .seq-btn-focus:hover {
  border-color: #FBBF24;
  color: #FDE68A;
}

body[data-theme="dark"] .seq-btn-focus[aria-pressed="true"] {
  background: #F59E0B;
  border-color: #F59E0B;
  color: #0F172A;
}

@media (min-width: 1024px) {
  #seq-workspace-row.is-focus-mode #seq-sidebar {
    display: none !important;
  }
  #seq-workspace-row.is-focus-mode #seq-main-col {
    max-width: 58rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
}

.seq-tools-drawer {
  display: none;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}

.seq-tools-drawer.is-open {
  display: block;
}

@media (min-width: 1024px) {
  .seq-tools-drawer {
    display: block !important;
  }
}

.seq-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 12px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-subtle);
  padding: 2px 8px;
}

.seq-search-ico {
  font-size: 13px;
  margin-right: 6px;
  flex-shrink: 0;
}

.seq-search-input {
  width: 100%;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 7px 4px;
  font-size: 13.5px;
  color: var(--text-main);
}

.seq-search-clear {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: none;
  background: rgba(100, 116, 139, 0.16);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.seq-chip-row,
.seq-sol-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.seq-drawer-label {
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 34px;
}

.seq-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seq-chip-btn.active {
  background: #6B3E1B;
  border-color: #6B3E1B;
  color: #FEF3C7;
  font-weight: 700;
}

.seq-chip-cnt {
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 10.5px;
  font-weight: 800;
}

.seq-chip-btn.active .seq-chip-cnt {
  background: rgba(251, 191, 36, 0.25);
  color: #FEF3C7;
}

.seq-sol-seg-group {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  gap: 3px;
}

.seq-sol-seg {
  padding: 5px 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seq-sol-seg.active {
  background: var(--bg-card);
  color: #6B3E1B;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

body[data-theme="dark"] .seq-sol-seg.active {
  color: #FDE68A;
}

.doc-link-card {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.doc-link-card:hover {
  border-color: #854D1E;
}

.doc-link-primary {
  background: rgba(107, 62, 27, 0.08);
  border-color: rgba(107, 62, 27, 0.25);
}

details[open] .docs-drawer-hint {
  color: #854D1E;
}

/* ============================================================================
   MOBILE BOTTOM NAVIGATION (< 768px) — Warm Brown & Gold Theme Matched
   ============================================================================ */
.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: linear-gradient(180deg, #42240E 0%, #241307 100%);
  border-top: 1.5px solid rgba(251, 191, 36, 0.55);
  box-shadow: 0 -8px 26px rgba(15, 23, 42, 0.42);
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

.mbn-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  border-radius: 11px;
  margin: 5px 3px;
  padding: 4px 2px;
  color: rgba(255, 251, 235, 0.78);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mbn-icon {
  font-size: 1.12rem;
  line-height: 1.1;
}

.mbn-label {
  font-family: "Prompt", sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.mbn-tab.active {
  color: #FDE68A;
  background: rgba(251, 191, 36, 0.16);
}

.mbn-tab.active .mbn-label {
  font-weight: 700;
}

.mbn-tab.active::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 22%;
  right: 22%;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: #FBBF24;
  box-shadow: 0 1px 8px rgba(251, 191, 36, 0.75);
}

/* ============================================================================
   QUESTION CARDS (6 JEWEL-TONED HEADER THEMES) & RESPONSIVE CHOICE GRID
   ============================================================================ */
.question-card-frame {
  --q-accent: #854D1E;
  --q-top-bar: #FBBF24;
  --q-stem-bg: rgba(248, 250, 252, 0.9);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 8px 20px -14px rgba(15, 23, 42, 0.22);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.q-theme-1 { --q-accent: #854D1E; --q-top-bar: #FBBF24; --q-stem-bg: rgba(254, 243, 199, 0.45); }
.q-theme-2 { --q-accent: #1D4ED8; --q-top-bar: #38BDF8; --q-stem-bg: rgba(239, 246, 255, 0.65); }
.q-theme-3 { --q-accent: #059669; --q-top-bar: #34D399; --q-stem-bg: rgba(236, 253, 245, 0.6); }
.q-theme-4 { --q-accent: #7C3AED; --q-top-bar: #C084FC; --q-stem-bg: rgba(245, 243, 255, 0.65); }
.q-theme-5 { --q-accent: #0D9488; --q-top-bar: #22D3EE; --q-stem-bg: rgba(240, 253, 250, 0.65); }
.q-theme-6 { --q-accent: #C2410C; --q-top-bar: #FDE047; --q-stem-bg: rgba(255, 247, 237, 0.68); }

.q-card-banner {
  position: relative;
  z-index: 1;
  padding: 9px 11px;
  border-top: 3.5px solid var(--q-top-bar);
  color: #FFFFFF;
}

@media (min-width: 768px) {
  .q-card-banner {
    padding: 13px 18px;
  }
}

.q-theme-1 .q-card-banner { background: linear-gradient(135deg, #6B3E1B 0%, #2D1B0E 100%); }
.q-theme-2 .q-card-banner { background: linear-gradient(135deg, #1E3A8A 0%, #172554 100%); }
.q-theme-3 .q-card-banner { background: linear-gradient(135deg, #065F46 0%, #022C22 100%); }
.q-theme-4 .q-card-banner { background: linear-gradient(135deg, #5B21B6 0%, #2E1065 100%); }
.q-theme-5 .q-card-banner { background: linear-gradient(135deg, #0F766E 0%, #0F172A 100%); }
.q-theme-6 .q-card-banner { background: linear-gradient(135deg, #9A3412 0%, #431407 100%); }

.q-num-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #FBBF24;
  color: #111827;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.q-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FEF3C7;
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.q-bm-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(15, 23, 42, 0.28);
  color: #F8FAFC;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.q-bm-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.q-bm-btn.is-bm {
  background: #FBBF24;
  border-color: #F59E0B;
  color: #111827;
  font-weight: 800;
}

.q-ref-pill {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.96);
  font-size: 11.5px;
  line-height: 1.35;
}

.q-body {
  position: relative;
  z-index: 1;
  padding: 13px 14px 15px;
}

@media (min-width: 768px) {
  .q-body {
    padding: 16px 18px 18px;
  }
}

.q-stem-box {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  border-left: 3.5px solid var(--q-accent);
  background: var(--q-stem-bg);
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.62;
}

.q-choices-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding-top: 2px;
}

@media (min-width: 1024px) {
  .q-choices-grid.q-choices-2col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

body[data-theme="sepia"] .q-stem-box {
  background: #FBF6EA;
}

body[data-theme="dark"] .q-stem-box {
  background: rgba(15, 23, 42, 0.65);
  color: #F8FAFC;
}

.q-stem-line {
  margin: 0 0 6px 0;
}

.q-stem-line:last-child {
  margin-bottom: 0;
}

.q-stem-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  -webkit-overflow-scrolling: touch;
}

.q-stem-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
}

.q-stem-table th {
  background: rgba(107, 62, 27, 0.10);
  color: var(--ocsc-900);
  font-weight: 700;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  white-space: nowrap;
}

.q-stem-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.q-stem-table tr:last-child td {
  border-bottom: 0;
}

.q-stem-table tbody tr:nth-child(even) {
  background: rgba(107, 62, 27, 0.035);
}

.q-stem-table .q-num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body[data-theme="sepia"] .q-stem-table th {
  background: rgba(133, 77, 30, 0.14);
  color: #4A2C14;
}

body[data-theme="dark"] .q-stem-table-wrap {
  border-color: rgba(255, 255, 255, 0.14);
}

body[data-theme="dark"] .q-stem-table th {
  background: rgba(245, 158, 11, 0.18);
  color: #FDE68A;
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

body[data-theme="dark"] .q-stem-table td {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: #E2E8F0;
}

body[data-theme="dark"] .q-stem-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.035);
}

body[data-theme="dark"] .q-card-banner {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.98em;
  line-height: 1.54;
  cursor: pointer;
  transition: all 0.15s ease;
}

.choice-btn:hover:not(:disabled) {
  border-color: #854D1E;
  background: var(--bg-subtle);
}

.choice-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

.choice-selected {
  border-color: #6B3E1B !important;
  background: #FFFBEB !important;
  color: #2D1B0E !important;
  font-weight: 600;
}

.choice-selected .choice-letter-badge {
  background: #6B3E1B;
  border-color: #6B3E1B;
  color: #FFFFFF;
}

.choice-correct {
  border-color: #059669 !important;
  background: #ECFDF5 !important;
  color: #064E3B !important;
  font-weight: 600;
}

.choice-correct .choice-letter-badge {
  background: #059669;
  border-color: #059669;
  color: #FFFFFF;
}

.choice-wrong {
  border-color: #DC2626 !important;
  background: #FEF2F2 !important;
  color: #7F1D1D !important;
}

.choice-wrong .choice-letter-badge {
  background: #DC2626;
  border-color: #DC2626;
  color: #FFFFFF;
}

body[data-theme="dark"] .choice-selected {
  background: rgba(133, 77, 30, 0.35) !important;
  color: #FDE68A !important;
  border-color: #F59E0B !important;
}

body[data-theme="dark"] .choice-correct {
  background: rgba(5, 150, 105, 0.28) !important;
  color: #A7F3D0 !important;
  border-color: #34D399 !important;
}

body[data-theme="dark"] .choice-wrong {
  background: rgba(220, 38, 38, 0.25) !important;
  color: #FECACA !important;
  border-color: #F87171 !important;
}

.solution-bottom-box {
  border-radius: 12px;
  padding: 14px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
}

body[data-theme="sepia"] .solution-bottom-box {
  background: #F8F2E4;
  border-color: #DECBB4;
}

body[data-theme="dark"] .solution-bottom-box {
  background: #0F172A;
  border-color: #334155;
}

.q-card-foot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 11.5px;
}

.q-law-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-family: "Prompt", sans-serif;
  font-weight: 600;
  text-decoration: none;
}

.q-law-ext-link:hover {
  color: #6B3E1B;
  text-decoration: underline;
}

body[data-theme="dark"] .q-law-ext-link:hover {
  color: #FDE68A;
}

.q-report-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.q-report-btn:hover {
  border-color: #BE123C;
  color: #BE123C;
}

body[data-theme="dark"] .q-report-btn:hover {
  border-color: #FCD34D;
  color: #FCD34D;
}

/* ============================================================================
   COLLAPSIBLE CHEAT SHEET ACCORDIONS + 15 DISTINCT COLOR THEMES + VIP LOCK
   ============================================================================ */
.cs-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: rgba(148, 163, 184, 0.22);
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cs-search-clear.hidden {
  display: none !important;
}

.cs-scope-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cs-scope-btn.active {
  background: linear-gradient(135deg, #6B3E1B, #2D1B0E);
  border-color: #6B3E1B;
  color: #FDE68A;
  box-shadow: 0 3px 10px rgba(107, 62, 27, 0.25);
}

.cs-scope-sub-btn {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.cs-scope-sub-btn:hover {
  border-color: #854D1E;
}

.cs-subject-pills {
  display: flex;
  flex-wrap: wrap;
  overflow-x: visible;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}

@media (max-width: 639px) {
  .cs-subject-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .cs-subject-pills::-webkit-scrollbar {
    display: none;
  }
  .cs-subject-pills .cs-subj-pill {
    flex-shrink: 0;
  }
}

@media (min-width: 640px) {
  .cs-subject-pills {
    gap: 6px;
  }
}

.cs-subj-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.cs-subj-pill:hover {
  border-color: #854D1E;
  color: var(--text-main);
}

.cs-subj-pill.active {
  background: #0F172A;
  border-color: #0F172A;
  color: #FDE68A;
  font-weight: 700;
}

.cs-pill-vip-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 999px;
  background: #F59E0B;
  color: #FFFFFF;
  font-family: "Prompt", sans-serif;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.cs-subj-pill.active .cs-pill-vip-tag {
  background: #FBBF24;
  color: #0F172A;
}

body[data-theme="dark"] .cs-subj-pill.active {
  background: #F59E0B;
  border-color: #F59E0B;
  color: #0F172A;
}

body[data-theme="dark"] .cs-subj-pill.active .cs-pill-vip-tag {
  background: #0F172A;
  color: #FDE68A;
}

@media (max-width: 419px) {
  .cs-scope-btn {
    padding: 5.5px 10px;
    font-size: 11.5px;
  }
  .cs-scope-sub-btn {
    padding: 5.5px 9px;
    font-size: 11px;
  }
  .cs-subj-pill {
    padding: 4.5px 9px;
    font-size: 11px;
  }
}

.cs-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-radius: 12px;
  font-family: "Prompt", sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.cs-section-heading--part1 {
  background: linear-gradient(90deg, rgba(107, 62, 27, 0.12), rgba(107, 62, 27, 0.03));
  color: #6B3E1B;
  border-left: 4px solid #6B3E1B;
}

.cs-section-heading--part2 {
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.14), rgba(15, 23, 42, 0.04));
  color: #92400E;
  border-left: 4px solid #D97706;
}

body[data-theme="dark"] .cs-section-heading--part1 {
  background: rgba(107, 62, 27, 0.28);
  color: #FDE68A;
}

body[data-theme="dark"] .cs-section-heading--part2 {
  background: rgba(217, 119, 6, 0.22);
  color: #FDE68A;
}

.cheatsheet-card {
  --cs-grad-start: #6B3E1B;
  --cs-grad-end: #2D1B0E;
  --cs-th-bg: #FFFBEB;
  --cs-th-text: #6B3E1B;
  --cs-border-tint: rgba(107, 62, 27, 0.28);
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  border: 1.5px solid var(--cs-border-tint);
  background: var(--bg-card);
  box-shadow: 0 8px 22px -12px rgba(15, 23, 42, 0.16);
}

/* 15 Distinct Harmonious Subject Themes */
.cs-theme-1  { --cs-grad-start: #6B3E1B; --cs-grad-end: #2D1B0E; --cs-th-bg: #FFFBEB; --cs-th-text: #6B3E1B; --cs-border-tint: #F59E0B; }
.cs-theme-2  { --cs-grad-start: #3730A3; --cs-grad-end: #1E1B4B; --cs-th-bg: #EEF2FF; --cs-th-text: #312E81; --cs-border-tint: #818CF8; }
.cs-theme-3  { --cs-grad-start: #0369A1; --cs-grad-end: #0C4A6E; --cs-th-bg: #E0F2FE; --cs-th-text: #075985; --cs-border-tint: #38BDF8; }
.cs-theme-4  { --cs-grad-start: #B45309; --cs-grad-end: #78350F; --cs-th-bg: #FEF3C7; --cs-th-text: #92400E; --cs-border-tint: #FBBF24; }
.cs-theme-5  { --cs-grad-start: #BE123C; --cs-grad-end: #6B3E1B; --cs-th-bg: #FEF3C7; --cs-th-text: #854D1E; --cs-border-tint: #F43F5E; }
.cs-theme-6  { --cs-grad-start: #1D4ED8; --cs-grad-end: #1E3A8A; --cs-th-bg: #DBEAFE; --cs-th-text: #1E40AF; --cs-border-tint: #60A5FA; }
.cs-theme-7  { --cs-grad-start: #854D1E; --cs-grad-end: #4A2C14; --cs-th-bg: #FEF3C7; --cs-th-text: #6B3E1B; --cs-border-tint: #34D399; }
.cs-theme-8  { --cs-grad-start: #0F766E; --cs-grad-end: #134E4A; --cs-th-bg: #CCFBF1; --cs-th-text: #115E59; --cs-border-tint: #2DD4BF; }
.cs-theme-9  { --cs-grad-start: #6D28D9; --cs-grad-end: #4C1D95; --cs-th-bg: #EDE9FE; --cs-th-text: #5B21B6; --cs-border-tint: #A78BFA; }
.cs-theme-10 { --cs-grad-start: #0E7490; --cs-grad-end: #164E63; --cs-th-bg: #CFFAFE; --cs-th-text: #155E75; --cs-border-tint: #22D3EE; }
.cs-theme-11 { --cs-grad-start: #A21CAF; --cs-grad-end: #701A75; --cs-th-bg: #FAE8FF; --cs-th-text: #86198F; --cs-border-tint: #E879F9; }
.cs-theme-12 { --cs-grad-start: #15803D; --cs-grad-end: #14532D; --cs-th-bg: #DCFCE7; --cs-th-text: #166534; --cs-border-tint: #4ADE80; }
.cs-theme-13 { --cs-grad-start: #334155; --cs-grad-end: #0F172A; --cs-th-bg: #E2E8F0; --cs-th-text: #1E293B; --cs-border-tint: #64748B; }
.cs-theme-14 { --cs-grad-start: #C2410C; --cs-grad-end: #7C2D12; --cs-th-bg: #FFEDD5; --cs-th-text: #9A3412; --cs-border-tint: #FB923C; }
.cs-theme-15 { --cs-grad-start: #7E22CE; --cs-grad-end: #3B0764; --cs-th-bg: #F3E8FF; --cs-th-text: #6B21A8; --cs-border-tint: #C084FC; }

.cs-accordion-head {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  background: linear-gradient(135deg, var(--cs-grad-start), var(--cs-grad-end));
  border: none;
  text-align: left;
  cursor: pointer;
  color: #FFFFFF;
  transition: filter 0.15s ease;
}

.cs-accordion-head:hover {
  filter: brightness(1.06);
}

.cs-head-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.cs-kicker-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FDE68A;
  font-family: "Prompt", sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
}

.cs-accordion-title {
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  font-size: 0.94rem;
  color: #FFFFFF;
  line-height: 1.35;
}

.cs-accordion-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cs-free-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 9999px;
  background: #10B981;
  color: #FFFFFF;
  font-family: "Prompt", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
}

.cs-chevron {
  font-size: 0.95rem;
  color: #FDE68A;
  transition: transform 0.2s ease;
}

.cheatsheet-card.is-open .cs-chevron {
  transform: rotate(180deg);
}

.cs-accordion-body {
  display: none;
  position: relative;
  padding: 14px 15px;
  font-size: 0.88em;
}

.cheatsheet-card.is-open .cs-accordion-body {
  display: block;
}

.cheatsheet-card th {
  font-family: "Prompt", sans-serif;
  font-size: 0.85em;
}

.cs-thead-row th {
  background: var(--cs-th-bg);
  color: var(--cs-th-text);
  border-color: var(--border-subtle);
  font-weight: 800;
}

body[data-theme="dark"] .cs-thead-row th {
  background: #1E293B;
  color: #FDE68A;
  border-color: #334155;
}

.cs-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  margin-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.cs-act-btn {
  padding: 6px 12px;
  border-radius: 9px;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease;
}

.cs-act-btn:hover {
  transform: translateY(-1px);
}

.cs-act-read {
  background: var(--cs-grad-start);
  color: #FFFFFF;
}

.cs-act-quiz {
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.cs-act-official {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-muted);
  text-decoration: none;
}

.cs-act-official:hover {
  border-color: #6B3E1B;
  color: #6B3E1B;
}

body[data-theme="dark"] .cs-act-official:hover {
  border-color: #FDE68A;
  color: #FDE68A;
}

.watermark-card {
  position: relative;
}

.watermark-stamp {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Prompt", sans-serif;
  font-weight: 800;
  font-size: clamp(1.1rem, 2.8vw, 2rem);
  color: rgba(107, 62, 27, 0.05);
  transform: rotate(-16deg);
  user-select: none;
}

.cs-vip-lock-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-family: "Prompt", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #FFFFFF;
}

.cs-vip-lock-pill.is-unlocked {
  background: #10B981;
  color: #FFFFFF;
}

.cs-table-lock-wrap {
  position: relative;
}

.is-cs-vip-locked .cs-table-lock-wrap {
  max-height: 280px;
  min-height: 180px;
  overflow: hidden;
  border-radius: 12px;
  position: relative;
}

.is-cs-vip-locked .cs-md-content .cs-trap-box,
.is-cs-vip-locked .cs-md-content .cs-ref-box,
.is-cs-vip-locked .cs-md-content .cs-exam-meta-note,
.is-cs-vip-locked .cs-md-content .cs-subhead,
.is-cs-vip-locked .cs-md-content .cs-subhead-sm,
.is-cs-vip-locked .cs-md-content .cs-divider,
.is-cs-vip-locked .cs-md-content .overflow-x-auto {
  display: none !important;
}

.is-cs-vip-locked .cs-md-content .cs-quick-box li:nth-child(n+3) {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

.cheatsheet-card[data-cs-pos="archived-cs"] {
  display: none !important;
}

.cs-vip-blurred-row td {
  filter: blur(5px);
  user-select: none;
}

.cs-vip-hidden-row {
  display: none !important;
}

.cs-vip-lock-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 2.2rem 1rem 1.15rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.96) 44%, #FFFFFF 100%);
  text-align: center;
}

body[data-theme="dark"] .cs-vip-lock-overlay {
  background: linear-gradient(to bottom, rgba(17, 24, 39, 0) 0%, rgba(17, 24, 39, 0.96) 44%, #111827 100%);
}

body[data-theme="sepia"] .cs-vip-lock-overlay {
  background: linear-gradient(to bottom, rgba(255, 253, 248, 0) 0%, rgba(255, 253, 248, 0.96) 44%, #FFFDF8 100%);
}

body[data-theme="dark"] .cs-vip-lock-overlay div {
  color: #FDE68A !important;
}

@media (max-width: 639px) {
  .cheatsheet-card table,
  .cheatsheet-card tbody {
    display: block;
    width: 100%;
  }
  .cheatsheet-card thead {
    display: none;
  }
  .cheatsheet-card tbody tr:not(.cs-vip-hidden-row) {
    display: block;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 11px;
    padding: 10px 11px;
    margin-bottom: 8px;
    background: var(--bg-subtle);
  }
  .cheatsheet-card tbody tr:last-child {
    margin-bottom: 0;
  }
  .cheatsheet-card tbody td {
    display: block;
    width: 100%;
    border: none !important;
    padding: 0 !important;
    font-size: 12.5px;
    line-height: 1.55;
  }
  .cheatsheet-card tbody td:nth-child(1) {
    font-family: "Prompt", sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--cs-th-text);
    padding-bottom: 5px !important;
    margin-bottom: 6px;
    border-bottom: 1px dashed var(--border-subtle) !important;
  }
  .cheatsheet-card tbody td:nth-child(2) {
    padding-bottom: 6px !important;
    color: var(--text-main);
  }
  .cheatsheet-card tbody td:not(:first-child) {
    padding-bottom: 5px !important;
    margin-bottom: 4px;
    color: var(--text-main);
  }
  .cheatsheet-card tbody td:last-child {
    padding-bottom: 0 !important;
    margin-bottom: 0;
  }
  .cheatsheet-card tbody td[data-label]:not(:first-child)::before {
    content: attr(data-label) " : ";
    display: block;
    margin-bottom: 3px;
    font-family: "Prompt", sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--cs-th-text);
  }
  body[data-theme="dark"] .cheatsheet-card tbody td:nth-child(1),
  body[data-theme="dark"] .cheatsheet-card tbody td[data-label]:not(:first-child)::before {
    color: #FDE68A !important;
  }
}

/* Mock Exam Prev/Next Stepper Buttons */
.exam-step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  font-family: "Prompt", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.exam-step-btn--prev {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-main);
}

.exam-step-btn--next {
  background: linear-gradient(135deg, #6B3E1B, #2D1B0E);
  border: 1.5px solid #6B3E1B;
  color: #FDE68A;
  box-shadow: 0 3px 8px rgba(107, 62, 27, 0.25);
}

.exam-step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ============================================================================
   FULL-BANK PRACTICE & TIMED MOCK EXAM ENGINE
   ============================================================================ */
.exam-setup-card {
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 8.5px;
}

@media (min-width: 640px) {
  .exam-setup-card {
    padding: 20px 22px;
    gap: 14px;
  }
}

.exam-resume-card.hidden {
  display: none !important;
}

.exam-resume-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 13px;
  border: 1.5px solid #F59E0B;
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  color: #451A03;
}

@media (min-width: 640px) {
  .exam-resume-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 15px;
  }
}

.exam-resume-copy {
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
}

.exam-resume-title {
  font-family: "Prompt", sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.35;
  color: #451A03;
}

.exam-resume-meta {
  font-size: 11.5px;
  color: #78350F;
  margin-top: 2px;
  line-height: 1.35;
}

.exam-resume-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .exam-resume-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
}

.exam-resume-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 10px;
  border: none;
  background: #F59E0B;
  color: #0F172A;
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.22);
}

.exam-resume-primary-btn:hover {
  background: #FBBF24;
}

.exam-resume-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid rgba(120, 53, 15, 0.25);
  background: #FFFFFF;
  color: #475569;
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.exam-resume-secondary-btn:hover {
  background: #F8FAFC;
}

.exam-setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border-subtle);
}

.exam-setup-title {
  font-family: "Prompt", sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin: 0;
}

@media (min-width: 640px) {
  .exam-setup-title {
    font-size: 1.32rem;
  }
}

.exam-access-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(107, 62, 27, 0.08);
  border: 1px solid rgba(107, 62, 27, 0.22);
  color: #6B3E1B;
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.exam-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

@media (min-width: 768px) {
  .exam-config-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 14px;
    align-items: start;
  }
}

.exam-field-label {
  display: block;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.exam-select {
  width: 100%;
  min-width: 0;
  padding: 9px 34px 9px 11px;
  border-radius: 11px;
  border: 1.5px solid var(--border-subtle);
  background-color: var(--bg-subtle);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 14px 14px;
  -webkit-appearance: none;
  appearance: none;
  text-overflow: ellipsis;
  color: var(--text-main);
  font-family: "Sarabun", sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
}

.exam-select:focus {
  outline: none;
  border-color: #854D1E;
}

.exam-scope-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  padding-top: 2px;
}

.exam-scope-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.exam-scope-meta strong {
  color: var(--text-main);
}

.exam-unlock-mini-btn {
  display: inline-flex;
  align-items: center;
  padding: 2.5px 8px;
  border-radius: 7px;
  border: none;
  background: #FBBF24;
  color: #0F172A;
  font-family: "Prompt", sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.exam-scope-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.exam-mini-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.exam-mini-link:hover {
  border-color: #854D1E;
}

.exam-mode-seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border-radius: 11px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.exam-mode-btn {
  padding: 8px 6px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all 0.15s ease;
}

.exam-mode-btn.active {
  background: #6B3E1B;
  color: #FDE68A;
  font-weight: 700;
  box-shadow: 0 2px 8px -2px rgba(107, 62, 27, 0.35);
}

.exam-size-seg {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.exam-size-btn {
  padding: 6.5px 3px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all 0.15s ease;
}

@media (min-width: 640px) {
  .exam-size-btn {
    padding: 7px 6px;
    font-size: 12px;
  }
}

.exam-size-btn.active {
  background: #6B3E1B;
  color: #FDE68A;
  box-shadow: 0 2px 8px -2px rgba(107, 62, 27, 0.35);
}

.exam-tier-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  border-radius: 13px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.exam-tier-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exam-tier-title {
  font-family: "Prompt", sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.3;
}

.exam-tier-count {
  font-weight: 800;
}

.exam-tier-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.exam-tier-card:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #854D1E;
  box-shadow: 0 10px 22px -14px rgba(107, 62, 27, 0.38);
}

.exam-tier-card:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.exam-tier-card--subject {
  background: linear-gradient(135deg, rgba(107, 62, 27, 0.06), rgba(248, 250, 252, 0.95));
  border-color: rgba(107, 62, 27, 0.28);
}

.exam-tier-card--subject .exam-tier-title {
  color: #2D1B0E;
}

.exam-tier-card--all {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(254, 243, 199, 0.45));
  border-color: rgba(245, 158, 11, 0.65);
}

.exam-tier-card--all .exam-tier-title {
  color: #451A03;
}

.exam-tier-cta {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 9999px;
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.exam-tier-cta--crimson {
  background: #6B3E1B;
  color: #FEF3C7;
}

.exam-tier-cta--gold {
  background: #F59E0B;
  color: #0F172A;
}

.exam-targeted-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.exam-targeted-bar .exam-filter-chip {
  grid-column: span 2;
}

@media (min-width: 640px) {
  .exam-targeted-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
  }
  .exam-targeted-bar .exam-filter-chip {
    grid-column: auto;
    margin-left: auto;
  }
}

.exam-target-btn,
.exam-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.14s ease;
}

@media (min-width: 640px) {
  .exam-target-btn,
  .exam-filter-chip {
    background: var(--bg-card);
    padding: 7px 12px;
    font-size: 12px;
  }
}

.exam-target-btn:hover:not(:disabled),
.exam-filter-chip:hover {
  border-color: #854D1E;
}

.exam-target-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.exam-filter-chip.active {
  background: #6B3E1B;
  border-color: #6B3E1B;
  color: #FDE68A;
}

.exam-advanced-details {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 9px 12px;
  background: var(--bg-subtle);
}

.exam-advanced-summary {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.exam-advanced-summary::-webkit-details-marker {
  display: none;
}

.exam-advanced-title {
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.exam-settings-pill {
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: "Prompt", sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-history-more-btn {
  list-style: none;
  cursor: pointer;
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 2px 4px;
  user-select: none;
}

.exam-history-more-btn::-webkit-details-marker {
  display: none;
}

.exam-runner-head {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 640px) {
  .exam-runner-head {
    padding: 12px 16px;
    gap: 10px;
  }
}

.exam-runner-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.exam-timer-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #FDE68A;
  background: #FFFBEB;
  color: #6B3E1B;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.exam-timer-pill.is-timed {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #6B3E1B;
}

.exam-timer-pill.is-urgent {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #991B1B;
}

.exam-runner-actions-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.exam-act-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.exam-act-chip--flag.is-flagged {
  background: #FBBF24;
  border-color: #F59E0B;
  color: #0F172A;
}

.exam-act-chip--cancel {
  color: #BE123C;
}

.exam-act-finish {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: #6B3E1B;
  color: #FEF3C7;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.exam-runner-track {
  width: 100%;
  height: 5px;
  border-radius: 9999px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.exam-setting-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (min-width: 768px) {
  .exam-setting-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
}

.exam-setting-label {
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.exam-seg-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exam-seg-btn {
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.exam-seg-btn.active {
  background: #6B3E1B;
  border-color: #6B3E1B;
  color: #FEF3C7;
  font-weight: 700;
}

.exam-flow-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  box-shadow: 0 4px 12px -10px rgba(15, 23, 42, 0.25);
}

.exam-flow-bar .exam-seg-group {
  flex-wrap: nowrap;
  gap: 4px;
}

.exam-flow-bar .exam-seg-btn {
  padding: 5px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.exam-autoadv-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 9999px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.exam-autoadv-switch.is-on {
  border-color: rgba(5, 150, 105, 0.45);
  background: rgba(16, 185, 129, 0.12);
  color: #6B3E1B;
}

body[data-theme="dark"] .exam-autoadv-switch.is-on {
  color: #FCD34D;
  border-color: rgba(52, 211, 153, 0.45);
}

.exam-autoadv-switch.is-dimmed {
  opacity: 0.65;
}

.exam-autoadv-dot {
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  background: #94A3B8;
  transition: background 0.15s ease;
}

.exam-autoadv-switch.is-on .exam-autoadv-dot {
  background: #10B981;
}

.exam-pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

body[data-theme="dark"] .exam-pause-overlay {
  background: rgba(15, 23, 42, 0.92);
}

.is-blurred-pause {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.exam-nav-grid-scroll {
  max-height: 184px;
  overflow-y: auto;
  padding-right: 2px;
}

@media (min-width: 1024px) {
  .exam-nav-grid-scroll {
    max-height: 290px;
  }
}

.exam-cell {
  padding: 6px 2px;
  border-radius: 8px;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  transition: all 0.12s ease;
}

.exam-cell.is-answered {
  background: #DCFCE7;
  border-color: #86EFAC;
  color: #166534;
}

.exam-cell.is-correct {
  background: #FEF3C7;
  border-color: #34D399;
  color: #6B3E1B;
}

.exam-cell.is-wrong {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #991B1B;
}

.exam-cell.is-flagged {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #92400E;
}

.exam-cell.is-current {
  background: #6B3E1B !important;
  border-color: #6B3E1B !important;
  color: #FDE68A !important;
  box-shadow: 0 2px 8px rgba(107, 62, 27, 0.35);
}

body[data-theme="dark"] .exam-cell.is-answered,
body[data-theme="dark"] .exam-cell.is-correct {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(52, 211, 153, 0.5);
  color: #FDE68A;
}

body[data-theme="dark"] .exam-cell.is-wrong {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(248, 113, 113, 0.5);
  color: #FECACA;
}

body[data-theme="dark"] .exam-cell.is-flagged {
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(251, 191, 36, 0.6);
  color: #FDE68A;
}

.exam-chunk-btn {
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.exam-chunk-btn.active {
  background: #6B3E1B;
  border-color: #6B3E1B;
  color: #FEF3C7;
}

/* Scorecard Gauge & 3-Second Diagnostic */
.scorecard-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.scorecard-hero-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.scorecard-donut-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 0;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .scorecard-hero-grid {
    grid-template-columns: 152px minmax(0, 1fr);
    gap: 24px;
  }
  .scorecard-hero-head {
    justify-content: center;
  }
  .scorecard-donut-wrap {
    width: 140px;
    height: 140px;
    margin: 0 auto;
  }
}

.scorecard-donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.scorecard-donut-bg {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 3.4;
}

.scorecard-donut-fill {
  fill: none;
  stroke-width: 3.4;
  stroke-linecap: round;
}

.scorecard-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sw-3sec-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

@media (min-width: 768px) {
  .sw-3sec-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.sw-diag-card {
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-diag-card.is-strength {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.sw-diag-card.is-moderate {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.09);
}

.sw-diag-card.is-weakness {
  border-color: rgba(225, 29, 72, 0.4);
  background: rgba(225, 29, 72, 0.07);
}

.exam-meter {
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.exam-meter-fill {
  height: 100%;
  border-radius: 9999px;
}

.exam-history-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.store-pkg-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-radius: 1rem;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-card);
  box-shadow: 0 8px 22px -12px rgba(15, 23, 42, 0.12);
}

.store-pkg-featured {
  border-color: #F59E0B;
  box-shadow: 0 12px 26px -12px rgba(245, 158, 11, 0.35);
}

.store-trust-card {
  border-radius: 1rem;
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.9) 0%, rgba(255, 251, 235, 0.88) 100%);
  padding: 18px;
}

body[data-theme="dark"] .store-trust-card {
  background: linear-gradient(135deg, rgba(74, 44, 20, 0.32) 0%, rgba(15, 23, 42, 0.9) 100%);
  border-color: rgba(52, 211, 153, 0.35);
}

/* ============================================================================
   ROLLING USER REVIEWS MARQUEE BAR & FOOTER
   ============================================================================ */
.bottom-reviews-outer {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
  background: var(--bg-card);
  padding: 10px 0 12px;
  overflow: hidden;
}

.reviews-marquee-viewport {
  overflow: hidden;
  width: 100%;
  margin-top: 8px;
}

.reviews-marquee-track {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: agoMarqueeScroll 46s linear infinite;
}

.reviews-marquee-viewport:hover .reviews-marquee-track {
  animation-play-state: paused;
}

@keyframes agoMarqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .reviews-marquee-track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
    padding: 0 16px;
  }
}

.review-pill-card {
  width: 295px;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  padding: 11px 13px;
}

.footer-pos-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F8FAFC;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.footer-pos-btn:hover {
  background: rgba(107, 62, 27, 0.45);
  border-color: rgba(251, 191, 36, 0.55);
}

/* ============================================================================
   DARK & SEPIA UTILITY CONTRAST OVERRIDES
   ============================================================================ */
body[data-theme="dark"] .exam-tier-card--subject {
  background: linear-gradient(135deg, rgba(107, 62, 27, 0.35), rgba(30, 41, 59, 0.9));
  border-color: rgba(251, 191, 36, 0.4);
}

body[data-theme="dark"] .exam-tier-card--subject .exam-tier-title {
  color: #FDE68A !important;
}

body[data-theme="dark"] .exam-tier-card--all {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.32), rgba(30, 41, 59, 0.9));
  border-color: rgba(245, 158, 11, 0.55);
}

body[data-theme="dark"] .exam-tier-card--all .exam-tier-title {
  color: #FDE68A !important;
}

body[data-theme="sepia"] .exam-resume-card {
  background: linear-gradient(135deg, #FBF2DA 0%, #F7E5B7 100%);
  border-color: #D97706;
}

body[data-theme="dark"] .exam-resume-card {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.44) 0%, rgba(146, 64, 14, 0.34) 100%) !important;
  border-color: #F59E0B !important;
}

body[data-theme="dark"] .exam-resume-title {
  color: #FDE68A !important;
}

body[data-theme="dark"] .exam-resume-meta {
  color: #FEF3C7 !important;
}

body[data-theme="dark"] .exam-resume-secondary-btn {
  background: #1E293B;
  border-color: #475569;
  color: #E2E8F0;
}

body[data-theme="dark"] .exam-access-pill {
  background: rgba(107, 62, 27, 0.35);
  border-color: rgba(251, 191, 36, 0.4);
  color: #FDE68A;
}

body[data-theme="dark"] .exam-timer-pill {
  background: rgba(74, 44, 20, 0.42);
  border-color: rgba(52, 211, 153, 0.45);
  color: #FCD34D;
}

body[data-theme="dark"] .exam-timer-pill.is-timed,
body[data-theme="dark"] .exam-timer-pill.is-urgent {
  background: rgba(107, 62, 27, 0.45);
  border-color: rgba(251, 191, 36, 0.5);
  color: #FDE68A;
}

body[data-theme="dark"] .exam-act-chip--cancel {
  color: #FCD34D;
}

body[data-theme="dark"] .exam-mode-seg,
body[data-theme="dark"] .exam-size-seg {
  background: #0F172A;
  border-color: #334155;
}

body[data-theme="dark"] .exam-mode-btn,
body[data-theme="dark"] .exam-size-btn {
  color: #CBD5E1;
}

body[data-theme="dark"] .exam-mode-btn.active,
body[data-theme="dark"] .exam-size-btn.active {
  background: #6B3E1B;
  color: #FDE68A;
}

body[data-theme="dark"] #exam-batch-progress-hint,
body[data-theme="dark"] #btn-reset-batch-cursor {
  color: #FDE68A !important;
}

body[data-theme="dark"] .saas-card {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

body[data-theme="dark"] .text-slate-900,
body[data-theme="dark"] .text-slate-800 {
  color: #F1F5F9 !important;
}

body[data-theme="dark"] .text-slate-700,
body[data-theme="dark"] .text-slate-600,
body[data-theme="dark"] .text-slate-500 {
  color: #CBD5E1 !important;
}

body[data-theme="dark"] .bg-slate-50,
body[data-theme="dark"] .bg-slate-50\/80,
body[data-theme="dark"] .bg-slate-50\/90,
body[data-theme="dark"] .bg-slate-100,
body[data-theme="dark"] .bg-white,
body[data-theme="dark"] .bg-white\/75,
body[data-theme="dark"] .bg-white\/80 {
  background-color: #1E293B !important;
  color: #F1F5F9 !important;
}

body[data-theme="dark"] .bg-slate-200 {
  background-color: #334155 !important;
  color: #F8FAFC !important;
}

body[data-theme="dark"] .solution-bottom-box .bg-amber-50,
body[data-theme="dark"] #exam-result-panel .bg-amber-50 {
  background-color: rgba(120, 53, 15, 0.34) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #FEF3C7 !important;
}

body[data-theme="dark"] .solution-bottom-box .bg-amber-50 strong,
body[data-theme="dark"] #exam-result-panel .bg-amber-50 strong {
  color: #FDE68A !important;
}

body[data-theme="dark"] #exam-result-panel .bg-rose-50 {
  background-color: rgba(133, 77, 30, 0.34) !important;
  border-color: rgba(251, 191, 36, 0.45) !important;
  color: #FDE68A !important;
}

body[data-theme="dark"] #vip-consent-error {
  color: #FCD34D !important;
}

body[data-theme="dark"] .border-slate-200,
body[data-theme="dark"] .border-slate-200\/70,
body[data-theme="dark"] .border-slate-300,
body[data-theme="dark"] .border-slate-100 {
  border-color: #334155 !important;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background-color: #0F172A !important;
  color: #F8FAFC !important;
  border-color: #334155 !important;
}

body[data-theme="dark"] .exam-select,
body[data-theme="dark"] .seq-law-select,
body[data-theme="dark"] .seq-subtopic-select,
body[data-theme="dark"] .pg-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23CBD5E1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
}

body[data-theme="dark"] .seq-search-wrap input.seq-search-input {
  background-color: transparent !important;
  border-color: transparent !important;
}

body[data-theme="dark"] #vip-pass-modal > div,
body[data-theme="dark"] #vip-modal > div,
body[data-theme="dark"] #purchase-consent-modal > div,
body[data-theme="dark"] #policy-modal > div,
body[data-theme="dark"] #question-report-modal > div {
  background-color: #111827 !important;
  color: #F1F5F9 !important;
}

/* ============================================================================
   SILENT DRM PROTECTION + PRINT BLOCKING
   ============================================================================ */
body[data-drm-shield="on"] #question-list-container,
body[data-drm-shield="on"] #exam-active-card,
body[data-drm-shield="on"] #section-cheatsheet {
  -webkit-user-select: none;
  user-select: none;
}

body.drm-snap-guard main {
  filter: blur(18px);
}

@media print {
  body * {
    display: none !important;
  }
  body::after {
    content: "เนื้อหานี้สงวนสิทธิ์เฉพาะการอ่านออนไลน์บน GovExamPass สำนักงาน ก.พ. ภาค ก. 2570 เท่านั้น";
    display: block;
    padding: 2rem;
    font-family: "Prompt", sans-serif;
    font-size: 1.25rem;
    text-align: center;
  }
}


/* ============================================================================
   Unfinished Positions Blur/Dim State, Sharp Status Badge, Reviews & Consent
   ============================================================================ */

.pos-card.is-pos-coming-soon,
.pos-chip-sm.is-pos-coming-soon,
.pos-drawer-item.is-pos-coming-soon,
.footer-pos-btn.is-pos-coming-soon,
.store-pkg-card.is-pos-coming-soon,
.vip-pkg-card.is-pos-coming-soon,
.cs-scope-btn.is-pos-coming-soon {
  position: relative;
  cursor: not-allowed !important;
  opacity: 1 !important;
}

.pos-card.is-pos-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 8px 10px;
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.55);
  background: var(--bg-subtle);
}

.pos-card.is-pos-coming-soon .pos-soon-dim,
.pos-drawer-item.is-pos-coming-soon .pos-soon-dim {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  width: 100%;
  flex: 0 1 auto;
}

.pos-card.is-pos-coming-soon .pos-card-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

@media (min-width: 1280px) {
  .pos-card.is-pos-coming-soon {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 9px 11px;
  }
  .pos-card.is-pos-coming-soon .pos-soon-dim {
    flex: 1 1 auto;
    width: auto;
    gap: 8px;
  }
  .pos-card.is-pos-coming-soon .pos-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }
}

.pos-soon-dim {
  filter: blur(0.85px);
  opacity: 0.44;
  pointer-events: none;
  user-select: none;
  transition: none !important;
}

.store-pkg-card.is-pos-coming-soon .pos-soon-dim {
  filter: blur(0.95px);
  opacity: 0.45;
}

.footer-pos-btn.is-pos-coming-soon {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 8px 10px;
  border-style: dashed !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  background: rgba(15, 23, 42, 0.42) !important;
}

.footer-pos-btn.is-pos-coming-soon:hover {
  transform: none !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  background: rgba(15, 23, 42, 0.42) !important;
}

.footer-pos-btn.is-pos-coming-soon .pos-soon-dim {
  display: block;
  min-width: 0;
  width: 100%;
  flex: 0 1 auto;
  filter: blur(0.85px);
  opacity: 0.46;
}

.pos-soon-badge {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1.5px 7px;
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: #78350F;
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  filter: none !important;
  opacity: 1 !important;
}

@media (min-width: 1280px) {
  .pos-soon-badge {
    padding: 2px 7px;
    font-size: 0.66rem;
  }
}

.pos-soon-badge-sm {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  color: #78350F;
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  filter: none !important;
  opacity: 1 !important;
}

.pos-soon-badge-footer {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 1.5px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  color: #FDE68A;
  background: rgba(120, 53, 15, 0.78);
  border: 1px solid rgba(251, 191, 36, 0.65);
  filter: none !important;
  opacity: 1 !important;
}

body[data-theme="dark"] .pos-card.is-pos-coming-soon {
  background: rgba(30, 41, 59, 0.68);
  border-color: rgba(148, 163, 184, 0.35);
}

body[data-theme="dark"] .pos-soon-badge,
body[data-theme="dark"] .pos-soon-badge-sm {
  color: #FDE68A;
  background: rgba(120, 53, 15, 0.85);
  border-color: rgba(251, 191, 36, 0.65);
}

.store-pkg-card.is-pos-coming-soon {
  background: var(--bg-subtle);
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.55);
}

body[data-theme="dark"] .store-pkg-card.is-pos-coming-soon {
  background: rgba(30, 41, 59, 0.65);
}

.store-pkg-card-head-soon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 639px) {
  .store-pkg-card.is-pos-coming-soon {
    padding: 11px 13px;
    gap: 6px;
  }
  .store-pkg-card-head-soon {
    margin-bottom: 0;
  }
}

.vip-pkg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.vip-pkg-open {
  grid-column: 1 / -1;
}

.vip-pkg-soon {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  padding: 6px 7px;
  border-radius: 10px;
  border: 1px dashed #CBD5E1;
  background: var(--bg-subtle);
  text-align: left;
  min-width: 0;
}

.pos-soon-badge-xs {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 999px;
  font-family: "Prompt", sans-serif;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  color: #78350F;
  background: #FEF3C7;
  border: 1px solid #F59E0B;
}

body[data-theme="dark"] .vip-pkg-soon {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(148, 163, 184, 0.35);
}

body[data-theme="dark"] .pos-soon-badge-xs {
  color: #FDE68A;
  background: rgba(120, 53, 15, 0.85);
  border-color: rgba(251, 191, 36, 0.65);
}

.review-stars {
  color: #F59E0B;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  line-height: 1;
}

.vip-consent-box {
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.85rem;
  background: #FFFBEB;
  border: 1.5px solid #FCD34D;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.vip-consent-box.is-checked {
  background: #FFFBEB;
  border-color: #10B981;
}

.vip-consent-box.is-error {
  background: #FFFBEB;
  border-color: #E11D48;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.14);
}

body[data-theme="dark"] .vip-consent-box {
  background: rgba(120, 53, 15, 0.28);
  border-color: rgba(245, 158, 11, 0.55);
}

body[data-theme="dark"] .vip-consent-box.is-checked {
  background: rgba(74, 44, 20, 0.32);
  border-color: rgba(16, 185, 129, 0.6);
}

body[data-theme="dark"] .vip-consent-box.is-error {
  background: rgba(107, 62, 27, 0.35);
  border-color: #F59E0B;
}

.vip-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-main);
}

.vip-consent-checkbox {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: #4A2C14;
  flex-shrink: 0;
  cursor: pointer;
}

.vip-policy-link {
  color: #854D1E;
  font-weight: 800;
  text-decoration: underline;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

body[data-theme="dark"] .vip-policy-link {
  color: #FCD34D;
}

/* ============================================================================
   COURT-PARITY CHECKOUT MODAL & CONSENT MODAL STYLES
   ============================================================================ */
.ocsc-qr-payment-layout {
  display: grid;
  grid-template-columns: minmax(220px, 256px) 1fr;
  gap: 1rem;
  align-items: stretch;
}

@media (max-width: 639px) {
  .ocsc-qr-payment-layout {
    grid-template-columns: 1fr;
  }
}

.ocsc-qr-card-frame {
  display: flex;
  flex-direction: column;
  border-radius: 1rem;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.ocsc-qr-card-head {
  background: linear-gradient(135deg, #0B3B68 0%, #102A43 100%);
  color: #FFFFFF;
  padding: 0.65rem 0.85rem;
  text-align: center;
}

.ocsc-qr-card-body {
  flex: 1 1 auto;
  padding: 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  text-align: center;
}

.ocsc-qr-icon-badge {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.9rem;
  background: #F1F5F9;
  border: 1px dashed #94A3B8;
  color: #0B3B68;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 639px) {
  .ocsc-qr-card-body {
    padding: 0.7rem 0.85rem;
    gap: 0.4rem;
  }
  .ocsc-qr-icon-badge {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
  }
}

.ocsc-qr-card-foot {
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  padding: 0.5rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: #475569;
}

.ocsc-qr-detail-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 1rem;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  padding: 0.95rem 1rem;
}

.ocsc-qr-detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ocsc-qr-detail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed #E2E8F0;
  font-size: 0.78rem;
  line-height: 1.45;
}

@media (max-width: 639px) {
  .ocsc-qr-detail-panel {
    padding: 0.65rem 0.8rem;
  }
  .ocsc-qr-detail-list {
    gap: 0.3rem;
  }
  .ocsc-qr-detail-row {
    gap: 0.2rem 0.5rem;
    padding-bottom: 0.3rem;
    font-size: 0.74rem;
    line-height: 1.35;
  }
}

.ocsc-qr-detail-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.ocsc-qr-detail-label {
  color: #64748B;
  font-weight: 600;
  white-space: nowrap;
}

.ocsc-qr-detail-val {
  color: #0F172A;
  font-weight: 700;
  text-align: right;
  flex: 1 1 auto;
}

.stripe-pulse-dot {
  width: 0.6rem;
  min-width: 0.6rem;
  height: 0.6rem;
  min-height: 0.6rem;
  border-radius: 9999px;
  background-color: #10B981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65);
  flex-shrink: 0;
  animation: stripePulseGlow 1.8s infinite;
}

@keyframes stripePulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.ocsc-qr-spinner {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 3px solid #E2E8F0;
  border-top-color: #854D1E;
  animation: agoQrSpin 0.8s linear infinite;
}

@keyframes agoQrSpin {
  to { transform: rotate(360deg); }
}

body[data-theme="dark"] #vip-customer-email-input,
body[data-theme="dark"] #vip-modal-recover-email,
body[data-theme="dark"] #vip-modal-recover-ref,
body[data-theme="dark"] #vip-pass-recover-email,
body[data-theme="dark"] #vip-pass-recover-ref {
  background-color: #1E293B !important;
  border-color: #475569 !important;
  color: #F8FAFC !important;
}

body[data-theme="dark"] #vip-modal-recovery-details summary,
body[data-theme="dark"] #vip-pass-recovery-details summary {
  color: #FCD34D !important;
}

/* Sepia & Dark Contrast Overrides for Checkout & Consent Modals */
body[data-theme="sepia"] .ocsc-qr-card-frame,
body[data-theme="sepia"] .ocsc-qr-detail-panel {
  background: #FFFDF8;
  border-color: #DECBB4;
}

body[data-theme="sepia"] .ocsc-qr-card-foot {
  background: #F5F0E6;
  border-top-color: #DECBB4;
}

body[data-theme="dark"] .ocsc-qr-card-frame,
body[data-theme="dark"] .ocsc-qr-detail-panel {
  background: #0F172A !important;
  border-color: #334155 !important;
}

body[data-theme="dark"] .ocsc-qr-card-foot {
  background: #1E293B !important;
  border-top-color: #334155 !important;
  color: #CBD5E1 !important;
}

body[data-theme="dark"] .ocsc-qr-icon-badge {
  background: #1E293B !important;
  border-color: #475569 !important;
  color: #93C5FD !important;
}

body[data-theme="dark"] .ocsc-qr-detail-row {
  border-bottom-color: #334155 !important;
}

body[data-theme="dark"] .ocsc-qr-detail-label {
  color: #94A3B8 !important;
}

body[data-theme="dark"] .ocsc-qr-detail-val {
  color: #F8FAFC !important;
}

body[data-theme="dark"] #vip-detail-net-price,
body[data-theme="dark"] #vip-qr-amount-text {
  color: #FCD34D !important;
}

body[data-theme="dark"] #vip-detail-ref-code {
  background: #1E293B !important;
  border-color: #475569 !important;
  color: #FCD34D !important;
}

body[data-theme="dark"] #vip-modal .bg-emerald-50,
body[data-theme="dark"] #vip-modal .bg-emerald-50\/70,
body[data-theme="dark"] #vip-receipt-card {
  background-color: rgba(74, 44, 20, 0.36) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
}

body[data-theme="dark"] #vip-receipt-card *,
body[data-theme="dark"] #vip-qr-status,
body[data-theme="dark"] #vip-price-summary {
  color: #FEF3C7 !important;
}

body[data-theme="dark"] #vip-receipt-code {
  background-color: #0F172A !important;
  color: #FCD34D !important;
  border-color: rgba(16, 185, 129, 0.55) !important;
}

body[data-theme="dark"] #vip-receipt-card .bg-white\/80 {
  background-color: rgba(15, 23, 42, 0.72) !important;
  border-color: rgba(16, 185, 129, 0.42) !important;
  color: #FFFBEB !important;
}

body[data-theme="dark"] #vip-receipt-card .bg-white\/80 code {
  color: #FDE68A !important;
}

body[data-theme="dark"] #vip-pkg-grid .vip-pkg-card:not(.is-pos-coming-soon) {
  background-color: #1E293B !important;
  border-color: #F59E0B !important;
}

body[data-theme="dark"] #purchase-consent-modal .bg-slate-50 {
  background-color: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}

body[data-theme="dark"] #btn-stripe-checkout {
  background: linear-gradient(90deg, #6B3E1B 0%, #854D1E 100%) !important;
  color: #FDE68A !important;
  border-color: rgba(251, 191, 36, 0.55) !important;
}

#btn-stripe-checkout[data-inapp-locked="1"] {
  background: #E2E8F0 !important;
  color: #475569 !important;
  border-color: #CBD5E1 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

body[data-theme="dark"] #btn-stripe-checkout[data-inapp-locked="1"] {
  background: #1E293B !important;
  color: #94A3B8 !important;
  border-color: #475569 !important;
}

/* =========================================================
   IN-APP BROWSER ADVISORY BANNER & HARD-GUARD (FBAN / LINE)
   ========================================================= */
.inapp-advisory-bar {
  background: #FFFDF7;
  border-bottom: 1px solid #F3D59B;
  color: #451A03;
  box-shadow: 0 2px 6px rgba(107, 62, 27, 0.06);
  position: relative;
  z-index: 20;
}

.inapp-advisory-bar.hidden,
.inapp-btn-external.hidden,
.inapp-ios-hint.hidden,
.inapp-copy-feedback.hidden {
  display: none !important;
}

.inapp-advisory-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "msg close"
    "actions actions";
  align-items: start;
  gap: 6px 8px;
  padding: 7px 12px;
}

@media (min-width: 768px) {
  .inapp-advisory-inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "msg actions close";
    align-items: center;
    gap: 12px;
    padding: 8px 24px;
  }
}

.inapp-advisory-msg {
  grid-area: msg;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #451A03;
}

.inapp-advisory-icon {
  flex-shrink: 0;
  color: #B45309;
  margin-top: 1px;
  display: inline-flex;
}

.inapp-advisory-text {
  min-width: 0;
  overflow-wrap: break-word;
}

.inapp-app-highlight {
  color: #6B3E1B;
  font-weight: 700;
}

.inapp-advisory-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.inapp-btn-external {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid #854D1E;
  background: #854D1E;
  color: #FFFFFF;
  font-family: "Prompt", "Sarabun", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.inapp-btn-external:hover {
  background: #6B3E1B;
  transform: translateY(-1px);
}

.inapp-btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #D97706;
  background: #FEF3C7;
  color: #78350F;
  font-family: "Prompt", "Sarabun", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.inapp-btn-copy:hover {
  background: #FDE68A;
}

#inapp-browser-banner .inapp-btn-external.hidden + .inapp-btn-copy {
  border-color: #6B3E1B;
  background: #6B3E1B;
  color: #FFFBEB;
}

#inapp-browser-banner .inapp-btn-external.hidden + .inapp-btn-copy:hover {
  background: #854D1E;
}

.inapp-ios-hint {
  font-size: 11px;
  color: #78350F;
  line-height: 1.3;
}

.inapp-copy-feedback {
  font-size: 11px;
  font-weight: 700;
  color: #6B3E1B;
  white-space: nowrap;
}

.inapp-close-btn {
  grid-area: close;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(180, 83, 9, 0.22);
  background: rgba(180, 83, 9, 0.08);
  color: #78350F;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.inapp-close-btn:hover {
  background: rgba(180, 83, 9, 0.16);
  color: #451A03;
}

body[data-theme="sepia"] .inapp-advisory-bar {
  background: #FBF3DF;
  border-bottom-color: #E2BE79;
}

body[data-theme="sepia"] #vip-inapp-warning,
body[data-theme="sepia"] #vip-pass-inapp-warning {
  background-color: #FFFBEB;
  border-color: #E11D48;
}

body[data-theme="dark"] .inapp-advisory-bar {
  background: linear-gradient(90deg, #2B1019 0%, #1F0D14 100%) !important;
  border-bottom-color: rgba(251, 191, 36, 0.38) !important;
  color: #FEF3C7 !important;
}

body[data-theme="dark"] .inapp-advisory-msg {
  color: #FEF3C7 !important;
}

body[data-theme="dark"] .inapp-advisory-icon,
body[data-theme="dark"] .inapp-app-highlight {
  color: #FCD34D !important;
}

body[data-theme="dark"] .inapp-ios-hint {
  color: #FDE68A !important;
}

body[data-theme="dark"] .inapp-copy-feedback {
  color: #FCD34D !important;
}

body[data-theme="dark"] #inapp-browser-banner .inapp-btn-copy {
  background: rgba(251, 191, 36, 0.16) !important;
  border-color: rgba(251, 191, 36, 0.55) !important;
  color: #FDE68A !important;
}

body[data-theme="dark"] #inapp-browser-banner .inapp-btn-external.hidden + .inapp-btn-copy {
  background: #FBBF24 !important;
  border-color: #FBBF24 !important;
  color: #0F172A !important;
}

body[data-theme="dark"] .inapp-close-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #FDE68A !important;
}

body[data-theme="dark"] #vip-inapp-warning,
body[data-theme="dark"] #vip-inapp-warning *,
body[data-theme="dark"] #vip-pass-inapp-warning,
body[data-theme="dark"] #vip-pass-inapp-warning * {
  color: #FEF3C7 !important;
}

body[data-theme="dark"] #vip-inapp-warning,
body[data-theme="dark"] #vip-pass-inapp-warning {
  background-color: rgba(107, 62, 27, 0.45) !important;
  border-color: #F59E0B !important;
}

body[data-theme="dark"] #btn-vip-inapp-copy-url,
body[data-theme="dark"] #btn-vip-pass-inapp-copy-url {
  background-color: #F59E0B !important;
  color: #0F172A !important;
}

body[data-theme="dark"] #btn-inapp-open-external,
body[data-theme="dark"] #btn-vip-inapp-open-external,
body[data-theme="dark"] #btn-vip-pass-inapp-open-external {
  background-color: #059669 !important;
  color: #FFFFFF !important;
}

/* =========================================================
   TAB 2 SMART RESUME, SUB-TOPIC TOC, PIN & BACK-TO-TOP
   ========================================================= */
.seq-subtopic-row.hidden,
.seq-resume-bar.hidden {
  display: none !important;
}

.seq-subtopic-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.seq-subtopic-select {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 100%;
  padding: 7px 34px 7px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border-subtle);
  background-color: var(--bg-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  -webkit-appearance: none;
  appearance: none;
  text-overflow: ellipsis;
  color: var(--text-main);
  font-family: "Prompt", "Sarabun", sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.seq-subtopic-select:focus {
  outline: none;
  border-color: #854D1E;
}

body[data-theme="dark"] .seq-subtopic-select {
  background: #0F172A;
  color: #F8FAFC;
  border-color: #334155;
}

.seq-resume-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 13px;
  border-radius: 13px;
  border: 1.5px solid #F59E0B;
  background: linear-gradient(90deg, #FFFBEB 0%, #FEF3C7 100%);
  color: #451A03;
  box-shadow: 0 4px 12px -6px rgba(180, 83, 9, 0.28);
}

.seq-resume-meta {
  min-width: 0;
  flex: 1 1 220px;
}

.seq-resume-title {
  font-family: "Prompt", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
}

.seq-resume-sub {
  font-size: 11.5px;
  opacity: 0.9;
  line-height: 1.35;
  margin-top: 2px;
}

.seq-resume-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.seq-resume-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 9px;
  border: none;
  background: #6B3E1B;
  color: #FEF3C7;
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s ease, background-color 0.15s ease;
}

.seq-resume-jump-btn:hover {
  background: #4A2C14;
  transform: translateY(-1px);
}

.seq-resume-clear-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(120, 53, 15, 0.3);
  background: rgba(255, 255, 255, 0.72);
  color: #78350F;
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.seq-resume-clear-btn:hover {
  background: #FFFFFF;
}

body[data-theme="sepia"] .seq-resume-bar {
  background: linear-gradient(90deg, #FBF2DA 0%, #F7E5B7 100%);
  border-color: #D97706;
}

body[data-theme="dark"] .seq-resume-bar {
  background: linear-gradient(90deg, rgba(120, 53, 15, 0.42) 0%, rgba(146, 64, 14, 0.34) 100%) !important;
  border-color: #F59E0B !important;
  color: #FDE68A !important;
}

body[data-theme="dark"] .seq-resume-jump-btn {
  background: #FBBF24;
  color: #0F172A;
}

body[data-theme="dark"] .seq-resume-jump-btn:hover {
  background: #F59E0B;
}

body[data-theme="dark"] .seq-resume-clear-btn {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(251, 191, 36, 0.4);
  color: #FDE68A;
}

.q-pin-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(15, 23, 42, 0.28);
  color: #F8FAFC;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.q-pin-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.q-pin-btn.is-pinned {
  background: #10B981;
  border-color: #059669;
  color: #052E16;
  font-weight: 800;
}

@keyframes qJumpPulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.72); }
  55% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.18); }
  100% { box-shadow: 0 0 0 3px #F59E0B, 0 14px 28px -10px rgba(245, 158, 11, 0.42); }
}

.q-card-jump-highlight {
  border-color: #F59E0B !important;
  box-shadow: 0 0 0 3px #F59E0B, 0 14px 28px -10px rgba(245, 158, 11, 0.42) !important;
  animation: qJumpPulse 0.9s ease-out 1;
}

.pg-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  max-width: 100%;
}

.pg-nav-btn {
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
}

.pg-nav-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.pg-select {
  padding: 6px 28px 6px 8px;
  border-radius: 9px;
  border: 1.5px solid var(--border-subtle);
  background-color: var(--bg-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px 12px;
  -webkit-appearance: none;
  appearance: none;
  text-overflow: ellipsis;
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  font-size: 11.5px;
  max-width: 210px;
  cursor: pointer;
}

@media (max-width: 639px) {
  #pagination-top,
  #pagination-bottom {
    width: 100%;
  }
  .pg-bar {
    flex-wrap: nowrap;
    width: 100%;
    gap: 5px;
  }
  .pg-nav-btn {
    padding: 6px 9px;
    flex-shrink: 0;
  }
  .pg-select {
    flex: 1 1 0%;
    min-width: 0;
    max-width: none;
    padding: 6px 26px 6px 8px;
    background-position: right 7px center;
  }
  .pg-jump-wrap {
    flex-shrink: 0;
    gap: 4px;
  }
  .pg-jump-input {
    width: 54px;
    padding: 5px 4px;
  }
  .pg-jump-btn {
    padding: 6px 9px;
  }
}

.pg-jump-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pg-jump-input {
  width: 74px;
  padding: 5px 7px;
  border-radius: 9px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
}

.pg-jump-btn {
  padding: 5px 10px;
  border-radius: 9px;
  border: none;
  background: #6B3E1B;
  color: #FEF3C7;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

body[data-theme="dark"] .pg-jump-btn {
  background: #F59E0B;
  color: #0F172A;
}

.back-to-top-btn {
  position: fixed;
  right: 14px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  z-index: 44;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6B3E1B 0%, #2D1B0E 100%);
  color: #FEF3C7;
  border: 1.5px solid rgba(251, 191, 36, 0.72);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.35);
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.back-to-top-btn:hover {
  transform: translateY(-2px);
}

@media (min-width: 768px) {
  .back-to-top-btn {
    right: 22px;
    bottom: 24px;
    padding: 9px 15px;
  }
}

@media (max-width: 639px) {
  .back-to-top-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    right: 10px;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    opacity: 0.92;
  }
}

.back-to-top-btn.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
}

body[data-theme="dark"] .back-to-top-btn {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #0F172A;
  border-color: #FEF3C7;
}

/* =========================================================
   DEDICATED "ทำต่อที่ค้างไว้" BUTTONS (TAB 1 HOME & TAB 2 HUB)
   ========================================================= */
.home-continue-bar.hidden {
  display: none !important;
}

.home-continue-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1.5px solid #F59E0B;
  background: linear-gradient(90deg, #FFFBEB 0%, #FEF3C7 100%);
  color: #451A03;
  box-shadow: 0 6px 16px -10px rgba(180, 83, 9, 0.35);
}

.home-continue-meta {
  min-width: 0;
  flex: 1 1 220px;
}

.home-continue-title {
  font-family: "Prompt", sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.35;
}

.home-continue-sub {
  font-size: 11.5px;
  opacity: 0.9;
  margin-top: 2px;
  line-height: 1.35;
}

.home-continue-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.home-continue-seq-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #059669, #854D1E);
  color: #FFFFFF;
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 3px 10px -4px rgba(5, 150, 105, 0.55);
  transition: transform 0.14s ease, filter 0.14s ease;
}

.home-continue-seq-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.home-continue-exam-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(107, 62, 27, 0.3);
  background: #6B3E1B;
  color: #FEF3C7;
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.14s ease, background-color 0.14s ease;
}

.home-continue-exam-btn:hover {
  background: #4A2C14;
  transform: translateY(-1px);
}

body[data-theme="sepia"] .home-continue-bar {
  background: linear-gradient(90deg, #FBF2DA 0%, #F7E5B7 100%);
  border-color: #D97706;
}

body[data-theme="dark"] .home-continue-bar {
  background: linear-gradient(90deg, rgba(120, 53, 15, 0.44) 0%, rgba(146, 64, 14, 0.34) 100%) !important;
  border-color: #F59E0B !important;
  color: #FDE68A !important;
}

body[data-theme="dark"] .home-continue-exam-btn {
  background: #FBBF24;
  color: #0F172A;
  border-color: #F59E0B;
}

.subject-continue-pill {
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 9999px;
  background: #FFFBEB;
  color: #6B3E1B;
  border: 1px solid rgba(5, 150, 105, 0.35);
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.subject-continue-pill:hover {
  transform: translateY(-1px);
  filter: brightness(0.97);
}

body[data-theme="dark"] .subject-continue-pill {
  background: rgba(5, 150, 105, 0.32);
  color: #FDE68A;
  border-color: rgba(52, 211, 153, 0.45);
}

.seq-btn-continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1.5px solid #059669;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  font-family: "Prompt", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  cursor: pointer;
  box-shadow: 0 3px 10px -4px rgba(5, 150, 105, 0.5);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.seq-btn-continue:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.seq-btn-continue.has-progress {
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.65), 0 4px 12px -4px rgba(5, 150, 105, 0.55);
}

body[data-theme="dark"] .seq-btn-continue {
  background: linear-gradient(135deg, #059669, #047857);
  border-color: #34D399;
  color: #ECFDF5;
}

/* =========================================================
   MOBILE TYPOGRAPHY & CONCISE LINE-WRAPPING POLISH (v21)
   ========================================================= */
@media (max-width: 639px) {
  .pos-card-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .subject-zone-head {
    gap: 3px;
    padding: 8px 11px;
  }
  .subject-clean-row {
    padding: 8px 10px;
    gap: 6px;
  }
  .subject-clean-main {
    gap: 8px;
  }
  .subject-code-pill {
    min-width: 30px;
    height: 22px;
    padding: 0 5px;
    font-size: 11px;
  }
  .subject-clean-title {
    font-size: 12.5px;
    line-height: 1.32;
  }
  .subject-quiz-pill {
    padding: 4px 9px;
    font-size: 11px;
  }
  .subject-chevron-btn {
    display: none;
  }
  .home-continue-title,
  .seq-resume-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero-stat-num,
  .hero-stat-sub {
    white-space: nowrap;
  }
  #locked-pos-drawer .pos-drawer-item.is-pos-coming-soon {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    padding: 7px 9px;
  }
  #locked-pos-drawer .pos-drawer-item.is-pos-coming-soon .pos-soon-badge-sm {
    font-size: 9.5px;
    padding: 1px 6px;
  }
  .exam-setup-head {
    padding-bottom: 4px;
  }
  .exam-setup-card {
    padding: 10px 11px !important;
    gap: 5px !important;
  }
  .exam-config-grid {
    gap: 6px !important;
  }
  .exam-select {
    padding: 7px 34px 7px 10px;
  }
  .exam-mode-btn {
    padding: 5px 5px;
    font-size: 11.5px;
  }
  .exam-size-btn {
    padding: 4.5px 4px;
    font-size: 11.5px;
  }
  .exam-tier-card {
    padding: 7.5px 10px;
  }
  .exam-target-btn,
  .exam-filter-chip {
    padding: 4.5px 8px;
    font-size: 11.5px;
  }
  .exam-advanced-details {
    padding: 6px 10px;
  }
  .brand-mark svg {
    width: 26px;
    height: 26px;
  }
  .header-brand-title {
    font-size: 11.5px !important;
  }
  .header-actions-wrap {
    gap: 4px !important;
  }
  .header-vip-pill {
    padding: 4.5px 9px;
    font-size: 11px;
  }
  .header-updates-btn {
    padding: 5px 6.5px;
  }
  .settings-pill-btn {
    padding: 5px 7.5px;
    font-size: 11px;
  }
}

@media (max-width: 389px) {
  .brand-mark svg {
    width: 24px;
    height: 24px;
  }
  .header-brand-title {
    font-size: 10.6px !important;
  }
  .header-vip-pill {
    padding: 4.5px 8px;
    font-size: 11px;
    gap: 3px;
  }
  .header-updates-btn {
    padding: 4.5px 6px;
  }
  .settings-pill-btn {
    padding: 4.5px 7px;
    font-size: 11px;
  }
  #home-hero-title {
    font-size: 1.03rem !important;
  }
  .hero-stat-tile {
    padding: 0.38rem 0.35rem;
  }
  .hero-stat-num {
    font-size: 0.86rem;
  }
}

@media (max-width: 359px) {
  .app-header > div {
    padding-left: 8px !important;
    padding-right: 8px !important;
    gap: 4px !important;
  }
  .app-header > div > button {
    gap: 5px !important;
  }
  .brand-mark svg {
    width: 21px;
    height: 21px;
  }
  .header-brand-title {
    font-size: 9.8px !important;
    letter-spacing: -0.02em;
  }
  .header-actions-wrap {
    gap: 3px !important;
  }
  .header-vip-pill {
    padding: 3.5px 5.5px;
    font-size: 9.8px;
    gap: 2.5px;
  }
  .header-vip-pill svg {
    width: 10.5px;
    height: 10.5px;
  }
  .header-updates-btn {
    padding: 3.5px 4.5px;
  }
  .settings-pill-btn {
    padding: 3.5px 5px;
    font-size: 10px;
  }
  #home-hero-title {
    font-size: 0.94rem !important;
  }
}

/* ============================================================================
   ROUND 61 + V49 RESPONSIVE DROPDOWNS, WEB ALERT BANNER & CHANGELOG STRIP
   ============================================================================ */
.updates-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.updates-panel-head > div {
  min-width: 0;
  flex: 1 1 auto;
}

.updates-panel-title {
  font-family: "Prompt", sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  white-space: normal;
  overflow-wrap: break-word;
}

.updates-panel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.updates-panel-item {
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-sizing: border-box;
}

.updates-panel-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  min-width: 0;
}

.updates-panel-item-title {
  font-family: "Prompt", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-main);
  min-width: 0;
}

.updates-panel-item-detail {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  min-width: 0;
}

.updates-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: "Prompt", sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  background: #FEF3C7;
  color: #6B3E1B;
}

.updates-badge.is-emerald {
  background: #FEF3C7;
  color: #6B3E1B;
}

.updates-badge.is-amber {
  background: #FEF3C7;
  color: #92400E;
}

.updates-panel-jump {
  align-self: flex-start;
  margin-top: 2px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  max-width: 100%;
  white-space: normal;
  text-align: left;
  line-height: 1.4;
}

/* Web Alert Banner (Below Sticky Header) */
.ocsc-web-alert-inner {
  max-width: 1280px;
  margin: 8px auto 0;
  padding: 0 12px;
  box-sizing: border-box;
}

.ocsc-web-alert-box {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid #93C5FD;
  background: #EFF6FF;
  color: #1E3A8A;
  font-size: 12.5px;
  line-height: 1.48;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.ocsc-web-alert-box.is-success {
  border-color: #FCD34D;
  background: #FFFBEB;
  color: #6B3E1B;
}

.ocsc-web-alert-box.is-warning {
  border-color: #FCD34D;
  background: #FFFBEB;
  color: #92400E;
}

.ocsc-web-alert-box.is-error {
  border-color: #FCD34D;
  background: #FFFBEB;
  color: #6B3E1B;
}

.ocsc-web-alert-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid currentColor;
  opacity: 0.7;
  background: transparent;
  color: inherit;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

/* Home Collapsible Changelog Strip */
.ocsc-changelog-strip {
  background: var(--bg-card);
  border: 1.5px solid #FDE68A;
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.ocsc-changelog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.ocsc-changelog-summary-btn {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 2px 0;
  text-align: left;
  cursor: pointer;
  color: var(--text-main);
}

.ocsc-changelog-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 700;
  background: #FEF3C7;
  color: #92400E;
}

.ocsc-changelog-pill.is-emerald {
  background: #FEF3C7;
  color: #6B3E1B;
}

.ocsc-changelog-headline {
  font-family: "Prompt", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ocsc-changelog-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ocsc-changelog-toggle {
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-main);
  border-radius: 8px;
  padding: 4px 9px;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.ocsc-changelog-dismiss {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ocsc-changelog-drawer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ocsc-changelog-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.ocsc-changelog-entry-title {
  font-family: "Prompt", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.ocsc-changelog-entry-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.ocsc-changelog-action {
  padding: 5px 10px;
  border-radius: 8px;
  background: #6B3E1B;
  color: #FDE68A;
  font-family: "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
}

/* Mobile <= 767px: Viewport-Safe Dropdowns Avoiding #mobile-bottom-nav */
@media (max-width: 767px) {
  .updates-wrap,
  .app-header .settings-wrap {
    position: static !important;
  }
  .settings-panel,
  .settings-dropdown,
  .updates-panel {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 156px);
    max-height: calc(100dvh - 156px);
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    white-space: normal !important;
    box-sizing: border-box !important;
  }
  .ocsc-changelog-strip {
    padding: 7px 10px;
  }
  .ocsc-changelog-bar {
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
  }
  .ocsc-changelog-summary-btn {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 1px 0;
  }
  .ocsc-changelog-headline {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    line-height: 1.35;
  }
  .ocsc-changelog-controls {
    width: auto;
    flex-shrink: 0;
    justify-content: flex-end;
    gap: 4px;
  }
  .ocsc-changelog-toggle {
    padding: 3px 8px;
    font-size: 11px;
  }
  .ocsc-changelog-dismiss {
    width: 24px;
    height: 24px;
  }
  .ocsc-changelog-entry {
    flex-direction: column;
    align-items: stretch;
  }
  .ocsc-changelog-action {
    width: 100%;
  }
}

/* Tablet 768px-1023px */
@media (min-width: 768px) and (max-width: 1023px) {
  .app-header > div {
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 6px !important;
  }
  .brand-mark svg {
    width: 28px;
    height: 28px;
  }
  .header-brand-title {
    font-size: 12px !important;
  }
  #desktop-nav-tabs {
    gap: 2px !important;
  }
  .nav-tab {
    font-size: 11px !important;
    padding: 4.5px 6px !important;
    gap: 3px !important;
  }
  .nav-tab svg {
    width: 12px !important;
    height: 12px !important;
  }
  .header-vip-pill {
    padding: 5px 8px;
    font-size: 11px;
  }
  .header-updates-btn {
    padding: 5px 7px;
  }
  .settings-pill-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .updates-panel {
    right: 0;
    width: min(350px, calc(100vw - 32px));
    max-height: min(72dvh, 520px);
  }
  .settings-panel,
  .settings-dropdown {
    right: 0;
    width: min(260px, calc(100vw - 32px)) !important;
  }
}

/* Desktop 1024px+ */
@media (min-width: 1024px) {
  .updates-panel {
    right: 0;
    width: min(390px, calc(100vw - 32px));
    max-height: min(74dvh, 620px);
  }
}

/* ============================================================================
   V50 VIP PASS MODAL + MOBILE VIEWPORT POLISH (<= 639px & <= 374px)
   ============================================================================ */
.vip-pass-dialog {
  background: #FFFFFF;
  color: #0F172A;
}

body[data-theme="sepia"] .vip-pass-dialog {
  background: #FBF6EC !important;
  border-color: #DFD1B4 !important;
  color: #2D241E !important;
}

body[data-theme="sepia"] .vip-pass-dialog .bg-amber-50,
body[data-theme="sepia"] .vip-pass-dialog .bg-amber-50\/90 {
  background-color: #F7ECD3 !important;
  border-color: #D9B77A !important;
}

body[data-theme="sepia"] .vip-pass-dialog .bg-indigo-50\/50 {
  background-color: #F3EAD6 !important;
  border-color: #C9B48B !important;
}

body[data-theme="dark"] #vip-pass-modal .vip-pass-dialog {
  background: #0F1E33 !important;
  border-color: #2C415E !important;
  color: #F8FAFC !important;
}

body[data-theme="dark"] #vip-pass-modal .bg-amber-50,
body[data-theme="dark"] #vip-pass-modal .bg-amber-50\/90 {
  background-color: rgba(120, 53, 15, 0.34) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #FEF3C7 !important;
}

body[data-theme="dark"] #vip-pass-modal .bg-amber-50 *,
body[data-theme="dark"] #vip-pass-modal .bg-amber-50\/90 * {
  color: #FEF3C7 !important;
}

body[data-theme="dark"] #vip-pass-modal .bg-indigo-50\/50 {
  background-color: #16263E !important;
  border-color: rgba(129, 140, 248, 0.45) !important;
  color: #F8FAFC !important;
}

body[data-theme="dark"] #vip-pass-modal .bg-rose-50 {
  background-color: rgba(133, 77, 30, 0.34) !important;
  border-color: rgba(251, 191, 36, 0.45) !important;
  color: #FDE68A !important;
}

body[data-theme="dark"] #vip-pass-modal .bg-emerald-50 {
  background-color: rgba(107, 62, 27, 0.38) !important;
  border-color: rgba(52, 211, 153, 0.45) !important;
  color: #FEF3C7 !important;
}

body[data-theme="dark"] #vip-pass-modal .bg-blue-50 {
  background-color: rgba(30, 58, 138, 0.4) !important;
  border-color: rgba(96, 165, 250, 0.45) !important;
  color: #DBEAFE !important;
}

body[data-theme="dark"] #vip-pass-modal #btn-vip-pass-open-checkout,
body[data-theme="dark"] #vip-pass-modal #btn-vip-pass-login,
body[data-theme="dark"] #vip-pass-modal #btn-vip-pass-buy-more {
  color: #0F172A !important;
}

@media (max-width: 639px) {
  .q-card-banner {
    padding: 8px 10px;
  }
  .q-num-pill {
    padding: 2.5px 8px;
    font-size: 11px;
  }
  .q-tag-pill {
    padding: 2px 7px;
    font-size: 10.5px;
  }
  .q-pin-btn,
  .q-bm-btn {
    padding: 3px 7px;
    font-size: 10.5px;
  }
  .q-ref-pill {
    margin-top: 5px;
    padding: 4px 8px;
    font-size: 11px;
  }
  .exam-scope-links {
    margin-left: 0;
  }
}

@media (max-width: 374px) {
  .pos-card-title {
    font-size: 11px;
  }
  .pos-card-mob-meta {
    font-size: 10px;
  }
  .exam-act-chip {
    padding: 4.5px 5.5px;
    font-size: 10.5px;
  }
  .exam-act-finish {
    padding: 5px 8px;
    font-size: 10.5px;
  }
  .exam-flow-bar {
    padding: 6px 8px;
    gap: 5px;
  }
  .exam-flow-bar .exam-seg-btn {
    padding: 4.5px 6.5px;
    font-size: 10.5px;
  }
  .exam-autoadv-switch {
    padding: 4.5px 7.5px;
    font-size: 10.5px;
    gap: 4px;
  }
}

/* ============================================================================
   AGO v52: CRO Inline QR Checkout, Header Unlock CTA & Mobile Polish
   ============================================================================ */
.app-header #header-unlock-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 11px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  color: #0F172A;
  border: 1px solid #FDE68A;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.app-header #header-unlock-btn:hover {
  filter: brightness(1.06);
}

.app-header #header-unlock-btn.hidden {
  display: none !important;
}

.app-header #header-vip-btn:not(.is-vip-active) {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.32) !important;
  color: #F8FAFC !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.app-header #header-vip-btn:not(.is-vip-active):hover {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #FFFFFF !important;
}

.app-header #header-vip-btn.is-vip-active {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
  border-color: #6EE7B7 !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35) !important;
}

@media (min-width: 768px) and (max-width: 1279px) {
  .app-header > div {
    padding-left: 10px !important;
    padding-right: 10px !important;
    gap: 5px !important;
  }
  .app-header .header-brand-title {
    font-size: 12.5px !important;
  }
  .app-header #desktop-nav-tabs {
    gap: 2px !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }
  .app-header #desktop-nav-tabs .nav-tab {
    font-size: 11px !important;
    padding: 5px 7px !important;
    gap: 3px !important;
  }
  .app-header #desktop-nav-tabs .nav-tab svg {
    width: 12px !important;
    height: 12px !important;
  }
  .app-header #header-unlock-btn,
  .app-header #header-vip-btn {
    padding: 4.5px 8px !important;
    font-size: 11px !important;
    gap: 3px !important;
  }
  .app-header #header-updates-btn {
    padding: 5px 6px !important;
  }
  .app-header #settings-toggle {
    padding: 5px 7px !important;
    font-size: 11px !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .app-header .header-brand-title {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    line-height: 1.12 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  .app-header .brand-main-word {
    display: block !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }
  .app-header .brand-sub-word {
    display: block !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }
  .app-header #desktop-nav-tabs .nav-tab {
    padding: 4.5px 6px !important;
  }
}

@media (max-width: 639px) {
  .app-header > div {
    padding-left: 10px !important;
    padding-right: 10px !important;
    gap: 6px !important;
  }
  .app-header .header-brand-title {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    line-height: 1.12 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  .app-header .brand-main-word {
    display: block !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }
  .app-header .brand-sub-word {
    display: block !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }
  .app-header #header-unlock-btn,
  .app-header #header-vip-btn {
    padding: 5px 8px !important;
    font-size: 11px !important;
    min-height: 32px !important;
    height: 32px !important;
    gap: 3px !important;
  }
  .app-header #header-unlock-btn svg,
  .app-header #header-vip-btn svg {
    width: 12px !important;
    height: 12px !important;
  }
  .app-header #header-updates-btn,
  .app-header #settings-toggle {
    min-height: 32px !important;
    height: 32px !important;
  }
}

@media (max-width: 399px) {
  .app-header > div {
    padding-left: 8px !important;
    padding-right: 8px !important;
    gap: 4px !important;
  }
  .app-header .brand-mark svg {
    width: 26px !important;
    height: 26px !important;
  }
  .app-header .header-actions-wrap {
    gap: 3px !important;
  }
  .app-header #header-unlock-btn,
  .app-header #header-vip-btn {
    padding: 4px 6.5px !important;
    font-size: 10.5px !important;
    min-height: 30px !important;
    height: 30px !important;
  }
  .app-header #header-unlock-btn svg,
  .app-header #header-vip-btn svg {
    display: none !important;
  }
  .app-header #header-updates-btn,
  .app-header #settings-toggle {
    padding: 4px 6px !important;
    min-height: 30px !important;
    height: 30px !important;
    font-size: 10.5px !important;
  }
}

@media (max-width: 359px) {
  .app-header .brand-main-word {
    font-size: 10.5px !important;
  }
  .app-header .brand-sub-word {
    font-size: 9px !important;
  }
  .app-header .brand-mark svg {
    width: 24px !important;
    height: 24px !important;
  }
  .app-header #header-unlock-btn,
  .app-header #header-vip-btn {
    padding: 3.5px 5.5px !important;
    font-size: 10px !important;
  }
}

@media (max-width: 767px) {
  .portal-switcher-bar .portal-pill {
    min-height: 35px !important;
    padding: 5px 10px !important;
    font-size: 11px !important;
  }
}

@media (max-width: 639px) {
  #section-seqsheet #question-list-container {
    padding-bottom: 84px;
  }
  #section-seqsheet .solution-bottom-box .sol-ref-badge {
    display: none !important;
  }
}

/* Non-Blocking In-App Browser Tip & Inline QR Form */
.inapp-modal-warning.is-nonblocking-tip {
  border-color: #6366F1 !important;
  background: linear-gradient(180deg, #EEF2FF 0%, #FFFBEB 100%) !important;
  color: #1E1B4B !important;
}

.inapp-modal-warning.is-nonblocking-tip strong {
  color: #1E1B4B !important;
}

body[data-theme="sepia"] .inapp-modal-warning.is-nonblocking-tip {
  background: linear-gradient(180deg, #F5ECD8 0%, #FFFBEB 100%) !important;
  border-color: #818CF8 !important;
  color: #2D241E !important;
}

body[data-theme="dark"] .inapp-modal-warning.is-nonblocking-tip {
  background: rgba(49, 46, 129, 0.38) !important;
  border-color: #818CF8 !important;
  color: #E0E7FF !important;
}

body[data-theme="dark"] .inapp-modal-warning.is-nonblocking-tip strong {
  color: #FDE68A !important;
}

.checkout-email-qr-box {
  padding: 11px 13px;
  border-radius: 12px;
  border: 2px solid #D97706;
  background: linear-gradient(180deg, #FFFBEB 0%, #FEF3C7 100%);
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.1);
}

#checkout-customer-email-input,
#vip-code-input {
  background: #FFFFFF !important;
  border: 2px solid #475569 !important;
  border-radius: 10px !important;
  color: #0F172A !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#checkout-customer-email-input::placeholder,
#vip-code-input::placeholder {
  color: #64748B;
  opacity: 1;
}

#checkout-customer-email-input:focus,
#vip-code-input:focus {
  border-color: #854D1E !important;
  box-shadow: 0 0 0 3px rgba(133, 77, 30, 0.18) !important;
  outline: none !important;
}

.checkout-inline-terms {
  font-size: 11px;
  line-height: 1.48;
  color: #475569;
  text-align: center;
}

body[data-theme="sepia"] .checkout-email-qr-box {
  background: #F5E6C8;
  border-color: #B45309;
}

body[data-theme="sepia"] #checkout-customer-email-input,
body[data-theme="sepia"] #vip-code-input {
  background: #FFFDF8 !important;
  border-color: #9A7B4F !important;
  color: #2D241E !important;
}

body[data-theme="dark"] .checkout-email-qr-box,
body[data-theme="dark"] #vip-hosted-checkout-box {
  background: #0F172A;
  border: 2px solid #D97706;
}

body[data-theme="dark"] .checkout-email-qr-box label {
  color: #F8FAFC;
}

body[data-theme="dark"] #checkout-customer-email-input,
body[data-theme="dark"] #vip-code-input {
  background: #1E293B !important;
  border-color: #64748B !important;
  color: #F8FAFC !important;
}

body[data-theme="dark"] #checkout-customer-email-input::placeholder,
body[data-theme="dark"] #vip-code-input::placeholder {
  color: #94A3B8;
}

body[data-theme="dark"] .checkout-inline-terms {
  color: #CBD5E1;
}

body[data-theme="sepia"] #vip-selected-summary-card,
body[data-theme="sepia"] #vip-code-details,
body[data-theme="sepia"] #vip-modal-recovery-details {
  background: #FAF0DC;
  border-color: #C7AD84;
}

body[data-theme="dark"] #vip-selected-summary-card,
body[data-theme="dark"] #vip-code-details,
body[data-theme="dark"] #vip-modal-recovery-details {
  background: #1E293B;
  border-color: #475569;
  color: #F8FAFC;
}

body[data-theme="dark"] #vip-selected-summary-card #vip-detail-pkg-name,
body[data-theme="dark"] #vip-code-details summary {
  color: #F8FAFC;
}

body[data-theme="dark"] #vip-selected-summary-card #vip-detail-net-price {
  color: #FBBF24;
}

#vip-qr-payment-layout:not(.has-live-qr):not(.is-loading-qr):not(.is-expired-qr) {
  grid-template-columns: 1fr !important;
}

#vip-qr-payment-layout:not(.has-live-qr):not(.is-loading-qr):not(.is-expired-qr) .ocsc-qr-card-frame {
  display: none !important;
}

.checkout-main-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.35;
  white-space: nowrap;
}

@media (max-width: 374px) {
  .checkout-main-cta {
    white-space: normal;
  }
}

@media (max-width: 639px) {
  #vip-qr-payment-layout.has-live-qr .ocsc-qr-card-frame,
  #vip-qr-payment-layout.is-loading-qr .ocsc-qr-card-frame,
  #vip-qr-payment-layout.is-expired-qr .ocsc-qr-card-frame {
    order: -1;
  }
  #vip-modal > div > div:last-child {
    padding: 10px !important;
  }
  #vip-checkout-flow-wrap > * + * {
    margin-top: 8px !important;
  }
  #vip-modal .checkout-promo-deadline-strip {
    padding: 4px 8px !important;
    font-size: 11px !important;
  }
  #vip-pkg-grid .vip-pkg-card {
    padding: 6px 9px !important;
  }
  #vip-modal-recovery-details {
    padding-top: 4px !important;
  }
  #vip-modal .ocsc-qr-detail-panel {
    padding: 8px 10px !important;
  }
  #vip-modal .ocsc-qr-detail-panel > * + * {
    margin-top: 7px !important;
  }
  #vip-hosted-checkout-box,
  #vip-inline-email-form {
    padding: 8px 10px !important;
  }
  #vip-hosted-checkout-box > * + *,
  #vip-inline-email-form > * + * {
    margin-top: 6px !important;
  }
  #checkout-customer-email-input {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
}

/* Store Free vs VIP Comparison & Duration Clarity */
.store-free-vs-vip-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 639px) {
  .store-free-vs-vip-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.store-cmp-col {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.store-cmp-col.is-free {
  border-color: #CBD5E1;
  background: #F8FAFC;
}

.store-cmp-col.is-vip {
  border-color: #F59E0B;
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
}

.store-cmp-title {
  font-family: "Prompt", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0F172A;
}

.store-cmp-items {
  font-size: 0.76rem;
  line-height: 1.5;
  color: #334155;
}

.store-pkg-duration {
  font-size: 0.72rem;
  font-weight: 600;
  color: #854D1E;
  line-height: 1.45;
  padding-top: 2px;
}

body[data-theme="sepia"] .store-cmp-col.is-free {
  background: #F5EBD6;
  border-color: #D6C5A3;
}

body[data-theme="sepia"] .store-cmp-col.is-vip {
  background: #F7E8C3;
  border-color: #D97706;
}

body[data-theme="dark"] .store-cmp-col.is-free {
  background: #0F172A;
  border-color: #334155;
}

body[data-theme="dark"] .store-cmp-col.is-vip {
  background: rgba(120, 53, 15, 0.35);
  border-color: #F59E0B;
}

body[data-theme="dark"] .store-cmp-title {
  color: #F8FAFC;
}

body[data-theme="dark"] .store-cmp-items {
  color: #CBD5E1;
}

body[data-theme="dark"] .store-pkg-duration {
  color: #FCD34D;
}

/* Post-10-Question Score Summary & Lead Support Paywall */
.seq-trial-paywall-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 20px 16px;
  background: radial-gradient(120% 120% at 90% 10%, rgba(245, 158, 11, 0.16) 0%, transparent 60%),
    linear-gradient(145deg, #2D1B0E 0%, #6B3E1B 52%, #0F172A 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  color: #FFFFFF;
  text-align: center;
  box-shadow: 0 14px 30px -14px rgba(45, 27, 14, 0.55);
}

@media (min-width: 640px) {
  .seq-trial-paywall-card {
    padding: 24px 22px;
  }
}

.seq-trial-paywall-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.seq-trial-paywall-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #FDE68A;
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.seq-trial-score-summary {
  margin: 10px auto 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(251, 191, 36, 0.48);
  max-width: 36rem;
  text-align: center;
}

.seq-trial-score-head {
  font-family: "Prompt", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #FEF3C7;
  line-height: 1.45;
}

.seq-trial-score-coach {
  margin: 4px 0 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: #E2E8F0;
}

.seq-paywall-title {
  font-family: "Prompt", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.4;
  margin: 0 0 6px;
}

@media (min-width: 640px) {
  .seq-paywall-title {
    font-size: 1.15rem;
  }
}

.seq-paywall-sub {
  font-size: 0.78rem;
  color: rgba(254, 226, 226, 0.9);
  line-height: 1.55;
  max-width: 38rem;
  margin: 0 auto 14px;
}

.seq-paywall-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  color: #0F172A;
  font-family: "Prompt", sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.seq-paywall-cta-btn:hover {
  filter: brightness(1.06);
}

.seq-paywall-help-strip {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.24);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  font-size: 0.76rem;
  color: #E2E8F0;
}

.seq-paywall-help-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FDE68A !important;
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  font-size: 0.74rem;
  text-decoration: none;
  transition: background 0.15s ease;
}

.seq-paywall-help-link:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* Credibility Cleanup, Hero Trust Pill & Store Chat CTA Parity (v55) */
.ocsc-hero-trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: "Prompt", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #FEF3C7;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-hero-chat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid rgba(255, 255, 255, 0.36);
  color: #FFFFFF !important;
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  font-size: 0.84rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.store-hero-chat-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

#bottom-user-reviews-bar .review-pill-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 15px;
}

#bottom-user-reviews-bar .review-pill-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#bottom-user-reviews-bar .review-pill-verified {
  color: #059669;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

body[data-theme="dark"] #bottom-user-reviews-bar .review-pill-verified {
  color: #34D399;
}

body[data-theme="sepia"] #bottom-user-reviews-bar .review-pill-verified {
  color: #047857;
}

#bottom-user-reviews-bar .review-pill-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: #6B3E1B;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

body[data-theme="dark"] #bottom-user-reviews-bar .review-pill-tag {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(251, 191, 36, 0.38);
  color: #FDE68A;
}

body[data-theme="sepia"] #bottom-user-reviews-bar .review-pill-tag {
  background: #F6E6D4;
  border-color: #D8B4A0;
  color: #6B1D2F;
}

#bottom-user-reviews-bar .review-pill-quote {
  margin: 0;
  font-size: 0.81rem;
  line-height: 1.5;
  color: var(--text-main);
  font-weight: 600;
  white-space: normal;
}

#bottom-user-reviews-bar .review-pill-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 0.72rem;
}

#bottom-user-reviews-bar .review-pill-name {
  color: #6B3E1B;
  font-weight: 800;
}

body[data-theme="dark"] #bottom-user-reviews-bar .review-pill-name {
  color: #FBBF24;
}

body[data-theme="sepia"] #bottom-user-reviews-bar .review-pill-name {
  color: #5C2434;
}

#bottom-user-reviews-bar .review-pill-role {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* =========================================================
 * CHEAT SHEET V58 REDESIGN: SCOPE BAR, QUICK BOX, TRAP BOX & COLLAPSIBLE REF
 * (AGO Crimson/Ruby-Gold Palette across Light / Sepia / Dark)
 * ========================================================= */
.cs-md-content {
  position: relative;
}
.cs-md-content .cs-subhead {
  font-family: "Prompt", sans-serif;
  font-size: 1.05em;
  font-weight: 800;
  color: #6B3E1B;
  margin: 14px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid #FDE68A;
}
body[data-theme="dark"] .cs-md-content .cs-subhead {
  color: #FDE68A;
  border-bottom-color: rgba(245, 158, 11, 0.35);
}
body[data-theme="sepia"] .cs-md-content .cs-subhead {
  color: #4A2C14;
  border-bottom-color: #DECBB4;
}
.cs-md-content .cs-subhead-sm {
  font-family: "Prompt", sans-serif;
  font-size: 0.96em;
  font-weight: 700;
  color: #4A2C14;
  margin: 10px 0 6px;
}
body[data-theme="dark"] .cs-md-content .cs-subhead-sm {
  color: #FCD34D;
}
.cs-md-content .cs-divider {
  border: 0;
  border-top: 1px dashed var(--border-subtle);
  margin: 12px 0;
}
.cs-md-content .cs-ul-list,
.cs-md-content .cs-ol-list {
  margin: 6px 0 12px 20px;
  padding: 0;
}
.cs-md-content .cs-ul-list { list-style: disc; }
.cs-md-content .cs-ol-list { list-style: decimal; }
.cs-md-content .cs-ul-list li,
.cs-md-content .cs-ol-list li {
  margin-bottom: 5px;
}
.cs-md-content .cs-para {
  margin: 6px 0 10px;
}
.cs-md-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(107, 62, 27, 0.08);
  color: #6B3E1B;
}
body[data-theme="dark"] .cs-md-content code {
  background: rgba(251, 191, 36, 0.16);
  color: #FDE68A;
}
.cs-md-content .overflow-x-auto {
  margin: 8px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}
.cs-md-content table {
  font-size: 0.98em;
  line-height: 1.65;
}
.cs-md-content tbody tr:nth-child(even) {
  background: rgba(107, 62, 27, 0.025);
}
body[data-theme="dark"] .cs-md-content tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}
.cs-md-content td,
.cs-md-content th {
  padding: 9px 11px;
}

/* Position Scope Bar inside each Cheat Sheet Card */
.cs-pos-scope-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(107, 62, 27, 0.05);
  border: 1px solid rgba(107, 62, 27, 0.16);
}
@media (max-width: 639px) {
  .cs-pos-scope-bar { margin: 0 0 10px; padding: 7px 9px; }
}
.cs-pos-scope-lbl {
  font-family: "Prompt", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #6B3E1B;
}
.cs-pos-scope-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cs-pos-scope-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 9999px;
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 600;
  background: #FFFFFF;
  color: #334155;
  border: 1px solid #CBD5E1;
}
.cs-pos-scope-chip.is-active-pos {
  background: #6B3E1B;
  color: #FDE68A;
  border-color: #6B3E1B;
  font-weight: 700;
}
body[data-theme="dark"] .cs-pos-scope-bar {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(251, 191, 36, 0.28);
}
body[data-theme="dark"] .cs-pos-scope-lbl {
  color: #FCD34D;
}
body[data-theme="dark"] .cs-pos-scope-chip {
  background: #1E293B;
  color: #CBD5E1;
  border-color: #334155;
}
body[data-theme="dark"] .cs-pos-scope-chip.is-active-pos {
  background: #854D1E;
  color: #FEF3C7;
  border-color: #F5D77F;
}
body[data-theme="sepia"] .cs-pos-scope-bar {
  background: #EFE7D8;
  border-color: #D6C5A3;
}
body[data-theme="sepia"] .cs-pos-scope-lbl {
  color: #4A2C14;
}
body[data-theme="sepia"] .cs-pos-scope-chip {
  background: #FBF7EC;
  border-color: #D6C5A3;
  color: #2D241E;
}
body[data-theme="sepia"] .cs-pos-scope-chip.is-active-pos {
  background: #6B3E1B;
  border-color: #6B3E1B;
  color: #FDE68A;
}

/* Quick 1-Minute Summary Box */
.cs-quick-box {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FFFBEB 0%, #FEFCE8 100%);
  border: 1.5px solid #FCD34D;
  border-left: 5px solid #6B3E1B;
}
.cs-quick-title {
  font-family: "Prompt", sans-serif;
  font-size: 1.02em;
  font-weight: 800;
  color: #4A2C14;
  margin-bottom: 6px;
}
.cs-quick-body ul,
.cs-trap-body ul {
  font-size: 0.95em !important;
  line-height: 1.66;
}
.cs-quick-body .cs-callout-list,
.cs-trap-body .cs-callout-list {
  margin: 4px 0 0 18px;
  padding: 0;
  list-style: disc;
}
.cs-quick-body li,
.cs-trap-body li {
  margin-bottom: 5px;
  line-height: 1.66;
}
body[data-theme="dark"] .cs-quick-box {
  background: linear-gradient(135deg, rgba(133, 77, 30, 0.20) 0%, rgba(217, 119, 6, 0.10) 100%);
  border-color: rgba(251, 191, 36, 0.42);
  color: #FFFBEB;
}
body[data-theme="dark"] .cs-quick-title {
  color: #FDE68A;
}
body[data-theme="sepia"] .cs-quick-box {
  background: linear-gradient(135deg, #F5EBD6 0%, #FAF3E0 100%);
  border-color: #C7B28A;
  border-left-color: #6B3E1B;
  color: #2D241E;
}
body[data-theme="sepia"] .cs-quick-title {
  color: #4A2C14;
}

/* 1-Line Plain-Thai Mini Example inside Cheat Sheet Table Cells */
.cs-mini-ex {
  margin-top: 6px;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(107, 62, 27, 0.06);
  border-left: 3px solid #B45309;
  font-size: 0.96em;
  line-height: 1.58;
  color: #334155;
}
.cs-mini-ex strong {
  color: #6B3E1B;
}
body[data-theme="sepia"] .cs-mini-ex {
  background: rgba(107, 62, 27, 0.08);
  border-left-color: #854D1E;
  color: #2D241E;
}
body[data-theme="sepia"] .cs-mini-ex strong {
  color: #4A2C14;
}
body[data-theme="dark"] .cs-mini-ex {
  background: rgba(251, 191, 36, 0.10);
  border-left-color: #FBBF24;
  color: #E2E8F0;
}
body[data-theme="dark"] .cs-mini-ex strong {
  color: #FDE68A;
}

/* Exam Trap Alert Box */
.cs-trap-box {
  margin: 10px 0 14px;
  padding: 11px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FFFBEB 0%, #FFFBEB 100%);
  border: 1.5px solid #FCD34D;
  border-left: 5px solid #D97706;
  color: #78350F;
}
.cs-trap-title {
  font-family: "Prompt", sans-serif;
  font-size: 1.02em;
  font-weight: 800;
  color: #9A3412;
  margin-bottom: 5px;
}
body[data-theme="dark"] .cs-trap-box {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.16) 0%, rgba(225, 29, 72, 0.10) 100%);
  border-color: rgba(251, 191, 36, 0.4);
  color: #FEF3C7;
}
body[data-theme="dark"] .cs-trap-title {
  color: #FDE68A;
}
body[data-theme="sepia"] .cs-trap-box {
  background: #F6E6D2;
  border-color: #D4A373;
  border-left-color: #B45309;
  color: #431407;
}

/* Collapsible Legal Reference Accordion */
.cs-ref-box {
  margin: 14px 0 4px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  overflow: hidden;
}
.cs-ref-box summary {
  cursor: pointer;
  padding: 9px 13px;
  font-family: "Prompt", sans-serif;
  font-size: 0.86em;
  font-weight: 700;
  color: #475569;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cs-ref-box summary::-webkit-details-marker {
  display: none;
}
.cs-ref-box summary::before {
  content: "📚 ";
}
.cs-ref-box summary::after {
  content: "กดดูที่มา ▾";
  font-size: 11px;
  font-weight: 600;
  color: #6B3E1B;
  margin-left: auto;
  white-space: nowrap;
}
.cs-ref-box[open] summary::after {
  content: "ซ่อน ▴";
}
.cs-ref-body {
  padding: 10px 14px 12px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 0.84em;
  line-height: 1.58;
  color: var(--text-muted);
}
body[data-theme="dark"] .cs-ref-box summary {
  color: #CBD5E1;
}
body[data-theme="dark"] .cs-ref-box summary::after {
  color: #FDE68A;
}
body[data-theme="sepia"] .cs-ref-box summary {
  color: #4A3B32;
}
body[data-theme="sepia"] .cs-ref-box summary::after {
  color: #4A2C14;
}

/* =========================================================
   CHEAT SHEET 3-TONE SEMANTIC HIGHLIGHTS, LEGEND & CELL LISTS
   ========================================================= */
.cs-color-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
}
.cs-legend-label {
  font-family: "Prompt", sans-serif;
  font-weight: 700;
  color: var(--text-main);
}
.cs-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
@media (max-width: 639px) {
  .cs-color-legend {
    gap: 3px 6px;
    padding-top: 4px;
    margin-top: 4px !important;
    font-size: 10px;
    line-height: 1.32;
  }
  .cs-color-legend .cs-hl-num,
  .cs-color-legend .cs-hl-warn,
  .cs-color-legend .cs-hl-term {
    padding: 0 4px;
  }
}
body[data-theme="sepia"] .cs-color-legend {
  border-top-color: #D6C5A3;
  color: #4A3B32;
}
body[data-theme="sepia"] .cs-legend-label {
  color: #2D241E;
}
body[data-theme="dark"] .cs-color-legend {
  border-top-color: rgba(148, 163, 184, 0.22);
  color: #CBD5E1;
}
body[data-theme="dark"] .cs-legend-label {
  color: #F8FAFC;
}

.cs-hl-num,
.cs-hl-warn,
.cs-hl-term {
  display: inline;
  font-weight: 700;
  border: none;
  padding: 0;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.cs-hl-num {
  background: rgba(245, 158, 11, 0.14);
  color: #78350F;
  padding: 0.01em 0.22em;
}
.cs-hl-warn {
  background: transparent;
  color: #B91C1C;
  text-decoration: underline;
  text-decoration-color: rgba(185, 28, 28, 0.36);
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
}
.cs-hl-term {
  background: transparent;
  color: #0F172A;
  font-weight: 700;
}
.cs-color-legend .cs-hl-num {
  padding: 1px 5px;
  border-radius: 4px;
}
body[data-theme="sepia"] .cs-hl-num {
  background: rgba(217, 119, 6, 0.14);
  color: #6C2E09;
}
body[data-theme="sepia"] .cs-hl-warn {
  background: transparent;
  color: #991B1B;
  text-decoration-color: rgba(153, 27, 27, 0.36);
}
body[data-theme="sepia"] .cs-hl-term {
  background: transparent;
  color: #2D241E;
  font-weight: 700;
}
body[data-theme="dark"] .cs-hl-num {
  background: rgba(251, 191, 36, 0.16);
  color: #FDE68A;
}
body[data-theme="dark"] .cs-hl-warn {
  background: transparent;
  color: #FCD34D;
  text-decoration-color: rgba(252, 211, 77, 0.42);
}
body[data-theme="dark"] .cs-hl-term {
  background: transparent;
  color: #F8FAFC;
  font-weight: 700;
}

.cs-md-content td {
  vertical-align: top;
}
.cs-cell-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cs-cell-list li {
  position: relative;
  padding-left: 12px;
  line-height: 1.58;
}
.cs-cell-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--cs-th-text);
  font-weight: 800;
}
body[data-theme="dark"] .cs-cell-list li::before {
  color: #FDE68A;
}
.cs-cell-head {
  font-weight: 700;
  color: var(--text-main);
}

.cs-exam-meta-note {
  margin: 12px 0 8px;
  padding: 10px 13px;
  border-radius: 11px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-left: 4px solid #475569;
  font-size: 0.86em;
  line-height: 1.58;
  color: #334155;
}
.cs-exam-meta-title {
  font-family: "Prompt", sans-serif;
  font-size: 0.94em;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 4px;
}
body[data-theme="sepia"] .cs-exam-meta-note {
  background: #F2EAD8;
  border-color: #CBBBA0;
  border-left-color: #6B5B45;
  color: #3E3024;
}
body[data-theme="sepia"] .cs-exam-meta-title {
  color: #2D241E;
}
body[data-theme="dark"] .cs-exam-meta-note {
  background: rgba(30, 41, 59, 0.72);
  border-color: #475569;
  border-left-color: #94A3B8;
  color: #CBD5E1;
}
body[data-theme="dark"] .cs-exam-meta-title {
  color: #F1F5F9;
}

/* =========================================================
   AUTO-PARAGRAPH & KEY-NUMBER HIGHLIGHTING IN EXPLANATIONS
   ========================================================= */
.ocsc-exp-prose {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.98em;
  line-height: 1.72;
}
.ocsc-exp-prose p {
  margin: 0;
  line-height: 1.72;
}
.ocsc-exp-prose .ocsc-exp-item {
  padding-left: 0.72rem;
  border-left: 2.5px solid rgba(107, 62, 27, 0.28);
}
.ocsc-exp-prose-sm {
  font-size: 0.95em;
}
.ocsc-exp-prose-sm p {
  line-height: 1.66;
}
.ocsc-exp-heading {
  font-family: "Prompt", sans-serif;
  font-size: 0.98em;
  font-weight: 800;
  color: #6B3E1B;
  margin-bottom: 1px;
}
.ocsc-exp-step-lbl {
  color: #6B3E1B;
  font-weight: 800;
}
.ocsc-exp-summary {
  padding: 8px 11px;
  border-radius: 9px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-left: 3.5px solid #059669;
  color: #064E3B;
  font-weight: 600;
  line-height: 1.62;
}
.ocsc-exp-summary-lbl {
  font-weight: 800;
}
.ocsc-exp-law-ref {
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(107, 62, 27, 0.05);
  border: 1px solid rgba(107, 62, 27, 0.16);
  font-size: 0.94em;
  color: #334155;
  line-height: 1.62;
}
.ocsc-exp-law-lbl {
  font-weight: 800;
  color: #6B3E1B;
}
.ocsc-trap-alert {
  font-size: 0.92em;
  line-height: 1.62;
}
.ocsc-exp-num {
  display: inline;
  white-space: nowrap;
  background: rgba(245, 158, 11, 0.18);
  color: #6B3E1B;
  font-weight: 700;
  padding: 0.04em 0.34em;
  border-radius: 0.32em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
body[data-theme="sepia"] .ocsc-exp-prose .ocsc-exp-item {
  border-left-color: rgba(107, 62, 27, 0.35);
}
body[data-theme="sepia"] .ocsc-exp-heading,
body[data-theme="sepia"] .ocsc-exp-step-lbl,
body[data-theme="sepia"] .ocsc-exp-law-lbl {
  color: #4A2C14;
}
body[data-theme="sepia"] .ocsc-exp-summary {
  background: #EEF6EE;
  border-color: #A7C9A7;
  border-left-color: #059669;
  color: #14452F;
}
body[data-theme="sepia"] .ocsc-exp-law-ref {
  background: #EFE7D8;
  border-color: #D6C5A3;
  color: #2D241E;
}
body[data-theme="sepia"] .ocsc-exp-num {
  background: rgba(180, 83, 9, 0.15);
  color: #4A2C14;
}
body[data-theme="dark"] .ocsc-exp-prose .ocsc-exp-item {
  border-left-color: rgba(251, 191, 36, 0.42);
}
body[data-theme="dark"] .ocsc-exp-heading {
  color: #FDE68A;
}
body[data-theme="dark"] .ocsc-exp-step-lbl {
  color: #FCD34D;
}
body[data-theme="dark"] .ocsc-exp-summary {
  background: rgba(5, 150, 105, 0.18);
  border-color: rgba(52, 211, 153, 0.40);
  border-left-color: #34D399;
  color: #D1FAE5;
}
body[data-theme="dark"] .ocsc-exp-law-ref {
  background: rgba(148, 163, 184, 0.10);
  border-color: rgba(148, 163, 184, 0.25);
  color: #CBD5E1;
}
body[data-theme="dark"] .ocsc-exp-law-lbl {
  color: #FDE68A;
}
body[data-theme="dark"] .ocsc-exp-num {
  background: rgba(251, 191, 36, 0.22);
  color: #FDE68A;
}

/* =========================================================
   AGO PRACTICE-MODE FORMULA SHEET BUTTON & MODAL
   ========================================================= */
.exam-flow-right-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}
.exam-formula-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1.5px solid #F59E0B;
  background: linear-gradient(135deg, #2D1B0E 0%, #6B3E1B 100%);
  color: #FEF3C7;
  font-family: var(--font-heading, "Prompt", sans-serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(107, 62, 27, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.exam-formula-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(107, 62, 27, 0.28);
  filter: brightness(1.07);
}
body[data-theme="dark"] .exam-formula-btn {
  background: linear-gradient(135deg, #6B3E1B 0%, #2D1B0E 100%);
  border-color: #FBBF24;
  color: #FDE68A;
}
body[data-theme="sepia"] .exam-formula-btn {
  background: linear-gradient(135deg, #4A2C14 0%, #6B3E1B 100%);
  border-color: #D97706;
  color: #FEF3C7;
}

.formula-sheet-dialog {
  background: #FFFFFF;
  color: #0F172A;
  border-color: #CBD5E1;
}
.formula-modal-header {
  padding: 15px 18px 12px;
  background: linear-gradient(135deg, #0F172A 0%, #2D1B0E 60%, #6B3E1B 100%);
  color: #F8FAFC;
  border-bottom: 2px solid #F59E0B;
  flex-shrink: 0;
}
.formula-modal-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #FDE68A;
  font-family: var(--font-heading, "Prompt", sans-serif);
  font-size: 11.5px;
  font-weight: 700;
}
.formula-modal-title {
  margin: 4px 0 2px;
  font-family: var(--font-heading, "Prompt", sans-serif);
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.35;
}
.formula-modal-subtitle {
  margin: 0;
  font-size: 12px;
  color: #FDE68A;
  line-height: 1.45;
}
.formula-close-x {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  font-weight: 700;
  flex-shrink: 0;
  cursor: pointer;
}
.formula-close-x:hover {
  background: rgba(255, 255, 255, 0.22);
}
.formula-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.formula-tab-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
  font-family: var(--font-heading, "Prompt", sans-serif);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.formula-tab-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.formula-tab-btn.is-active {
  background: #FBBF24;
  border-color: #F59E0B;
  color: #0F172A;
  font-weight: 800;
}
.formula-modal-body {
  padding: 14px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #F8FAFC;
}
.formula-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-left: 4px solid #6B3E1B;
  border-radius: 12px;
  padding: 11px 13px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.formula-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
}
.formula-card-title {
  font-family: var(--font-heading, "Prompt", sans-serif);
  font-size: 1rem;
  font-weight: 800;
  color: #2D1B0E;
}
.formula-card-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #6B3E1B;
}
.formula-expr-box {
  padding: 8px 11px;
  border-radius: 8px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #78350F;
  font-family: var(--font-heading, "Prompt", sans-serif);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.58;
  word-break: break-word;
}
.formula-example-row {
  margin-top: 7px;
  font-size: 0.94rem;
  line-height: 1.56;
  color: #1E293B;
}
.formula-note-row {
  margin-top: 5px;
  font-size: 0.88rem;
  line-height: 1.52;
  color: #9A3412;
  background: #FFF7ED;
  border-radius: 6px;
  padding: 5px 9px;
}
.formula-modal-footer {
  padding: 10px 18px;
  border-top: 1px solid #E2E8F0;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.formula-footer-hint {
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
}
.formula-footer-close-btn {
  padding: 7px 14px;
  border-radius: 10px;
  background: #6B3E1B;
  color: #FFFFFF;
  font-family: var(--font-heading, "Prompt", sans-serif);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}
.formula-footer-close-btn:hover {
  background: #854D1E;
}

body[data-theme="dark"] .formula-sheet-dialog {
  background: #0F172A;
  border-color: #334155;
}
body[data-theme="dark"] .formula-modal-body {
  background: #0B1220;
}
body[data-theme="dark"] .formula-card {
  background: #1E293B;
  border-color: #334155;
  border-left-color: #F59E0B;
}
body[data-theme="dark"] .formula-card-title {
  color: #FDE68A;
}
body[data-theme="dark"] .formula-card-tag {
  background: rgba(107, 62, 27, 0.35);
  border-color: rgba(251, 191, 36, 0.35);
  color: #FDE68A;
}
body[data-theme="dark"] .formula-expr-box {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
  color: #FEF3C7;
}
body[data-theme="dark"] .formula-example-row {
  color: #E2E8F0;
}
body[data-theme="dark"] .formula-note-row {
  background: rgba(234, 88, 12, 0.16);
  color: #FDBA74;
}
body[data-theme="dark"] .formula-modal-footer {
  background: #0F172A;
  border-top-color: #334155;
}
body[data-theme="dark"] .formula-footer-hint {
  color: #94A3B8;
}

body[data-theme="sepia"] .formula-sheet-dialog {
  background: #FAF3E0;
  border-color: #D2BFA0;
}
body[data-theme="sepia"] .formula-modal-body {
  background: #F4EAD2;
}
body[data-theme="sepia"] .formula-card {
  background: #FFFDF7;
  border-color: #DECBA8;
  border-left-color: #4A2C14;
}
body[data-theme="sepia"] .formula-modal-footer {
  background: #FAF3E0;
  border-top-color: #DECBA8;
}

@media (max-width: 640px) {
  .exam-flow-right-actions {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }
  .exam-flow-right-actions .exam-formula-btn {
    flex: 0 0 auto;
    padding: 5px 10px;
    font-size: 11.5px;
  }
  .exam-flow-right-actions .exam-autoadv-switch {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    padding: 5px 8px;
    font-size: 11.5px;
  }
  .formula-modal-header {
    padding: 12px 14px 10px;
  }
  .formula-modal-title {
    font-size: 0.95rem;
  }
  .formula-modal-body {
    padding: 10px 12px;
  }
  .formula-modal-footer {
    padding: 9px 12px;
    flex-direction: column;
    align-items: stretch;
  }
  .formula-footer-close-btn {
    width: 100%;
  }
}

/* ============================================================================
   OCSC 2570 — 3-PILLAR PASS/FAIL DIAGNOSTIC GATE
   ============================================================================ */
.ocsc-pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 767px) {
  .ocsc-pillar-grid {
    grid-template-columns: 1fr;
  }
}

.ocsc-pillar-card {
  border-radius: 1rem;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-card);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ocsc-pillar-card.is-pass {
  border-color: #10B981;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.09) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.ocsc-pillar-card.is-fail {
  border-color: #E11D48;
  background: linear-gradient(180deg, rgba(225, 29, 72, 0.09) 0%, rgba(225, 29, 72, 0.02) 100%);
}

.ocsc-pillar-card.is-untested {
  border-style: dashed;
  opacity: 0.78;
}

body[data-theme="dark"] .ocsc-pillar-card.is-pass {
  background: rgba(74, 44, 20, 0.35);
}

body[data-theme="dark"] .ocsc-pillar-card.is-fail {
  background: rgba(136, 19, 55, 0.25);
}

.ocsc-pillar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: "Prompt", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.ocsc-pillar-badge.is-pass {
  background: #FEF3C7;
  color: #6B3E1B;
}

.ocsc-pillar-badge.is-fail {
  background: #FFE4E6;
  color: #9F1239;
}

.ocsc-pillar-badge.is-untested {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.cs-pillar-filter-btn {
  font-family: "Prompt", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cs-pillar-filter-btn.is-active {
  background: #6B3E1B;
  border-color: #6B3E1B;
  color: #FFFFFF;
}

/* Official OCSC 1-Click Timed Mock CTA & Official OCSC Subject Score Summary Table */
.ocsc-official-mock-btn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4A2C14 0%, #6B3E1B 58%, #2D1B0E 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.72);
  box-shadow: 0 8px 20px -10px rgba(45, 27, 14, 0.55);
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.ocsc-official-mock-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.ocsc-official-mock-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ocsc-score-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.ocsc-score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.ocsc-score-table thead th {
  background: linear-gradient(135deg, #4A2C14 0%, #2D1B0E 100%);
  color: #FDE68A;
  font-family: "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 10px;
  border-bottom: 1.5px solid rgba(245, 158, 11, 0.5);
  white-space: nowrap;
}

.ocsc-score-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.ocsc-score-table tbody tr:nth-child(even) {
  background: rgba(107, 62, 27, 0.03);
}

.ocsc-score-table tfoot td {
  padding: 9px 10px;
  background: #FFFBEB;
  color: #2D1B0E;
  font-family: "Prompt", sans-serif;
  font-weight: 800;
  border-top: 2px solid rgba(107, 62, 27, 0.35);
  white-space: nowrap;
}

.ocsc-score-table .is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ocsc-score-table .is-status {
  text-align: center;
  white-space: nowrap;
}

.ocsc-score-table--compact thead th,
.ocsc-score-table--compact tbody td,
.ocsc-score-table--compact tfoot td {
  padding: 7px 9px;
  font-size: 12px;
}

.ocsc-score-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.ocsc-score-status.is-pass {
  background: #DCFCE7;
  color: #166534;
}

.ocsc-score-status.is-fail {
  background: #FFE4E6;
  color: #9F1239;
}

.ocsc-score-status.is-untested {
  background: #E2E8F0;
  color: #475569;
}

body[data-theme="sepia"] .ocsc-score-table tfoot td {
  background: #EFE7D8;
  color: #2D1B0E;
}

body[data-theme="dark"] .ocsc-score-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

body[data-theme="dark"] .ocsc-score-table tfoot td {
  background: rgba(107, 62, 27, 0.35);
  color: #FDE68A;
  border-top-color: rgba(245, 158, 11, 0.45);
}

body[data-theme="dark"] .ocsc-score-status.is-pass {
  background: rgba(16, 185, 129, 0.25);
  color: #A7F3D0;
}

body[data-theme="dark"] .ocsc-score-status.is-fail {
  background: rgba(244, 63, 94, 0.25);
  color: #FECDD3;
}

@media (max-width: 639px) {
  .ocsc-score-table thead th,
  .ocsc-score-table tbody td,
  .ocsc-score-table tfoot td {
    padding: 7px 6px;
    font-size: 11.5px;
  }
  .ocsc-score-table thead th {
    font-size: 11px;
  }
}

.ocsc-score-scroll-hint {
  display: none;
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 2px;
}

@media (max-width: 520px) {
  .ocsc-col-hide-xs {
    display: none !important;
  }
}

@media (max-width: 440px) {
  .ocsc-score-scroll-hint {
    display: block;
  }
}
