/* ==========================================================================
   UPSC India — "Study Studio" look (presentation only, loaded LAST, after refresh.css)
   One look for web, desktop shell and the phone app: indigo accent (#4F46E5, same as the APK and Loki),
   calm off-white page with white cards (dark: deep navy), fewer borders and more space for grouping,
   a labelled sidebar in sections (Today · Study · Exams & News · Learn · Plan · More) and a bright
   "Today" hero like the phone's home card. Exam accents (exam-theme.js) still win where set.
   Basis: sidebar 240–280px + KPI strip + card grid; grouping by spacing over borders; WCAG AA contrast.
   No markup, handler or data changes live here.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --color-primary: #4F46E5;
  --color-primary-hover: #4338CA;
  --color-primary-active: #3730A3;
  --color-primary-light: #EEF0FF;
  --color-primary-focus: rgba(79, 70, 229, 0.28);
  --color-accent: #4F46E5;
  --color-on-accent: #FFFFFF;
  --color-navy: #0F172A;

  --color-bg: #F6F7FB;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F1F3F9;
  --color-surface-subtle: #F4F5FA;
  --color-surface-sunken: #ECEEF5;

  --color-text: #0F172A;
  --color-text-secondary: #475569;
  --color-muted: #64748B;
  --color-placeholder: #94A3B8;

  --color-border: #E5E7EF;
  --color-border-subtle: #EEF0F5;
  --color-border-strong: #CBD2E0;

  --color-success: #16A34A;
  --color-success-soft: #E8F7EE;
  --color-success-text: #166534;
  --color-warning: #D97706;
  --color-warning-soft: #FEF5E7;
  --color-warning-text: #92400E;
  --color-danger: #DC2626;
  --color-danger-soft: #FDECEC;
  --color-danger-text: #991B1B;
  --color-info: #0EA5E9;
  --color-info-soft: #E6F6FD;
  --color-info-text: #075985;

  --font-sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Devanagari", "Nirmala UI", sans-serif;
  /* Headings in the same clean sans as the text (the old serif made pages look like a document). */
  --font-serif: var(--font-sans);

  --radius-sm: 9px;
  --radius: 11px;
  --radius-md: 14px;
  --radius-lg: 18px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow: 0 6px 20px -8px rgba(15, 23, 42, 0.14);
  --studio-hero: linear-gradient(135deg, #4F46E5 0%, #6D28D9 55%, #7C3AED 100%);
  --studio-hero-text: #FFFFFF;
}

:root[data-theme="dark"] {
  --color-primary: #8B8CF8;
  --color-primary-hover: #A5A6FA;
  --color-primary-active: #C4C5FC;
  --color-primary-light: rgba(129, 131, 248, 0.14);
  --color-primary-focus: rgba(139, 140, 248, 0.35);
  --color-accent: #8B8CF8;
  --color-on-accent: #0B1020;
  --color-navy: #E6E9F5;

  --color-bg: #0B1020;
  --color-surface: #131A2E;
  --color-surface-alt: #19213A;
  --color-surface-subtle: #161E33;
  --color-surface-sunken: #0F1628;

  --color-text: #E6E9F5;
  --color-text-secondary: #AAB3CF;
  --color-muted: #8590B0;
  --color-placeholder: #66718F;

  --color-border: #232C47;
  --color-border-subtle: #1C243C;
  --color-border-strong: #33406A;

  --color-success: #4ADE80;
  --color-success-soft: rgba(74, 222, 128, 0.12);
  --color-success-text: #86EFAC;
  --color-warning: #FBBF24;
  --color-warning-soft: rgba(251, 191, 36, 0.12);
  --color-warning-text: #FCD34D;
  --color-danger: #F87171;
  --color-danger-soft: rgba(248, 113, 113, 0.12);
  --color-danger-text: #FCA5A5;
  --color-info: #38BDF8;
  --color-info-soft: rgba(56, 189, 248, 0.12);
  --color-info-text: #7DD3FC;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --studio-hero: linear-gradient(135deg, #3730A3 0%, #5B21B6 60%, #6D28D9 100%);
}

/* When an exam is chosen, refresh.css repainted everything green; keep the one indigo brand colour
   (the exam badge text, e.g. "SSC", still changes). Same selector, loaded later, so this wins. */
html:root[data-exam-accent] {
  --color-primary: #4F46E5; --color-primary-hover: #4338CA; --color-primary-active: #3730A3;
  --color-primary-light: #EEF0FF; --color-primary-focus: rgba(79, 70, 229, 0.28);
}
html:root[data-theme="dark"][data-exam-accent] {
  --color-primary: #8B8CF8; --color-primary-hover: #A5A6FA; --color-primary-active: #C4C5FC;
  --color-primary-light: rgba(129, 131, 248, 0.14); --color-primary-focus: rgba(139, 140, 248, 0.35);
}

/* The Test Centre (Mock Tests) has its own brand variable; same indigo there. */
:root { --rf-brand: #4F46E5; --rf-brand-soft: #EEF0FF; }
:root[data-theme="dark"] { --rf-brand: #8B8CF8; --rf-brand-soft: rgba(129, 131, 248, 0.14); }
.eh-hero { background: linear-gradient(110deg, #EEF0FF, #F5F3FF 60%, #FDF4FF) !important; border-color: var(--color-border-subtle) !important; border-radius: 20px !important; }
.eh-hero h1 { font-weight: 800 !important; }
:root[data-theme="dark"] .eh-hero { background: linear-gradient(110deg, #19213A, #1E1B4B) !important; }

html, body { background: var(--color-bg); }
body { font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
::selection { background: var(--color-primary-focus); }

/* ---------- 2. Sidebar ---------- */
#workspace .primary-nav {
  background: var(--color-surface) !important;
  border-right: 1px solid var(--color-border-subtle) !important;
  padding: 14px 12px 18px !important;
  gap: 0;
}
.sidebar-brand-row { padding: 2px 6px 14px !important; }
.brand-badge {
  background: var(--studio-hero) !important;
  color: #FFFFFF !important;
  border-radius: 9px !important;
  padding: 5px 8px !important;
  font-weight: 800;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.55);
}
.brand-text { font-family: var(--font-sans) !important; font-weight: 800 !important; letter-spacing: 0.08em !important; color: var(--color-text); }

.primary-nav .nav-section { display: flex; flex-direction: column; margin-top: 10px; }
.primary-nav .nav-section[data-group="Primary"] { margin-top: 2px; }
.primary-nav .sidebar-section-title {
  /* notes-simple.css hid the old single "CORE STUDY" label; the section names are wanted now. */
  display: block !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase;
  color: var(--color-muted) !important;
  padding: 8px 10px 6px !important;
  margin: 0 !important;
}
.primary-nav button {
  min-height: 38px !important;
  padding: 7px 10px !important;
  gap: 10px;
  border-radius: 10px !important;
  font-size: 13.5px !important;
  color: var(--color-text-secondary) !important;
}
.primary-nav button[data-module]::before { margin-right: 0 !important; opacity: .85; }
.primary-nav button:hover { background: var(--color-surface-alt) !important; color: var(--color-text) !important; }
.primary-nav button[aria-current="page"] {
  background: var(--color-primary-light) !important;
  color: var(--color-primary) !important;
  font-weight: 650 !important;
  border-left: 0 !important;
  position: relative;
}
.primary-nav button[aria-current="page"]::after {
  content: "";
  position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--color-primary);
}
.primary-nav .nav-group { margin-top: 12px !important; border-top: 1px solid var(--color-border-subtle); padding-top: 8px; }
.primary-nav .nav-group > summary {
  font-size: 10.5px !important; font-weight: 700 !important; letter-spacing: 0.09em !important;
  text-transform: uppercase; color: var(--color-muted) !important; padding: 8px 10px !important;
}
/* Icon rail (sidebar collapsed, or a 760–1024px window): icons only, no labels or section names. */
#workspace.sidebar-collapsed .primary-nav .nav-section { margin-top: 6px; }
#workspace.sidebar-collapsed .primary-nav .sidebar-section-title { display: none !important; }
#workspace.sidebar-collapsed .primary-nav button[data-module] {
  width: 44px; margin: 0 auto 2px; padding: 0 !important; justify-content: center; font-size: 0 !important; gap: 0;
}
#workspace.sidebar-collapsed .primary-nav .nav-section + .nav-section { border-top: 1px solid var(--color-border-subtle); padding-top: 6px; }
@media (max-width: 1024px) and (min-width: 760px) {
  #workspace .primary-nav .sidebar-section-title { display: none !important; }
  #workspace .primary-nav button[data-module] {
    width: 44px; margin: 0 auto 2px; padding: 0 !important; justify-content: center; font-size: 0 !important; gap: 0;
  }
  #workspace .primary-nav .nav-section { margin-top: 6px; }
  #workspace .primary-nav .nav-section + .nav-section { border-top: 1px solid var(--color-border-subtle); padding-top: 6px; }
  #workspace .primary-nav button[aria-current="page"]::after { left: -8px; }
}
#workspace.sidebar-collapsed .primary-nav button[aria-current="page"]::after { left: -8px; }

/* ---------- 3. Top bar ---------- */
#workspace > header.app-header {
  /* No backdrop-filter here: it would make the fixed sidebar (inside this header) stick to the header box. */
  background: var(--color-bg) !important;
  border-bottom: 1px solid var(--color-border-subtle) !important;
  box-shadow: none !important;
}
#global-search {
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-xs) !important;
  min-width: 240px;
}
#global-search:hover { border-color: var(--color-border-strong) !important; }
#global-ai-btn {
  background: var(--color-primary-light) !important;
  color: var(--color-primary) !important;
  border: 0 !important;
  border-radius: 12px !important;
  font-weight: 650 !important;
}
#global-ai-btn:hover { filter: brightness(0.97); }
#account-menu > summary { border-radius: 12px !important; }

