/* =========================================================
   Ionik — Cream & ink. Sans-serif. Soft, modern, low-strain.
   Ported faithfully from the Claude Design bundle at
   .redesign-fetch/new-ionik/project/styles.css
   ========================================================= */

:root {
  --bg: #ece2cd;
  --bg-2: #e3d8be;
  --bg-3: #d8ccaf;
  --ink: #2a241c;
  --ink-soft: #4a4034;
  --ink-muted: #7e7361;
  --ink-faint: #b3a895;
  --rule: rgba(42,36,28,0.12);
  --rule-soft: rgba(42,36,28,0.08);
  --rule-faint: rgba(42,36,28,0.04);
  --panel: rgba(42,36,28,0.04);
  --panel-2: rgba(42,36,28,0.08);
  --logo: #1a4fb8;
  --accent: #2a241c;
  --accent-ink: #efe7d6;
  --r-red: #a8503c;
  --r-amber: #b58646;
  --r-green: #5e7e4c;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  /* Panels stay square-leaning — soft 24px/16px cards read as template AI slop,
     so surfaces sit on tight 8-14px rectangles. Pills (buttons, tags, chips,
     tabs) are fully round again, as in the pre-ee6e8c4 cream build; circles
     (bell, avatar, flags, dots) keep their literal 999px/50% radii. */
  --shadow-sm: 0 2px 8px rgba(32, 27, 20, 0.12);
  --shadow-md: 0 8px 24px -5px rgba(32, 27, 20, 0.2);
  --shadow-lg: 0 18px 46px -12px rgba(32, 27, 20, 0.3);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 8px;
  --r-pill: 999px;
  --rail: 56px;
  --rail-open: 216px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Premium fluid easings — out-expo / in-out-expo for slow, weighty motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.83, 0, 0.17, 1);
  --ease-fluid: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-fast: var(--m-quick, 240ms);
  --dur-base: var(--m-base, 420ms);
  --dur-slow: var(--m-slow, 680ms);
  --dur-xslow: var(--m-xslow, 1100ms);
}

body[data-subject="Chemistry"] { --accent: #2a5e8a; }
body[data-subject="Physics"]   { --accent: #8a5530; }
body[data-subject="Biology"]   { --accent: #4a6e3d; }

.theme-dark {
  --bg: #15110a; --bg-2: #1d1810; --bg-3: #251f15;
  --ink: #efe7d6; --ink-soft: #d4ccba; --ink-muted: #8e8472; --ink-faint: #5a5444;
  --rule: rgba(239,231,214,0.10); --rule-soft: rgba(239,231,214,0.06); --rule-faint: rgba(239,231,214,0.03);
  --panel: rgba(239,231,214,0.04); --panel-2: rgba(239,231,214,0.07);
  --accent: #f0e7d2; --accent-ink: #15110a;
  /* Status colours lifted for contrast on the dark background. */
  --r-green: #82ad6c; --r-amber: #d3a45c; --r-red: #d27560;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* `hidden` always wins, even over a class that sets display. */
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--ink); color: var(--bg); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
input, textarea, select { font-family: inherit; color: inherit; }

/* ===== Shell ===== */
.shell { min-height: 100vh; padding-left: var(--rail); }

/* ===== Rail (sidebar) ===== */
.rail {
  position: fixed;
  top: 18px; left: 18px; bottom: 18px;
  width: calc(var(--rail) - 18px);
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: 22px;
  padding: 18px 4px;
  display: flex; flex-direction: column;
  gap: 30px;
  z-index: 40;
  overflow: hidden;
  transition:
    width var(--dur-xslow) var(--ease-fluid),
    border-radius var(--dur-slow) var(--ease-fluid),
    box-shadow var(--dur-slow) var(--ease-fluid),
    padding var(--dur-xslow) var(--ease-fluid);
  will-change: width;
}
.rail:hover, .rail:focus-within {
  width: calc(var(--rail-open) - 18px);
  border-radius: 20px;
  padding: 18px 10px;
  box-shadow:var(--shadow-lg);
}

/* No brand mark in rail (user choice — pure icon rail) */
.rail .brand { display: none; }

/* ===== Top strip ===== */
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 44px 0;
  max-width: 1280px;
  margin: 0 auto;
}
.top .left { display: flex; align-items: center; gap: 14px; }
.top .right { display: flex; align-items: center; gap: 12px; position: relative; }

/* Top-strip subject pill — present on all in-app pages */
.subject-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px;
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500;
  color: var(--ink);
  cursor: default;
  position: relative;
}
.subject-pill .sdot {
  width: 7px; height: 7px; border-radius: 999px; background: var(--accent);
}

.dropdown {
  position: absolute;
  top: 44px; left: 0;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 6px;
  min-width: 200px;
  z-index: 50;
  box-shadow:var(--shadow-lg);
}
.dropdown .item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 14px; cursor: pointer;
}
.dropdown .item:hover { background: var(--panel-2); }
.dropdown .item .dot { width: 8px; height: 8px; border-radius: 999px; }
.dropdown .item.on { background: var(--panel); }

