/* ── lattice.study signed-in home (home.js) ────────────────────────────────────
   Scoped to html.is-authed:not(.legacy-home). Guests never see any of this,
   and ?legacyhome=1 restores the old compact picker on a device.
   Dark: translucent surfaces over the lattice canvas, hairline borders, a faint
   accent glow. Light: opaque white surfaces, hairline borders, soft shadow.
   State colours are fixed and always paired with a shape (never colour alone). */

:root{
  --hm-surface:rgba(255,255,255,.035);
  --hm-surface-2:rgba(255,255,255,.06);
  --hm-line:rgba(255,255,255,.09);
  --hm-line-2:rgba(255,255,255,.16);
  /* a no-op shadow, not "none": it is the first item of comma lists below */
  --hm-shadow:0 0 #0000;
  --hm-glow:22%;
  --hm-on-accent:#03141a;
  --st-solid:#22c55e;
  --st-studying:#3b82f6;
  --st-review:#f59e0b;
  --st-none:rgba(232,230,224,.34);
  --hm-seg-off:rgba(232,230,224,.12);
}
[data-theme="light"]{
  --hm-surface:#ffffff;
  --hm-surface-2:#faf9f7;
  --hm-line:rgba(0,0,0,.09);
  --hm-line-2:rgba(0,0,0,.16);
  --hm-shadow:0 1px 2px rgba(0,0,0,.05),0 6px 18px -8px rgba(0,0,0,.12);
  --hm-glow:0%;
  --hm-on-accent:#ffffff;
  --st-solid:#15803d;
  --st-studying:#1d4ed8;
  --st-review:#b45309;
  --st-none:rgba(26,25,22,.38);
  --hm-seg-off:rgba(26,25,22,.1);
}

/* ── show / hide ─────────────────────────────────────────────────────────── */
#hm,.hm-browse-toggle{display:none;}
html.is-authed:not(.legacy-home) #hm{display:block;}
html.is-authed:not(.legacy-home) .hm-browse-toggle{display:flex;}
html.is-authed:not(.legacy-home) #course-select .cs-hero,
html.is-authed:not(.legacy-home) #course-select .cs-tabs{display:none;}
html.is-authed:not(.legacy-home) #course-select .cs-inner{max-width:1080px;padding:0 20px 60px;}
html.is-authed:not(.legacy-home) #course-select .cs-courses-wrap{padding:0 0 40px;gap:20px;}
/* "My Stuff" is folded in as the tools row; its PINNED shelf is replaced by Your courses. */
html.is-authed:not(.legacy-home) #cs-panel-mystuff{display:flex!important;gap:0;}
html.is-authed:not(.legacy-home) #course-select [data-pinned-host]{display:none!important;}
/* The full catalog is a collapsed shelf. */
html.is-authed:not(.legacy-home) #cs-panel-courses{display:none!important;}
html.is-authed.hm-browse-open:not(.legacy-home) #cs-panel-courses{display:flex!important;}

/* ── frame ───────────────────────────────────────────────────────────────── */
.hm{width:100%;padding:18px 0 0;position:relative;z-index:1;font-variant-numeric:tabular-nums;}
.hm-head{height:30px;display:flex;align-items:center;margin-bottom:22px;}
.hm-brand .cs-logo-ap,.hm-brand .cs-logo-graphs{font-size:17px;letter-spacing:1px;}
.hm-label{font-family:var(--font-mono);font-size:11px;letter-spacing:2.5px;text-transform:uppercase;
  color:var(--muted);margin:0 0 12px;}
.hm-sec{margin-top:36px;}
.hm-sec[hidden]{display:none;}
.hm-tools-label{margin:36px 0 0;}
.hm-dim{color:var(--muted);}
.hm-fade{animation:hm-fade .18s ease both;}
@keyframes hm-fade{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion:reduce){.hm-fade,.hm-pop{animation:none;}}

/* ── today strip ─────────────────────────────────────────────────────────── */
.hm-strip{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 18px;
  min-height:24px;margin-bottom:14px;}
