@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Instrument+Serif&display=swap");
/* Theme matched to deja-vu.pro: near-black with violet glow, plum + periwinkle accents */
:root {
  --bg: #050308; --panel: #0e0b14; --panel-2: #17131f; --line: rgba(191,160,229,.15);
  --text: #f3f0e9; --muted: #b3acbb; --accent: #d2a5c9; --accent-soft: rgba(210,165,201,.10);
  --done: #9da9ff; --done-soft: rgba(157,169,255,.12); --warn: #f0a3b4;
  --grad: linear-gradient(135deg, #d2a5c9, #9da9ff);
  --radius: 12px; --shadow: none;
  --head: "Bebas Neue", Impact, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* Gate */
.gate { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.gate-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px; max-width: 520px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.gate-card h1 { margin: 12px 0 8px; font-size: 22px; }
.gate-card p, .gate-card li { color: var(--muted); text-align: left; }
.gate-card ol { padding-left: 20px; }
.gate-card code { background: var(--panel-2); padding: 1px 6px; border-radius: 6px; }

.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 800; }
.logo.big { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; }

.btn { border: 1px solid var(--line); background: var(--panel); padding: 8px 14px; border-radius: 10px; font-weight: 600; }
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.on { background: var(--done-soft); border-color: var(--done); color: var(--done); }
.icon-btn { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 8px; font-size: 18px; }
.icon-btn:hover { background: var(--panel-2); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 10; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
#search { flex: 1; max-width: 420px; margin-left: 12px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); outline: none; }
#search:focus { border-color: var(--accent); }
.overall { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.overall .bar { width: 120px; }
.sync { font-size: 12px; color: var(--muted); min-width: 16px; }
.sync.error { color: var(--warn); }
.banner { background: var(--accent-soft); color: var(--text); padding: 10px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); }

.layout { display: grid; grid-template-columns: 290px 1fr; height: calc(100vh - 56px); }
aside { border-right: 1px solid var(--line); background: var(--panel); overflow: auto; padding: 10px 8px 40px; }
main { overflow: auto; position: relative; }
.only-mobile { display: none; }

/* Sidebar tree */
.tree a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--text); }
.tree a:hover { background: var(--panel-2); }
.tree a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tree .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .pct { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tree .pct.full { color: var(--done); }
.tree .tw { width: 16px; text-align: center; color: var(--muted); font-size: 10px; flex: none; border: 0; background: none; padding: 0; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 14px; }
.tree > ul { padding-left: 0; }

/* Main content */
.page { max-width: 1100px; margin: 0 auto; padding: 20px 24px 60px; }
.crumbs { color: var(--muted); margin-bottom: 6px; font-size: 13px; }
.crumbs a:hover { color: var(--accent); }
h2.title { margin: 0 0 16px; font-size: 22px; }
h3.section { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 0 10px; }

.hero { display: grid; grid-template-columns: 1fr auto; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.hero .big-num { font-size: 34px; font-weight: 800; }
.hero .muted { color: var(--muted); }

.bar { height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.full > i { background: var(--done); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); transition: border-color .15s; }
.card:hover { border-color: var(--accent); }
.card .name { font-weight: 600; }
.card .meta { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; }

.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--panel-2); }
.row .ico { width: 24px; text-align: center; font-size: 18px; flex: none; }
.row .info { flex: 1; min-width: 0; }
.row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.done .name { color: var(--muted); text-decoration: line-through; }
.row .meta { color: var(--muted); font-size: 12px; display: flex; gap: 10px; }
.row .meta .resume { color: var(--accent); font-weight: 600; }
.row .bar { width: 90px; flex: none; }
.check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: transparent; display: grid; place-items: center; font-size: 13px; color: transparent; padding: 0; }
.check:hover { border-color: var(--done); }
.check.on { background: var(--done); border-color: var(--done); color: #fff; }
.empty { color: var(--muted); padding: 30px; text-align: center; }

/* Player */
.player { display: flex; flex-direction: column; height: 100%; }
.pbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.pbar .ptitle { flex: 1; min-width: 160px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar .speeds { display: flex; gap: 2px; }
.pbar .speeds button { border: 1px solid var(--line); background: var(--panel); padding: 3px 7px; font-size: 12px; border-radius: 6px; }
.pbar .speeds button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.pbody { flex: 1; overflow: auto; position: relative; background: #000; }
.pbody.light { background: var(--panel-2); }
.pbody video { width: 100%; height: 100%; display: block; background: #000; }
.pbody audio { width: min(700px, 90%); margin: 80px auto; display: block; }
.pbody iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--panel); }
.pbody img { max-width: 100%; display: block; margin: 0 auto; }
.pdf { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; }
.pdf-page { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); max-width: 100%; }
.pdf-page canvas { display: block; }
.pageind { position: sticky; bottom: 12px; float: right; margin-right: 16px; background: rgba(0,0,0,.7); color: #fff; padding: 4px 10px; border-radius: 99px; font-size: 12px; }
.note { padding: 10px 16px; background: var(--accent-soft); font-size: 13px; }
.loading { color: var(--muted); padding: 40px; text-align: center; }

.menu { position: fixed; top: 52px; right: 12px; z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-width: 220px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.menu .who { padding: 6px 10px 10px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; }
.menu button:hover { background: var(--panel-2); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 40; font-weight: 600; }

@media (max-width: 760px) {
  .only-mobile { display: inline-block; }
  .layout { grid-template-columns: 1fr; }
  aside { position: fixed; top: 56px; bottom: 0; left: 0; width: 85%; max-width: 320px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  aside.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .overall .bar, .overall .txt { display: none; }
  #search { margin-left: 0; min-width: 0; }
  .page { padding: 16px; }
  .row .bar { display: none; }
  .hero { grid-template-columns: 1fr; }
}

/* Déjà Vu look */
body { background: radial-gradient(ellipse at 50% -10%, #1a1230 0%, var(--bg) 60%) fixed var(--bg); }
.top { background: rgba(10,10,10,.9); backdrop-filter: blur(12px) saturate(1.2); }
aside, .list, .card, .hero, .gate-card, .pbar, .menu { background: rgba(14,11,20,.75); }
.brand span:last-child, h2.title, .gate-card h1, .hero .big-num { font-family: var(--head); font-weight: 400; letter-spacing: .04em; }
.brand span:last-child { font-size: 22px; }
h2.title { font-size: 34px; }
.gate-card h1 { font-size: 40px; }
.hero .big-num { font-size: 48px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
h3.section { color: var(--accent); letter-spacing: .14em; }
.logo { background: var(--grad); color: #120c18; }
.btn { border-radius: 999px; background: rgba(210,165,201,.08); border-color: rgba(210,165,201,.45); }
.btn.primary, .pbar .speeds button.on { background: var(--grad); border-color: transparent; color: #120c18; box-shadow: 0 8px 28px rgba(157,169,255,.25); }
.bar > i { background: var(--grad); }
.check.on { color: #120c18; }
.toast { background: var(--grad); color: #120c18; }
.hero .btn.primary { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero > div { min-width: 0; }
.row .meta .docs { color: var(--accent); }
.crumbs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn.back { flex: none; }

/* Slides & notes */
.slide-card { background: rgba(14,11,20,.75); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 16px 0; }
.slide-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.slide-no { font-family: var(--head); letter-spacing: .08em; color: var(--accent); font-size: 18px; }
.slide-card img { width: 100%; border-radius: 8px; display: block; background: #000; }
.slide-title { font-family: var(--head); font-weight: 400; letter-spacing: .04em; font-size: 22px; margin: 14px 0 4px; }
.slide-notes { margin: 8px 0 0; padding-left: 20px; line-height: 1.6; }
.slide-notes li { margin: 4px 0; }
.said { margin-top: 10px; color: var(--muted); font-size: 13px; }
.said summary { cursor: pointer; color: var(--accent); }
@media print {
  body { background: #fff !important; color: #000; }
  .top, aside, .no-print, .said, .banner { display: none !important; }
  .layout { display: block; height: auto; } main { overflow: visible; }
  .slide-card { background: #fff; border: 1px solid #ccc; break-inside: avoid; page-break-inside: avoid; }
  .slide-no, .slide-title, h2.title { color: #000; }
  .hero { background: #fff; border: 1px solid #ccc; } .hero .muted, .slide-notes { color: #000; }
}

/* Study plan shortcut in the top bar */
.plan-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; padding: 0 10px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; flex: none; }
@media (max-width: 700px) { .plan-btn .plan-lbl { display: none; } .plan-btn { width: 36px; padding: 0; } }

/* Study plan view */
.pl-endo { background: #ff6b7d; } .pl-perio { background: #f59ac0; } .pl-prostho { background: #7ea6ff; } .pl-implant { background: #8fb3c4; }
.pl-ebd { background: #f2c14e; } .pl-review { background: #b48cff; } .pl-other { background: #8a8494; }
.pl-t-endo { color: #ff6b7d; } .pl-t-perio { color: #f59ac0; } .pl-t-prostho { color: #7ea6ff; } .pl-t-implant { color: #8fb3c4; }
.pl-t-ebd { color: #f2c14e; } .pl-t-review { color: #b48cff; } .pl-t-other { color: #8a8494; }
.pl-hero { display: block; }
.pl-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 32px; }
.pl-figs { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.pl-figs b { display: block; font-size: 26px; line-height: 1.1; white-space: nowrap; }
.pl-figs span { font-size: 13px; color: var(--muted); }
.pl-speed { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; }
.pl-speed .muted { margin-right: 4px; font-size: 13px; }
.pl-strip { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 5px; margin-top: 18px; align-items: end; }
.pl-cell { border: 0; background: transparent; padding: 4px 1px; border-radius: 8px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; color: var(--muted); min-width: 0; }
.pl-cell.sel { background: var(--accent-soft); }
.pl-cell.today .pl-d { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.pl-stack { position: relative; height: 96px; display: flex; flex-direction: column-reverse; border-radius: 5px; overflow: hidden; background: var(--panel-2); }
.pl-stack i { display: block; }
.pl-stack span { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.pl-d { font-size: 12px; font-weight: 600; text-align: center; }
.pl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.pl-legend em { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.pl-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 28px; margin-top: 8px; }
.pl-dayhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; }
.pl-h { margin: 4px 0 0; }
.pl-nav { display: flex; gap: 6px; }
.pl-status { margin: 12px 0; padding: 9px 12px; border-radius: 10px; background: var(--done-soft); color: var(--text); font-size: 14px; }
.pl-status.bad { background: rgba(240,163,180,.14); }
.pl-meter { height: 8px; }
.pl-mline { display: flex; justify-content: space-between; font-size: 13px; margin: 6px 0 12px; }
.pl-item.on .name { text-decoration: line-through; color: var(--muted); }
.pl-chk:not(.on) { background: transparent !important; }
.pl-tag { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--muted); }
.pl-tag b { font-weight: 600; }
.pl-min { font-weight: 700; white-space: nowrap; font-size: 15px; }
.pl-side .section { margin-top: 0; }
.pl-subj { display: grid; gap: 12px; }
.pl-sl { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 5px; }
.pl-sl span:last-child { color: var(--muted); white-space: nowrap; }
.pl-note { font-size: 13px; margin-top: 20px; line-height: 1.5; }
@media (max-width: 900px) { .pl-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .pl-strip { grid-template-columns: repeat(10, minmax(0, 1fr)); row-gap: 10px; } .pl-stack { height: 64px; } }

/* plan: "not a priority" button */
.pl-low { background: none; border: 1px solid transparent; color: var(--muted); border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; flex: none; opacity: .65; }
.pl-low:hover { opacity: 1; border-color: rgba(210,165,201,.35); color: #d2a5c9; }
.pl-low.on { opacity: 1; color: #d2a5c9; border-color: rgba(210,165,201,.45); background: rgba(210,165,201,.08); }
.pl-item.low .name { color: var(--muted); }
.pl-lowtag { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; color: #d2a5c9; border: 1px solid rgba(210,165,201,.35); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.pl-low { width: auto; height: 30px; gap: 6px; padding: 0 10px; display: inline-flex; align-items: center; font: 600 12px/1 inherit; font-family: inherit; border-color: rgba(210,165,201,.25); opacity: .85; white-space: nowrap; }
.pl-donehead { margin-top: 18px; color: var(--muted); }
.pl-donelist { opacity: .75; }
@media (max-width: 560px) { .pl-low span { display: none; } }
.lowpage .pl-lowtag { display: none; }
.pl-low.np { padding: 0 8px; gap: 3px; height: 26px; font-size: 11px; letter-spacing: .04em; }
.pl-low.np svg { width: 13px; height: 13px; }
@media (max-width: 560px) { .pl-low.np span { display: inline; } .pl-low.np svg { display: none; } }
.pl-notes { display: inline-grid; place-items: center; width: 22px; height: 20px; margin-left: 6px; font-size: 12px; text-decoration: none; border-radius: 6px; border: 1px solid rgba(157,169,255,.35); background: rgba(157,169,255,.1); vertical-align: 1px; }
.pl-notes:hover { border-color: #9da9ff; background: rgba(157,169,255,.2); }