/* ---------- 4. Buttons, inputs ---------- */
#workspace button.ui-primary, #workspace .ui-primary, #workspace #submit, #workspace #new,
#workspace .dash-btn.btn-ai-plan {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: var(--color-on-accent) !important;
  border-radius: 10px !important;
  font-weight: 650 !important;
  box-shadow: 0 4px 12px -6px rgba(79, 70, 229, 0.6) !important;
}
#workspace button.ui-primary:hover, #workspace #submit:hover, #workspace #new:hover { background: var(--color-primary-hover) !important; }
#workspace input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), #workspace select, #workspace textarea {
  border-radius: 10px;
  border-color: var(--color-border);
}
#workspace input:focus-visible, #workspace select:focus-visible, #workspace textarea:focus-visible, #workspace button:focus-visible {
  outline: 2px solid var(--color-primary) !important;
  outline-offset: 2px;
}

/* ---------- 5. Cards ---------- */
#workspace .dash-card, #workspace .ui-card, #workspace .metric-card, #workspace .pf-stat, #exams-workspace .eh-card {
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border-subtle) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
}
#workspace .dash-card { padding: 20px 22px !important; }
#workspace .dash-card h2, #workspace .section-card-header h2 { font-size: 16px !important; font-weight: 700 !important; letter-spacing: -0.01em; }
#workspace .badge { border-radius: 999px !important; font-weight: 600 !important; }
#workspace .badge-blue { background: var(--color-primary-light) !important; color: var(--color-primary) !important; }
#workspace .badge-green { background: var(--color-success-soft) !important; color: var(--color-success-text) !important; }

/* ---------- 6. "Today" hero (dashboard) ---------- */
#dashboard-workspace .dash-welcome-banner {
  background: var(--studio-hero) !important;
  color: var(--studio-hero-text) !important;
  border: 0 !important;
  border-radius: 22px !important;
  padding: 26px 28px !important;
  box-shadow: 0 18px 40px -20px rgba(79, 70, 229, 0.75) !important;
  position: relative;
  overflow: hidden;
}
#dashboard-workspace .dash-welcome-banner::after {
  /* soft light in the corner, like the phone's home card */
  content: ""; position: absolute; right: -80px; top: -90px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.22), transparent);
  pointer-events: none;
}
#dashboard-workspace .dash-welcome-banner * { color: inherit; }
#dashboard-workspace .dash-welcome-banner .eyebrow { opacity: .8; letter-spacing: .12em !important; color: #E0E7FF !important; }
#dashboard-workspace .dash-welcome-banner h1 { font-size: 30px !important; font-weight: 800 !important; letter-spacing: -0.02em !important; color: #FFFFFF !important; }
#dashboard-workspace .dash-greeting-chip {
  background: rgba(255, 255, 255, 0.16) !important; color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important; border-radius: 999px !important;
}
#dashboard-workspace .dash-meta-text { color: #E0E7FF !important; opacity: .9; }
#dashboard-workspace .dash-actions { position: relative; z-index: 1; }
#dashboard-workspace .dash-actions .dash-btn {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 11px !important;
  box-shadow: none !important;
}
#dashboard-workspace .dash-actions .dash-btn:hover { background: rgba(255, 255, 255, 0.24) !important; }
#dashboard-workspace .dash-actions .dash-btn.btn-ai-plan {
  background: #FFFFFF !important; color: #4338CA !important; border-color: #FFFFFF !important;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.45) !important;
}

/* KPI strip: coloured icon chips, big numbers */
#dashboard-workspace .dash-metrics-grid { gap: 14px !important; }
#dashboard-workspace .metric-card { padding: 16px 18px !important; }
#dashboard-workspace .metric-value { font-size: 28px !important; font-weight: 800 !important; letter-spacing: -0.02em; color: var(--color-text) !important; }
#dashboard-workspace .metric-label { font-size: 11px !important; font-weight: 700 !important; letter-spacing: .08em; color: var(--color-muted) !important; }
#dashboard-workspace .metric-icon {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-size: 15px;
  background: var(--color-primary-light);
}
#dashboard-workspace .metric-revision .metric-icon { background: var(--color-info-soft); }
#dashboard-workspace .metric-practice .metric-icon { background: var(--color-warning-soft); }
#dashboard-workspace .metric-syllabus .metric-icon { background: var(--color-success-soft); }

/* "Next up" cards */
#dashboard-workspace #dash-next-items { gap: 14px !important; }
#dashboard-workspace #dash-next-items > article {
  background: var(--color-surface-subtle) !important;
  border: 1px solid var(--color-border-subtle) !important;
  border-radius: 14px !important;
  padding: 16px !important;
  transition: transform .15s ease, box-shadow .15s ease;
}
#dashboard-workspace #dash-next-items > article:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
#dashboard-workspace .dash-habit-pill { border-radius: 12px !important; }

/* ---------- 7. Mobile (phone width) ---------- */
@media (max-width: 760px) {
  #dashboard-workspace .dash-welcome-banner { border-radius: 18px !important; padding: 20px !important; }
  #dashboard-workspace .dash-welcome-banner h1 { font-size: 24px !important; }
  #dashboard-workspace .metric-value { font-size: 22px !important; }
  /* KPI strip as a 2 × 2 grid on phones (one tall column pushed "Next up" far down). */
  #dashboard-workspace .dash-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  #dashboard-workspace .metric-card { padding: 12px 14px !important; }
  #dashboard-workspace .metric-label { font-size: 10px !important; letter-spacing: .05em; }
  #dashboard-workspace .metric-sub { font-size: 12px !important; }
  #dashboard-workspace .dash-actions { gap: 8px !important; }
  #global-search { min-width: 0; }
  #mobile-tabs { background: color-mix(in srgb, var(--color-surface) 92%, transparent) !important; backdrop-filter: blur(10px); border-top: 1px solid var(--color-border-subtle) !important; }
  #mobile-tabs button[aria-current="page"] { color: var(--color-primary) !important; }
}