.hm-greet{font-family:var(--font-body);font-size:14px;color:var(--text);opacity:.9;}
.hm-strip-r{display:flex;align-items:center;flex-wrap:wrap;gap:6px 16px;font-family:var(--font-mono);
  font-size:11px;letter-spacing:.3px;color:var(--muted);}
.hm-st{display:inline-flex;align-items:center;gap:6px;color:var(--text);}
.hm-st svg{color:#f97316;}
.hm-st.is-off svg{color:var(--muted);}
.hm-lv{display:inline-flex;align-items:center;gap:8px;color:var(--text);}
.hm-lv-bar{display:inline-block;width:56px;height:3px;border-radius:2px;background:var(--hm-seg-off);overflow:hidden;}
.hm-lv-bar b{display:block;height:100%;background:var(--accent);border-radius:inherit;}
.hm-week{display:inline-flex;gap:5px;}
.hm-wd{display:flex;flex-direction:column;align-items:center;gap:3px;font-size:8.5px;line-height:1;color:var(--muted);}
.hm-wd i{width:7px;height:7px;border-radius:50%;background:var(--hm-seg-off);}
.hm-wd.is-on i{background:var(--accent);}
.hm-wd.is-fz i{background:transparent;box-shadow:inset 0 0 0 1.5px #60a5fa;}
.hm-wd.is-today{color:var(--text);}

/* ── top row: hero + side card ───────────────────────────────────────────── */
.hm-top{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:16px;align-items:stretch;}
.hm.hm-no-side .hm-top{grid-template-columns:minmax(0,1fr);}
.hm.hm-no-side .hm-side{display:none;}
.hm-hero,.hm-side,.hm-card,.hm-nudge,.hm-tile{background:var(--hm-surface);border:1px solid var(--hm-line);
  border-radius:14px;box-shadow:var(--hm-shadow);}
[data-theme="cyber"] .hm-hero,[data-theme="cyber"] .hm-side,[data-theme="cyber"] .hm-card,[data-theme="cyber"] .hm-nudge{
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);}
.hm-hero{--cc:var(--accent);position:relative;display:flex;gap:20px;align-items:center;padding:24px;min-height:196px;
  border-color:color-mix(in srgb,var(--cc) 45%,var(--hm-line));
  box-shadow:var(--hm-shadow),0 0 40px -18px color-mix(in srgb,var(--cc) var(--hm-glow),transparent);}
.hm-hero-main{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;}
.hm-kicker{font-family:var(--font-mono);font-size:11px;letter-spacing:2.5px;text-transform:uppercase;color:var(--muted);margin-bottom:8px;}
.hm-title{font-family:var(--font-display);font-weight:800;font-size:clamp(24px,3.2vw,31px);line-height:1.12;
  letter-spacing:-.4px;color:var(--text);margin:0;}
.hm-line{font-size:14px;line-height:1.5;color:var(--text);opacity:.86;margin:8px 0 0;}
.hm-meta{font-size:13px;color:var(--muted);margin:4px 0 0;}
.hm-hero-acts{display:flex;align-items:center;flex-wrap:wrap;gap:8px 18px;margin-top:18px;}
.hm-side{padding:20px;display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-height:196px;}
.hm-side-title{font-family:var(--font-display);font-weight:700;font-size:17px;color:var(--text);line-height:1.25;}
.hm-side-sub{font-size:13px;color:var(--muted);line-height:1.45;}
.hm-side .hm-btn-outline{margin-top:12px;}
.hm-side-exam{margin-top:auto;padding-top:14px;font-family:var(--font-mono);font-size:11px;letter-spacing:.4px;color:var(--muted);}

/* buttons: exactly one filled button on the page, the hero action */
.hm-btn-primary{appearance:none;border:1px solid var(--accent);background:var(--accent);color:var(--hm-on-accent);
  font-family:var(--font-body);font-weight:600;font-size:14px;padding:11px 26px;border-radius:999px;cursor:pointer;
  transition:background var(--dur-1),transform var(--dur-1);}
.hm-btn-primary:hover{background:color-mix(in srgb,var(--accent) 86%,#fff);}
.hm-btn-primary:active{transform:scale(.97);}
.hm-btn-outline{appearance:none;background:transparent;border:1px solid color-mix(in srgb,var(--accent) 55%,transparent);
  color:var(--accent);font-family:var(--font-body);font-weight:600;font-size:13px;padding:8px 18px;border-radius:999px;cursor:pointer;
  transition:background var(--dur-1),border-color var(--dur-1);}
.hm-btn-outline:hover{background:rgba(var(--accent-rgb),.08);border-color:var(--accent);}
.hm-text-btn{appearance:none;background:none;border:none;padding:0;color:var(--accent);font-family:var(--font-body);
  font-size:13px;cursor:pointer;text-align:left;}
.hm-text-btn:hover{text-decoration:underline;text-underline-offset:3px;}
.hm-x{appearance:none;background:none;border:none;color:var(--muted);font-size:12px;cursor:pointer;padding:4px 6px;border-radius:6px;}
.hm-x:hover{color:var(--text);background:var(--hm-surface-2);}
.hm :focus-visible{outline:2px solid rgba(var(--accent-rgb),.7);outline-offset:2px;}

/* skeletons: static, replaced by a plain fade when content lands */
.hm-skel{width:100%;border-radius:10px;background:var(--hm-surface-2);}
.hm-skel-hero{height:140px;}
.hm-skel-side{height:140px;}

/* start state */
.hm-recs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;width:100%;margin:18px 0 12px;}
.hm-rec{appearance:none;text-align:left;cursor:pointer;display:flex;flex-direction:column;gap:6px;padding:14px 14px 14px 16px;
  border-radius:12px;background:var(--hm-surface-2);border:1px solid var(--hm-line);color:var(--text);
  box-shadow:inset 3px 0 0 var(--cc);transition:border-color var(--dur-1),background var(--dur-1);}
.hm-rec:hover{border-color:color-mix(in srgb,var(--cc) 60%,var(--hm-line));}
.hm-rec.is-first{border-color:var(--accent);background:rgba(var(--accent-rgb),.08);}
.hm-rec-name{font-family:var(--font-display);font-weight:700;font-size:15px;line-height:1.25;}
.hm-rec-desc{font-family:var(--font-mono);font-size:10px;letter-spacing:.3px;color:var(--muted);line-height:1.4;}
html.hm-new .hm-hero{min-height:0;}

/* ── hero mini map ───────────────────────────────────────────────────────── */
.hm-map{width:300px;flex-shrink:0;align-self:stretch;display:flex;flex-direction:column;justify-content:center;gap:6px;}
.hm-map-svg{display:block;width:100%;height:auto;overflow:visible;}
.hm-map .lp-edge{animation:none;stroke:var(--hm-line-2);stroke-dasharray:none;stroke-width:1.2;}
.lm-node{cursor:pointer;outline:none;}
.lm-core{fill:var(--bg);stroke-width:1.8;transition:fill var(--dur-1),stroke-width var(--dur-1);}
.lm-lab{font-family:var(--font-mono);font-size:9px;font-weight:700;text-anchor:middle;pointer-events:none;}
.lm-node:hover .lm-core,.lm-node:focus-visible .lm-core{stroke-width:3;}
.lm-s-none .lm-core{stroke:var(--st-none);fill:transparent;stroke-dasharray:2.5 2.5;}
.lm-s-none .lm-lab{fill:var(--muted);}
.lm-s-studying .lm-core{stroke:var(--st-studying);fill:color-mix(in srgb,var(--st-studying) 22%,var(--bg));}
.lm-s-review .lm-core{stroke:var(--st-review);fill:color-mix(in srgb,var(--st-review) 22%,var(--bg));}
.lm-s-solid .lm-core{stroke:var(--st-solid);fill:color-mix(in srgb,var(--st-solid) 30%,var(--bg));}
.lm-s-studying .lm-lab,.lm-s-review .lm-lab,.lm-s-solid .lm-lab{fill:var(--text);}
.lm-mark-bg{fill:var(--st-solid);stroke:var(--bg);stroke-width:1.5;}
.lm-mark-ink{fill:none;stroke:var(--bg);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;}
.lm-mark-dot{fill:var(--st-review);stroke:var(--bg);stroke-width:1.5;}
.hm-map-key{display:flex;flex-wrap:wrap;gap:4px 12px;justify-content:center;font-family:var(--font-mono);font-size:9px;
  letter-spacing:.4px;color:var(--muted);}
.hm-map-key span,.hm-pop-w,.hm-dot{display:inline-flex;align-items:center;gap:5px;}
.hm-map-key i,.hm-pop-w i,.hm-dot i{width:8px;height:8px;border-radius:50%;flex-shrink:0;}
.lm-s-solid>i{background:var(--st-solid);}
.lm-s-studying>i{background:var(--st-studying);}
.lm-s-review>i{background:var(--st-review);border-radius:1px!important;transform:rotate(45deg) scale(.9);}
.lm-s-none>i{background:transparent;box-shadow:inset 0 0 0 1.5px var(--st-none);}
/* small-screen / reduced-motion fallback: a row of labelled unit dots */
.hm-dots{display:flex;flex-wrap:wrap;gap:6px;}
.hm-dot{appearance:none;border:1px solid var(--hm-line);background:var(--hm-surface-2);color:var(--text);border-radius:999px;
  padding:4px 9px 4px 7px;font-family:var(--font-mono);font-size:10px;cursor:pointer;}
.hm-pop{position:absolute;z-index:5;width:248px;padding:12px 12px 10px;border-radius:12px;background:var(--bg2);
  border:1px solid var(--hm-line-2);box-shadow:0 12px 32px rgba(0,0,0,.35);animation:hm-fade .15s ease both;}
.hm-pop-t{font-family:var(--font-display);font-weight:700;font-size:14px;color:var(--text);line-height:1.3;padding-right:16px;}
.hm-pop-w{font-size:12px;color:var(--muted);margin:6px 0 10px;}
.hm-pop-acts{display:flex;align-items:center;justify-content:space-between;}

/* ── referral nudge (one at a time, dismissible) ─────────────────────────── */
.hm-nudge-row{margin-top:16px;}
.hm-nudge-row[hidden]{display:none;}
.hm-nudge{display:flex;align-items:center;justify-content:space-between;gap:12px 18px;padding:12px 14px 12px 18px;flex-wrap:wrap;}
.hm-nudge-t{font-size:13px;color:var(--text);line-height:1.45;flex:1;min-width:220px;}
.hm-nudge-acts{display:flex;align-items:center;gap:10px;}

/* ── your courses ────────────────────────────────────────────────────────── */
.hm-courses{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;}
.hm-courses.is-one{grid-template-columns:minmax(0,2fr) minmax(0,1fr);}
.hm-card{--cc:var(--accent);position:relative;display:flex;flex-direction:column;align-items:stretch;gap:8px;
  padding:18px 18px 16px 20px;cursor:pointer;text-align:left;
  box-shadow:var(--hm-shadow),inset 3px 0 0 var(--cc),0 0 30px -18px color-mix(in srgb,var(--cc) var(--hm-glow),transparent);
  transition:border-color var(--dur-1),background var(--dur-1);}
.hm-card:hover{border-color:color-mix(in srgb,var(--cc) 55%,var(--hm-line));background:var(--hm-surface-2);}
.hm-card.is-big{padding:22px 22px 18px 24px;}
.hm-card.is-stub{opacity:.72;}
.hm-card-top{display:flex;align-items:center;gap:8px;}
.hm-card-badge{font-family:var(--font-mono);font-size:10px;letter-spacing:1.5px;color:var(--muted);}
.hm-tier{margin-left:auto;font-family:var(--font-mono);font-size:9px;letter-spacing:1px;text-transform:uppercase;
  color:var(--muted);border:1px solid var(--hm-line-2);border-radius:999px;padding:2px 8px;}
.hm-tier-ip{border-style:dashed;}
.hm-card-name{font-family:var(--font-display);font-weight:700;font-size:16px;line-height:1.25;color:var(--text);}
.hm-card.is-big .hm-card-name{font-size:19px;}
.hm-card-last{font-size:12.5px;color:var(--muted);line-height:1.4;}
.hm-cov{display:flex;gap:3px;margin-top:4px;}
.hm-cov i{flex:1;height:5px;border-radius:2px;background:var(--hm-seg-off);}
.hm-cov i.on{background:var(--cc);}
[data-theme="light"] .hm-cov i.on{background:color-mix(in srgb,var(--cc) 80%,#000);}
.hm-card-foot{display:flex;align-items:center;flex-wrap:wrap;gap:6px 8px;margin-top:2px;}
/* strength is a word plus a marker shape, never a bar or a percent */
.hm-str{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:var(--text);margin-right:auto;}
.hm-str i{width:9px;height:9px;flex-shrink:0;}
.hm-str-none{color:var(--muted);}
.hm-str-none i{border-radius:50%;box-shadow:inset 0 0 0 1.5px var(--st-none);}
.hm-str-building i{background:var(--st-studying);transform:rotate(45deg) scale(.82);border-radius:1px;}
.hm-str-solid i{border-radius:50%;background:var(--st-solid);box-shadow:0 0 0 2px color-mix(in srgb,var(--st-solid) 28%,transparent);}
.hm-chip{font-family:var(--font-mono);font-size:10px;letter-spacing:.3px;color:var(--muted);border:1px solid var(--hm-line-2);
  border-radius:999px;padding:3px 9px;white-space:nowrap;}
.hm-chip-due{color:var(--st-review);border-color:color-mix(in srgb,var(--st-review) 45%,transparent);}
.hm-card-diag{font-size:12px;color:var(--muted);}
button.hm-card-diag{color:var(--accent);font-size:12px;align-self:flex-start;}
.hm-card-pro{font-size:12px;color:var(--text);}
.hm-card-stub{font-size:12.5px;color:var(--muted);}
.hm-tile{appearance:none;display:flex;align-items:center;justify-content:center;gap:8px;min-height:64px;padding:14px;cursor:pointer;
  color:var(--muted);font-family:var(--font-body);font-size:13px;border-style:dashed;background:transparent;box-shadow:none;
  transition:color var(--dur-1),border-color var(--dur-1);}
.hm-tile:hover{color:var(--text);border-color:var(--hm-line-2);}
.hm-tile-add span{font-size:16px;line-height:1;}

/* ── tools row (My Stuff, folded in) ─────────────────────────────────────── */
html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-strip{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-wide{grid-column:auto;}
html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-card{background:var(--hm-surface);border-color:var(--hm-line);
  border-radius:14px;box-shadow:var(--hm-shadow);gap:4px;padding:14px 16px;}
html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-card.cs-action-create{padding:0;}
html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-create-trigger{padding:14px 16px;gap:4px;}
html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-icon{width:30px;height:30px;}
html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-icon svg{width:17px;height:17px;}
html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-title{font-size:14px;font-weight:700;}
html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-sub{font-size:12px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-btn{display:none;}
html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-card:not(.cs-action-soon):hover{transform:none;box-shadow:var(--hm-shadow);}

/* ── browse shelf ────────────────────────────────────────────────────────── */
.hm-browse-toggle{appearance:none;width:100%;align-items:center;justify-content:space-between;gap:10px;margin-top:16px;
  padding:14px 18px;border-radius:14px;background:transparent;border:1px solid var(--hm-line);color:var(--text);
  font-family:var(--font-body);font-size:14px;cursor:pointer;transition:border-color var(--dur-1),background var(--dur-1);}
.hm-browse-toggle:hover{border-color:var(--hm-line-2);background:var(--hm-surface);}
.hm-browse-toggle svg{color:var(--muted);transition:transform var(--dur-2);}
html.hm-browse-open .hm-browse-toggle svg{transform:rotate(180deg);}
html.hm-browse-open #cs-panel-courses{animation:hm-fade .18s ease both;}

/* ── in-progress course banner (dashboard.js addStubBanner) ──────────────── */
.dash-stub-banner{margin:0 0 16px;padding:12px 16px;border:1px dashed var(--border2);border-radius:12px;
  font-family:var(--font-body);font-size:13px;line-height:1.5;color:var(--text);background:rgba(var(--inkw),.025);}

/* ── tablet ──────────────────────────────────────────────────────────────── */
@media (max-width:900px){
  .hm-courses{grid-template-columns:repeat(2,minmax(0,1fr));}
  .hm-hero{flex-direction:column;align-items:stretch;}
  .hm-map{width:100%;max-width:420px;align-self:center;}
}
/* ── phone ───────────────────────────────────────────────────────────────── */
@media (max-width:600px){
  html.is-authed:not(.legacy-home) #course-select .cs-inner{padding:0 16px 48px;}
  .hm{padding-top:64px;}
  .hm-head{display:none;}
  .hm-strip{margin-bottom:12px;}
  .hm-strip-r{gap:6px 12px;}
  .hm-top{grid-template-columns:minmax(0,1fr);gap:10px;}
  .hm-hero{padding:20px 18px;min-height:0;}
  .hm-hero-acts{width:100%;}
  .hm-hero-acts .hm-btn-primary{width:100%;padding:13px 20px;}
  .hm-map-key{display:none;}
  /* the side card becomes a one-line row */
  .hm-side{min-height:0;flex-direction:row;flex-wrap:wrap;align-items:center;gap:2px 12px;padding:12px 16px;}
  .hm-side .hm-kicker,.hm-side-sub{display:none;}
  .hm-side-title{font-size:14px;}
  .hm-side .hm-btn-outline{margin:0 0 0 auto;padding:6px 14px;}
  .hm-side-exam{width:100%;padding-top:4px;margin-top:0;}
  .hm-recs{grid-template-columns:minmax(0,1fr);}
  .hm-sec{margin-top:28px;}
  .hm-courses,.hm-courses.is-one{grid-template-columns:minmax(0,1fr);}
  .hm-pop{left:12px!important;right:12px;bottom:12px;top:auto!important;width:auto;}
  html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-strip{gap:8px;}
  html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-sub{display:none;}
  html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-card,
  html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-create-trigger{padding:12px;align-items:center;text-align:center;}
  html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-card.cs-action-create{padding:0;}
  html.is-authed:not(.legacy-home) #cs-panel-mystuff .cs-action-title{font-size:12.5px;}
}

/* ── Explore "My progress" overlay (progress-overlay.js) ─────────────────────
   Signed-in only. Colour always comes with a shape: Solid = check badge,
   Review = diamond badge, Studying = solid ring, Not started = dashed ring. */
html:not(.is-authed) #ps-tool,html:not(.is-authed) #ps-key,html:not(.is-authed) #ps-chip{display:none!important;}
.ps-tool{display:flex;flex-direction:column;align-items:center;gap:5px;}
.unit-bubble.ps-s-solid{--ps-c:var(--st-solid);}
.unit-bubble.ps-s-studying{--ps-c:var(--st-studying);}
.unit-bubble.ps-s-review{--ps-c:var(--st-review);}
.unit-bubble.ps-s-none{--ps-c:var(--st-none);}
#view-explore.ps-on .unit-bubble.ps-state::before{display:none;}
#view-explore.ps-on .unit-bubble.ps-state{outline:3px solid var(--ps-c);outline-offset:4px;}
#view-explore.ps-on .unit-bubble.ps-s-none{outline-style:dashed;outline-width:2px;opacity:.7;}
.ps-mark{display:none;}
#view-explore.ps-on .ps-s-solid .ps-mark,#view-explore.ps-on .ps-s-review .ps-mark{display:flex;position:absolute;top:-6px;right:-6px;
  width:22px;height:22px;border-radius:50%;align-items:center;justify-content:center;background:var(--ps-c);
  border:2px solid var(--bg);pointer-events:none;}
#view-explore.ps-on .ps-s-solid .ps-mark::after{content:'';width:8px;height:4px;border-left:2px solid var(--bg);border-bottom:2px solid var(--bg);
  transform:translate(0,-1px) rotate(-45deg);}
#view-explore.ps-on .ps-s-review .ps-mark{width:16px;height:16px;top:-3px;right:-3px;border-radius:3px;transform:rotate(45deg);}
.ps-key{position:absolute;top:14px;left:50%;transform:translateX(-50%);z-index:40;display:flex;flex-wrap:wrap;align-items:center;
  justify-content:center;gap:4px 12px;max-width:calc(100% - 32px);padding:7px 14px;border-radius:999px;
  background:rgba(var(--canvas-bg),.92);border:1px solid var(--border2);backdrop-filter:blur(10px);
  font-family:var(--font-mono);font-size:9.5px;letter-spacing:.4px;color:var(--muted);}
.ps-key[hidden]{display:none;}
.ps-key>span{display:inline-flex;align-items:center;gap:5px;}
.ps-key i{width:8px;height:8px;border-radius:50%;flex-shrink:0;display:inline-block;}
.ps-key-t{color:var(--text);font-weight:700;}
.ps-key-note{color:var(--text);}
.ps-key-note[hidden]{display:none!important;}
.ps-key .ps-key-x{padding:2px 4px;margin:-2px -6px -2px 0;font-size:11px;}
.ps-chip{display:none;}
.ps-pop{position:absolute;z-index:90;width:260px;padding:12px 12px 10px;border-radius:12px;background:var(--bg2);
  border:1px solid var(--hm-line-2);box-shadow:0 12px 32px rgba(0,0,0,.35);animation:hm-fade .15s ease both;}
.ps-pop .hm-pop-acts{gap:8px;}
.ps-pop-r{display:inline-flex;align-items:center;gap:2px;}
.ps-link{appearance:none;background:none;border:none;color:var(--muted);font-size:12px;cursor:pointer;padding:4px 6px;
  text-decoration:underline;text-underline-offset:2px;}
.ps-link:hover{color:var(--text);}
@media (prefers-reduced-motion:reduce){.ps-pop{animation:none;}}
@media (max-width:600px){
  .ps-key{top:10px;left:80px;right:12px;transform:none;max-width:none;border-radius:12px;font-size:9px;justify-content:flex-start;}
  .ps-pop{left:12px;right:12px;bottom:84px;top:auto;width:auto;}
  #ps-tool{display:none;}
  .ps-chip{position:absolute;top:10px;left:80px;z-index:40;display:inline-flex;align-items:center;gap:6px;appearance:none;cursor:pointer;
    padding:7px 12px;border-radius:999px;background:rgba(var(--canvas-bg),.92);border:1px solid var(--border2);backdrop-filter:blur(10px);
    font-family:var(--font-mono);font-size:10px;letter-spacing:.4px;color:var(--text);}
  .ps-chip i{width:10px;height:10px;border-radius:50%;background:conic-gradient(var(--text) 0 50%,transparent 50% 100%);box-shadow:inset 0 0 0 1.5px var(--text);}
  #view-explore.ps-on .ps-chip{display:none;}
}

/* Settings: sub-line under a switch label (the reviews-due email row) */
.sp-row-sub{display:block;font-size:10.5px;opacity:.75;margin-top:2px;}

/* ── your courses: remove, drag, add mode ────────────────────────────────── */
.hm-card-top{padding-right:26px;}
.hm-card-x{appearance:none;position:absolute;top:10px;right:10px;z-index:2;width:26px;height:26px;padding:0;display:grid;place-items:center;
  border-radius:50%;border:1px solid transparent;background:transparent;color:var(--muted);cursor:pointer;opacity:0;
  transition:opacity var(--dur-1),background var(--dur-1),color var(--dur-1),border-color var(--dur-1);}
.hm-card:hover .hm-card-x,.hm-card:focus-within .hm-card-x,.hm-card-x:focus-visible{opacity:1;}
.hm-card-x:hover{background:var(--hm-surface-2);color:var(--text);border-color:var(--hm-line-2);}
@media (hover:none){.hm-card-x{opacity:.75;}}
.hm-card.is-dragging{opacity:.35;border-style:dashed;}
.hm-courses.is-reordering .hm-card{cursor:grabbing;}
.hm-courses.is-reordering .hm-card:not(.is-dragging):hover{background:var(--hm-surface);}
.hm-card-new{animation:hm-new 1.6s ease both;}
@keyframes hm-new{0%,60%{box-shadow:0 0 0 2px var(--cc),var(--hm-shadow);}100%{box-shadow:var(--hm-shadow),inset 3px 0 0 var(--cc);}}

.hm-toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%);z-index:1300;display:flex;align-items:center;gap:14px;
  max-width:calc(100vw - 32px);padding:10px 12px 10px 18px;border-radius:999px;background:var(--bg2);border:1px solid var(--hm-line-2);
  color:var(--text);font-family:var(--font-body);font-size:13px;box-shadow:0 8px 30px rgba(0,0,0,.35);animation:hm-fade .18s ease both;}
.hm-toast.is-out{opacity:0;transition:opacity .2s;}
.hm-toast-undo{appearance:none;background:transparent;border:0;color:var(--accent);font:inherit;font-weight:600;cursor:pointer;padding:4px 8px;border-radius:999px;}
.hm-toast-undo:hover{background:var(--hm-surface-2);}

/* Add mode: the catalog becomes a picker. A tap adds or removes; nothing launches. */
.hm-add-bar{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:1300;display:flex;align-items:center;gap:14px;
  max-width:calc(100vw - 24px);padding:10px 10px 10px 20px;border-radius:999px;background:var(--bg2);border:1px solid var(--hm-line-2);
  box-shadow:0 10px 36px rgba(0,0,0,.4);font-family:var(--font-body);font-size:13px;color:var(--text);animation:hm-fade .18s ease both;}
.hm-add-t{font-weight:600;white-space:nowrap;}
.hm-add-n{color:var(--muted);white-space:nowrap;}
.hm-add-done{padding:8px 18px;}
html.hm-adding #cs-all-grid .cs-card.cs-available{cursor:copy;}
html.hm-adding #cs-all-grid .cs-card.cs-available.is-added{cursor:pointer;border-color:var(--accent);}
html.hm-adding #cs-all-grid .cs-card.is-added::after{content:"Added";position:absolute;top:8px;right:8px;z-index:3;
  font-family:var(--font-mono);font-size:9px;letter-spacing:1px;text-transform:uppercase;color:var(--accent);
  border:1px solid var(--accent);border-radius:999px;padding:2px 8px;background:var(--bg2);}
@media (max-width:600px){
  /* clear of the Graphy button in the bottom-right corner */
  .hm-add-bar{bottom:72px;gap:10px;padding-left:16px;}
  .hm-toast,.hm-tray{bottom:72px;}
}

/* ── add mode: unmistakable selected state ───────────────────────────────── */
html.hm-adding #cs-all-grid .cs-card.is-added{
  border-color:var(--accent)!important;background:rgba(var(--accent-rgb),.16)!important;
  box-shadow:0 0 0 2px var(--accent),0 10px 30px rgba(var(--accent-rgb),.3)!important;}