.bell, .avatar {
  width: 36px; height: 36px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  font-size: 12px; font-weight: 500;
  color: var(--ink-muted);
  transition: background 160ms var(--ease);
}
.bell:hover, .avatar:hover { background: var(--bg-3); color: var(--ink); }
.bell .pip {
  position: absolute; top: 8px; right: 8px;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 999px;
}
.avatar { color: var(--ink); }

.menu {
  position: absolute;
  top: 48px; right: 0;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  width: 240px;
  padding: 14px;
  z-index: 50;
  box-shadow:var(--shadow-lg);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-fluid), transform var(--dur-slow) var(--ease-fluid);
}
.menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.menu .nm { font-size: 15px; font-weight: 600; padding: 4px 10px 0; }
.menu .sub { font-size: 12px; color: var(--ink-muted); padding: 0 10px 12px; }
.menu .mi {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px; font-weight: 500;
}
.menu .mi:hover { background: var(--panel-2); }
.menu .mi.danger { color: var(--r-red); }

/* ===== Content ===== */
.content {
  padding: 48px 44px 96px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}
.content.wide { max-width: 1320px; }
.content.flush { max-width: 1400px; padding: 32px 44px 96px; }

.kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: 18px;
}
.kicker .sep { margin: 0 10px; color: var(--ink-faint); }
.kicker .now { color: var(--accent); }

h1.head {
  font-size: 64px;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
  font-weight: 600;
}
h1.head.med { font-size: 44px; }
h1.head.sm  { font-size: 32px; }

.lede {
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 60ch;
  margin: 0 0 32px;
  font-weight: 400;
}

.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 56px 0 20px;
}
.section-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.015em; font-weight: 600; }
.section-head .meta { color: var(--ink-muted); font-size: 13px; }

.body { font-size: 15px; line-height: 1.7; color: var(--ink-soft); }
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.rule { height: 1px; background: var(--rule-soft); border: 0; margin: 24px 0; }

/* ===== Panels ===== */
.panel {
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-lg);
  padding: 24px 28px;
}
.panel.tight { padding: 18px 22px; }
.panel.flush { padding: 0; }
.panel.lift  { background: var(--bg-3); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500;
  font-family: var(--sans);
  cursor: pointer;
  transition:
    background var(--dur-base) var(--ease-fluid),
    border-color var(--dur-base) var(--ease-fluid),
    color var(--dur-base) var(--ease-fluid),
    transform 180ms var(--ease);
  white-space: nowrap;
}
.btn:hover  { background: var(--panel); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
.btn.accent  { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.accent:hover { filter: brightness(1.08); }
.btn.danger  { color: var(--r-red); border-color: color-mix(in srgb, var(--r-red) 35%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--r-red) 10%, transparent); }
.btn.sm { padding: 7px 14px; font-size: 12px; }
.btn.lg { padding: 13px 26px; font-size: 14px; }

.linkbtn {
  cursor: pointer;
  color: var(--ink);
  font-size: 13px; font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--ink-faint);
}
.linkbtn:hover { text-decoration-color: var(--accent); color: var(--accent); }

