*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:      #2f6bd6;          /* calmer accent for the papery look */
  --blue-bg:   #eaf1fb;
  --blue-txt:  #2257b0;
  --bg:        #fdfcfa;          /* warm panel white */
  --bg2:       #f4f1ea;          /* warm hover */
  --bg3:       #ebe7dd;
  --text:      #37352f;          /* warm ink */
  --text2:     #79746a;
  --text3:     #b3ac9f;
  --border:    rgba(55,49,38,0.12);
  --wb-bg:     #f6f3ea;          /* paper */
  --wb-line:   rgba(70,60,40,0.07);
  --red:       #c0392b;
  --red-bg:    #fde8e8;
  --shadow:    0 4px 20px rgba(60,50,30,.07);
  --shadow-lg: 0 14px 40px rgba(60,50,30,.16);
  --marker:    #fce7ad;          /* paper highlighter */
  --note-card: #fffdf9;
  --hl-bg:     #fbf3df;
}
[data-theme="dark"] {
  --blue:      #6f9eff;
  --blue-bg:   #1a2540;
  --blue-txt:  #aac5ff;
  --bg:        #211f1b;          /* warm charcoal */
  --bg2:       #2a2823;
  --bg3:       #34312a;
  --text:      #ece7dc;
  --text2:     #a39d8f;
  --text3:     #6b6557;
  --border:    rgba(255,248,230,0.10);
  --wb-bg:     #1b1916;
  --wb-line:   rgba(255,240,210,0.05);
  --red:       #f0796b;
  --red-bg:    rgba(240,121,107,.16);
  --shadow:    0 4px 22px rgba(0,0,0,.4);
  --shadow-lg: 0 18px 48px rgba(0,0,0,.55);
  --marker:    rgba(252,231,173,0.16);
  --note-card: #262420;
  --hl-bg:     rgba(252,231,173,0.10);
}

html, body { height: 100%; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); overflow: hidden; -webkit-font-smoothing: antialiased; }

/* crisp, consistent keyboard focus everywhere */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
button, input, a, textarea { outline: none; }

/* respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ── App shell ── */
.app { display: flex; flex-direction: column; height: 100vh; }

/* ── Topbar ── */
.topbar {
  height: 50px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  z-index: 10;
}
.tl { display: flex; align-items: center; gap: 10px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-box { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.logo-box .revio-face { width: 30px; height: 30px; }
.logo-word { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; }
.logo-word em { color: var(--blue); font-style: normal; }

.session-chip {
  font-size: 11px; font-weight: 500;
  color: var(--blue-txt); background: var(--blue-bg);
  padding: 3px 10px; border-radius: 20px;
  display: flex; align-items: center; gap: 5px;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); flex-shrink: 0; animation: blink 2s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.35} }

.tr-bar { display: flex; align-items: center; gap: 5px; }

/* ── Auth (Clerk) controls + gate ── */
.auth-slot { display: inline-flex; align-items: center; gap: 6px; }
.auth-btn { font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  padding: 6px 12px; border-radius: 8px; border: 0.5px solid var(--border);
  background: transparent; color: var(--text2); transition: background .12s; }
.auth-btn:hover { background: var(--bg2); color: var(--text); }
.auth-btn.primary { background: var(--blue); color: #fff; border-color: transparent; }
.auth-btn.primary:hover { opacity: .9; background: var(--blue); }
#auth-gate { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(40,36,28,.34); backdrop-filter: blur(4px); }
.auth-gate-card { display: flex; }
.ib {
  width: 32px; height: 32px; border-radius: 8px;
  border: 0.5px solid var(--border); background: transparent;
  color: var(--text2); cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background .13s;
}
.ib:hover { background: var(--bg2); color: var(--text); }
.ib:active { transform: scale(.94); }
.speed-btn { width: auto; min-width: 34px; padding: 0 9px; font-family: inherit; font-size: 12px; font-weight: 600; }

/* ── Main ── */
.main { flex: 1; display: flex; overflow: hidden; position: relative; }

/* ── Sidebar ── */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg); border-right: 0.5px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform .22s ease;
}
.sidebar.off { transform: translateX(-220px); position: absolute; height: 100%; z-index: 5; box-shadow: 2px 0 12px rgba(0,0,0,.08); }

.sb-head { padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 9px; }
.new-session-btn {
  width: 100%; padding: 10px 12px; border: none; border-radius: 10px;
  background: var(--blue); color: #fff; font-family: inherit; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  box-shadow: 0 3px 11px rgba(47,107,214,.28); transition: transform .12s, box-shadow .15s;
}
.new-session-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(47,107,214,.36); }
.new-session-btn:active { transform: translateY(0); }
.new-session-btn i { font-size: 16px; }
.sb-section-label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .09em; margin: 6px 2px 0; }
.upload-btn {
  width: 100%; padding: 8px 12px;
  border: 1px dashed var(--border); border-radius: 9px;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text2);
  transition: all .13s; font-family: inherit;
}
.upload-btn:hover { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); }
.upload-btn i { font-size: 15px; }