/* ---------- 8. Simple pages: less text, fewer buttons ---------- */
/* Hidden: "Synced — backend confirmed" when all is well, technical fine print (workspace-ui.js marks it),
   small caps labels above titles, and Refresh buttons (pages load fresh on their own; "Retry sync" stays in
   the Account menu). Errors are never hidden. */
#workspace .quiet-confirmation, #workspace .fine-print { display: none !important; }
#workspace .ui-page .eyebrow, #dashboard-workspace .dash-welcome-banner .eyebrow { display: none !important; }
#practice-refresh, #mw-refresh, #chron-refresh, #learn-refresh, #rev-refresh, #insights-refresh,
#dash-refresh, #planner-refresh, #insights-export, #tracker-migration { display: none !important; }

/* Page titles: one clear heading per page */
#workspace .ui-page h1 { font-size: 28px !important; font-weight: 800 !important; letter-spacing: -0.02em !important; }
#workspace .ui-page > header, #workspace .ui-page .page-head { border-bottom: 0 !important; }

/* Short-mock notice: one small tag instead of the same warning written twice */
#practice-workspace .mock-notice-banner {
  font-size: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; margin: 4px 0 !important;
}
#practice-workspace .mock-notice-banner strong {
  display: inline-block; font-size: 11px !important; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--color-warning-soft); color: var(--color-warning-text);
}

/* Note body grows with its text. It had a fixed 480px height with visible overflow, so long notes ran over
   the "Important sections" row and the footer below it. */
#notes-main #body.document-body-content { height: auto !important; min-height: 480px; flex-shrink: 0 !important; }

/* Answer Writing: each question is its own card; the "reviewed question" label line is dropped */
#mw-bank { display: grid; gap: 12px; }
#mw-bank > .mw-row {
  background: var(--color-surface-subtle); border: 1px solid var(--color-border-subtle); border-radius: 14px;
  padding: 16px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
}
#mw-bank > .mw-row > h3 { flex: 1 1 100%; margin: 0 !important; font-size: 15px !important; line-height: 1.5; font-weight: 650 !important; }
#mw-bank > .mw-row > p:first-of-type { flex: 1 1 auto; margin: 0 !important; font-size: 12.5px; color: var(--color-muted); }
#mw-bank > .mw-row > p + p { display: none; }
#mw-bank > .mw-row > button {
  background: var(--color-primary) !important; color: var(--color-on-accent) !important; border: 0 !important;
  border-radius: 10px !important; font-weight: 650 !important; padding: 7px 14px !important;
}
#mw-bank > .mw-row > a { font-size: 12.5px; }

/* ---------- 9. Syllabus: official syllabus + small tracker (syllabus-simple.js) ---------- */
#tracker-workspace.syl-simple-on .tracker-toolbar,
#tracker-workspace.syl-simple-on #tracker-main,
#tracker-workspace.syl-simple-on #tracker-export,
#tracker-workspace.syl-simple-on .tracker-heading > div > p:not(.eyebrow) { display: none !important; }
#syl-simple { display: grid; gap: 16px; margin-top: 8px; }
.syl-top {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.syl-overall {
  --p: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--color-surface) 78%, transparent 80% 100%),
    conic-gradient(var(--color-primary) calc(var(--p) * 1%), var(--color-surface-sunken) 0);
}
.syl-overall strong { font-size: 18px; font-weight: 800; line-height: 1; color: var(--color-text); }
.syl-overall span { font-size: 11px; color: var(--color-muted); }
.syl-summary h2 { margin: 0 0 4px !important; font-size: 18px !important; font-weight: 800 !important; }
.syl-summary p { margin: 0; color: var(--color-muted); font-size: 13.5px; }
.syl-views { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.syl-views button {
  border: 1px solid var(--color-border) !important; background: var(--color-surface) !important; color: var(--color-text-secondary) !important;
  border-radius: 10px !important; padding: 7px 12px !important; font-weight: 600 !important; font-size: 13px !important;
}
.syl-views button.active { background: var(--color-primary) !important; border-color: var(--color-primary) !important; color: var(--color-on-accent) !important; }
.syl-views .syl-detailed { border-style: dashed !important; }

.syl-sections { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.syl-sections button {
  flex: 0 0 auto; display: grid; gap: 2px; text-align: left; min-width: 104px;
  border: 1px solid var(--color-border-subtle) !important; background: var(--color-surface) !important;
  border-radius: 12px !important; padding: 9px 12px !important; color: var(--color-text-secondary) !important;
}
.syl-sections button span { font-weight: 650; font-size: 13.5px; }
.syl-sections button small { font-size: 11.5px; color: var(--color-muted); }
.syl-sections button.active { border-color: var(--color-primary) !important; background: var(--color-primary-light) !important; color: var(--color-primary) !important; }
.syl-search { width: 100%; max-width: 360px; padding: 9px 12px !important; }
.syl-list { display: grid; gap: 14px; }
.syl-group { background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: 16px; overflow: hidden; }
.syl-group-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--color-surface-subtle); border-bottom: 1px solid var(--color-border-subtle); }
.syl-group-head h3 { margin: 0 !important; font-size: 14px !important; font-weight: 750 !important; }
.syl-group-head span { font-size: 12px; color: var(--color-muted); font-weight: 600; }
.syl-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--color-border-subtle); }
.syl-group-head + .syl-row { border-top: 0; }
.syl-tick {
  width: 30px; height: 30px; border-radius: 50% !important; padding: 0 !important; display: grid; place-items: center;
  border: 2px solid var(--color-border-strong) !important; background: var(--color-surface) !important; color: var(--color-muted) !important;
  font-size: 14px !important; font-weight: 800 !important; cursor: pointer;
}
.syl-row[data-status="studying"] .syl-tick, .syl-row[data-status="first_reading"] .syl-tick { border-color: var(--color-info) !important; color: var(--color-info) !important; }
.syl-row[data-status="revision"] .syl-tick { border-color: var(--color-warning) !important; color: var(--color-warning) !important; }
.syl-row[data-status="ready"] .syl-tick { border-color: var(--color-success) !important; background: var(--color-success) !important; color: #fff !important; }
.syl-row[data-status="ready"] .syl-text strong { color: var(--color-muted); }
.syl-text strong { display: block; font-size: 14px; font-weight: 650; color: var(--color-text); }
.syl-text p { margin: 3px 0 0; font-size: 12.5px; color: var(--color-muted); line-height: 1.45; }
.syl-chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--color-surface-sunken); color: var(--color-muted); white-space: nowrap; }
.syl-row[data-status="ready"] .syl-chip { background: var(--color-success-soft); color: var(--color-success-text); }
.syl-row[data-status="studying"] .syl-chip, .syl-row[data-status="first_reading"] .syl-chip { background: var(--color-info-soft); color: var(--color-info-text); }
.syl-row[data-status="revision"] .syl-chip { background: var(--color-warning-soft); color: var(--color-warning-text); }
.syl-pdf { display: grid; gap: 10px; }
.syl-pdf-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 650; }
.syl-pdf iframe { width: 100%; height: min(78vh, 900px); border: 1px solid var(--color-border-subtle); border-radius: 14px; background: #fff; }
.syl-pdf-missing { background: var(--color-surface); border: 1px dashed var(--color-border-strong); border-radius: 14px; padding: 18px; display: grid; gap: 8px; }
.syl-pdf-missing p { margin: 0; color: var(--color-text-secondary); }
.syl-pdf-missing select { max-width: 420px; }
.syl-empty, .syl-error { color: var(--color-muted); }
@media (max-width: 760px) {
  .syl-top { grid-template-columns: auto 1fr; }
  .syl-views { grid-column: 1 / -1; justify-content: flex-start; }
  .syl-row { grid-template-columns: 32px 1fr; }
  .syl-chip { display: none; }
}

/* ---------- 10. Notes: calm three panes (folders · list · writing) ---------- */
/* Narrower folders and list, so the writing area gets the room; text column ~760px for comfortable reading. */
@media (min-width: 1025px) {
  #notes-main { grid-template-columns: 200px 300px minmax(0, 1fr) !important; }
}
#notes-main { background: var(--color-bg) !important; }
#notes-main #sidebar.notes-collections-pane {
  background: var(--color-surface-subtle) !important; border-right: 1px solid var(--color-border-subtle) !important; padding: 14px 10px !important;
}
#notes-main .collections-eyebrow { font-size: 10.5px !important; font-weight: 700 !important; letter-spacing: .09em; text-transform: uppercase; color: var(--color-muted) !important; }
#notes-main #sidebar .nav-item, #notes-main #groups .group-row > button {
  border: 0 !important; border-radius: 9px !important; background: transparent !important; box-shadow: none !important;
  min-height: 34px !important; padding: 6px 10px !important; font-size: 13.5px !important; color: var(--color-text-secondary) !important;
}
#notes-main #groups .group-row { border: 0 !important; background: transparent !important; box-shadow: none !important; margin: 0 !important; }
#notes-main #sidebar .nav-item:hover, #notes-main #groups .group-row > button:hover { background: var(--color-surface-alt) !important; color: var(--color-text) !important; }
#notes-main #sidebar .nav-item.active, #notes-main #groups .group-row > button.active, #notes-main #groups .group-row > button[aria-current="true"] {
  background: var(--color-primary-light) !important; color: var(--color-primary) !important; font-weight: 650 !important;
}
#notes-main .collections-divider { border-color: var(--color-border-subtle) !important; margin: 8px 0 !important; }

