/* =====================================================================
   StudyMind — shared stylesheet
   One file styles the landing page, sign-in, paywall, the study app and
   the admin panel, so the live site and the preview look identical.
   ===================================================================== */

:root {
  --paper: #F5F7FC;
  --grid: rgba(47, 91, 255, .055);
  --card: #FFFFFF;
  --card-2: #F0F3FB;
  --ink: #16204A;
  --ink-2: #4B557C;
  --ink-3: #8189A8;
  --line: #DCE1F0;
  --pen: #2F5BFF;
  --pen-deep: #1D3FD4;
  --pen-soft: #E6ECFF;
  --hi: #FFE45C;
  --hi-soft: #FFF6C2;
  --mint: #16A864;
  --mint-soft: #DDF6E9;
  --coral: #E8434D;
  --coral-soft: #FDE3E5;
  --shadow: 0 1px 0 rgba(22, 32, 74, .04), 0 10px 30px -12px rgba(22, 32, 74, .18);
  --shadow-lift: 0 2px 0 rgba(22, 32, 74, .05), 0 22px 50px -18px rgba(22, 32, 74, .30);
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --font-display: "Familjen Grotesk", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-body: "Figtree", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Caveat", "Comic Sans MS", cursive;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1330; --grid: rgba(111, 139, 255, .07); --card: #161D42; --card-2: #1C2450;
    --ink: #EEF1FF; --ink-2: #B3BADD; --ink-3: #7C85B3; --line: #2A3469;
    --pen: #6F8BFF; --pen-deep: #8FA5FF; --pen-soft: #222C63; --hi: #FFD84A; --hi-soft: #3A3620;
    --mint: #3CCB86; --mint-soft: #173A33; --coral: #FF6B73; --coral-soft: #43222F;
    --shadow: 0 1px 0 rgba(0,0,0,.2), 0 10px 30px -12px rgba(0,0,0,.6);
    --shadow-lift: 0 2px 0 rgba(0,0,0,.2), 0 22px 50px -18px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1330; --grid: rgba(111, 139, 255, .07); --card: #161D42; --card-2: #1C2450;
  --ink: #EEF1FF; --ink-2: #B3BADD; --ink-3: #7C85B3; --line: #2A3469;
  --pen: #6F8BFF; --pen-deep: #8FA5FF; --pen-soft: #222C63; --hi: #FFD84A; --hi-soft: #3A3620;
  --mint: #3CCB86; --mint-soft: #173A33; --coral: #FF6B73; --coral-soft: #43222F;
  --shadow: 0 1px 0 rgba(0,0,0,.2), 0 10px 30px -12px rgba(0,0,0,.6);
  --shadow-lift: 0 2px 0 rgba(0,0,0,.2), 0 22px 50px -18px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-behavior: smooth; scroll-padding-top: calc(80px + env(safe-area-inset-top, 0px)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font: 16px/1.6 var(--font-body); color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-font-smoothing: antialiased;
}
img, svg, video, canvas { max-width: 100%; }
a { color: var(--pen); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .5em; color: var(--ink); }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--hi); color: #16204A; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.hand { font-family: var(--font-hand); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Buttons & form controls ---------- */
.btn {
  --bg: var(--card); --fg: var(--ink); --bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .6em 1.15em; border-radius: 12px;
  border: 1.5px solid var(--bd); background: var(--bg); color: var(--fg);
  font-weight: 650; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }
.btn--primary { --bg: var(--pen); --fg: #fff; --bd: var(--pen); box-shadow: 0 3px 0 var(--pen-deep); }
.btn--primary:hover { box-shadow: 0 4px 0 var(--pen-deep); }
.btn--hi { --bg: var(--hi); --fg: #16204A; --bd: #E9C92C; box-shadow: 0 3px 0 #D9B91A; }
.btn--ghost { --bg: transparent; --bd: var(--line); }
.btn--quiet { --bg: transparent; --bd: transparent; padding-inline: .7em; }
.btn--danger { --bg: var(--coral-soft); --fg: var(--coral); --bd: transparent; }
.btn--sm { min-height: 36px; padding: .35em .85em; font-size: .875rem; border-radius: 10px; }
.btn--lg { min-height: 54px; padding: .8em 1.6em; font-size: 1.05rem; border-radius: 14px; }
.btn--block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span, .field > label { font-weight: 650; font-size: .9rem; }
.field small { color: var(--ink-3); font-size: .82rem; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: .65em .9em; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 160px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--pen); box-shadow: 0 0 0 4px var(--pen-soft); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: .45em .9em; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: .3em .75em; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.chip--hi { background: var(--hi-soft); border-color: transparent; color: var(--ink); }
.chip--mint { background: var(--mint-soft); border-color: transparent; color: var(--mint); }
.chip--coral { background: var(--coral-soft); border-color: transparent; color: var(--coral); }
.chip--pen { background: var(--pen-soft); border-color: transparent; color: var(--pen); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 550; font-size: .93rem; }
.alert--error { background: var(--coral-soft); color: var(--coral); }
.alert--ok { background: var(--mint-soft); color: var(--mint); }
.alert--info { background: var(--pen-soft); color: var(--pen); }

/* ======================================================================
   LANDING PAGE
   ====================================================================== */
.nav { position: sticky; top: 0; z-index: 40; backdrop-filter: saturate(1.4) blur(10px); background: color-mix(in srgb, var(--paper) 82%, transparent); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__in { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand small { font-family: var(--font-body); font-weight: 600; font-size: .72rem; color: var(--ink-3); letter-spacing: 0; margin-inline-start: -2px; }
.nav__links { display: flex; gap: 22px; margin-inline-start: auto; }
.nav__links a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav__links a:hover { color: var(--ink); }
.nav__cta { display: flex; gap: 8px; }
@media (max-width: 860px) { .nav__links { display: none; } .nav__cta { margin-inline-start: auto; } }
@media (max-width: 420px) { .nav__cta .btn--ghost { display: none; } }

.hero { padding: 56px 0 40px; }
.hero__grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 960px) { .hero__grid { grid-template-columns: 1fr; gap: 36px; } }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.15rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; margin-bottom: 22px; }
.hero__lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 36em; margin-bottom: 30px; }
.hero__buy { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.pricetag {
  position: relative; display: inline-grid; place-items: center; text-align: center;
  width: 168px; aspect-ratio: 1; padding: 16px; background: var(--hi); color: #16204A;
  transform: rotate(-4deg); box-shadow: 0 16px 30px -14px rgba(120, 90, 0, .55), inset 0 -10px 18px -12px rgba(0,0,0,.18);
  border-radius: 3px 3px 14px 3px;
}
.pricetag::before { content: ""; position: absolute; top: -12px; left: 50%; width: 74px; height: 24px; transform: translateX(-50%) rotate(3deg); background: rgba(255,255,255,.55); border: 1px solid rgba(0,0,0,.05); }
.pricetag__amt { font-family: var(--font-display); font-weight: 800; font-size: 3.1rem; line-height: .9; letter-spacing: -.04em; }
.pricetag__cur { font-weight: 800; font-size: 1rem; letter-spacing: .02em; }
.pricetag__per { font-family: var(--font-hand); font-size: 1.35rem; line-height: 1; margin-top: 4px; }
.hero__buy-copy { display: grid; gap: 10px; }
.hero__fine { font-size: .9rem; color: var(--ink-3); }
.paylogos { display: flex; gap: 8px; flex-wrap: wrap; }
.paylogos span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: .78rem; font-weight: 700; color: var(--ink-2); }

/* hero picture — a study pack being built from a lecture */
.hero__art { position: relative; min-height: 460px; }
.sheet { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lift); overflow: hidden; }
.sheet__bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card-2); }
.sheet__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.sheet__title { font-weight: 700; font-size: .85rem; margin-inline-start: 8px; color: var(--ink-2); }
.sheet__body { padding: 20px 22px 22px; }
.hero__sheet { margin-inline-start: 36px; }
.mini-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.mini-tabs span { font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--card-2); color: var(--ink-3); }
.mini-tabs span.on { background: var(--pen); color: #fff; }
.mini-h { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; margin-bottom: 8px; }
.mini-p { font-size: .9rem; color: var(--ink-2); margin-bottom: 12px; line-height: 1.55; }
.mark { background: linear-gradient(transparent 55%, var(--hi) 55%, var(--hi) 92%, transparent 92%); padding: 0 2px; color: var(--ink); }
.mini-map { display: block; width: 100%; height: auto; margin-top: 6px; }
.float-card { position: absolute; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); padding: 12px 14px; }
.float-rec { left: 0; bottom: 28px; width: 220px; }
.float-rec .rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); margin-inline-end: 6px; animation: pulse 1.4s infinite; }
.float-rec b { font-size: .85rem; }
.wave { display: flex; align-items: center; gap: 3px; height: 34px; margin-top: 8px; }
.wave i { flex: 1; background: var(--pen); border-radius: 3px; opacity: .8; }
.float-card--flash { right: -8px; top: -20px; width: 200px; transform: rotate(3deg); background: var(--hi-soft); }
.float-card--flash small { display: block; font-size: .72rem; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }
.float-card--flash p { margin: 0; font-weight: 700; font-size: .92rem; line-height: 1.35; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (max-width: 960px) { .hero__art { min-height: 0; } .hero__sheet { margin-inline-start: 0; } .float-rec { position: relative; left: auto; bottom: auto; margin: -24px 0 0 12px; } .float-card--flash { right: 6px; top: -26px; width: 170px; } }

/* margin scribbles on the pictures */
.scribble { position: absolute; font-family: var(--font-hand); font-weight: 600; font-size: 1.35rem; line-height: 1.05; color: var(--pen); pointer-events: none; }
.scribble svg { display: block; width: 64px; height: 40px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 960px) { .scribble { display: none; } }

.sources { padding: 30px 0 60px; }
.sources__label { text-align: center; font-weight: 650; color: var(--ink-2); margin-bottom: 16px; }
.sources__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.src-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-weight: 650; font-size: .95rem; box-shadow: var(--shadow); }
.src-chip svg { width: 20px; height: 20px; }

.section { padding: 70px 0; }
.section__head { max-width: 680px; margin-bottom: 44px; }
.section__head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 800; letter-spacing: -.03em; }
.section__head p { font-size: 1.1rem; color: var(--ink-2); }
.section--center .section__head { margin-inline: auto; text-align: center; }