/* ===== Tags / chips ===== */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  color: var(--ink-soft);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.tag.accent { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.tag.solid  { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  font-size: 12px; font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { background: var(--bg-3); }
.chip .x { color: var(--ink-faint); }

/* ===== Grid / stats ===== */
.grid { display: grid; gap: 0; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.grid.gap-md { gap: 12px; }

.stat {
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-md);
  padding: 20px 22px;
}
.stat .lbl {
  font-size: 11px; color: var(--ink-muted);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: 0.04em; font-weight: 500;
  text-transform: uppercase;
}
.stat .val { font-size: 38px; line-height: 1; letter-spacing: -0.03em; font-weight: 600; }
.stat .sub { font-size: 12px; color: var(--ink-muted); margin-top: 8px; }

.marker { display: inline-block; width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.marker.r { color: var(--r-red); }
.marker.y { color: var(--r-amber); }
.marker.g { color: var(--r-green); }
.marker.u { color: var(--ink-faint); }

/* ===== Inputs ===== */
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  border-radius: var(--r-md);
  font-family: var(--sans);
  font-size: 14px;
  padding: 12px 16px;
  outline: none;
  color: var(--ink);
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); background: var(--bg-3); }
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.field-label {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-pill);
  padding: 10px 20px;
}
.search input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-family: var(--sans); font-size: 14px; color: var(--ink);
}
.search input::placeholder { color: var(--ink-faint); }
.search .glyph { color: var(--ink-faint); }

/* ===== Segmented (pill) ===== */
.segm {
  display: inline-flex;
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-pill);
  padding: 4px;
  gap: 2px;
}
.segm button {
  padding: 7px 16px;
  font-size: 12px; font-weight: 500;
  border-radius: var(--r-pill);
  color: var(--ink-muted);
  white-space: nowrap;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}
.segm button.on { background: var(--ink); color: var(--bg); }
.segm button:hover:not(.on) { color: var(--ink); }

/* Modules pill row */
.mods {
  display: inline-flex;
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-pill);
  padding: 4px;
  gap: 2px;
}
.mods button {
  padding: 8px 18px;
  font-size: 13px; font-weight: 500;
  border-radius: var(--r-pill);
  color: var(--ink-muted);
  text-transform: capitalize;
  white-space: nowrap;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}
.mods button.on { background: var(--ink); color: var(--bg); }
.mods button:hover:not(.on) { color: var(--ink); }

/* Toggle */
.toggle {
  width: 40px; height: 22px; border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--rule);
  position: relative; cursor: pointer;
  transition: background 200ms var(--ease);
  flex-shrink: 0;
}
.toggle::after {
  content: ""; position: absolute; top: 1px; left: 1px;
  width: 18px; height: 18px;
  background: var(--ink);
  border-radius: 999px;
  transition: left 220ms var(--ease), background 200ms var(--ease);
}
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle.on::after { left: 19px; background: var(--bg); }

/* KV */
.kv {
  display: grid; grid-template-columns: 180px 1fr; gap: 8px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.kv:last-child { border-bottom: 0; }
.kv .k { font-size: 12px; color: var(--ink-muted); padding-top: 2px; font-weight: 500; }
.kv .v { font-size: 14px; font-weight: 400; }

.bar { height: 4px; background: var(--rule-soft); border-radius: 999px; position: relative; overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 999px; transition: width 500ms var(--ease); }

/* ===== Layout helpers ===== */
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; }
.cols.even { grid-template-columns: 1fr 1fr; gap: 32px; }
.cols.tight { gap: 24px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
 .gap-12 { gap: 12px; }  
.mt-8 { margin-top: 8px; }  .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }  
 .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; } 

/* ===== Modes (QM picker) ===== */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.modes button {
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 200px;
  transition: background 220ms var(--ease), border-color 220ms var(--ease), transform 320ms var(--ease);
}
.modes button:hover { background: var(--bg-3); border-color: color-mix(in srgb, var(--accent) 30%, var(--rule)); transform: translateY(-3px); }
.modes .mn { font-size: 11px; color: var(--ink-muted); letter-spacing: 0.1em; font-weight: 600; text-transform: uppercase; }
.modes .mt { font-size: 28px; letter-spacing: -0.02em; line-height: 1.1; font-weight: 600; }
.modes .md { font-size: 13px; color: var(--ink-muted); max-width: 36ch; line-height: 1.5; }
.modes .arrow { margin-top: auto; color: var(--accent); font-size: 13px; font-weight: 500; }