/* Note list: title, one-line preview, date; selected card in brand colour */
#notes-main #list.notes-explorer-pane { background: var(--color-bg) !important; border-right: 1px solid var(--color-border-subtle) !important; }
#notes-main #notes .note-card {
  border: 1px solid transparent !important; border-radius: 12px !important; background: transparent !important; box-shadow: none !important;
  padding: 11px 13px !important; margin: 0 8px 4px !important; text-align: left;
}
#notes-main #notes .note-card:hover { background: var(--color-surface) !important; border-color: var(--color-border-subtle) !important; }
#notes-main #notes .note-card.active {
  background: var(--color-surface) !important; border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px var(--color-primary-focus) !important;
}
#notes-main #notes .note-card strong { font-size: 14px !important; font-weight: 700 !important; color: var(--color-text) !important; }
#notes-main #notes .note-card p {
  margin: 3px 0 !important; font-size: 12.5px !important; color: var(--color-text-secondary) !important;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
#notes-main #notes .note-card small { font-size: 11.5px !important; color: var(--color-muted) !important; }

/* Writing area: centred, readable column; quieter controls */
#notes-main #editor-panel.notes-editor-pane { background: var(--color-surface) !important; }
#notes-main #editing.editor-active-canvas { max-width: 780px; margin: 0 auto !important; width: 100%; padding-inline: clamp(16px, 3vw, 40px) !important; }
#notes-main #title.document-title-input { font-size: 26px !important; text-overflow: ellipsis; font-weight: 800 !important; letter-spacing: -0.02em !important; border: 0 !important; background: transparent !important; padding-left: 0 !important; }
#notes-main .document-header-area select, #notes-main .document-header-area input:not(#title) {
  border-radius: 999px !important; font-size: 12.5px !important; padding: 5px 12px !important; min-height: 0 !important;
  background: var(--color-surface-alt) !important; border: 1px solid var(--color-border-subtle) !important;
}
#notes-main #toolbar.document-toolbar {
  position: sticky; top: 0; z-index: 3; border-radius: 12px !important;
  background: var(--color-surface-subtle) !important; border: 1px solid var(--color-border-subtle) !important; box-shadow: none !important;
}
#notes-main #body.document-body-content { font-size: 16px; line-height: 1.75; }
#notes-main #body.document-body-content h1, #notes-main #body.document-body-content h2, #notes-main #body.document-body-content h3 { letter-spacing: -0.01em; }
#notes-main details.capture-settings > summary { color: var(--color-muted) !important; font-size: 12.5px !important; }

/* ---------- 11. Planner card: controls in one row, a clear timer ---------- */
#daily-planner .dash-actions { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px !important; margin: 10px 0 !important; }
#daily-planner .dash-actions > * { margin: 0 !important; }
#daily-planner .dash-actions label { display: inline-flex !important; align-items: center; gap: 8px; }
#daily-planner #planner-totals { font-size: 13px; color: var(--color-muted); }
#daily-planner h3 { font-size: 15px !important; font-weight: 750 !important; margin: 22px 0 8px !important; padding-top: 16px; border-top: 1px solid var(--color-border-subtle); }
#daily-planner #session-clock { font-size: 34px !important; font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; margin: 6px 0 !important; color: var(--color-text); }
#daily-planner #session-status { color: var(--color-muted); font-size: 13px; }
#daily-planner h3:has(+ #planner-searches:empty), #daily-planner #planner-searches:empty { display: none !important; }

/* ---------- 12. Today = status + next step (research: one clear focus, few choices) ----------
   Kept: hero with one main action, the 4 numbers, "Next up", and "Continue where you left off" (4 items).
   Hidden on Today (each still has its own page in the sidebar or More): insights, 2-week habit strip, setup card,
   duplicate note list, empty PDFs/courses cards, and the right column (Revision / Practice / Mains / News /
   Syllabus summaries that repeat the numbers above). The Planner view (same page) is not affected. */
#dashboard-workspace:not(:has(> #daily-planner:not([hidden]))) :is(#dash-insights-section, #dash-habit-strip-card, #dash-welcome, .dash-column-right) { display: none !important; }
#dashboard-workspace .dash-column-left > section:not(:first-of-type) { display: none !important; }
#dashboard-workspace .dash-main-columns:not([hidden]) { display: block !important; }
#dashboard-workspace .dash-column-left > section:first-of-type .badge, #dashboard-workspace .dash-column-left .muted-note { display: none !important; }
#dash-activity { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px !important; }
#dash-activity > .dash-row:nth-of-type(n+5) { display: none !important; }
#dash-activity > .dash-row {
  margin: 0 !important; border-radius: 14px !important; padding: 14px 16px !important;
  background: var(--color-surface-subtle) !important; border: 1px solid var(--color-border-subtle) !important;
  display: flex; flex-direction: column; gap: 4px; transition: transform .15s ease, box-shadow .15s ease;
}
#dash-activity > .dash-row:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
#dash-activity > .dash-row :is(h3, strong) {
  font-size: 14px !important; font-weight: 700 !important; margin: 0 !important;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#dash-activity > .dash-row p { margin: 0 !important; font-size: 12px !important; color: var(--color-muted) !important; }
#dash-activity > .dash-row button { align-self: flex-start; margin-top: 6px !important; }
/* Hero: one main action (AI plan) + Notifications; preferences live in the Account menu */
#dash-settings { display: none !important; }
#dashboard-workspace .dash-welcome-banner { margin-bottom: 4px !important; }