.feature { display: grid; grid-template-columns: 1fr 1.08fr; gap: 56px; align-items: center; padding: 44px 0; }
.feature--flip .feature__copy { order: 2; }
@media (max-width: 900px) { .feature, .feature--flip { grid-template-columns: 1fr; gap: 28px; } .feature--flip .feature__copy { order: 0; } }
.feature__copy h3 { font-size: clamp(1.55rem, 2.6vw, 2.1rem); font-weight: 800; letter-spacing: -.025em; }
.feature__copy p { color: var(--ink-2); font-size: 1.05rem; }
.feature__copy ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.feature__copy li { display: flex; gap: 10px; align-items: flex-start; }
.feature__copy li::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 3px; border-radius: 6px; background: var(--mint-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' stroke='%2316A864' stroke-width='2.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.feature__art { position: relative; }

/* ---- screenshot mockups used on the landing page ---- */
.shot { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lift); overflow: hidden; }
.shot__body { padding: 20px; }
.rec-shot { display: grid; gap: 14px; }
.rec-shot__top { display: flex; align-items: center; justify-content: space-between; }
.rec-shot__time { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rec-big { width: 64px; height: 64px; border-radius: 50%; background: var(--coral); display: grid; place-items: center; box-shadow: 0 0 0 8px var(--coral-soft); }
.rec-big i { width: 20px; height: 20px; border-radius: 5px; background: #fff; }
.caption-box { background: var(--card-2); border-radius: 12px; padding: 14px; font-size: .92rem; color: var(--ink-2); line-height: 1.55; }
.caption-box b { color: var(--ink); font-weight: 650; }
.parts { display: grid; gap: 8px; }
.part-row { display: flex; align-items: center; gap: 10px; font-size: .85rem; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.part-row span:last-child { margin-inline-start: auto; }
.level-shot .seg { margin-bottom: 14px; }
.explain { display: grid; gap: 10px; }
.explain h4 { font-size: 1.1rem; margin: 0; }
.explain p { font-size: .92rem; color: var(--ink-2); margin: 0; }
.analogy { border-inline-start: 4px solid var(--hi); background: var(--hi-soft); padding: 10px 14px; border-radius: 0 10px 10px 0; font-size: .9rem; }
[dir="rtl"] .analogy { border-radius: 10px 0 0 10px; }
.flash-stack { position: relative; height: 290px; }
.flash-mock { position: absolute; inset: 0 30px 40px 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lift); padding: 26px; display: grid; align-content: space-between; }
.flash-mock:nth-child(1) { transform: rotate(-5deg) translate(-8px, 14px); background: var(--pen-soft); }
.flash-mock:nth-child(2) { transform: rotate(3deg) translate(18px, 8px); background: var(--hi-soft); }
.flash-mock:nth-child(3) { transform: none; }
.flash-mock q { font-family: var(--font-display); font-size: 1.35rem; font-weight: 750; quotes: none; line-height: 1.25; }
.flash-mock .row { justify-content: space-between; }
.boxes { display: flex; gap: 6px; }
.boxes i { width: 26px; height: 8px; border-radius: 4px; background: var(--line); }
.boxes i.on { background: var(--mint); }
.quiz-mock { display: grid; gap: 10px; }
.quiz-mock .opt { padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-size: .92rem; font-weight: 550; }
.quiz-mock .opt.ok { border-color: var(--mint); background: var(--mint-soft); }
.quiz-mock .opt.no { border-color: var(--coral); background: var(--coral-soft); text-decoration: line-through; opacity: .8; }
.why { font-size: .88rem; color: var(--ink-2); padding: 10px 12px; background: var(--card-2); border-radius: 10px; }
.chat-mock { display: grid; gap: 10px; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: .92rem; line-height: 1.5; }
.bubble--me { justify-self: end; background: var(--pen); color: #fff; border-end-end-radius: 4px; }
.bubble--ai { background: var(--card-2); border-end-start-radius: 4px; }
.diagram-shot svg { width: 100%; height: auto; display: block; }

.extras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--card); }
.extras > div { padding: 26px 24px; border-inline-end: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.extras > div:nth-child(3n) { border-inline-end: 0; }
.extras > div:nth-last-child(-n+3) { border-bottom: 0; }
.extras h4 { font-size: 1.1rem; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.extras h4 svg { width: 22px; height: 22px; color: var(--pen); flex: none; }
.extras p { margin: 0; color: var(--ink-2); font-size: .95rem; }
@media (max-width: 860px) {
  .extras { grid-template-columns: 1fr 1fr; }
  .extras > div, .extras > div:nth-child(3n), .extras > div:nth-last-child(-n+3) { border-inline-end: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .extras > div:nth-child(2n) { border-inline-end: 0; }
  .extras > div:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 540px) {
  .extras { grid-template-columns: 1fr; }
  .extras > div, .extras > div:nth-child(2n) { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .extras > div:last-child { border-bottom: 0; }
}

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 58px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
[dir="rtl"] .step::before { left: auto; right: 0; }
.step h3 { font-size: 1.3rem; }
.step p { color: var(--ink-2); margin: 0; }

.plan { display: grid; grid-template-columns: 1fr 1.1fr; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lift); overflow: hidden; }
@media (max-width: 820px) { .plan { grid-template-columns: 1fr; } }
.plan__price { padding: 40px; background: var(--ink); color: var(--paper); display: grid; align-content: center; gap: 14px; }
.plan__price h3 { color: var(--paper); font-size: 1.4rem; margin: 0; }
.plan__amount { font-family: var(--font-display); font-weight: 800; font-size: clamp(3.6rem, 8vw, 5.2rem); line-height: .9; letter-spacing: -.045em; }
.plan__amount small { font-size: 1.3rem; letter-spacing: 0; font-weight: 700; margin-inline-start: 6px; }
.plan__per { font-family: var(--font-hand); font-size: 1.6rem; color: var(--hi); }
.plan__price .btn { justify-self: start; }
.plan__price .hero__fine { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.plan__list { padding: 40px; }
.plan__list h4 { font-size: 1.1rem; margin-bottom: 16px; }
.plan__list ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
@media (max-width: 520px) { .plan__list ul { grid-template-columns: 1fr; } .plan__price, .plan__list { padding: 28px 24px; } }
.plan__list li { display: flex; gap: 10px; font-size: .95rem; }
.plan__list li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: var(--pen-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' stroke='%232F5BFF' stroke-width='2.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/13px no-repeat; }

.faq { max-width: 780px; margin-inline: auto; display: grid; gap: 10px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 20px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 700; font-size: 1.05rem; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--pen); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); margin: 0 0 18px; }

.cta-band { text-align: center; padding: 80px 20px; }
.cta-band h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; letter-spacing: -.035em; max-width: 16em; margin-inline: auto; }
.cta-band p { color: var(--ink-2); font-size: 1.1rem; margin-bottom: 26px; }

.footer { border-top: 1px solid var(--line); padding: 36px 0 44px; font-size: .92rem; color: var(--ink-2); }
.footer__in { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.footer a { color: var(--ink-2); }
.footer address { font-style: normal; line-height: 1.7; }

/* ======================================================================
   AUTH & PAYWALL
   ====================================================================== */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; }
.auth__card { width: min(440px, 100%); padding: 34px 30px; }
.auth__card .brand { margin-bottom: 22px; }
.auth__card h1 { font-size: 1.75rem; font-weight: 800; }
.auth__card > p.muted { margin-bottom: 22px; }
.auth__alt { text-align: center; margin: 18px 0 0; font-size: .93rem; color: var(--ink-2); }
.pay { width: min(560px, 100%); padding: 0; overflow: hidden; }
.pay__top { background: var(--ink); color: var(--paper); padding: 30px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pay__top h1 { color: var(--paper); font-size: 1.5rem; margin: 0 0 4px; }
.pay__top p { margin: 0; opacity: .75; font-size: .95rem; }
.pay__top .pricetag { width: 132px; }
.pay__top .pricetag__amt { font-size: 2.4rem; }
.pay__body { padding: 28px 30px 30px; }
.pay__list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.pay__list li { display: flex; gap: 10px; }
.pay__list li::before { content: "✓"; color: var(--mint); font-weight: 800; }

/* ======================================================================
   STUDY APP SHELL
   ====================================================================== */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 6px; padding: 20px 14px; background: var(--card); border-inline-end: 1px solid var(--line); overflow-y: auto; }
.side .brand { padding: 4px 10px 18px; }
.side__nav { display: grid; gap: 2px; }
.side__nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem; }
.side__nav a svg { width: 20px; height: 20px; flex: none; }
.side__nav a:hover { background: var(--card-2); color: var(--ink); }
.side__nav a.is-on { background: var(--pen-soft); color: var(--pen); }
.side__nav a .count { margin-inline-start: auto; background: var(--hi); color: #16204A; font-size: .72rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; }
.side__sep { height: 1px; background: var(--line); margin: 12px 8px; }
.side__foot { margin-top: auto; display: grid; gap: 10px; padding: 12px 6px 4px; }
.sub-pill { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--hi-soft); font-size: .82rem; }
.sub-pill b { font-size: .9rem; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px; min-height: 64px; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar__search { flex: 1; max-width: 420px; position: relative; }
.topbar__search .input { padding-inline-start: 40px; min-height: 42px; }
.topbar__search svg { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--ink-3); pointer-events: none; }
.topbar__end { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 800; font-size: .9rem; flex: none; }
.menu-btn { display: none; }
.page { padding: 28px; width: 100%; max-width: 1180px; }
.page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page__head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; margin: 0; }
.page__head p { margin: 4px 0 0; color: var(--ink-2); }
.scrim { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 60; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lift); padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
  [dir="rtl"] .side { inset: 0 0 0 auto; transform: translateX(102%); }
  .shell.is-open .side { transform: none; }
  .shell.is-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10, 14, 36, .45); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .page { padding: 20px 16px 40px; }
  .topbar__search { display: none; }
}