/* ===== Examiner block ===== */
.exam {
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin-bottom: 12px;
}
.exam .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.exam .verdict { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0.04em; text-transform: uppercase; }
.exam .verdict.no { color: var(--r-red); }
.exam .verdict.partial { color: var(--r-amber); }

.exam .body { font-size: 14px; line-height: 1.6; margin: 6px 0 12px; color: var(--ink); }
.exam .need { padding: 12px 16px; background: var(--panel); border-radius: var(--r-sm); font-size: 13px; color: var(--ink-soft); }

/* ===== Tabs ===== */
.tabs {
  display: inline-flex; gap: 4px;
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  padding: 4px;
  border-radius: var(--r-pill);
}
.tabs button {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}
.tabs button.on { background: var(--ink); color: var(--bg); }
.tabs button:hover:not(.on) { color: var(--ink); }

/* ===== Modals ===== */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(42,36,28,0.5);

  z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 28px 30px;
  width: 100%;
  max-width: 460px;
  box-shadow:var(--shadow-lg);
}
.modal h3 { font-size: 20px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.015em; }
.modal .desc { font-size: 14px; color: var(--ink-muted); margin: 0 0 20px; }
.modal .row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.modal .row:last-of-type { border-bottom: 0; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--rule-soft); }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ===== Brand mark — "Ionik+" wordmark ===== */
:root { --brand-blue: #5B6FE8; --brand-red: #FF5C5C; }
.brand-mark {
  display: inline-flex; align-items: flex-start;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--brand-blue);
  user-select: none;
  white-space: nowrap;
}
.brand-mark .wm { font-size: 32px; }
.brand-mark .plus {
  color: var(--brand-red);
  font-size: 18px;
  font-weight: 700;
  margin-left: 4px;
  transform: translateY(-3px);
  letter-spacing: 0;
}
.brand-mark.sm  .wm { font-size: 22px; }
.brand-mark.sm  .plus { font-size: 12px; transform: translateY(-2px); }
.brand-mark.lg  .wm { font-size: 56px; letter-spacing: -0.05em; }
.brand-mark.lg  .plus { font-size: 28px; transform: translateY(-6px); margin-left: 6px; }

/* ===== Premium notification panel ===== */
.notif-panel {
  position: absolute;
  top: 48px;
  right: 0;
  width: 360px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  z-index: 60;
  box-shadow:var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-fluid), transform var(--dur-slow) var(--ease-fluid);
}
.notif-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.notif-panel .nhd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px 12px;
}
.notif-panel .nhd .ttl { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.notif-panel .nhd .count { font-size: 11px; color: var(--ink-muted); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.notif-panel .nlist { max-height: 380px; overflow-y: auto; padding: 0 8px 8px; }
.notif-panel .ni {
  display: grid;
  grid-template-columns: 36px 1fr 22px;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 160ms var(--ease);
  position: relative;
}
.notif-panel .ni:hover { background: var(--panel); }
/* Per-item clear — appears on hover so the panel stays quiet at rest, but is
   always present for keyboard/touch (no hover state on a phone). */
.notif-panel .ni .nx {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; padding: 0; margin: 0;
  background: transparent;
  color: var(--ink-faint);
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease), transform 260ms var(--spring-soft);
}
.notif-panel .ni:hover .nx, .notif-panel .ni .nx:focus-visible { opacity: 1; }
.notif-panel .ni .nx:hover { background: var(--bg-3); color: var(--ink); transform: scale(1.12); }
.notif-panel .ni .nx:active { transform: scale(0.92); }
@media (hover: none) { .notif-panel .ni .nx { opacity: 1; } }
.notif-panel .nempty { padding: 20px 16px; font-size: 13px; color: var(--ink-muted); text-align: center; }
.notif-panel .ni.unread::before {
  content: "";
  position: absolute;
  left: 4px; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  background: var(--brand-red);
  border-radius: 999px;
}
.notif-panel .ni .ico {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--bg-3);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-muted);
  flex-shrink: 0;
}
.notif-panel .ni .ico.accent { background: color-mix(in srgb, var(--accent) 14%, var(--bg-2)); color: var(--accent); }
.notif-panel .ni .ico.brand  { background: color-mix(in srgb, var(--brand-blue) 14%, var(--bg-2)); color: var(--brand-blue); }
.notif-panel .ni .nbody { min-width: 0; }
.notif-panel .ni .nt { font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.notif-panel .ni .nd { font-size: 12px; color: var(--ink-muted); margin-top: 3px; line-height: 1.45; }
.notif-panel .ni .nw { font-size: 11px; color: var(--ink-faint); margin-top: 4px; letter-spacing: 0.02em; }
.notif-panel .nft {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--rule-soft);
  background: var(--panel);
}
.notif-panel .nft .markall { font-size: 12px; font-weight: 500; color: var(--ink-soft); cursor: pointer; }
.notif-panel .nft .markall:hover { color: var(--ink); }
.notif-panel .nft .clearall { font-size: 12px; font-weight: 500; color: var(--ink-muted); cursor: pointer; transition: color 140ms; }
.notif-panel .nft .clearall:hover { color: var(--r-red); }
.notif-panel .nft .clearall.armed { color: var(--r-red); }
.notif-panel .nft .see { font-size: 12px; font-weight: 500; color: var(--brand-blue); cursor: pointer; }
.notif-panel .empty { padding: 32px 20px; text-align: center; color: var(--ink-muted); font-size: 13px; }