/* ---------- 13. Revision Centre: segmented tabs, number tiles, friendly empty state ---------- */
#revision-workspace nav.ui-subtabs {
  display: inline-flex !important; flex-wrap: wrap; gap: 4px !important; padding: 4px !important; border-radius: 12px !important;
  background: var(--color-surface-alt) !important; border: 1px solid var(--color-border-subtle) !important; width: auto !important;
}
#revision-workspace nav.ui-subtabs > button {
  border: 0 !important; background: transparent !important; border-radius: 9px !important; padding: 7px 14px !important;
  color: var(--color-text-secondary) !important; font-weight: 600 !important; box-shadow: none !important; margin: 0 !important;
}
#revision-workspace nav.ui-subtabs > button:is([aria-current="page"], [aria-pressed="true"], [aria-selected="true"], .active, .ui-primary) {
  background: var(--color-surface) !important; color: var(--color-primary) !important; box-shadow: var(--shadow-xs) !important;
}
/* Numbers as small chips in one row instead of four big empty boxes */
#rev-stats { display: flex !important; flex-wrap: wrap; gap: 8px !important; }
#rev-stats > p {
  margin: 0 !important; padding: 6px 12px !important; border-radius: 999px !important; min-height: 0 !important;
  background: var(--color-surface) !important; border: 1px solid var(--color-border-subtle) !important;
  font-size: 13px !important; font-weight: 600 !important; color: var(--color-text-secondary) !important; flex: 0 0 auto !important;
}
#revision-workspace .rev-filters { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important; }
#revision-workspace .rev-filters select { width: 100% !important; min-width: 0 !important; }
#revision-workspace :is(h2, h3):not(.rev-rich *) { font-size: 16px !important; font-weight: 750 !important; margin: 18px 0 6px !important; }
#revision-workspace :is(h2, h3) + p { color: var(--color-muted); font-size: 13.5px; margin: 0 !important; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--color-border); }

/* Filters fold into one quiet row */
#workspace details.compact-filters > summary, #workspace details.practice-rules > summary {
  color: var(--color-muted) !important; font-weight: 600 !important; font-size: 13px !important;
}

@media (prefers-reduced-motion: reduce) {
  #dashboard-workspace #dash-next-items > article { transition: none; }
  #dashboard-workspace #dash-next-items > article:hover { transform: none; }
}

/* Planner: the habit strip shows this week (last 7 days) instead of a scrolling fortnight */
#dash-habit-strip > .dash-habit-pill:nth-last-child(n+8) { display: none !important; }
#dash-habit-strip { display: grid !important; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px !important; overflow: visible !important; }
#dash-habit-strip > .dash-habit-pill { min-width: 0 !important; }

/* ---------- 14. Planner card, rebuilt (planner-layout.js): toolbar · Tasks | Focus timer · revision ---------- */
#daily-planner .pl-toolbar {
  display: inline-flex !important; flex-wrap: wrap; align-items: center; gap: 4px !important; padding: 4px !important;
  border-radius: 12px; background: var(--color-surface-alt); border: 1px solid var(--color-border-subtle); margin: 4px 0 14px !important;
}
#daily-planner .pl-toolbar > button {
  border: 0 !important; background: transparent !important; border-radius: 9px !important; padding: 6px 12px !important;
  color: var(--color-text-secondary) !important; font-weight: 600 !important; box-shadow: none !important;
}
#daily-planner .pl-toolbar > button:is([aria-pressed="true"], .active, .ui-primary) { background: var(--color-surface) !important; color: var(--color-primary) !important; box-shadow: var(--shadow-xs) !important; }
#daily-planner .pl-toolbar label { font-size: 12.5px; color: var(--color-muted); padding-left: 6px; }
#daily-planner .pl-toolbar input[type="date"] { padding: 5px 8px !important; font-size: 12.5px !important; min-height: 0 !important; }
#daily-planner .pl-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
#daily-planner .pl-card {
  background: var(--color-surface-subtle); border: 1px solid var(--color-border-subtle); border-radius: 16px; padding: 18px 20px;
}
#daily-planner .pl-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
#daily-planner .pl-card-head h3 { margin: 0 !important; padding: 0 !important; border: 0 !important; font-size: 16px !important; font-weight: 800 !important; }
#daily-planner .pl-card-head span { font-size: 12px; color: var(--color-muted); }
#daily-planner #planner-totals { margin: 0 0 12px !important; font-size: 12.5px !important; color: var(--color-muted) !important; }
/* Empty task list: one friendly line instead of the long rule text */
#daily-planner #planner-tasks > p:only-child {
  font-size: 0 !important; margin: 0 !important; padding: 26px 16px; text-align: center;
  border: 1px dashed var(--color-border-strong); border-radius: 14px;
}
#daily-planner #planner-tasks > p:only-child::before { content: "📝"; display: block; font-size: 26px; margin-bottom: 6px; }
#daily-planner #planner-tasks > p:only-child::after { content: "Nothing planned yet. Use “+ Task” above to add today’s first study task."; font-size: 13.5px; color: var(--color-text-secondary); }
/* Focus timer card: big clock, one main button */
#daily-planner .pl-timer { text-align: center; background: linear-gradient(160deg, var(--color-primary-light), var(--color-surface-subtle) 70%); }
#daily-planner .pl-timer .pl-card-head { flex-direction: column; align-items: center; gap: 2px; }
#daily-planner .pl-timer #session-clock { font-size: 46px !important; font-weight: 800 !important; letter-spacing: .03em; margin: 10px 0 4px !important; color: var(--color-text) !important; font-variant-numeric: tabular-nums; }
#daily-planner .pl-timer #session-status { margin: 0 0 12px !important; font-size: 12.5px !important; color: var(--color-muted) !important; }
#daily-planner .pl-timer label { display: flex !important; justify-content: center; align-items: center; gap: 8px; font-size: 12.5px; color: var(--color-muted); margin-bottom: 12px; }
#daily-planner .pl-timer label select { max-width: 200px; padding: 5px 10px !important; font-size: 13px !important; }
#daily-planner .pl-timer .dash-actions { justify-content: center; margin: 0 !important; }
#daily-planner .pl-timer #session-start, #daily-planner .pl-timer #session-resume {
  background: var(--color-primary) !important; color: var(--color-on-accent) !important; border: 0 !important;
  border-radius: 999px !important; padding: 10px 26px !important; font-weight: 700 !important; font-size: 14px !important;
  box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.8) !important;
}
#daily-planner .pl-timer :is(#session-pause, #session-finish) { border-radius: 999px !important; padding: 9px 18px !important; }
/* Revision box only when something is due; empty searches hidden */
#daily-planner .pl-due, #daily-planner .pl-searches { margin-top: 16px; }
#daily-planner .pl-due h3, #daily-planner .pl-searches h3 { border: 0 !important; padding: 0 !important; margin: 0 0 8px !important; }
#daily-planner .pl-due:has(#planner-due > p:only-child) { display: none !important; }
#daily-planner .pl-searches:has(#planner-searches:empty) { display: none !important; }
@media (max-width: 900px) {
  #daily-planner .pl-grid { grid-template-columns: 1fr; }
  #daily-planner .pl-timer { order: -1; }
}