/* the course-ID pill gives way to the Added pill instead of stacking under it */
html.hm-adding #cs-all-grid .cs-card.is-added .cs-card-top{visibility:hidden;}
html.hm-adding #cs-all-grid .cs-card.is-added::after{content:"\2713  Added";top:10px;right:10px;
  background:var(--accent);color:var(--bg,#000);border-color:var(--accent);font-weight:700;padding:3px 9px;}

/* ── dragging between the catalog and Your courses ───────────────────────── */
.hm-courses.is-drop{outline:2px dashed var(--accent);outline-offset:6px;border-radius:14px;}
.hm-tray{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:1400;max-width:calc(100vw - 24px);
  padding:16px 28px;border-radius:999px;background:var(--bg2);border:2px dashed var(--hm-line-2);color:var(--text);
  font-family:var(--font-body);font-size:14px;font-weight:600;box-shadow:0 10px 36px rgba(0,0,0,.45);animation:hm-fade .15s ease both;
  transition:background var(--dur-1),border-color var(--dur-1);}
.hm-tray.is-in{border-color:var(--accent);}
.hm-tray.is-out{border-color:var(--st-review,#e0a64a);}
.hm-tray.is-over.is-in{background:rgba(var(--accent-rgb),.22);border-style:solid;}
.hm-tray.is-over.is-out{background:color-mix(in srgb,var(--st-review,#e0a64a) 22%,var(--bg2));border-style:solid;}
html.hm-dragging .hm-add-bar{display:none;}
html.hm-dragging #cs-all-grid .cs-card.cs-available{cursor:grabbing;}