/* Bell pip — use brand red, not accent (more recognisable) */
.bell .pip { background: var(--brand-red); }

/* ===== Filter panel (Vault / History) ===== */
.filter-panel {
  background: var(--bg-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  margin-bottom: 18px;
}

/* Mini-chip used inside filter rows */
.mchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--bg);
  border: 1px solid var(--rule-soft);
  font-size: 12px; font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}
.mchip:hover { background: var(--bg-3); }
.mchip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.mchip .dot { width: 6px; height: 6px; border-radius: 999px; }

/* ===== Dot grid (notecard / dotpoint completion heatmap) ===== */
.dotgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14px, 1fr));
  gap: 5px;
}
.dotgrid .dn {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--rule-soft);
  transition: transform 160ms var(--ease), background 160ms var(--ease);
  cursor: default;
}
.dotgrid .dn.l1 { background: color-mix(in srgb, var(--accent) 22%, var(--bg-3)); }
.dotgrid .dn.l2 { background: color-mix(in srgb, var(--accent) 45%, var(--bg-3)); }
.dotgrid .dn.l3 { background: color-mix(in srgb, var(--accent) 70%, var(--bg-3)); }
.dotgrid .dn.l4 { background: var(--accent); }
.dotgrid .dn:hover { transform: scale(1.18); }

/* Sparkline / minimal bar chart */
.spark { display: flex; align-items: flex-end; gap: 4px; height: 84px; padding-top: 4px; }
.spark .b {
  flex: 1; min-width: 6px;
  background: color-mix(in srgb, var(--accent) 32%, var(--bg-3));
  border-radius: 4px 4px 0 0;
  transition: background 160ms var(--ease);
}
.spark .b:hover { background: var(--accent); }
.spark .b.today { background: var(--accent); }
.spark-lbls { display: flex; gap: 4px; margin-top: 8px; font-size: 10px; color: var(--ink-faint); letter-spacing: 0.04em; }
.spark-lbls span { flex: 1; text-align: center; }

/* Standard small section head */
.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 18px; }
.sec-head .ttl { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; color: var(--ink-muted); }
.sec-head .meta { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.04em; }
.sec-block { margin-bottom: 64px; }
.sec-block:last-child { margin-bottom: 0; }

/* ===== Subject pill: coming soon items ===== */
.item.coming-soon { opacity: 0.4; pointer-events: none; position: relative; }
.item.coming-soon::after { content: 'Coming soon'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 9px; letter-spacing: 0.06em; color: var(--ink-muted); background: var(--bg-3); padding: 1px 6px; border-radius: var(--r-pill); }

/* ===== Scrollbars (chromium) ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius:var(--r-md); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }

.top .menu .mi { width: 100%; text-align: left; }
.top .menu:not(.open), .top .notif-panel:not(.open) { visibility: hidden; }
:where(button, a, [role="button"], [role="slider"]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.ionik-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 12000;
  max-width: min(92vw, 36rem); padding: 9px 18px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-md); font-size: 13px; }
.ionik-toast.is-error { background: var(--r-red); color: white; }