/* ---------- 15. Today v2 (today-layout.js): greeting hero with stats inside · focus cards · continue list ---------- */
#dashboard-workspace.today-v2 .dash-welcome-banner {
  display: grid !important; grid-template-columns: 1fr auto; grid-template-areas: "hello actions" "stats stats";
  gap: 18px 20px !important; padding: 28px 30px 24px !important; border-radius: 24px !important;
}
#dashboard-workspace.today-v2 .dash-welcome-content { grid-area: hello; }
#dashboard-workspace.today-v2 .dash-welcome-banner > .dash-actions { grid-area: actions; align-self: start; }
#dashboard-workspace.today-v2 .dash-greeting-chip, #dashboard-workspace.today-v2 #dash-date { display: none !important; }
#dashboard-workspace.today-v2 .dash-welcome-banner h1 { font-size: 32px !important; line-height: 1.15; margin: 0 !important; }
#dashboard-workspace.today-v2 .today-date { margin: 6px 0 0 !important; color: #E0E7FF !important; font-size: 14.5px; opacity: .9; }
/* the four numbers as glass tiles inside the hero */
#dashboard-workspace.today-v2 .dash-welcome-banner > #dash-metrics-grid {
  grid-area: stats; margin: 0 !important; display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px !important; position: relative; z-index: 1;
}
#dashboard-workspace.today-v2 .dash-welcome-banner .metric-card {
  background: rgba(255, 255, 255, 0.12) !important; border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: none !important; border-radius: 16px !important; padding: 14px 16px !important; color: #fff !important;
}
#dashboard-workspace.today-v2 .dash-welcome-banner .metric-icon { background: rgba(255, 255, 255, 0.18) !important; }
#dashboard-workspace.today-v2 .dash-welcome-banner .metric-label { color: #E0E7FF !important; letter-spacing: .04em !important; text-transform: none !important; font-size: 12.5px !important; font-weight: 600 !important; }
#dashboard-workspace.today-v2 .dash-welcome-banner .metric-value { color: #fff !important; font-size: 26px !important; margin-top: 4px; }
#dashboard-workspace.today-v2 .dash-welcome-banner .metric-sub { color: #C7D2FE !important; font-size: 12px !important; }

/* Today's focus: three action cards, coloured icon, one button each */
#dashboard-workspace.today-v2 #dash-next { margin-top: 22px !important; background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
#dashboard-workspace.today-v2 :is(#dash-next, .dash-column-left > section) .section-card-header { border: 0 !important; padding: 0 0 10px !important; margin: 0 !important; }
#dashboard-workspace.today-v2 :is(#dash-next, .dash-column-left > section) .section-card-header h2 { font-size: 18px !important; font-weight: 800 !important; }
#dashboard-workspace.today-v2 #dash-next .badge, #dashboard-workspace.today-v2 #dash-hero-action:empty { display: none !important; }
#dashboard-workspace.today-v2 #dash-next-items { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px !important; }
#dashboard-workspace.today-v2 #dash-next-items > article {
  background: var(--color-surface) !important; border: 1px solid var(--color-border-subtle) !important; border-radius: 18px !important;
  padding: 18px !important; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm);
}
#dashboard-workspace.today-v2 #dash-next-items > article::before {
  content: attr(data-icon); width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px;
  background: var(--color-primary-light); margin-bottom: 6px;
}
#dashboard-workspace.today-v2 #dash-next-items > article:nth-child(2)::before { background: var(--color-info-soft); }
#dashboard-workspace.today-v2 #dash-next-items > article:nth-child(3)::before { background: var(--color-success-soft); }
#dashboard-workspace.today-v2 #dash-next-items > article h3 { margin: 0 !important; font-size: 16px !important; font-weight: 750 !important; }
#dashboard-workspace.today-v2 #dash-next-items > article p { margin: 0 !important; color: var(--color-muted) !important; font-size: 13px !important; flex: 1; }
#dashboard-workspace.today-v2 #dash-next-items > article button {
  margin-top: 10px !important; align-self: flex-start; border-radius: 10px !important; padding: 8px 14px !important; font-weight: 650 !important;
  background: var(--color-primary-light) !important; color: var(--color-primary) !important; border: 0 !important; box-shadow: none !important;
}
#dashboard-workspace.today-v2 #dash-next-items > article button.ui-primary { background: var(--color-primary) !important; color: var(--color-on-accent) !important; }

/* Continue where you left off: compact rows */
#dashboard-workspace.today-v2 .dash-column-left > section:first-of-type { margin-top: 22px !important; background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
#dashboard-workspace.today-v2 #dash-activity { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px !important; }
#dashboard-workspace.today-v2 #dash-activity > .dash-row {
  display: grid !important; grid-template-columns: 40px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: center;
  background: var(--color-surface) !important; padding: 12px 14px !important; border-radius: 14px !important;
}
#dashboard-workspace.today-v2 #dash-activity > .dash-row::before {
  content: "📝"; grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--color-surface-alt); font-size: 18px;
}
#dashboard-workspace.today-v2 #dash-activity > .dash-row[data-kind="pdf"]::before, #dashboard-workspace.today-v2 #dash-activity > .dash-row[data-kind="book"]::before { content: "📘"; }
#dashboard-workspace.today-v2 #dash-activity > .dash-row strong { grid-column: 2; -webkit-line-clamp: 1 !important; font-size: 14px !important; }
#dashboard-workspace.today-v2 #dash-activity > .dash-row small { grid-column: 2; font-size: 12px; color: var(--color-muted); }
#dashboard-workspace.today-v2 #dash-activity > .dash-row button {
  grid-column: 3; grid-row: 1 / 3; margin: 0 !important; border-radius: 999px !important; padding: 6px 14px !important; font-size: 12.5px !important;
}
@media (max-width: 1100px) {
  #dashboard-workspace.today-v2 .dash-welcome-banner > #dash-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #dashboard-workspace.today-v2 .dash-welcome-banner { grid-template-columns: 1fr; grid-template-areas: "hello" "actions" "stats"; padding: 20px !important; }
  #dashboard-workspace.today-v2 .dash-welcome-banner h1 { font-size: 24px !important; }
  #dashboard-workspace.today-v2 #dash-next-items, #dashboard-workspace.today-v2 #dash-activity { grid-template-columns: 1fr; }
}
#dashboard-workspace.today-v2 #dash-activity > .dash-row:nth-of-type(n+5) { display: none !important; }