.sb-list { flex: 1; overflow-y: auto; padding: 8px; }
.sb-list::-webkit-scrollbar { width: 3px; }
.sb-list::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

.sb-empty { padding: 24px 12px; text-align: center; }
.sb-empty i { font-size: 28px; color: var(--text3); display: block; margin-bottom: 8px; }
.sb-empty p { font-size: 12px; color: var(--text3); line-height: 1.5; }

.sb-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border-radius: 9px; margin-bottom: 2px;
  cursor: pointer; font-size: 12.5px; color: var(--text2);
  transition: background .12s, color .12s; position: relative;
}
.sb-item::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%) scaleY(0);
  width: 3px; height: 18px; border-radius: 3px; background: var(--blue); transition: transform .15s;
}
.sb-item:hover { background: var(--bg2); color: var(--text); }
.sb-item.on { background: var(--blue-bg); color: var(--blue-txt); font-weight: 500; }
.sb-item.on::before { transform: translateY(-50%) scaleY(1); }
.sb-item i.type-icon { font-size: 14px; flex-shrink: 0; }
.sb-item .item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-badge { font-size: 9px; font-weight: 600; padding: 1px 6px; border-radius: 8px; background: var(--blue); color: #fff; flex-shrink: 0; }
.sb-del {
  width: 20px; height: 20px; border-radius: 5px;
  border: none; background: transparent; color: var(--text3);
  cursor: pointer; font-size: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.sb-item:hover .sb-del { opacity: 1; }
.sb-del:hover { background: var(--red-bg); color: var(--red); }

.sb-foot { padding: 12px 12px 14px; border-top: 0.5px solid var(--border); background: var(--bg); }
.prog-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.prog-row span { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.prog-row strong { font-size: 16px; color: var(--blue); font-weight: 700; letter-spacing: -.01em; }
.prog-track { height: 6px; background: var(--bg3); border-radius: 6px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--blue); border-radius: 6px; transition: width .6s cubic-bezier(.22,.61,.36,1); }
.prog-sub { font-size: 11px; color: var(--text3); margin-top: 6px; }

/* ── Whiteboard shell ── */
.wb { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.wb-stage { position: relative; flex: 1; overflow: hidden; background: var(--wb-bg); }
.wb-lines {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: repeating-linear-gradient(var(--wb-bg), var(--wb-bg) 33px, var(--wb-line) 33px, var(--wb-line) 34px);
  background-size: 100% 34px;
}

/* Pannable viewport + transformable world */
.wb-viewport {
  position: absolute; inset: 0; overflow: hidden; z-index: 1;
  cursor: grab; touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.wb-viewport.grab { cursor: grabbing; }
.wb-world { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.wb-world.anim { transition: transform .7s cubic-bezier(.22,.61,.36,1); }

/* ── Note blocks (clean, modern, Revio) ── */
.nb {
  /* reveal left-to-right, like Revio is writing it on the board */
  clip-path: inset(0 100% 0 0);
  opacity: .12;
  transform-origin: left top;
}
.nb.in { animation: write-in .8s cubic-bezier(.4,0,.2,1) forwards; }

/* notebook page break */
.page-break { position: absolute; display: flex; align-items: center; justify-content: center;
  border-top: 2px dashed var(--border); height: 0; }
.page-break span { transform: translateY(-50%); background: var(--wb-bg); padding: 2px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text3);
  display: inline-flex; align-items: center; gap: 5px; border: 0.5px solid var(--border); }
@keyframes write-in {
  0%   { clip-path: inset(0 100% 0 0); opacity: .12; }
  100% { clip-path: inset(0 0 0 0);    opacity: 1; }
}

.nb-note, .nb-def, .nb-bullets, .nb-key, .nb-bul-title {
  font-family: 'Inter', sans-serif; color: var(--text);
}

/* draggable notes — grab any block to rearrange it on the board */
.nb { cursor: grab; }
.nb.dragging { cursor: grabbing; z-index: 60; box-shadow: 0 14px 40px rgba(60,50,30,.22); }
.nb.dragging * { pointer-events: none; }

/* ── Snipped slide image ── */
.nb-img { background: var(--note-card); border: 0.5px solid var(--border); border-radius: 13px; padding: 8px; box-shadow: var(--shadow); }
.nb-img img { display: block; width: 100%; height: auto; border-radius: 8px; }
.nb-img-cap { font-size: 12.5px; color: var(--text2); padding: 8px 6px 4px; line-height: 1.4; }

/* ── Revio's drawn visuals + "generating image" animation ── */
.nb-visual { background: var(--note-card); border: 0.5px solid var(--border); border-radius: 13px;
  padding: 14px 16px; box-shadow: var(--shadow); }
.va-stage { position: relative; min-height: 168px; margin-top: 8px; }
.va-svg { width: 100%; height: auto; display: block; }
.va-axis { stroke: var(--text2); stroke-width: 1.6; stroke-linecap: round; }
.va-curve { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.va-curve.hi { stroke: var(--blue); }
.va-curve.lo { stroke: var(--text3); stroke-dasharray: 1 0; }
.va-force { stroke: var(--text3); stroke-width: 1.4; fill: none; stroke-dasharray: 4 4; }
.va-cnode rect { fill: var(--blue-bg); stroke: none; }
.va-l { font-family: 'Inter', sans-serif; font-size: 11px; fill: var(--text2); font-weight: 500; }
.va-l.hi-t { fill: var(--blue-txt); } .va-l.lo-t { fill: var(--text2); }
.va-axl { font-family: 'Inter', sans-serif; font-size: 11px; fill: var(--text3); font-weight: 600; }
.va-cap { font-size: 13px; color: var(--text2); margin-top: 8px; line-height: 1.5; }

/* the art is hidden behind a "generating" loader until revealed */
.va-art { opacity: 0; transform: scale(.96); transition: opacity .5s ease, transform .5s cubic-bezier(.22,.61,.36,1); }
.va-stage.revealed .va-art { opacity: 1; transform: none; }
.gen-anim { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  transition: opacity .4s ease; }
.va-stage.revealed .gen-anim { opacity: 0; pointer-events: none; }
.gen-ring { position: absolute; top: 50%; left: 50%; width: 64px; height: 64px; margin: -42px 0 0 -32px;
  border-radius: 50%; border: 2px dashed var(--blue); opacity: .5; animation: gen-spin 2.4s linear infinite; }
.gen-core { position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -21px 0 0 -11px;
  border-radius: 50%; background: var(--blue); opacity: .85; animation: gen-pulse 1.4s ease-in-out infinite; }
.gen-dot { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--blue);
  margin: -10px 0 0 -3px; animation: gen-orbit 2s linear infinite; }
.gen-dot.d2 { animation-delay: -.5s; background: #e0822a; }
.gen-dot.d3 { animation-delay: -1s; background: #2f9e6f; }
.gen-dot.d4 { animation-delay: -1.5s; background: #9a4fd0; }
.gen-text { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--text2); }
@keyframes gen-spin { to { transform: rotate(360deg); } }
@keyframes gen-pulse { 0%,100% { transform: scale(.8); opacity: .6; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes gen-orbit { from { transform: rotate(0) translateX(30px) rotate(0); } to { transform: rotate(360deg) translateX(30px) rotate(-360deg); } }

/* highlighter marker — Revio "draws" a highlight swipe behind key phrases */
.hl {
  position: relative; font-weight: 600; color: var(--text);
  background-image: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%);
  background-repeat: no-repeat;
  background-size: 0% 100%;
  padding: 0 2px; border-radius: 1px;
}
.nb.in .hl { animation: draw-hl .5s ease .55s forwards; }
@keyframes draw-hl { to { background-size: 100% 100%; } }

/* page title — serif, with a drawn underline */
.nb-title {
  font-family: 'Newsreader', Georgia, serif; font-weight: 600;
  font-size: 34px; line-height: 1.15; letter-spacing: -.01em; color: var(--text);
  padding-bottom: 14px; position: relative;
}
.nb-title::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 80px; height: 3px; border-radius: 3px; background: var(--blue);
  transform: scaleX(0); transform-origin: left;
}
.nb.in .nb-title::after { animation: draw-line .5s ease .45s forwards; }
@keyframes draw-line { to { transform: scaleX(1); } }

/* section heading — serif, drawn underline under the text */
.nb-section {
  font-family: 'Newsreader', Georgia, serif; font-weight: 600;
  font-size: 25px; line-height: 1.25; color: var(--text);
  display: inline-block; position: relative; padding-bottom: 6px;
}
.nb-section::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px;
  background: var(--blue); border-radius: 3px;
  transform: scaleX(0); transform-origin: left;
}
.nb.in .nb-section::after { animation: draw-line .55s ease .4s forwards; }

/* plain note */
.nb-note { font-size: 16px; line-height: 1.7; color: var(--text2); }
.nb-lead { font-weight: 600; color: var(--text); }

/* definition card */
.nb-def {
  font-size: 15.5px; line-height: 1.65; color: var(--text2);
  background: var(--note-card); border: 0.5px solid var(--border);
  border-left: 3px solid var(--blue); border-radius: 12px;
  padding: 15px 17px; box-shadow: var(--shadow);
}
.nb-term { font-family: 'Newsreader', Georgia, serif; color: var(--blue); font-weight: 600; font-size: 17px; }

/* bulleted list */
.nb-bullets { font-size: 16px; line-height: 1.5; }
.nb-bul-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text3); margin-bottom: 9px; }
.nb-bul { display: flex; gap: 11px; align-items: baseline; padding: 4px 0; color: var(--text2); }
.nb-dot { color: var(--blue); font-weight: 700; flex-shrink: 0; }

/* key takeaway — highlighter block */
.nb-key {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 15.5px; line-height: 1.6; color: #4a3a00; font-weight: 500;
  background: var(--marker); border-radius: 10px; padding: 13px 16px;
}
[data-theme="dark"] .nb-key { color: var(--text); background: rgba(255,224,120,0.14); }
.nb-key i { color: #b8860b; font-size: 18px; margin-top: 1px; flex-shrink: 0; }
[data-theme="dark"] .nb-key i { color: #e8c14a; }

/* diagram — a little flow of steps */
.nb-diagram { background: var(--note-card); border: 0.5px solid var(--border); border-radius: 12px; padding: 15px 17px; box-shadow: var(--shadow); }
.diag-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.diag-step {
  font-size: 14px; font-weight: 600; color: var(--text);
  background: var(--blue-bg); border: 0.5px solid var(--border); border-radius: 9px; padding: 8px 13px;
}
.diag-arrow { color: var(--blue); font-size: 16px; display: flex; align-items: center; }

/* chart — simple horizontal bars */
.nb-chart { background: var(--note-card); border: 0.5px solid var(--border); border-radius: 12px; padding: 15px 17px; box-shadow: var(--shadow); }
.chart-bars { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.chart-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 10px; }
.chart-label { font-size: 13.5px; color: var(--text2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-bar { height: 16px; background: var(--bg3); border-radius: 6px; overflow: hidden; }
.chart-fill { display: block; height: 100%; background: var(--blue); border-radius: 6px; transition: width .6s cubic-bezier(.22,.61,.36,1); }
.chart-val { font-size: 13px; font-weight: 600; color: var(--text); min-width: 24px; }

/* ── View tools ── */
.wb-tools {
  position: absolute; top: 14px; right: 14px; z-index: 12;
  display: flex; flex-direction: column; gap: 2px; padding: 4px;
  background: rgba(253,252,250,.86); backdrop-filter: blur(8px);
  border: 0.5px solid var(--border); border-radius: 13px; box-shadow: var(--shadow);
}
[data-theme="dark"] .wb-tools { background: rgba(33,31,27,.86); }
.wt {
  width: 32px; height: 32px; border-radius: 9px;
  border: none; background: transparent;
  color: var(--text2); cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background .13s, color .13s, transform .1s;
}
.wt:hover { background: var(--blue-bg); color: var(--blue); }
.wt:active { transform: scale(.92); }
/* separate the destructive clear button */
#clear-btn { margin-top: 2px; border-top: 0.5px solid var(--border); border-radius: 0 0 9px 9px; }
#clear-btn:hover { background: #fdecea; color: var(--red); }

/* ── Live captions (bottom center of the stage) ── */
.caption {
  position: absolute; left: 50%; bottom: 26px; transform: translate(-50%, 8px);
  max-width: min(680px, 88%); text-align: center; z-index: 15;
  font-size: 20px; line-height: 1.5; font-weight: 500;
  color: var(--text); background: none; border: none; box-shadow: none;
  /* soft paper halo so it stays readable without a box */
  text-shadow: 0 0 10px var(--wb-bg), 0 0 10px var(--wb-bg), 0 1px 3px var(--wb-bg);
  /* wrap naturally (no clipping / no ellipsis) and stay centered */
  white-space: normal; text-wrap: balance;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .45s cubic-bezier(.22,.61,.36,1);
}
.caption.show { opacity: 1; transform: translate(-50%, 0); }
/* fade fully out while swapping to the next sentence, then fade back in */
.caption.show.fading { opacity: 0; }
.caption.user { font-style: italic; color: var(--text2); }

/* ── Dock text input (type instead of talk) ── */
.dock-text {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 6px;
  background: var(--bg2); border: 0.5px solid var(--border); border-radius: 11px;
  padding: 5px 5px 5px 13px; width: min(300px, 30vw); transition: border-color .14s, box-shadow .14s;
}
.dock-text:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.dock-text input { flex: 1; border: none; background: transparent; outline: none; min-width: 0;
  font-family: inherit; font-size: 13.5px; color: var(--text); padding: 7px 0; }
.dock-text input::placeholder { color: var(--text3); }
.dock-send { flex-shrink: 0; width: 32px; height: 32px; border: none; border-radius: 8px;
  background: var(--blue); color: #fff; cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center; transition: transform .1s; }
.dock-send:hover { transform: scale(1.06); }
@media (max-width: 720px) { .dock-text { display: none; } }

/* ── Interactive quiz block ── */
.nb-quiz { background: var(--note-card); border: 0.5px solid var(--border); border-left: 3px solid var(--blue);
  border-radius: 13px; padding: 15px 17px; box-shadow: var(--shadow); transition: box-shadow .3s, border-color .3s; }
.nb-quiz.live { border-left-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.22), var(--shadow); }
.quiz-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.quiz-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--blue-txt); background: var(--blue-bg);
  padding: 3px 9px; border-radius: 20px; }
.quiz-timer { font-size: 13px; font-weight: 700; color: var(--text2); font-variant-numeric: tabular-nums; }
.quiz-timer.good { color: #15803d; } .quiz-timer.bad { color: var(--red); }
.quiz-q { font-size: 16px; font-weight: 600; line-height: 1.45; margin-bottom: 12px; color: var(--text); }
.quiz-opts { display: flex; flex-direction: column; gap: 7px; }
.quiz-opt { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  font-family: inherit; font-size: 14.5px; color: var(--text); background: var(--bg);
  border: 0.5px solid var(--border); border-radius: 9px; padding: 10px 12px; transition: all .12s; }
.quiz-opt:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-bg); }
.quiz-opt:disabled { cursor: default; }
.quiz-key { flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; background: var(--bg3);
  color: var(--text2); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.quiz-opt.correct { border-color: #16a34a; background: #eafaf0; color: #14532d; }
.quiz-opt.correct .quiz-key { background: #16a34a; color: #fff; }
.quiz-opt.wrong { border-color: var(--red); background: #fdecea; color: #7f1d1d; }
[data-theme="dark"] .quiz-opt.correct { background: rgba(22,163,74,.18); color: #b7f0c8; }
[data-theme="dark"] .quiz-opt.wrong { background: rgba(192,57,43,.18); color: #f6b6ae; }

/* ── YouTube suggestion card ── */
.nb-video { display: flex; align-items: center; gap: 12px; text-decoration: none;
  background: var(--note-card); border: 0.5px solid var(--border); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.nb-video:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg, 0 10px 30px rgba(60,50,30,.12)); }
.vid-ic { flex-shrink: 0; width: 38px; height: 38px; border-radius: 9px; background: #ff0033;
  color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.vid-meta { flex: 1; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.vid-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.vid-sub { font-size: 12px; color: var(--text3); }
.vid-go { color: var(--text3); font-size: 16px; }

/* ── Confirm dialog ── */
.confirm-bg { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center;
  background: rgba(40,36,28,.4); backdrop-filter: blur(3px); opacity: 0; transition: opacity .16s; }
.confirm-bg.show { opacity: 1; }
.confirm-card { background: var(--bg); border: 0.5px solid var(--border); border-radius: 14px;
  padding: 22px; width: 360px; box-shadow: var(--shadow); transform: translateY(8px) scale(.98); transition: transform .16s; }
.confirm-bg.show .confirm-card { transform: none; }
.confirm-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.confirm-card p { font-size: 13.5px; color: var(--text2); line-height: 1.55; margin-bottom: 18px; }
.confirm-row { display: flex; justify-content: flex-end; gap: 8px; }
.btn-b.danger { background: var(--red); }

/* ── Animated loading screen ── */
.loading-screen { position: fixed; inset: 0; z-index: 350; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; background: var(--wb-bg);
  opacity: 0; pointer-events: none; transition: opacity .25s; }
.loading-screen.show { opacity: 1; pointer-events: all; }
.load-orb { width: 64px; height: 64px; border-radius: 50%; position: relative; }
.load-orb svg { width: 64px; height: 64px; animation: load-bob 1.6s ease-in-out infinite; }
@keyframes load-bob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
.load-ring { position: absolute; inset: -10px; border: 2.5px solid var(--blue-bg); border-top-color: var(--blue);
  border-radius: 50%; animation: load-spin .9s linear infinite; }
@keyframes load-spin { to { transform: rotate(360deg); } }
.load-text { font-size: 14px; color: var(--text2); font-weight: 500; }
.load-dots::after { content: ''; animation: load-dots 1.4s steps(4,end) infinite; }
@keyframes load-dots { 0%{content:''} 25%{content:'.'} 50%{content:'..'} 75%{content:'...'} }

/* ── Study stats dashboard ── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 4px; }
.stat-card { background: var(--bg2); border: 0.5px solid var(--border); border-radius: 12px; padding: 16px;
  transition: transform .15s cubic-bezier(.22,.61,.36,1), box-shadow .15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-num { font-family: 'Newsreader', Georgia, serif; font-size: 32px; font-weight: 600; color: var(--blue); line-height: 1; }
.stat-label { font-size: 12.5px; color: var(--text2); margin-top: 6px; }

/* ── Progress highlight (bottom-left) ── */
.prog-row strong { color: var(--blue-txt); background: var(--blue-bg); padding: 1px 8px; border-radius: 20px; font-weight: 700; }

/* ── Empty state ── */
.wb-empty {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; pointer-events: none;
}
.wb-empty.hidden { display: none; }
.wb-empty-icon { display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; font-size: 36px; color: var(--blue);
  background: var(--blue-bg); border-radius: 20px; margin-bottom: 4px; }
.wb-empty-title { font-size: 15px; font-weight: 500; color: var(--text2); }
.wb-empty-sub { font-size: 13px; color: var(--text3); text-align: center; max-width: 280px; line-height: 1.5; }
.wb-empty-btn {
  margin-top: 4px; padding: 9px 20px; background: var(--blue); color: #fff;
  border: none; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer;
  pointer-events: all; font-family: inherit; transition: transform .13s, box-shadow .15s; box-shadow: 0 4px 14px rgba(0,71,204,.26);
}
.wb-empty-btn:hover { transform: translateY(-1px); box-shadow: 0 7px 20px rgba(0,71,204,.34); }
.wb-empty-btn:active { transform: translateY(0); }

/* ── Dock (fixed bar under the board) ── */
.wb-dock {
  flex-shrink: 0; height: 106px; position: relative;
  border-top: 0.5px solid var(--border); background: var(--bg);
  box-shadow: 0 -8px 24px rgba(60,50,30,.05);
  display: flex; align-items: center; justify-content: center;
}

/* Revio avatar */
.dock-agent {
  position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 11px;
}
.dock-orb {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  background: var(--blue-bg); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .2s, box-shadow .25s;
}
.dock-orb .revio-face { width: 36px; height: 36px; position: relative; z-index: 2; }
.dock-orb.speaking { animation: ob 1.7s ease-in-out infinite; box-shadow: 0 0 0 4px var(--blue-bg), 0 0 18px rgba(47,107,214,.3); }
.dock-orb.listening { box-shadow: 0 0 0 4px rgba(192,57,43,.14); }
@keyframes ob { 0%,100%{transform:scale(1)} 50%{transform:scale(1.06)} }
.dock-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--blue); opacity: 0; }
.dock-orb.speaking .dock-ring { animation: hr 1.7s ease-out infinite; }
.dock-orb.listening .dock-ring { border-color: var(--red); animation: hr 1.4s ease-out infinite; }
.dock-meta { display: flex; flex-direction: column; gap: 1px; }
.dock-name { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.dock-state { font-size: 11px; color: var(--text3); }

/* Hold-to-speak (centered in the dock) */
.hold {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.hold-mic {
  position: relative;
  width: 60px; height: 60px; border-radius: 50%;
  border: none; background: var(--blue); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; box-shadow: 0 6px 20px rgba(0,71,204,.32);
  transition: background .2s, transform .12s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent; touch-action: none;
}
.hold-mic:hover { transform: scale(1.05); }
.hold-mic:active { transform: scale(.95); }

.hold-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--blue); opacity: 0; }
@keyframes hr { 0%{inset:0;opacity:.5} 100%{inset:-14px;opacity:0} }

/* Live (listening, unmuted) — gentle pulse so the student knows it's hearing them */
.hold-mic.live .hold-ring { animation: hr 2.1s ease-out infinite; }
.hold-mic.live .hold-ring.r2 { animation-delay: 1.05s; }

/* Muted */
.hold-mic.muted { background: var(--bg3); color: var(--text3); box-shadow: none; }
.hold-mic.muted .hold-ring { display: none; }

.hold-label { font-size: 12.5px; font-weight: 500; color: var(--text2); letter-spacing: .01em; }

/* ── Upload modal ── */
.modal-bg { position: fixed; inset: 0; background: rgba(40,36,28,.42); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .18s; }
.modal-bg.open { opacity: 1; pointer-events: all; }
.modal { background: var(--bg); border-radius: 16px; padding: 26px; width: 420px; border: 0.5px solid var(--border); box-shadow: var(--shadow-lg); transform: translateY(10px) scale(.98); transition: transform .2s cubic-bezier(.22,.61,.36,1); }
.modal-bg.open .modal { transform: none; }
.modal h2 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--text2); margin-bottom: 20px; }

.drop-zone {
  border: 1.5px dashed var(--border); border-radius: 12px;
  padding: 30px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s; margin-bottom: 12px; position: relative;
}
.drop-zone:hover { border-color: var(--blue); background: var(--blue-bg); }
.drop-zone:hover i { color: var(--blue); }
.drop-zone.drag-over { border-color: var(--blue); background: var(--blue-bg); transform: scale(1.01); }
.drop-zone i { font-size: 28px; color: var(--text3); display: block; margin-bottom: 8px; transition: color .13s, transform .13s; }
.drop-zone.drag-over i { color: var(--blue); transform: translateY(-2px); }
.drop-zone p { font-size: 13px; color: var(--text2); }
.drop-zone p strong { color: var(--text); }
.drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.file-queue { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow-y: auto; }
.fq-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg2); border-radius: 8px; }
.fq-icon { font-size: 16px; color: var(--blue); flex-shrink: 0; }
.fq-info { flex: 1; overflow: hidden; }
.fq-name { font-size: 12px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fq-size { font-size: 11px; color: var(--text3); }
.fq-del { width: 22px; height: 22px; border-radius: 5px; border: none; background: transparent; color: var(--text3); cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; transition: all .12s; flex-shrink: 0; }
.fq-del:hover { background: var(--red-bg); color: var(--red); }

.modal-fmts { font-size: 11px; color: var(--text3); text-align: center; margin-bottom: 14px; }

/* "or type a topic" divider + row */
.modal-or { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; color: var(--text3); font-size: 11px; }
.modal-or::before, .modal-or::after { content: ""; flex: 1; height: 0.5px; background: var(--border); }
.topic-modal-row { display: flex; gap: 8px; margin-bottom: 18px; }
.topic-modal-row input {
  flex: 1; border: 0.5px solid var(--border); border-radius: 9px; background: var(--bg2);
  padding: 9px 12px; font-family: inherit; font-size: 13px; color: var(--text); outline: none;
  transition: border-color .14s, box-shadow .14s; min-width: 0;
}
.topic-modal-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.topic-modal-row input::placeholder { color: var(--text3); }
.topic-modal-row .btn-b { padding: 9px 16px; }
.modal-row { display: flex; gap: 8px; justify-content: flex-end; }
.btn-g { padding: 8px 14px; border-radius: 8px; border: 0.5px solid var(--border); background: transparent; font-size: 13px; font-weight: 500; color: var(--text2); cursor: pointer; font-family: inherit; transition: background .12s; }
.btn-g:hover { background: var(--bg2); }
.btn-b { padding: 8px 18px; border-radius: 8px; border: none; background: var(--blue); font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; font-family: inherit;
  box-shadow: 0 3px 11px rgba(47,107,214,.26); transition: transform .12s, box-shadow .15s, opacity .12s; }
.btn-b:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(47,107,214,.32); }
.btn-b:active:not(:disabled) { transform: translateY(0); }
.btn-b:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--text); color: var(--bg);
  font-size: 13px; font-weight: 500; padding: 11px 20px; border-radius: 10px;
  z-index: 200; opacity: 0; transition: all .22s cubic-bezier(.22,.61,.36,1); pointer-events: none;
  white-space: nowrap; box-shadow: 0 8px 26px rgba(0,0,0,.22);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Auth gate (Clerk) ── */
#auth-gate {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image: repeating-linear-gradient(var(--bg), var(--bg) 33px, var(--wb-line) 33px, var(--wb-line) 34px);
}
.auth-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; }
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 2px; }
.auth-brand b { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.auth-brand b em { color: var(--blue); font-style: normal; }
.auth-box { width: 30px; height: 30px; background: var(--blue); border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.auth-box svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.auth-tag { font-size: 14px; color: var(--text2); margin-bottom: 14px; }

/* ── Access pill + paywall/volume modals ── */
.access-pill { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px;
  border-radius: 20px; font-size: 11.5px; font-weight: 600; text-decoration: none;
  background: var(--bg2); color: var(--text2); border: 0.5px solid var(--border); transition: all .13s; }
.access-pill:hover { background: var(--blue-bg); color: var(--blue-txt); border-color: transparent; }
.access-pill.pro { background: linear-gradient(135deg, #f4b740, #e0822a); color: #3a2606; border-color: transparent; }
.access-pill.low { background: #fde7e4; color: #b33; border-color: transparent; }
[data-theme="dark"] .access-pill.low { background: rgba(192,57,43,.2); color: #f0796b; }

/* ── Study with friends ── */
.collab-pill { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 20px;
  background: #e2f4ec; color: #1d7a55; font-size: 11.5px; font-weight: 600; border: 0.5px solid transparent; }
[data-theme="dark"] .collab-pill { background: rgba(47,158,111,.2); color: #6cd6a8; }
.collab-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #2f9e6f; animation: blink 2s ease-in-out infinite; }
.collab-card { width: 460px; max-width: calc(100vw - 32px); }
.collab-head { display: flex; align-items: center; justify-content: space-between; }
.collab-head h2 { display: inline-flex; align-items: center; gap: 8px; }
.collab-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text3); margin: 16px 0 8px; }
.collab-input { width: 100%; border: 0.5px solid var(--border); border-radius: 10px; background: var(--bg);
  font-family: inherit; font-size: 14px; color: var(--text); padding: 11px 13px; outline: none; }
.collab-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.collab-actions { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.collab-actions .btn-b { display: flex; align-items: center; justify-content: center; gap: 7px; }
.collab-join { display: flex; gap: 8px; }
.collab-join .collab-input { flex: 1; }
.collab-join .btn-g { white-space: nowrap; padding: 0 18px; }
.friends-block { margin-top: 18px; border-top: 0.5px solid var(--border); padding-top: 8px; }
.friends-list, .peers-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 200px; overflow-y: auto; }
.friend-row, .peer-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg2); }
.friend-row .fr-name, .peer-row .fr-name { flex: 1; font-size: 14px; }
.fr-avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(135deg,#5b8def,#2f6bd6); flex-shrink: 0; }
.fr-invite { border: none; background: var(--blue); color: #fff; font-family: inherit; font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.fr-del { border: none; background: transparent; color: var(--text3); cursor: pointer; font-size: 16px; display: flex; }
.fr-del:hover { color: var(--red); }
.peer-row .host-tag { font-size: 10.5px; font-weight: 700; color: var(--blue-txt); background: var(--blue-bg); padding: 2px 8px; border-radius: 12px; }
.room-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--blue-bg);
  border-radius: 14px; padding: 14px 16px; margin-top: 4px; }
.room-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--blue-txt); }
.room-code { font-family: 'Newsreader', serif; font-size: 26px; font-weight: 600; color: var(--blue-d); letter-spacing: .08em; }
.room-banner .btn-b { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn-g.danger { color: var(--red); }

/* onboarding */
.onboard-card { text-align: center; width: 440px; max-width: calc(100vw - 32px); }
.onboard-orb { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--blue-bg);
  display: flex; align-items: center; justify-content: center; }
.onboard-orb .revio-face { width: 44px; height: 44px; }
.onboard-list { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 14px; margin: 18px 0 22px; }
.onboard-list li { display: flex; gap: 13px; align-items: flex-start; }
.ob-ic { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; background: var(--blue-bg); color: var(--blue);
  display: flex; align-items: center; justify-content: center; font-size: 19px; }
.onboard-list b { display: block; font-size: 14.5px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.onboard-list small { display: block; font-size: 13px; color: var(--text2); line-height: 1.5; }

.vol-card { text-align: center; }
.vol-ic { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; background: var(--blue-bg);
  color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.tester-inline { display: flex; gap: 8px; margin: 4px 0 2px; }
.tester-inline input { flex: 1; border: 0.5px solid var(--border); border-radius: 10px; background: var(--bg);
  font-family: inherit; font-size: 14px; color: var(--text); padding: 11px 13px; outline: none; }
.tester-inline input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.tester-inline button { border: none; border-radius: 10px; background: var(--blue); color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 600; padding: 0 18px; cursor: pointer; }
#paywall-msg.tester-msg { display: block; font-size: 12.5px; min-height: 16px; margin: 8px 2px 4px; }
#paywall-modal .modal a.btn-b { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }

/* ── End-session button ── */
.end-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px;
  border-radius: 8px; border: 0.5px solid var(--border); background: var(--bg2);
  color: var(--text); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .13s, color .13s, border-color .13s, transform .1s;
}
.end-btn i { font-size: 15px; color: var(--blue); transition: color .13s; }
.end-btn:hover { background: var(--blue); color: #fff; border-color: transparent; }
.end-btn:hover i { color: #fff; }
.end-btn:active { transform: scale(.96); }

/* ── Saved notebook sidebar items ── */
.sb-nb-label { display: flex; align-items: center; gap: 6px; margin-top: 16px; }
.sb-nb .item-name { display: flex; flex-direction: column; line-height: 1.25; }
.sb-nb .item-name small { font-size: 10.5px; color: var(--text3); font-weight: 400; }
.sb-badge.cards { background: #fbeed2; color: #946a12; display: inline-flex; align-items: center; gap: 3px; }
[data-theme="dark"] .sb-badge.cards { background: rgba(244,191,79,.18); color: #f0cd7a; }

/* ── Saved-notebook banner over the board ── */
.notebook-bar {
  position: absolute; top: 14px; left: 50%; transform: translate(-50%, -14px);
  z-index: 16; display: flex; align-items: center; gap: 12px;
  background: var(--bg); border: 0.5px solid var(--border); border-radius: 13px;
  padding: 9px 10px 9px 15px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s cubic-bezier(.22,.61,.36,1);
}
.notebook-bar.show { opacity: 1; pointer-events: all; transform: translate(-50%, 0); }
.nbar-ic { font-size: 19px; color: var(--blue); }
.nbar-meta { display: flex; flex-direction: column; line-height: 1.2; }
.nbar-title { font-size: 13.5px; font-weight: 600; color: var(--text); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbar-date { font-size: 11px; color: var(--text3); }
.nbar-fc {
  display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 9px;
  background: var(--blue); color: #fff; font-family: inherit; font-size: 12.5px; font-weight: 600;
  padding: 8px 13px; cursor: pointer; box-shadow: 0 3px 10px rgba(47,107,214,.28); transition: transform .12s;
}
.nbar-fc:hover { transform: translateY(-1px); }
.nbar-close { width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent;
  color: var(--text3); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .12s; }
.nbar-close:hover { background: var(--bg2); color: var(--text); }

/* ── Flashcard deck ── */
.fc-modal-card { width: 460px; max-width: calc(100vw - 32px); }
.fc-head { display: flex; align-items: center; justify-content: space-between; }
.fc-card {
  margin: 16px 0 18px; height: 240px; perspective: 1400px; cursor: pointer; user-select: none;
}
.fc-inner { position: relative; width: 100%; height: 100%; transition: transform .5s cubic-bezier(.34,1.3,.5,1); transform-style: preserve-3d; }
.fc-card.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 16px; border: 0.5px solid var(--border); padding: 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  box-shadow: var(--shadow);
}
.fc-face-front { background: var(--note-card); }
.fc-face-back { background: var(--blue-bg); transform: rotateY(180deg); }
.fc-tag { position: absolute; top: 14px; left: 16px; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text3); }
.fc-face-back .fc-tag { color: var(--blue-txt); }
.fc-face p { font-size: 19px; line-height: 1.45; font-weight: 500; color: var(--text); }
.fc-face-front p { font-family: 'Newsreader', Georgia, serif; font-size: 21px; }
.fc-hint { position: absolute; bottom: 14px; font-size: 11.5px; color: var(--text3); display: inline-flex; align-items: center; gap: 5px; }
.fc-nav { display: flex; align-items: center; justify-content: space-between; }
.fc-count { font-size: 13px; font-weight: 600; color: var(--text2); font-variant-numeric: tabular-nums; }
.fc-nav .btn-g { display: inline-flex; align-items: center; gap: 6px; }
.fc-nav .btn-g:disabled { opacity: .4; cursor: not-allowed; }
