:root {
  --bg: #f5f5f7; --panel: rgba(255,255,255,.72); --panel-solid: #fff; --panel-2: rgba(0,0,0,.035);
  --ink: #1d1d1f; --ink-soft: #5f5f66; --ink-faint: #8e8e93;
  --line: rgba(0,0,0,.09); --edge: rgba(255,255,255,.8);
  --side: rgba(255,255,255,.6);
  --good: #1a8a49; --good-bg: #e4f5ea; --warn: #a86a00; --warn-bg: #fbf0d9; --bad: #cf2a1e; --bad-bg: #fce8e6;
  --accent: #0071e3; --accent-bg: #e6f1fd;
  --btn: #1d1d1f; --btn-ink: #fff;
  --blob1: #c9c2e8; --blob2: #b9cfea; --blob3: #bfe0d1;
  --shadow: 0 10px 30px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.04);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.13), 0 4px 16px rgba(0,0,0,.06);
  --r: 20px; --r-sm: 14px; --ease: cubic-bezier(.16,1,.3,1);
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000; --panel: rgba(28,28,30,.66); --panel-solid: #1c1c1e; --panel-2: rgba(255,255,255,.055);
  --ink: #f5f5f7; --ink-soft: #a1a1a6; --ink-faint: #77777d;
  --line: rgba(255,255,255,.1); --edge: rgba(255,255,255,.14);
  --side: rgba(22,22,24,.7);
  --good: #32d74b; --good-bg: rgba(50,215,75,.14); --warn: #ffd60a; --warn-bg: rgba(255,214,10,.13); --bad: #ff5a4f; --bad-bg: rgba(255,69,58,.15);
  --accent: #4fa2ff; --accent-bg: rgba(10,132,255,.17);
  --btn: #f5f5f7; --btn-ink: #1d1d1f;
  --blob1: #3b3560; --blob2: #24415f; --blob3: #1f4a3c;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.2; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
code {
  font: .88em/1.5 var(--mono); background: var(--panel-2); border: 1px solid var(--line);
  padding: .1em .4em; border-radius: 6px; overflow-wrap: anywhere;
}

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg i { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .5; }
.bg i:nth-child(1) { width: 520px; height: 520px; background: var(--blob1); top: -180px; left: 22%; }
.bg i:nth-child(2) { width: 460px; height: 460px; background: var(--blob2); top: 30%; right: -140px; }
.bg i:nth-child(3) { width: 420px; height: 420px; background: var(--blob3); bottom: -160px; left: 30%; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 292px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 16px 16px;
  background: var(--side); border-right: 1px solid var(--line);
  backdrop-filter: blur(28px) saturate(170%); -webkit-backdrop-filter: blur(28px) saturate(170%);
  display: flex; flex-direction: column; gap: 18px;
}
.brand { display: block; padding: 0 8px 16px; border-bottom: 1px solid var(--line); }
.brand strong { display: block; font-size: 1.12rem; letter-spacing: -.02em; }
.brand span { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
#nav { display: flex; flex-direction: column; gap: 8px; }
.nav-label { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); padding: 10px 10px 2px; }
.pill {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px;
  padding: 10px 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel-2);
  transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.pill:hover { background: var(--accent-bg); transform: translateX(2px); }
.pill[aria-current="page"] { background: var(--accent-bg); border-color: var(--accent); }
.pill b { display: block; font-size: .86rem; font-weight: 650; line-height: 1.25; }
.pill small { display: block; font-size: .7rem; color: var(--ink-faint); line-height: 1.3; margin-top: 1px; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); }
.pill .dot.bad { background: var(--bad); }
.pill .pct { font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.side-foot { margin-top: auto; padding: 8px; }
.link-btn { background: none; border: 0; padding: 0; font-size: .78rem; color: var(--ink-faint); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--bad); }

main { padding: 56px clamp(18px, 5vw, 64px) 96px; max-width: 1080px; width: 100%; margin: 0 auto; outline: none; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel);
  display: grid; place-items: center; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.icon-btn svg { width: 18px; height: 18px; }
.theme-float { position: fixed; top: 18px; right: 20px; z-index: 5; }
.topbar { display: none; }
.scrim { display: none; }

/* ---------- shared pieces ---------- */
.eyebrow { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: inset 0 1px 0 var(--edge), var(--shadow);
  backdrop-filter: blur(28px) saturate(170%); -webkit-backdrop-filter: blur(28px) saturate(170%);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  font-weight: 600; font-size: .95rem; transition: transform .2s var(--ease), background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--btn); color: var(--btn-ink); border-color: transparent; }
.btn.small { padding: 8px 15px; font-size: .84rem; }
.btn svg { width: 16px; height: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2); font-size: .84rem; font-weight: 550;
}
.chip[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.chip .n { font-variant-numeric: tabular-nums; opacity: .75; font-weight: 500; }
.tag { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); }