/* ---------- 16. Revision Centre, visual (revision-layout.js) ---------- */
#revision-workspace .rev-heading { align-items: center !important; }
#rev-stats, #revision-workspace .revision-toolbar > :not(details), #revision-workspace .revision-toolbar > details > summary { display: none !important; }
#revision-workspace .revision-toolbar { margin: 0 !important; padding: 0 !important; min-height: 0 !important; }
#revision-workspace .rv-hero {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "ring text actions" "tiles tiles tiles";
  align-items: center; gap: 18px 22px; padding: 24px 26px; border-radius: 24px; margin: 6px 0 18px;
  background: linear-gradient(135deg, #0EA5E9 0%, #4F46E5 55%, #7C3AED 100%); color: #fff;
  box-shadow: 0 18px 40px -22px rgba(79, 70, 229, .8);
}
:root[data-theme="dark"] #revision-workspace .rv-hero { background: linear-gradient(135deg, #075985 0%, #3730A3 55%, #5B21B6 100%); }
#revision-workspace .rv-ring {
  --p: 100; grid-area: ring; width: 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, rgba(15, 23, 42, .35) 76%, transparent 78% 100%), conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .25) 0);
}
#revision-workspace .rv-ring strong { font-size: 30px; font-weight: 800; line-height: 1; }
#revision-workspace .rv-ring span { font-size: 11px; opacity: .85; text-transform: uppercase; letter-spacing: .08em; }
#revision-workspace .rv-hero.clear .rv-ring { background: radial-gradient(closest-side, rgba(15, 23, 42, .35) 76%, transparent 78% 100%), conic-gradient(#86EFAC 100%, #86EFAC 0); }
#revision-workspace .rv-hero-text { grid-area: text; }
#revision-workspace .rv-hero-text h2 { margin: 0 0 4px !important; font-size: 26px !important; font-weight: 800 !important; color: #fff !important; }
#revision-workspace .rv-hero-text p { margin: 0; color: #E0E7FF; font-size: 14px; }
#revision-workspace .rv-hero-actions { grid-area: actions; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#revision-workspace .rv-hero-actions button {
  border-radius: 12px !important; padding: 9px 16px !important; font-weight: 700 !important; box-shadow: none !important;
  background: rgba(255, 255, 255, .15) !important; color: #fff !important; border: 1px solid rgba(255, 255, 255, .3) !important;
}
#revision-workspace .rv-hero-actions #rev-start { background: #fff !important; color: #3730A3 !important; border-color: #fff !important; }
#revision-workspace .rv-tiles { grid-area: tiles; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#revision-workspace .rv-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); border-radius: 16px; padding: 12px 14px; }
#revision-workspace .rv-tile-icon { grid-row: 1 / 3; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); font-size: 18px; }
#revision-workspace .rv-tile strong { font-size: 22px; font-weight: 800; line-height: 1.1; }
#revision-workspace .rv-tile small { font-size: 12px; color: #E0E7FF; }
#revision-workspace .rv-tile.alert { background: rgba(248, 113, 113, .28); border-color: rgba(254, 202, 202, .6); }
#revision-workspace details.rv-filters { margin: 0 0 14px; }
#revision-workspace details.rv-filters > summary { cursor: pointer; color: var(--color-muted); font-weight: 600; font-size: 13px; padding: 6px 0; list-style: none; }
#revision-workspace details.rv-filters > summary::before { content: "⚙ "; }
#revision-workspace details.rv-filters[open] > summary { margin-bottom: 8px; }
#revision-workspace .rv-empty {
  text-align: center; padding: 38px 20px; border-radius: 20px; border: 1px dashed var(--color-border-strong); background: var(--color-surface);
}
#revision-workspace .rv-empty[hidden] { display: none !important; }
#revision-workspace .rv-empty-art { font-size: 44px; margin-bottom: 6px; }
#revision-workspace .rv-empty h3 { margin: 0 0 6px !important; font-size: 20px !important; font-weight: 800 !important; }
#revision-workspace .rv-empty p { margin: 0 auto 16px !important; max-width: 460px; color: var(--color-muted); font-size: 14px; border: 0 !important; padding: 0 !important; }
#revision-workspace .rv-empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
#revision-workspace .rv-empty-btn { border-radius: 12px !important; padding: 9px 18px !important; font-weight: 700 !important; background: var(--color-primary) !important; color: var(--color-on-accent) !important; border: 0 !important; }
#revision-workspace .rv-empty-btn.ghost { background: var(--color-primary-light) !important; color: var(--color-primary) !important; }
#rev-list.rv-list-empty { display: none !important; }
#rev-list > h2[data-kind]::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: middle; background: var(--color-info); }
#rev-list > h2[data-kind="overdue"]::before { background: var(--color-danger); }
#rev-list > h2[data-kind="due-today"]::before { background: var(--color-warning); }
@media (max-width: 860px) {
  #revision-workspace .rv-hero { grid-template-columns: auto 1fr; grid-template-areas: "ring text" "actions actions" "tiles tiles"; padding: 20px; }
  #revision-workspace .rv-hero-actions { justify-content: flex-start; }
  #revision-workspace .rv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #revision-workspace .rv-ring { width: 78px; height: 78px; }
}
#revision-workspace .rv-hero-text p { border: 0 !important; padding: 0 !important; border-radius: 0 !important; }

/* ---------- 17. Visual page heroes for every page (page-hero.js) ---------- */
.vh-orig { display: none !important; }
#workspace .vh-hero {
  --g1: #4F46E5; --g2: #7C3AED;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px 20px;
  padding: 22px 26px; margin: 4px 0 18px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 16px 36px -22px var(--g1);
  position: relative; overflow: hidden;
}
#workspace .vh-hero::after { content: ""; position: absolute; right: -70px; top: -90px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.2), transparent); pointer-events: none; }
#workspace .vh-hero[data-page="library"] { --g1: #0D9488; --g2: #2563EB; }
#workspace .vh-hero[data-page="mains"] { --g1: #EA580C; --g2: #DB2777; }
#workspace .vh-hero[data-page="chronicle"] { --g1: #E11D48; --g2: #7C3AED; }
#workspace .vh-hero[data-page="tracker"] { --g1: #0891B2; --g2: #4F46E5; }
#workspace .vh-hero[data-page="practice"] { --g1: #9333EA; --g2: #2563EB; }
#workspace .vh-hero:is([data-page="insights"], [data-page="profile"]) { --g1: #CA8A04; --g2: #EA580C; }
#workspace .vh-hero:is([data-page="freecourses"], [data-page="learning"]) { --g1: #16A34A; --g2: #0D9488; }
:root[data-theme="dark"] #workspace .vh-hero { filter: saturate(.9) brightness(.85); }
#workspace .vh-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); }
#workspace .vh-text h2 { margin: 0 0 4px !important; font-size: 26px !important; font-weight: 800 !important; color: #fff !important; letter-spacing: -0.02em; }
#workspace .vh-text p { margin: 0 !important; color: rgba(255,255,255,.86) !important; font-size: 14px; border: 0 !important; padding: 0 !important; }
#workspace .vh-tiles { display: flex; gap: 10px; position: relative; z-index: 1; }
#workspace .vh-tiles:empty { display: none; }
#workspace .vh-tile { min-width: 92px; text-align: center; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24); }
#workspace .vh-tile strong { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; }
#workspace .vh-tile small { font-size: 11.5px; color: rgba(255,255,255,.85); }
/* Syllabus already shows its own progress card under the hero: hide the old heading row text there */
#tracker-workspace.vh-on .tracker-heading > div:first-child { display: none !important; }
#tracker-workspace.vh-on .tracker-heading { justify-content: flex-end !important; margin: 0 !important; }
@media (max-width: 760px) {
  #workspace .vh-hero { grid-template-columns: auto 1fr; padding: 18px; }
  #workspace .vh-tiles { grid-column: 1 / -1; }
  #workspace .vh-tile { flex: 1; }
  #workspace .vh-icon { width: 48px; height: 48px; font-size: 24px; }
  #workspace .vh-text h2 { font-size: 21px !important; }
}

/* Answer Writing: coloured paper / subject tags, left colour bar per GS paper */
#mw-bank > .mw-row { border-left: 4px solid var(--paper, var(--color-primary)) !important; }
#mw-bank > .mw-row[data-paper="gs1"] { --paper: #EA580C; }
#mw-bank > .mw-row[data-paper="gs2"] { --paper: #2563EB; }
#mw-bank > .mw-row[data-paper="gs3"] { --paper: #16A34A; }
#mw-bank > .mw-row[data-paper="gs4"] { --paper: #9333EA; }
#mw-bank .mw-tag { display: inline-block; margin: 0 6px 4px 0; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--color-surface-alt); color: var(--color-text-secondary); }
#mw-bank .mw-tag.paper { background: var(--paper, var(--color-primary)); color: #fff; }
#mw-bank .mw-tag.subject { background: color-mix(in srgb, var(--paper, var(--color-primary)) 16%, transparent); color: var(--paper, var(--color-primary)); }

/* News: editions look like magazine covers */
#chronicle-workspace #chron-archive article {
  border-radius: 18px !important; overflow: hidden; padding: 0 !important; background: var(--color-surface) !important;
  border: 1px solid var(--color-border-subtle) !important; box-shadow: var(--shadow-sm);
}
#chronicle-workspace #chron-archive article::before {
  content: "📰"; display: grid; place-items: center; height: 110px; font-size: 42px;
  background: linear-gradient(135deg, #E11D48, #7C3AED);
}
#chronicle-workspace #chron-archive article > * { margin-left: 16px !important; margin-right: 16px !important; }
#chronicle-workspace #chron-archive article > :last-child { margin-bottom: 16px !important; }
#chronicle-workspace #chron-archive article > :nth-child(1) { margin-top: 14px !important; }
#workspace details.vh-fold { margin: 0 0 14px; }
#workspace details.vh-fold > summary { cursor: pointer; list-style: none; color: var(--color-muted); font-weight: 600; font-size: 13px; padding: 6px 0; }
#workspace details.vh-fold > summary::before { content: "🔍 "; }
#workspace details.vh-fold[open] > summary { margin-bottom: 8px; }