/* dashboard */
.hello { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 26px 28px; margin-bottom: 22px; background: var(--ink); color: var(--paper); border-radius: var(--r-lg); position: relative; overflow: hidden; }
.hello h1 { color: var(--paper); font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 6px; }
.hello p { margin: 0; opacity: .8; }
.hello .hand { color: var(--hi); font-size: 1.5rem; display: block; margin-bottom: 2px; }
@media (max-width: 640px) { .hello { grid-template-columns: 1fr; } }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { display: grid; gap: 10px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s, border-color .12s; cursor: pointer; text-align: start; }
.tile:hover { transform: translateY(-2px); border-color: var(--pen); }
.tile__icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.tile__icon svg { width: 22px; height: 22px; }
.tile b { font-size: .98rem; }
.tile small { color: var(--ink-3); font-size: .8rem; line-height: 1.35; }
.ic-coral { background: var(--coral-soft); color: var(--coral); }
.ic-pen { background: var(--pen-soft); color: var(--pen); }
.ic-hi { background: var(--hi-soft); color: #9A7A00; }
.ic-mint { background: var(--mint-soft); color: var(--mint); }
[data-theme="dark"] .ic-hi { color: var(--hi); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 18px 20px; }
.stat b { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat span { color: var(--ink-2); font-size: .88rem; font-weight: 600; }
.block-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.block-title h2 { font-size: 1.25rem; margin: 0; }

.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.pack-card { display: grid; gap: 10px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .12s, border-color .12s; }
.pack-card:hover { transform: translateY(-2px); border-color: var(--pen); }
.pack-card__top { display: flex; align-items: center; gap: 12px; }
.pack-card__emoji { width: 46px; height: 46px; border-radius: 12px; background: var(--card-2); display: grid; place-items: center; font-size: 1.5rem; flex: none; }
.pack-card h3 { font-size: 1.05rem; margin: 0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pack-card p { font-size: .88rem; color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pack-card__meta { display: flex; gap: 6px; flex-wrap: wrap; }

.empty { text-align: center; padding: 48px 20px; border: 2px dashed var(--line); border-radius: var(--r-lg); background: color-mix(in srgb, var(--card) 60%, transparent); }
.empty h3 { font-size: 1.25rem; }
.empty p { color: var(--ink-2); max-width: 30em; margin: 0 auto 18px; }

/* new pack */
.src-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
@media (max-width: 980px) { .src-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.src-tab { display: grid; justify-items: center; gap: 8px; padding: 14px 8px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-weight: 650; font-size: .88rem; color: var(--ink-2); text-align: center; }
.src-tab svg { width: 24px; height: 24px; }
.src-tab[aria-pressed="true"] { border-color: var(--pen); background: var(--pen-soft); color: var(--pen); }
.panel { padding: 24px; margin-bottom: 18px; }
.drop { display: grid; place-items: center; gap: 8px; text-align: center; padding: 36px 20px; border: 2px dashed var(--line); border-radius: var(--r); cursor: pointer; transition: border-color .15s, background .15s; }
.drop.is-over, .drop:hover { border-color: var(--pen); background: var(--pen-soft); }
.drop svg { width: 36px; height: 36px; color: var(--pen); }
.drop b { font-size: 1.05rem; }
.file-list { display: grid; gap: 8px; margin-top: 12px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: .9rem; background: var(--card); }
.file-row span:nth-child(2) { color: var(--ink-3); margin-inline-start: auto; font-size: .82rem; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.thumbs img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 700px) { .opts { grid-template-columns: 1fr; } }
.opts .field { margin: 0; }

.progress { padding: 34px 28px; text-align: center; }
.progress h2 { font-size: 1.5rem; }
.pstep-list { list-style: none; padding: 0; margin: 22px auto 0; max-width: 360px; display: grid; gap: 10px; text-align: start; }
.pstep-list li { display: flex; gap: 12px; align-items: center; color: var(--ink-3); font-weight: 600; }
.pstep-list li i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-style: normal; font-size: .7rem; }
.pstep-list li.is-now { color: var(--ink); }
.pstep-list li.is-now i { border-color: var(--pen); border-top-color: transparent; animation: spin .8s linear infinite; }
.pstep-list li.is-done { color: var(--ink-2); }
.pstep-list li.is-done i { background: var(--mint); border-color: var(--mint); color: #fff; }
.pstep-list li.is-done i::after { content: "✓"; }
@keyframes spin { to { transform: rotate(360deg); } }
.pencil { width: 74px; height: 74px; margin: 0 auto 12px; color: var(--pen); }
.pencil path.line { stroke-dasharray: 90; animation: draw 1.8s ease-in-out infinite; }
@keyframes draw { from { stroke-dashoffset: 90; } to { stroke-dashoffset: -90; } }

/* recorder */
.rec { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
@media (max-width: 980px) { .rec { grid-template-columns: 1fr; } }
.rec__stage { padding: 26px; display: grid; gap: 20px; }
.rec__controls { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.rec-btn { width: 88px; height: 88px; border-radius: 50%; border: 0; background: var(--coral); cursor: pointer; display: grid; place-items: center; box-shadow: 0 0 0 10px var(--coral-soft); transition: transform .15s; flex: none; }
.rec-btn:hover { transform: scale(1.04); }
.rec-btn i { width: 30px; height: 30px; border-radius: 50%; background: #fff; transition: border-radius .2s, width .2s, height .2s; }
.rec-btn.is-live i { border-radius: 7px; width: 28px; height: 28px; }
.rec-btn.is-live { animation: ring 1.8s infinite; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 10px var(--coral-soft); } 50% { box-shadow: 0 0 0 18px var(--coral-soft); } }
.rec__time { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, 6vw, 3.4rem); letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.rec__state { color: var(--ink-2); font-weight: 600; }
.rec canvas { width: 100%; height: 80px; display: block; border-radius: 12px; background: var(--card-2); }
.captions { min-height: 150px; max-height: 320px; overflow-y: auto; padding: 16px; border-radius: 12px; background: var(--card-2); font-size: 1rem; line-height: 1.65; color: var(--ink-2); }
.captions .interim { color: var(--ink-3); }
.rec__side { padding: 20px; display: grid; gap: 14px; align-content: start; }

/* pack viewer */
.pack-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 18px; flex-wrap: wrap; }
.pack-head__emoji { width: 64px; height: 64px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; font-size: 2rem; flex: none; box-shadow: var(--shadow); }
.pack-head__txt { flex: 1; min-width: 240px; }
.pack-head h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; margin-bottom: 8px; }
.pack-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; margin-bottom: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; scrollbar-width: none; position: sticky; top: 72px; z-index: 20; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; background: transparent; padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 650; font-size: .9rem; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); background: var(--card-2); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tab .n { font-size: .72rem; opacity: .7; }
@media (max-width: 900px) { .tabs { top: calc(62px + env(safe-area-inset-top, 0px)); } }
.pane { padding: 28px 32px; }
@media (max-width: 640px) { .pane { padding: 20px 18px; } }
.tldr { background: var(--hi-soft); border-radius: 14px; padding: 16px 20px; margin-bottom: 22px; font-size: 1.05rem; font-weight: 550; }
.tldr b { display: block; font-family: var(--font-hand); font-size: 1.4rem; font-weight: 700; margin-bottom: 2px; }
.keypoints { display: grid; gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; counter-reset: kp; }
.keypoints li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; }
.keypoints li::before { counter-increment: kp; content: counter(kp); flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--pen-soft); color: var(--pen); font-weight: 800; font-size: .85rem; display: grid; place-items: center; }

.prose { font-size: 1.03rem; line-height: 1.72; max-width: 74ch; }
.prose h1, .prose h2 { font-size: 1.45rem; margin: 1.6em 0 .55em; }
.prose h3 { font-size: 1.18rem; margin: 1.4em 0 .5em; }
.prose h4 { font-size: 1.02rem; margin: 1.2em 0 .4em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose strong { color: var(--ink); background: linear-gradient(transparent 62%, var(--hi-soft) 62%); }
.prose blockquote { margin: 1em 0; padding: 12px 18px; border-inline-start: 4px solid var(--hi); background: var(--hi-soft); border-radius: 0 12px 12px 0; }
.prose blockquote p:last-child { margin: 0; }
.prose code { background: var(--card-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.prose pre { background: var(--card-2); padding: 14px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: start; }
.prose th { background: var(--card-2); }
.prose hr { border: 0; border-top: 1px dashed var(--line); margin: 2em 0; }
.prose mjx-container { overflow-x: auto; overflow-y: hidden; max-width: 100%; }

.diagrams { display: grid; gap: 18px; }
.diagram { padding: 22px; }
.diagram h3 { font-size: 1.15rem; margin-bottom: 4px; }
.diagram p.muted { margin-bottom: 14px; font-size: .93rem; }
.diagram__canvas { overflow-x: auto; background: var(--card-2); border-radius: 12px; padding: 16px; display: grid; place-items: center; min-height: 160px; }
.diagram__canvas svg { max-width: 100%; height: auto; }
.diagram__err { font-size: .88rem; color: var(--ink-3); }

.flash-wrap { max-width: 640px; margin: 0 auto; display: grid; gap: 18px; }
.flash-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flash { perspective: 1400px; cursor: pointer; }
.flash__in { position: relative; min-height: 300px; transition: transform .5s cubic-bezier(.3, .7, .3, 1); transform-style: preserve-3d; }
.flash.is-flipped .flash__in { transform: rotateY(180deg); }
.flash__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; padding: 30px; display: grid; place-items: center; text-align: center; border: 1px solid var(--line); box-shadow: var(--shadow-lift); overflow-y: auto; }
.flash__face--front { background: var(--card); }
.flash__face--back { background: var(--hi-soft); transform: rotateY(180deg); }
.flash__face small { position: absolute; top: 16px; inset-inline-start: 20px; font-weight: 700; color: var(--ink-3); font-size: .78rem; }
.flash__q { font-family: var(--font-display); font-size: clamp(1.25rem, 2.6vw, 1.7rem); font-weight: 750; line-height: 1.3; }
.flash__a { font-size: 1.08rem; line-height: 1.55; }
.flash-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.meter { height: 8px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--mint); border-radius: 99px; transition: width .3s; }

.quiz { max-width: 720px; display: grid; gap: 16px; }
.q-card { padding: 22px 24px; }
.q-card h3 { font-size: 1.15rem; line-height: 1.4; margin-bottom: 14px; }
.q-card h3 span { color: var(--ink-3); font-weight: 700; margin-inline-end: 6px; }
.q-opts { display: grid; gap: 8px; }
.q-opt { text-align: start; padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-weight: 550; line-height: 1.45; }
.q-opt:hover:not([disabled]) { border-color: var(--pen); }
.q-opt.is-right { border-color: var(--mint); background: var(--mint-soft); }
.q-opt.is-wrong { border-color: var(--coral); background: var(--coral-soft); }
.q-opt[disabled] { cursor: default; }
.q-why { margin-top: 12px; font-size: .95rem; padding: 12px 14px; background: var(--card-2); border-radius: 12px; color: var(--ink-2); }
.score { display: flex; align-items: center; gap: 20px; padding: 22px 24px; }
.score b { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; }

.glossary { display: grid; gap: 0; }
.glossary div { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.glossary div:last-child { border-bottom: 0; }
.glossary dt { font-weight: 750; }
.glossary dd { margin: 0; color: var(--ink-2); }
@media (max-width: 600px) { .glossary div { grid-template-columns: 1fr; gap: 4px; } }

.exam-q { padding: 18px 0; border-bottom: 1px dashed var(--line); }
.exam-q:last-child { border-bottom: 0; }
.exam-q h4 { font-size: 1.05rem; line-height: 1.45; margin-bottom: 10px; }
.exam-q details summary { cursor: pointer; font-weight: 650; color: var(--pen); font-size: .92rem; }
.exam-q details .prose { margin-top: 10px; font-size: .97rem; }

.transcript { white-space: pre-wrap; font-size: .98rem; line-height: 1.75; color: var(--ink-2); max-height: 70vh; overflow-y: auto; }

.chat { display: grid; grid-template-rows: 1fr auto; min-height: 520px; padding: 0; overflow: hidden; }
.chat__log { padding: 22px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: 60vh; }
.chat__log .bubble { max-width: min(80%, 640px); }
.chat__log .bubble--ai .prose { font-size: .96rem; }
.chat__log .bubble--ai .prose p:last-child { margin: 0; }
.chat__foot { padding: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; background: var(--card-2); }
.chat__suggest { display: flex; gap: 8px; flex-wrap: wrap; }
.chat__suggest button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: .84rem; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.chat__suggest button:hover { border-color: var(--pen); color: var(--pen); }
.chat__form { display: flex; gap: 8px; }
.chat__form .input { flex: 1; }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); margin: 0 2px; animation: pulse 1s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }

.list-plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list-plain li { padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; }

/* toast & modal */
.toasts { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); inset-inline-end: 18px; z-index: 90; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .93rem; box-shadow: var(--shadow-lift); animation: toast-in .25s ease; max-width: 360px; }
.toast--error { background: var(--coral); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(10, 14, 36, .5); display: grid; place-items: center; padding: 18px; }
.modal { width: min(460px, 100%); padding: 26px; }
.modal h2 { font-size: 1.3rem; }

/* ======================================================================
   ADMIN
   ====================================================================== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .8rem; color: var(--ink-3); font-weight: 700; background: var(--card-2); }
.table tr:last-child td { border-bottom: 0; }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-tabs a { padding: 9px 16px; border-radius: 10px; text-decoration: none; font-weight: 650; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); }
.admin-tabs a.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.settings-group { padding: 24px; margin-bottom: 18px; }
.settings-group h2 { font-size: 1.2rem; margin-bottom: 4px; }
.settings-group > p { color: var(--ink-2); margin-bottom: 18px; font-size: .93rem; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; margin-bottom: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--pen); }

/* installer */
.install { width: min(640px, 100%); padding: 32px; }
.install__steps { display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap; }
.install__steps span { flex: 1; min-width: 70px; height: 6px; border-radius: 4px; background: var(--line); }
.install__steps span.on { background: var(--pen); }
.req { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.req li { display: flex; justify-content: space-between; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.btnrow { display: flex; gap: 10px; justify-content: space-between; margin-top: 8px; flex-wrap: wrap; }

/* preview-only banner */
.preview-bar { position: fixed; inset-inline-start: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 70; display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 16px; background: var(--ink); color: var(--paper); border-radius: 999px; font-size: .84rem; font-weight: 600; box-shadow: var(--shadow-lift); max-width: calc(100% - 24px); }
.preview-bar .btn { min-height: 32px; --bg: var(--hi); --fg: #16204A; --bd: var(--hi); }
[dir="rtl"] .preview-bar { transform: translateX(50%); }

/* print: notes export */
#print-area { display: none; }
@media print {
  body { background: #fff; color: #000; }
  .side, .topbar, .tabs, .pack-head__actions, .toasts, .preview-bar, .no-print { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; border: 0; }
  .pane { padding: 0; }
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block !important; color: #000; font-size: 11pt; }
  body.printing #print-area h1 { font-size: 20pt; }
  body.printing #print-area svg { max-width: 100%; height: auto; }
}

/* =====================================================================
   v2 — Notebooks (handwriting) and AI tutor
   ===================================================================== */
.page.page--full { max-width: none; padding: 0; }
.bar-progress { height: 10px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); overflow: hidden; margin: 6px 0 18px; }
.bar-progress i { display: block; height: 100%; background: var(--pen); transition: width .3s; }
.hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.hits a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.hits a:hover { background: var(--card-2); }
.menu-list { display: grid; gap: 6px; margin-bottom: 16px; }
.menu-list button { text-align: start; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 14px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.menu-list button:hover { border-color: var(--pen); }
.menu-list button.danger { color: var(--coral); }

/* notebook list */
.nb-search { margin-bottom: 18px; max-width: 620px; flex-wrap: nowrap; }
.nb-search .input { flex: 1; }
.nb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px; }
.nb-card { text-decoration: none; color: var(--ink); display: grid; gap: 10px; }
.nb-card__cover { position: relative; aspect-ratio: 1240 / 1754; border-radius: 6px 14px 14px 6px; background: var(--cov); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.nb-card:hover .nb-card__cover { transform: translateY(-3px) rotate(-.6deg); box-shadow: var(--shadow-lift); }
.nb-card__spine { position: absolute; inset: 0 auto 0 0; width: 14px; background: rgba(0,0,0,.18); z-index: 2; }
.nb-card__cover img { position: absolute; inset: 10px 10px 10px 24px; width: calc(100% - 34px); height: calc(100% - 20px); object-fit: cover; object-position: top; border-radius: 4px; background: #fff; }
.nb-card__blank { position: absolute; inset: 10px 10px 10px 24px; border-radius: 4px; background: repeating-linear-gradient(#fff 0 13px, #dfe6f5 13px 14px); opacity: .95; }
.nb-card__meta { display: grid; gap: 2px; }
.nb-card__meta b { font-size: .98rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nb-card__meta span { font-size: .8rem; color: var(--ink-3); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; background: var(--sw); border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.papers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.papers button { display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font: inherit; font-size: .82rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.papers button[aria-pressed="true"] { border-color: var(--pen); color: var(--pen); box-shadow: 0 0 0 2px var(--pen-soft); }
.paper-ico { width: 38px; height: 50px; border-radius: 4px; background: #fff; border: 1px solid #d5dbe8; display: block; }
.paper-ico--lined { background: repeating-linear-gradient(#fff 0 7px, #c9d6f0 7px 8px); }
.paper-ico--grid { background: linear-gradient(#dde5f4 1px, transparent 1px) 0 0 / 6px 6px, linear-gradient(90deg, #dde5f4 1px, #fff 1px) 0 0 / 6px 6px; }
.paper-ico--dots { background: radial-gradient(#b8c4dc 1px, #fff 1.4px) 0 0 / 6px 6px; }
.paper-ico--cornell { background: linear-gradient(90deg, transparent 11px, #f2a7ae 11px 12px, transparent 12px), repeating-linear-gradient(#fff 0 7px, #c9d6f0 7px 8px); }
.paper-ico--music { background: repeating-linear-gradient(#fff 0 3px, #c3cbdb 3px 4px, #fff 4px 5px) 0 6px / 100% 20px no-repeat, repeating-linear-gradient(#fff 0 3px, #c3cbdb 3px 4px, #fff 4px 5px) 0 30px / 100% 20px no-repeat; }

/* notebook editor */
.nb { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; height: calc(100dvh - 65px); background: var(--card-2); }
.nb-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.nb-bar::-webkit-scrollbar { display: none; }
.nb-title { border: 0; background: transparent; font: inherit; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--ink); width: 11em; min-width: 6em; padding: 6px 8px; border-radius: 8px; }
.nb-title:focus { outline: 2px solid var(--pen-soft); background: var(--card-2); }
.nb-tools { display: flex; gap: 2px; padding: 3px; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; flex: none; }
.nb-tools button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); cursor: pointer; }
.nb-tools button svg { width: 20px; height: 20px; }
.nb-tools button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.nb-tools button:disabled { opacity: .35; }
.nb-opts { display: flex; align-items: center; gap: 6px; flex: none; min-height: 38px; }
.nb-opts .small { white-space: nowrap; }
.ink { width: 26px; height: 26px; border-radius: 50%; background: var(--sw); border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; flex: none; padding: 0; }
.ink[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.ink--custom { position: relative; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.ink--custom input { position: absolute; inset: -6px; opacity: 0; cursor: pointer; }
.nb-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.wdot { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.wdot i { display: block; border-radius: 50%; background: currentColor; }
.wdot[aria-pressed="true"] { background: var(--pen-soft); color: var(--pen); }
.nb-save { font-size: .78rem; font-weight: 600; color: var(--ink-3); white-space: nowrap; margin-inline-start: auto; }
.nb-save[data-state="busy"] { color: var(--pen); }
.nb-save[data-state="err"] { color: var(--coral); }
.nb-stage { overflow: auto; padding: 12px; overscroll-behavior: contain; }
.nb-page { position: relative; margin: 0 auto; box-shadow: 0 1px 2px rgba(22,32,74,.12), 0 8px 30px rgba(22,32,74,.12); background: #fff; }
.nb-page canvas { position: absolute; inset: 0; display: block; }
#nb-live { touch-action: none; }
.nb-textedit { position: absolute; z-index: 3; border: 2px dashed var(--pen); background: rgba(255,255,255,.92); resize: none; overflow: hidden; line-height: 1.35; padding: 0; margin: -2px; font-family: Figtree, "IBM Plex Sans Arabic", system-ui, sans-serif; outline: 0; }
.nb-foot { display: flex; align-items: center; gap: 6px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--card); border-top: 1px solid var(--line); }
.nb-foot #nb-pos { font-weight: 700; font-size: .9rem; min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; }
.nb-foot__sp { flex: 1; }
.sel-bar { position: absolute; z-index: 6; display: flex; gap: 2px; padding: 4px; background: var(--ink); border-radius: 12px; box-shadow: var(--shadow-lift); }
.sel-bar button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: #fff; font: inherit; font-size: .84rem; font-weight: 600; padding: 8px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.sel-bar button:hover { background: rgba(255,255,255,.12); }
.sel-bar button svg { width: 16px; height: 16px; }
.sel-bar .danger { color: #ff9aa1; }
.hw-text { width: 100%; font-size: 1rem; line-height: 1.5; margin-bottom: 14px; resize: vertical; }
@media (min-width: 1000px) { .nb-bar { flex-wrap: wrap; row-gap: 6px; } }
@media (max-width: 900px) { .nb { height: calc(100dvh - 62px - env(safe-area-inset-top, 0px)); } .nb-title { width: 7em; } }
@media (max-width: 600px) { .nb-foot { gap: 2px; padding-inline: 6px; } .nb-foot .btn { padding-inline: 8px; } .nb-foot #nb-zfit { display: none; } .nb-stage { padding: 6px; } }

/* AI tutor page */
.tutor { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.tutor__threads { padding: 6px 0; max-height: calc(100dvh - 190px); overflow: auto; position: sticky; top: 84px; }
.tutor__h { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 10px 16px 4px; margin: 0; }
.tutor__threads ul { list-style: none; margin: 0; padding: 0 6px; }
.tutor__threads li { display: flex; align-items: center; border-radius: 10px; }
.tutor__threads li a { flex: 1; min-width: 0; padding: 9px 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; border-radius: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tutor__threads li a small { display: block; font-weight: 500; color: var(--ink-3); font-size: .75rem; }
.tutor__threads li a.is-on, .tutor__threads li a:hover { background: var(--pen-soft); }
.tutor__threads li button { border: 0; background: transparent; color: var(--ink-3); padding: 6px; cursor: pointer; border-radius: 8px; opacity: .6; }
.tutor__threads li button:hover { opacity: 1; color: var(--coral); }
.tutor__threads li button svg { width: 16px; height: 16px; }
.tutor__main { padding: 0; overflow: hidden; }
@media (max-width: 900px) { .tutor { grid-template-columns: 1fr; } .tutor__threads { position: static; max-height: 220px; order: 2; } }

.tchat { display: grid; grid-template-rows: 1fr auto; height: min(78dvh, 820px); }
.tchat--compact { height: 100%; }
.tchat__log { overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.tchat__log .bubble { max-width: min(88%, 720px); }
.tchat__log .bubble--ai { max-width: 100%; width: fit-content; }
.tchat__log .bubble--ai .prose { font-size: .97rem; }
.tchat__log .bubble--ai .prose > :last-child { margin-bottom: 0; }
.bubble__meta { display: block; margin-top: 4px; font-size: .74rem; opacity: .85; }
.bubble__tools { margin-top: 8px; display: flex; gap: 6px; }
.bubble__tools button { border: 1px solid var(--line); background: var(--card); color: var(--ink-3); border-radius: 8px; font: inherit; font-size: .75rem; font-weight: 600; padding: 3px 9px; cursor: pointer; }
.typing em { font-style: normal; font-size: .82rem; color: var(--ink-3); margin-inline-start: 8px; }
.tchat__hello { text-align: center; margin: auto; max-width: 560px; padding: 10px 0; }
.tchat__bot { width: 58px; height: 58px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 18px; background: var(--pen); color: #fff; box-shadow: 0 8px 24px color-mix(in srgb, var(--pen) 35%, transparent); }
.tchat__bot svg { width: 30px; height: 30px; }
.tchat__hello h3 { font-size: 1.25rem; }
.tchat__starters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-top: 16px; text-align: start; }
.tchat__starters button { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 14px; font: inherit; font-size: .88rem; font-weight: 600; color: var(--ink); cursor: pointer; text-align: start; }
.tchat__starters button:hover { border-color: var(--pen); }
.tchat__starters span { font-size: 1.2rem; }
.tchat__foot { border-top: 1px solid var(--line); background: var(--card-2); padding: 10px 12px 12px; display: grid; gap: 8px; }
.tchat__screen { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; min-width: 0; }
.tchat__screen #t-screen { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tchat__eye svg { width: 16px; height: 16px; color: var(--pen); display: block; }
.tchat__modes { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tchat__modes button { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.tchat__modes button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tchat__thumbs { display: flex; gap: 8px; }
.tchat__thumbs:empty { display: none; }
.tchat__thumb { position: relative; }
.tchat__thumb img { width: 58px; height: 58px; object-fit: cover; border-radius: 10px; display: block; }
.tchat__thumb button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.tchat__thumb button svg { width: 12px; height: 12px; }
.tchat__form { display: flex; gap: 6px; align-items: flex-end; }
.tchat__form textarea { flex: 1; resize: none; min-height: 44px; max-height: 160px; line-height: 1.4; padding-top: 11px; }
.tchat__form .btn--quiet { height: 44px; }
#t-mic.is-live { color: var(--coral); }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::after { transform: translateX(16px); }

/* tutor answer widgets */
.tw-cards { margin: 12px 0; display: grid; gap: 10px; }
.tw-cards .row { justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tw-cards__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tw-card { position: relative; min-height: 118px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 14px; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; text-align: center; display: grid; place-items: center; transition: transform .25s; }
.tw-card__b { display: none; font-weight: 500; }
.tw-card__f { font-weight: 700; }
.tw-card.is-flipped { background: var(--hi-soft); border-color: transparent; }
.tw-card.is-flipped .tw-card__f { display: none; }
.tw-card.is-flipped .tw-card__b { display: block; }
.tw-quiz { margin: 12px 0; display: grid; gap: 14px; }
.tw-q { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--card); }
.tw-q__t { margin: 0 0 10px; }
.tw-q__opts { display: grid; gap: 6px; }
.tw-q__opts button { text-align: start; border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); padding: 9px 12px; font: inherit; font-size: .92rem; color: var(--ink); cursor: pointer; }
.tw-q__opts button:hover { border-color: var(--pen); }
.tw-q__opts button.is-right { background: var(--mint-soft); border-color: var(--mint); }
.tw-q__opts button.is-wrong { background: var(--coral-soft); border-color: var(--coral); }
.tw-q__ex { margin-top: 10px; font-size: .9rem; }
.tw-quiz__score { font-weight: 800; margin: 0; }
.tw-diagram { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin: 12px 0; overflow-x: auto; }

/* Ask-AI button and drawer */
.ask-fab { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px 12px 14px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-weight: 800; font-size: .95rem; cursor: pointer; box-shadow: 0 10px 30px rgba(22,32,74,.35); }
.ask-fab svg { width: 22px; height: 22px; color: var(--hi); }
.ask-fab:hover { transform: translateY(-2px); }
.ask-fab[hidden], body.tdrawer-open .ask-fab { display: none; }
.tdrawer[hidden] { display: none; }
.tdrawer { position: fixed; inset: 0; z-index: 80; }
.tdrawer__scrim { position: absolute; inset: 0; background: rgba(12,17,40,.25); }
.tdrawer__panel { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(460px, calc(100% - 24px)); display: grid; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; box-shadow: var(--shadow-lift); animation: slidein .2s ease-out; }
.tdrawer__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.tdrawer__title { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; }
.tdrawer__title svg { width: 20px; height: 20px; color: var(--pen); }
.tdrawer__body { min-height: 0; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 700px) {
  .tdrawer__panel { inset: auto 0 0 0; top: calc(8vh + env(safe-area-inset-top, 0px)); width: 100%; border-radius: 20px 20px 0 0; animation: slideup .2s ease-out; }
  .ask-fab span { display: none; }
  .ask-fab { padding: 14px; }
  .nb ~ .ask-fab, body:has(.nb) .ask-fab { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
body:has(.nb) .ask-fab { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
.print-page { display: block; width: 100%; page-break-after: always; }
@media print { .ask-fab, .tdrawer { display: none !important; } body.printing #print-area .print-page { margin: 0; } }

/* landing v2 mockups */
.nbm { padding: 0; background: var(--card-2); }
.nbm__tools { display: flex; gap: 6px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--card); }
.nbm__tools i { width: 24px; height: 24px; border-radius: 7px; background: var(--card-2); border: 1px solid var(--line); }
.nbm__tools i.on { background: var(--ink); }
.nbm__tools b { width: 16px; height: 16px; border-radius: 50%; background: var(--c); margin-inline-start: 4px; }
.nbm__tools b.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--c); }
.nbm__paper { position: relative; margin: 14px; padding: 18px 22px 30px 54px; background: #fff repeating-linear-gradient(#fff 0 33px, #c9d6f0 33px 34px); background-position: 0 14px; border-radius: 6px; box-shadow: var(--shadow); min-height: 190px; }
.nbm__paper::before { content: ""; position: absolute; left: 40px; top: 0; bottom: 0; width: 1px; background: #f2a7ae; }
.nbm__hand { font-family: var(--font-hand); font-size: 1.75rem; line-height: 34px; margin: 0; color: #1C1F2E; position: relative; }
.nbm__hand span { color: #E8434D; font-size: 1.4rem; }
.nbm__lasso { display: inline-block; padding: 0 10px; margin-inline-start: -10px; border: 2px dashed var(--pen); border-radius: 18px; }
.nbm__hl { position: absolute; left: 50px; top: 22px; width: 190px; height: 24px; background: #FFE45C; opacity: .45; border-radius: 3px; mix-blend-mode: multiply; }
.nbm__sel { position: absolute; right: 16px; top: 58px; display: flex; gap: 2px; padding: 4px; background: var(--ink); border-radius: 10px; }
.nbm__sel span { color: #fff; font-size: .72rem; font-weight: 700; padding: 5px 8px; border-radius: 6px; }
.nbm__sel span:first-child { background: rgba(255,255,255,.14); }
.nbm__typed { margin: 0 14px 14px; padding: 10px 12px; font-size: .82rem; background: var(--mint-soft); border-radius: 10px; }
.tmock { display: grid; grid-template-columns: 1fr 1.25fr; gap: 12px; padding: 14px; background: var(--card-2); }
.tmock__page { background: #fff repeating-linear-gradient(#fff 0 33px, #dde5f4 33px 34px); border-radius: 6px; padding: 14px 16px; box-shadow: var(--shadow); }
.tmock__page i { color: #E8434D; font-style: normal; font-family: var(--font-body); font-size: 1rem; }
.tmock__panel { display: grid; gap: 8px; align-content: start; background: var(--card); border-radius: 12px; padding: 10px; box-shadow: var(--shadow); }
.tmock__panel .bubble { max-width: 100%; font-size: .82rem; }
.tmock__eye { font-size: .74rem; font-weight: 700; color: var(--mint); background: var(--mint-soft); border-radius: 99px; padding: 4px 10px; justify-self: start; }
@media (max-width: 560px) { .tmock { grid-template-columns: 1fr; } }
.app-badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.app-badge { display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px 9px 14px; border-radius: 14px; background: #0b0f1f; color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.25); }
.app-badge svg { width: 26px; height: 26px; }
.app-badge span { display: grid; line-height: 1.1; font-weight: 800; font-size: 1.05rem; text-align: start; }
.app-badge small { font-weight: 500; font-size: .7rem; opacity: .8; }