.meter { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.meter span { display: block; height: 100%; transition: width .5s var(--ease); }
.meter .y { background: var(--good); } .meter .u { background: var(--warn); } .meter .n { background: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--ink-soft); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.legend .y i { background: var(--good); } .legend .u i { background: var(--warn); } .legend .n i { background: var(--bad); } .legend .new i { background: var(--ink-faint); }

/* ---------- home ---------- */
.hero { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 2.9rem); font-weight: 700; margin: 14px 0 14px; }
.hero p { color: var(--ink-soft); font-size: 1.05rem; }
.search { position: relative; margin: 28px auto 0; max-width: 600px; text-align: left; }
.search input {
  width: 100%; padding: 15px 20px 15px 48px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font: inherit; box-shadow: inset 0 1px 0 var(--edge), var(--shadow);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.search input::placeholder { color: var(--ink-faint); }
.search > svg { position: absolute; left: 19px; top: 17px; width: 18px; height: 18px; color: var(--ink-faint); pointer-events: none; z-index: 1; }
.results { margin-top: 10px; padding: 8px; max-height: 420px; overflow-y: auto; }
.results:empty { display: none; }
.res { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 0; background: none; }
.res:hover { background: var(--panel-2); }
.res b { font-size: .92rem; } .res p { font-size: .82rem; color: var(--ink-soft); }
.res .tag { margin-right: 8px; }
.res-empty { padding: 14px; color: var(--ink-soft); font-size: .9rem; }
.hero .btn { margin-top: 26px; padding: 15px 30px; font-size: 1rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.tile { padding: 24px; display: flex; flex-direction: column; gap: 12px; transition: transform .3s var(--ease), box-shadow .3s; }
.tile:hover { transform: translateY(-4px); box-shadow: inset 0 1px 0 var(--edge), var(--shadow-lg); }
.tile-top { display: flex; align-items: center; justify-content: space-between; }
.tile-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); }
.tile-ico svg { width: 22px; height: 22px; }
.tile h3 { font-size: 1.16rem; }
.tile p { color: var(--ink-soft); font-size: .9rem; flex: 1; }
.tile-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .76rem; color: var(--ink-soft); }
.tile-meta span { padding: 3px 10px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); }
.home-foot { margin-top: 34px; text-align: center; color: var(--ink-faint); font-size: .82rem; }

/* ---------- subject ---------- */
.s-head { margin-bottom: 26px; }
.s-head h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 12px 0 8px; }
.s-head .exam { color: var(--ink-soft); font-size: .92rem; }
.s-progress { margin-top: 20px; display: grid; gap: 10px; max-width: 560px; }
.tabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 28px; max-width: 100%; overflow-x: auto; }
.tab { padding: 9px 20px; border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.tab[aria-current="page"] { background: var(--btn); color: var(--btn-ink); }

.main-point { padding: 26px 28px; margin-bottom: 22px; border-left: 4px solid var(--accent); }
.main-point p { font-size: 1.06rem; margin-top: 8px; max-width: 70ch; }
.sec { padding: 24px 28px; margin-bottom: 16px; }
.sec h2 { font-size: 1.14rem; }
.sec > p { color: var(--ink-soft); margin: 6px 0 12px; max-width: 70ch; }
.sec ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; max-width: 74ch; }
.sec li::marker { color: var(--ink-faint); }
.tips { border-left: 4px solid var(--warn); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.filter { width: 100%; max-width: 420px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; margin-bottom: 20px; }
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.term { padding: 18px 20px; }
.term h3 { font-size: .98rem; margin-bottom: 6px; }
.term p { font-size: .9rem; color: var(--ink-soft); }
.none { color: var(--ink-soft); padding: 20px 0; }

/* ---------- flashcards ---------- */
.setup { padding: 28px; display: grid; gap: 22px; max-width: 720px; }
.setup h2 { font-size: 1.25rem; }
.setup .row { display: grid; gap: 10px; }
.setup .row > span { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.how { font-size: .86rem; color: var(--ink-soft); }
.how kbd, .keys kbd { font: .78rem var(--mono); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); }

.session { max-width: 720px; margin: 0 auto; }
.s-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; font-size: .86rem; color: var(--ink-soft); }
.s-bar .tally { display: flex; gap: 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
.tally .y { color: var(--good); } .tally .u { color: var(--warn); } .tally .n { color: var(--bad); }
.track { height: 6px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; margin-bottom: 22px; }
.track span { display: block; height: 100%; background: var(--accent); transition: width .4s var(--ease); }

.fc { perspective: 1600px; width: 100%; background: none; border: 0; padding: 0; text-align: left; display: block; }
.fc-inner { display: grid; transform-style: preserve-3d; transition: transform .6s var(--ease); }
.fc.flipped .fc-inner { transform: rotateY(180deg); }
.face {
  grid-area: 1 / 1; min-height: 320px; padding: 30px 32px; display: flex; flex-direction: column;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 26px;
  box-shadow: inset 0 1px 0 var(--edge), var(--shadow-lg);
}
.face.back { transform: rotateY(180deg); }
.face-top { display: flex; justify-content: space-between; align-items: center; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.face-body { flex: 1; display: flex; align-items: center; padding: 22px 0; }
.face.front .face-body { font-size: clamp(1.15rem, 2.6vw, 1.45rem); font-weight: 600; letter-spacing: -.01em; line-height: 1.4; }
.face.back .face-body { font-size: 1.04rem; line-height: 1.7; }
.face-body > div { width: 100%; overflow-wrap: anywhere; }
.face-foot { font-size: .8rem; color: var(--ink-faint); text-align: center; }
.enter { animation: enter .45s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(14px) scale(.985); } }

.rate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; transition: opacity .3s; }
.rate[inert] { opacity: .35; }
.rbtn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--panel); font-weight: 650; font-size: .96rem;
  transition: transform .2s var(--ease), background .2s, border-color .2s;
}
.rbtn svg { width: 22px; height: 22px; }
.rbtn small { font-weight: 500; font-size: .72rem; color: var(--ink-faint); }
.rbtn:hover { transform: translateY(-2px); }
.rbtn:active { transform: scale(.97); }
.rbtn.y { color: var(--good); } .rbtn.y:hover { background: var(--good-bg); border-color: var(--good); }
.rbtn.u { color: var(--warn); } .rbtn.u:hover { background: var(--warn-bg); border-color: var(--warn); }
.rbtn.n { color: var(--bad); }  .rbtn.n:hover { background: var(--bad-bg); border-color: var(--bad); }
.keys { margin-top: 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .78rem; color: var(--ink-faint); }