/* ---------- 18. Syllabus v2: one hero (progress ring + exam + tabs), no duplicate headers ---------- */
#tracker-workspace.syl-simple-on .tracker-heading, #tracker-workspace .vh-hero { display: none !important; }
#tracker-workspace .syl-top {
  background: linear-gradient(135deg, #0891B2 0%, #4F46E5 60%, #7C3AED 100%) !important; border: 0 !important; color: #fff;
  border-radius: 24px !important; padding: 24px 26px !important; box-shadow: 0 18px 40px -22px rgba(79, 70, 229, .8) !important;
}
:root[data-theme="dark"] #tracker-workspace .syl-top { background: linear-gradient(135deg, #0E7490 0%, #3730A3 60%, #5B21B6 100%) !important; }
#tracker-workspace .syl-overall { width: 96px !important; height: 96px !important;
  background: radial-gradient(closest-side, rgba(15, 23, 42, .35) 76%, transparent 78% 100%), conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .25) 0) !important; }
#tracker-workspace .syl-overall strong { color: #fff !important; font-size: 22px !important; }
#tracker-workspace .syl-overall span { color: #E0E7FF !important; }
#tracker-workspace .syl-kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: #E0E7FF; }
#tracker-workspace .syl-summary h2 { color: #fff !important; font-size: 26px !important; margin: 2px 0 4px !important; }
#tracker-workspace .syl-summary p { color: #E0E7FF !important; }
#tracker-workspace .syl-exam { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: #E0E7FF; }
#tracker-workspace .syl-exam select { background: rgba(255, 255, 255, .16) !important; color: #fff !important; border: 1px solid rgba(255, 255, 255, .3) !important; border-radius: 10px !important; padding: 6px 10px !important; max-width: 280px; }
#tracker-workspace .syl-exam select option { color: #0F172A; }
#tracker-workspace .syl-views { gap: 8px !important; align-self: center; }
#tracker-workspace .syl-views button { background: rgba(255, 255, 255, .14) !important; color: #fff !important; border: 1px solid rgba(255, 255, 255, .28) !important; border-radius: 12px !important; padding: 9px 16px !important; }
#tracker-workspace .syl-views button.active { background: #fff !important; color: #3730A3 !important; border-color: #fff !important; }
#tracker-workspace .syl-views .syl-detailed { background: transparent !important; border-style: dashed !important; font-weight: 500 !important; opacity: .9; }
#tracker-workspace .syl-pdf-bar { padding: 2px 4px; }
#tracker-workspace .syl-pdf iframe { height: min(80vh, 1000px) !important; border-radius: 18px !important; box-shadow: var(--shadow); }
#tracker-workspace .syl-pdf-pages { display: grid; justify-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--color-surface-sunken); max-height: 82vh; overflow: auto; }
#tracker-workspace .syl-pdf-page { position: relative; width: 100%; max-width: 1000px; min-height: 360px; display: grid; justify-items: center; }
#tracker-workspace .syl-pdf-page canvas { background: #fff; border-radius: 6px; box-shadow: 0 4px 18px rgba(15, 23, 42, .25); }
#tracker-workspace .syl-pdf-num { position: absolute; top: 8px; left: 8px; z-index: 1; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(15, 23, 42, .65); color: #fff; }
#tracker-workspace .syl-pdf-loading { color: var(--color-muted); padding: 30px; }
#tracker-workspace .syl-pdf-bar { gap: 10px; }
#tracker-workspace .syl-jump { margin-left: auto; border-radius: 10px !important; padding: 6px 12px !important; font-weight: 650 !important; background: var(--color-primary) !important; color: var(--color-on-accent) !important; border: 0 !important; }
#tracker-workspace .syl-pdf-pages { position: relative; }
#syl-simple, #syl-simple > *, #tracker-workspace .syl-summary { min-width: 0; }
@media (max-width: 760px) {
  #tracker-workspace .syl-top { grid-template-columns: auto minmax(0, 1fr) !important; padding: 18px !important; gap: 14px !important; }
  #tracker-workspace .syl-overall { width: 72px !important; height: 72px !important; }
  #tracker-workspace .syl-summary h2 { font-size: 21px !important; }
  #tracker-workspace .syl-exam { display: flex; flex-wrap: wrap; width: 100%; }
  #tracker-workspace .syl-exam select { max-width: 100%; width: 100%; }
  #tracker-workspace .syl-views { grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-start !important; }
  #tracker-workspace .syl-views button { padding: 8px 12px !important; font-size: 13px !important; }
  #tracker-workspace .syl-pdf-pages { padding: 8px; max-height: 75vh; }
}

/* ---------- Exam switcher in the top bar (exam-theme.js): the exam you are working on, one click to change ---------- */
#workspace > header .exam-switcher { position: relative; flex: none; }
#workspace > header .exam-switcher > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface)); border: 1px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
  color: var(--color-text); font-size: 13px; font-weight: 700; white-space: nowrap; user-select: none;
}
#workspace > header .exam-switcher > summary::-webkit-details-marker { display: none; }
#workspace > header .exam-switcher > summary:hover { background: color-mix(in srgb, var(--color-primary) 18%, var(--color-surface)); }
#workspace > header .exam-switcher > summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
#workspace > header .exam-switcher-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 22%, transparent); }
#workspace > header .exam-switcher-label { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
#workspace > header .exam-switcher-caret { font-size: 10px; color: var(--color-text-secondary); }
#workspace > header .exam-switcher-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: min(300px, calc(100vw - 24px)); padding: 6px; border-radius: 14px;
  background: var(--color-surface); border: 1px solid var(--color-border); box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .45);
}
#workspace > header .exam-switcher-head { margin: 4px 10px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); }
#workspace > header .exam-switcher-item, #workspace > header .exam-switcher-add {
  display: flex !important; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 9px 10px !important;
  border: 0 !important; border-radius: 10px !important; background: transparent !important; color: var(--color-text) !important; font-size: 13px !important; font-weight: 600 !important; cursor: pointer;
}
#workspace > header .exam-switcher-item::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex: none; background: hsl(var(--exam-hue, 218) 70% 50%); }
#workspace > header .exam-switcher-item > span:first-child { flex: 1; min-width: 0; }
#workspace > header .exam-switcher-item:hover, #workspace > header .exam-switcher-add:hover { background: var(--color-surface-subtle) !important; }
#workspace > header .exam-switcher-item.active { background: color-mix(in srgb, var(--color-primary) 10%, transparent) !important; }
#workspace > header .exam-switcher-tick { color: var(--color-primary); font-weight: 800; }
#workspace > header .exam-switcher-add { margin-top: 4px; border-top: 1px solid var(--color-border-subtle) !important; border-radius: 0 0 10px 10px !important; color: var(--color-primary) !important; justify-content: flex-start; }
@media (max-width: 760px) {
  #workspace > header .exam-switcher > summary { height: 32px; padding: 0 10px; font-size: 12px; }
  #workspace > header .exam-switcher-label { max-width: 110px; }
}
@media (max-width: 760px) {
  /* the switcher sits on the left of the top bar on phones: open the menu across the screen, not off its left edge */
  #workspace > header .exam-switcher-menu { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; }
}
#workspace > header .exam-switcher-icon { font-size: 15px; line-height: 1; }
#workspace > header .exam-switcher-item:has(> span:first-child) { padding-left: 10px !important; }