.done { padding: 40px 32px; text-align: center; max-width: 620px; margin: 0 auto; }
.done h2 { font-size: 1.6rem; margin-bottom: 8px; }
.done > p { color: var(--ink-soft); }
.done-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 26px 0; }
.stat { padding: 16px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel-2); }
.stat b { display: block; font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--ink-soft); }
.stat.y b { color: var(--good); } .stat.u b { color: var(--warn); } .stat.n b { color: var(--bad); }
.done .cta-row { justify-content: center; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20;
    padding: 10px 14px; background: var(--side); border-bottom: 1px solid var(--line);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  }
  .topbar-title { font-weight: 700; letter-spacing: -.02em; }
  .theme-float { display: none; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: min(310px, 86vw); transform: translateX(-102%); transition: transform .35s var(--ease); background: var(--panel-solid); }
  .side.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .scrim.open { opacity: 1; pointer-events: auto; }
  main { padding-top: 30px; }
  .face { padding: 22px 20px; min-height: 280px; }
  .sec, .main-point, .setup { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- schools ---------- */
body.no-side .shell { grid-template-columns: minmax(0, 1fr); }
body.no-side .side, body.no-side #menuBtn { display: none; }
body.no-side main { padding-top: clamp(48px, 12vh, 120px); }
.schools { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 340px)); gap: 22px; justify-content: center; }
.school { padding: 22px 22px 26px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; transition: transform .3s var(--ease), box-shadow .3s; }
.school:hover { transform: translateY(-5px); box-shadow: inset 0 1px 0 var(--edge), var(--shadow-lg); }
.school-logo { width: 100%; height: 190px; border-radius: 14px; background: #fff; display: block; padding: 26px; margin-bottom: 10px; }
.school-logo img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.school h2 { font-size: 1.3rem; }
.school p { color: var(--ink-soft); font-size: .92rem; }
.school-meta { font-size: .78rem; color: var(--ink-faint); margin-bottom: 10px; }
.hero-logo { display: inline-grid; place-items: center; width: 92px; height: 92px; border-radius: 22px; background: #fff; padding: 14px; margin-bottom: 18px; box-shadow: var(--shadow); }
.hero-logo img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.school-chip { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 11px; padding: 8px 12px 8px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel-2); transition: background .2s; }
.school-chip:hover { background: var(--accent-bg); }
.school-chip img { width: 40px; height: 40px; border-radius: 10px; background: #fff; padding: 5px; object-fit: contain; }
.school-chip b { display: block; font-size: .88rem; line-height: 1.2; }
.school-chip small { font-size: .7rem; color: var(--ink-faint); }
.school-chip svg { width: 15px; height: 15px; color: var(--ink-faint); }
.nav-empty { font-size: .8rem; color: var(--ink-faint); padding: 2px 10px; }
.pill .dot.note { background: var(--accent); }

/* ---------- highlighter ---------- */
mark.hl { color: inherit; border-radius: 4px; padding: .08em 0; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
mark.hl code { background: transparent; }
.hl-yellow { background: rgba(255, 214, 10, .42); } .hl-green { background: rgba(50, 215, 75, .36); }
.hl-blue { background: rgba(64, 156, 255, .4); }   .hl-pink { background: rgba(255, 100, 170, .4); }
.hl-orange { background: rgba(255, 149, 0, .42); }  .hl-purple { background: rgba(175, 110, 255, .42); }
body.hl-armed [data-hl] { cursor: text; }
body.hl-armed [data-hl] ::selection, body.hl-armed [data-hl]::selection { background: rgba(120, 170, 255, .45); }
.island { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 15; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 6px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel);
  box-shadow: inset 0 1px 0 var(--edge), var(--shadow); backdrop-filter: blur(24px) saturate(170%); -webkit-backdrop-filter: blur(24px) saturate(170%); }
.island[hidden] { display: none; }
.isl-grip { width: 26px; height: 44px; border: 0; background: none; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-soft); }
.isl-grip:hover { background: var(--panel-2); }
.isl-grip i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.isl-grip svg { width: 15px; height: 15px; }
.island.open .isl-grip { width: 30px; height: 30px; }
.isl-tools { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-bottom: 4px; }
.isl-sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; outline: 1px solid var(--line); transition: transform .2s var(--ease); }
.isl-sw.hl-yellow { background: #ffd60a; } .isl-sw.hl-green { background: #32d74b; } .isl-sw.hl-blue { background: #409cff; }
.isl-sw.hl-pink { background: #ff64aa; } .isl-sw.hl-orange { background: #ff9500; } .isl-sw.hl-purple { background: #af6eff; }
.isl-sw:hover { transform: scale(1.15); }
.isl-sw[aria-pressed="true"] { border-color: var(--panel-solid); outline: 2px solid var(--ink); transform: scale(1.12); }
.isl-btn { width: 30px; height: 30px; border-radius: 10px; border: 1px solid transparent; background: none; display: grid; place-items: center; color: var(--ink-soft); }
.isl-btn svg { width: 16px; height: 16px; }
.isl-btn:hover { background: var(--panel-2); }
.isl-btn[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.isl-hint { position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: .76rem; padding: 6px 12px; border-radius: 99px;
  background: var(--panel-solid); border: 1px solid var(--line); color: var(--ink-soft); box-shadow: var(--shadow); pointer-events: none; }

/* ---------- notes ---------- */
.notes { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.note-list { display: grid; gap: 10px; position: sticky; top: 20px; }
#noteItems { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; }
.note-item { display: block; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.note-item:hover { background: var(--accent-bg); }
.note-item[aria-current="page"] { border-color: var(--accent); background: var(--accent-bg); }
.note-item b { display: block; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-item small { font-size: .7rem; color: var(--ink-faint); }
.note-doc { background: var(--panel-solid); padding: 26px 30px 30px; }
.note-title { width: 100%; border: 0; background: none; color: var(--ink); font: 700 1.7rem/1.2 inherit; letter-spacing: -.02em; padding: 0 0 12px; outline: none; }
.note-title::placeholder { color: var(--ink-faint); }
.note-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); position: sticky; top: 10px; z-index: 2; }
.note-bar button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 0; background: none; font-size: .9rem; display: grid; place-items: center; }
.note-bar button:hover { background: var(--accent-bg); }
.note-bar svg { width: 16px; height: 16px; }
.note-status { margin-left: auto; font-size: .76rem; color: var(--ink-faint); padding: 0 8px; }
.note-status.bad { color: var(--bad); }
.note-bar .note-del:hover { background: var(--bad-bg); color: var(--bad); }
.note-body { min-height: 55vh; padding: 20px 2px; outline: none; font-size: 1.02rem; line-height: 1.7; overflow-wrap: anywhere; }
.note-body:empty::before { content: attr(data-placeholder); color: var(--ink-faint); }
.note-body h2 { font-size: 1.3rem; margin: 18px 0 6px; }
.note-body p, .note-body div { margin: 0 0 4px; }
.note-body ul, .note-body ol { padding-left: 24px; margin: 6px 0; }

@media (max-width: 900px) {
  .island { top: auto; bottom: 16px; right: 12px; transform: none; }
  .isl-hint { display: none; }
  .notes { grid-template-columns: 1fr; }
  .note-list { position: static; }
  #noteItems { grid-auto-flow: column; grid-auto-columns: minmax(150px, 60%); overflow-x: auto; max-height: none; }
  .note-doc { padding: 18px; }
  .note-bar { top: 66px; }
}
