/* ==========================================================================
   munotes-unified — design system v2 · "Studio" (sleek pro-tool)
   Native-app feel: depth, glass, motion, view transitions, ⌘K palette.
   Auto light/dark. Inter. Mobile-first.
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Devanagari", sans-serif;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

    /* light — Apple-grade neutrals */
    --bg: #ffffff;
    --bg-2: #f5f5f7;
    --surface: #ffffff;
    --surface-2: #f5f5f7;
    --surface-3: #ececef;
    --elevated: #ffffff;
    --text: #1d1d1f;
    --text-2: #6e6e73;
    --text-3: #8e8e93;
    --line: #e6e6e9;
    --line-2: #d7d7db;
    --hairline: rgba(0, 0, 0, .08);

    --accent: #0071e3;
    --accent-2: #0071e3;
    --accent-ink: #ffffff;
    --accent-text: #0066cc;
    --accent-soft: rgba(0, 113, 227, .10);
    --accent-line: rgba(0, 113, 227, .30);
    --accent-grad: var(--accent);
    --accent-glow: 0 1px 2px rgba(0,0,0,.06);

    --k-notes: #0066cc;   --k-notes-bg: rgba(0, 102, 204, .08);
    --k-papers: #9a5b00;  --k-papers-bg: rgba(154, 91, 0, .08);
    --k-syll: #0a7d62;    --k-syll-bg: rgba(10, 125, 98, .09);

    --ok: #0a7d33; --warn: #9a6700; --danger: #d70015;

    --r-xs: 8px; --r-sm: 10px; --r: 13px; --r-lg: 18px; --r-xl: 22px; --r-pill: 999px;

    --sh-1: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.03);
    --sh-2: 0 4px 16px -6px rgba(0,0,0,.10);
    --sh-3: 0 12px 30px -12px rgba(0,0,0,.13);
    --sh-pop: 0 24px 64px -16px rgba(0,0,0,.22);
    --glass: saturate(180%) blur(20px);

    --sidebar-w: 252px;
    --rail-w: 72px;
    --topbar-h: 60px;
    --bottomnav-h: 62px;
    --maxw: 1160px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);

    --ease: cubic-bezier(.4, 0, .2, 1);
    --spring: cubic-bezier(.2, .8, .3, 1);
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #000000;
    --bg-2: #0a0a0c;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --surface-3: #3a3a3c;
    --elevated: #1c1c1e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #727278;
    --line: #2c2c2e;
    --line-2: #3a3a3c;
    --hairline: rgba(255, 255, 255, .10);

    --accent: #0a84ff;
    --accent-2: #0a84ff;
    --accent-ink: #ffffff;
    --accent-text: #409cff;
    --accent-soft: rgba(10, 132, 255, .16);
    --accent-line: rgba(10, 132, 255, .38);
    --accent-grad: var(--accent);
    --accent-glow: 0 1px 2px rgba(0,0,0,.5);

    --k-notes: #6cb1ff;   --k-notes-bg: rgba(10, 132, 255, .16);
    --k-papers: #ffb066;  --k-papers-bg: rgba(255, 159, 10, .16);
    --k-syll: #54d6b6;    --k-syll-bg: rgba(48, 209, 168, .16);

    --sh-1: 0 1px 2px rgba(0,0,0,.6);
    --sh-2: 0 6px 20px -8px rgba(0,0,0,.7);
    --sh-3: 0 16px 40px -12px rgba(0,0,0,.8);
    --sh-pop: 0 28px 70px -16px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.06);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg: #000000; --bg-2: #0a0a0c; --surface: #1c1c1e; --surface-2: #2c2c2e; --surface-3: #3a3a3c;
        --elevated: #1c1c1e; --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #727278; --line: #2c2c2e;
        --line-2: #3a3a3c; --hairline: rgba(255,255,255,.10); --accent: #0a84ff; --accent-2: #0a84ff;
        --accent-ink: #ffffff; --accent-text: #409cff; --accent-soft: rgba(10,132,255,.16);
        --accent-line: rgba(10,132,255,.38); --accent-grad: #0a84ff; --accent-glow: 0 1px 2px rgba(0,0,0,.5);
        --k-notes:#6cb1ff; --k-notes-bg:rgba(10,132,255,.16); --k-papers:#ffb066; --k-papers-bg:rgba(255,159,10,.16);
        --k-syll:#54d6b6; --k-syll-bg:rgba(48,209,168,.16);
        --sh-1:0 1px 2px rgba(0,0,0,.6); --sh-2:0 6px 20px -8px rgba(0,0,0,.7); --sh-3:0 16px 40px -12px rgba(0,0,0,.8);
        --sh-pop:0 28px 70px -16px rgba(0,0,0,.85),0 0 0 1px rgba(255,255,255,.06); color-scheme: dark;
    }
}

/* 2. RESET / BASE ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font); background: var(--bg); color: var(--text);
    line-height: 1.55; font-size: 15.5px; min-height: 100dvh;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    letter-spacing: -0.011em;
}
/* calm, flat surface — depth comes from light & material, not colour */
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font: inherit; }
h1,h2,h3 { line-height: 1.12; letter-spacing: -0.03em; font-weight: 680; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 200; background: var(--elevated); color: var(--text);
    padding: 10px 16px; border-radius: var(--r-sm); box-shadow: var(--sh-pop); transform: translateY(-160%); transition: transform .2s; }
.skip-link:focus { transform: translateY(0); }

/* press feedback (touch + mouse) */
.btn, .iconbtn, .card, .chip, .navlink, .navgroup__head, .bottomnav__item, .cmdk-item, .quicktool {
    -webkit-tap-highlight-color: transparent;
}
.btn:active, .iconbtn:active, .chip:active, .card:active, .bottomnav__item:active, .cmdk-item:active { transform: scale(.97); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    @view-transition { navigation: none; }
}

/* 3. VIEW TRANSITIONS (fluid page navigation, no white flash) --------------- */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: vt-sidebar; }
.topbar { view-transition-name: vt-topbar; }
.bottomnav { view-transition-name: vt-bottomnav; }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
::view-transition-old(root) { animation: vt-out .18s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .28s var(--ease) both; }

/* entrance stagger for content */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.main > * { animation: rise .5s var(--ease) both; }
.main > *:nth-child(2) { animation-delay: .04s; }
.main > *:nth-child(3) { animation-delay: .08s; }
.main > *:nth-child(4) { animation-delay: .12s; }
.main > *:nth-child(5) { animation-delay: .16s; }

/* 4. SHELL ----------------------------------------------------------------- */
.app { display: block; }
.sidebar { display: none; }
.app__main { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.main {
    width: 100%; max-width: var(--maxw); margin-inline: auto;
    padding: clamp(14px, 3.5vw, 28px);
    padding-bottom: calc(var(--bottomnav-h) + var(--safe-b) + 22px);
    flex: 1;
}

/* topbar — glass */
.topbar {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px;
    height: calc(var(--topbar-h) + var(--safe-t)); padding: var(--safe-t) clamp(10px,3vw,18px) 0;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
    border-bottom: 1px solid var(--hairline);
}
.topbar__brand { display: flex; }
.topbar__menu { display: inline-flex; }
.topbar .search { display: none; }
.topbar__searchlink { display: inline-flex; }
.topbar__title {
    flex: 1; min-width: 0; font-weight: 640; font-size: 16px; letter-spacing: -0.02em;
    opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; pointer-events: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.is-scrolled .topbar__title { opacity: 1; transform: none; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar .topbar__hide-sm { display: none; }
.topbar__cmdk { display: none; }

/* bottom nav — glass + animated indicator */
.bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex;
    height: calc(var(--bottomnav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
    border-top: 1px solid var(--hairline);
}
.bottomnav__item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--text-3); font-size: 10.5px; font-weight: 600; padding-top: 8px; position: relative;
    transition: color .2s;
}
.bottomnav__item.is-active { color: var(--accent-text); }
.bottomnav__item.is-active::before {
    content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 4px 4px;
    background: var(--accent-grad); view-transition-name: vt-tab-indicator; box-shadow: var(--accent-glow);
}
.bottomnav__icon { display: grid; place-items: center; transition: transform .25s var(--spring); }
.bottomnav__item.is-active .bottomnav__icon { transform: translateY(-1px); }
.bottomnav__item--center .bottomnav__icon {
    background: var(--accent-grad); color: #fff; width: 46px; height: 46px; border-radius: var(--r-pill);
    margin-top: -16px; box-shadow: var(--accent-glow); border: 3px solid var(--surface);
}
.bottomnav__item--center.is-active::before { display: none; }

/* drawer → bottom sheet */
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; max-height: 86dvh;
    background: var(--elevated); border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-top: 1px solid var(--hairline); box-shadow: var(--sh-pop);
    transform: translateY(100%); transition: transform .34s var(--ease);
    display: flex; flex-direction: column; overflow: hidden; padding-bottom: var(--safe-b);
}
.sheet.is-open { transform: translateY(0); }
.sheet__grab { width: 40px; height: 4px; border-radius: 99px; background: var(--line-2); margin: 10px auto 4px; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 18px 8px; }
.sheet__body { overflow-y: auto; padding: 6px 18px calc(20px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.drawer__nav { margin-top: 8px; display: flex; flex-direction: column; gap: 12px; }
.drawer__grouphead { display: flex; align-items: center; gap: 10px; font-weight: 660; color: var(--text); padding: 8px 4px; border-radius: var(--r-sm); }
.drawer__grouphead.is-active { color: var(--accent-text); }
.drawer__grouphead svg { color: var(--text-3); }
.drawer__grouphead.is-active svg { color: var(--accent-text); }
.drawer__chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 2px 0 34px; }
.drawer__foot { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.drawer__legal { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; color: var(--text-3); font-size: 13px; }
.drawer__legal a:hover { color: var(--accent-text); }

.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(5,7,12,.5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity: 1; }
.scrim[hidden] { display: none; }

/* 5. COMMAND PALETTE (⌘K) -------------------------------------------------- */
.cmdk { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.cmdk.is-open { display: flex; }
.cmdk__scrim { position: absolute; inset: 0; background: rgba(5,7,12,.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: vt-in .15s ease; }
.cmdk__panel {
    position: relative; width: min(620px, 100%); background: var(--elevated);
    border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-pop);
    overflow: hidden; animation: cmdk-pop .22s var(--spring) both;
}
@keyframes cmdk-pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.cmdk__search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--hairline); }
.cmdk__search svg { color: var(--text-3); }
.cmdk__input { flex: 1; border: 0; background: transparent; outline: none; color: var(--text); font-size: 16px; }
.cmdk__hint { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; }
.cmdk__list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.cmdk__group { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: 10px 12px 6px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text); cursor: pointer; }
.cmdk-item svg { color: var(--text-2); }
.cmdk-item .cmdk-item__sub { color: var(--text-3); font-size: 12.5px; margin-left: auto; white-space: nowrap; }
.cmdk-item__t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item__ic { width: 18px; height: 18px; border-radius: 5px; background: var(--kbg, var(--surface-3)); flex-shrink: 0; }
.cmdk-item.is-active, .cmdk-item:hover { background: var(--accent-soft); color: var(--accent-text); }
.cmdk-item.is-active svg, .cmdk-item:hover svg { color: var(--accent-text); }
.cmdk__empty { padding: 28px; text-align: center; color: var(--text-3); font-size: 14px; }

/* 6. COMPONENTS ------------------------------------------------------------ */
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 760; letter-spacing: -0.03em; }
.brand__mark { display: grid; place-items: center; }
.brand__mark img { width: 28px; height: 28px; border-radius: 7px; display: block; object-fit: contain; }
.brand__word { font-size: 18px; }

.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-sm); color: var(--text-2); transition: background .15s, color .15s, transform .12s; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 17px;
    border-radius: var(--r-sm); font-weight: 600; font-size: 14.5px; white-space: nowrap; transition: background .15s, box-shadow .2s, transform .12s, border-color .15s; }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--sh-1); }
.btn--primary:hover { background: var(--accent-text); transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn--ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--sh-1); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn--block { width: 100%; }
.btn.is-active { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.btn.is-active svg { color: var(--accent); }

.search { display: flex; align-items: center; gap: 9px; flex: 1; max-width: 540px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0 14px; height: 42px; transition: border-color .15s, box-shadow .15s, background .15s; }
.search:focus-within { border-color: var(--accent-line); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.search__icon { color: var(--text-3); display: inline-flex; }
.search__input { flex: 1; border: 0; background: transparent; color: var(--text); height: 100%; outline: none; min-width: 0; }
.search__input::placeholder { color: var(--text-3); }
.search--drawer { display: flex; max-width: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--r-pill);
    background: var(--surface); border: 1px solid var(--line-2); font-size: 13px; font-weight: 550; color: var(--text); box-shadow: var(--sh-1); transition: border-color .15s, color .15s, transform .12s, box-shadow .2s; }
.chip:hover { border-color: var(--accent-line); color: var(--accent-text); box-shadow: var(--sh-2); transform: translateY(-1px); }
.chip svg { color: var(--text-3); transition: color .15s; }
.chip:hover svg { color: var(--accent-text); }
.chip--active, .chip--active:hover { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chips__label { color: var(--text-3); font-size: 13px; font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--r-pill); font-size: 12px; font-weight: 650; }
.badge--soft { background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-line); }

.theme-icon { display: none; }
.theme-icon--dark { display: inline-flex; }
[data-theme="dark"] .theme-icon--dark, :root:not([data-theme]) .theme-icon--dark { display: none; }
[data-theme="dark"] .theme-icon--light, :root:not([data-theme]) .theme-icon--light { display: inline-flex; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .theme-icon--dark { display: none; } :root:not([data-theme]) .theme-icon--light { display: inline-flex; } }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .theme-icon--light { display: none; } :root:not([data-theme]) .theme-icon--dark { display: inline-flex; } }

/* cards & grids */
.grid { display: grid; gap: 13px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid--3 { grid-template-columns: repeat(3,1fr); } .grid--4 { grid-template-columns: repeat(4,1fr); } }

.card { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--hairline);
    border-radius: var(--r-lg); padding: 17px; box-shadow: var(--sh-1); transition: transform .18s var(--ease), box-shadow .2s, border-color .2s; position: relative; overflow: hidden; }
.card::after { content: none; }
.card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-color: var(--accent-line); }
.card:hover::after { opacity: 1; }
.card__icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-text); flex-shrink: 0; }
.card__icon--soft { background: var(--surface-2); color: var(--text-2); }
.card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card__title { font-weight: 650; font-size: 15.5px; letter-spacing: -0.02em; }
.card__desc { color: var(--text-2); font-size: 13px; }
.card__arrow { margin-left: auto; color: var(--text-3); transition: transform .2s, color .2s; }
.card:hover .card__arrow { color: var(--accent-text); transform: translateX(3px); }
.card--soft { flex-direction: column; align-items: flex-start; text-align: left; }
.card--kind.kind-notes .card__icon { background: var(--k-notes-bg); color: var(--k-notes); }
.card--kind.kind-papers .card__icon { background: var(--k-papers-bg); color: var(--k-papers); }
.card--kind.kind-syllabus .card__icon { background: var(--k-syll-bg); color: var(--k-syll); }

.section { margin-top: clamp(26px, 5vw, 46px); }
.section--tight { margin-top: clamp(16px, 3vw, 24px); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.section__title { font-size: clamp(19px, 3vw, 24px); }
.section__link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-weight: 600; font-size: 14px; }

/* hero */
.hero { padding: clamp(22px, 5vw, 46px) 0 6px; }
.hero__inner { max-width: 720px; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-text); font-weight: 650; font-size: 13px; background: var(--accent-soft); border: 1px solid var(--accent-line); padding: 6px 13px; border-radius: var(--r-pill); }
.hero__title { font-size: clamp(32px, 6.4vw, 56px); margin-top: 18px; letter-spacing: -0.045em; font-weight: 760; line-height: 1.04; }
.hero__accent { color: var(--accent); }
.hero__sub { font-size: clamp(15px, 2.4vw, 19px); color: var(--text-2); margin-top: 16px; max-width: 600px; }
.search--hero { max-width: 620px; height: 56px; margin-top: 26px; padding-right: 6px; box-shadow: var(--sh-2); background: var(--surface); border-color: var(--line-2); }
.search--hero .search__input { font-size: 16px; }
.search__go { height: 44px; }
.chips--hero { margin-top: 18px; }

.stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 11px; margin-top: clamp(24px,5vw,38px); }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4,1fr); } }
.stat { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 17px; text-align: center; box-shadow: var(--sh-1); }
.stat__value { font-size: clamp(22px,4vw,30px); font-weight: 680; letter-spacing: -0.04em; color: var(--text); }
.stat__label { color: var(--text-2); font-size: 12.5px; margin-top: 5px; }

.promise { margin-top: clamp(28px,6vw,54px); background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-xl); padding: clamp(20px,4vw,32px); box-shadow: var(--sh-1); }
.promise__inner { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 780px) { .promise__inner { grid-template-columns: repeat(3,1fr); } }
.promise__item { display: flex; gap: 12px; color: var(--text-2); font-size: 14px; }
.promise__item svg { color: var(--accent-text); flex-shrink: 0; }
.promise__item strong { color: var(--text); font-weight: 620; }
.promise__link { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; color: var(--accent-text); font-weight: 600; }

.breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; }
.breadcrumb a:hover { color: var(--accent-text); }
.breadcrumb svg { color: var(--text-3); }
.pagehead { margin: 16px 0 8px; }
.pagehead__title { font-size: clamp(26px,5vw,38px); letter-spacing: -0.04em; }
.pagehead__sub { color: var(--text-2); margin-top: 8px; font-size: 15.5px; max-width: 620px; }
.pagehead .badge { margin-top: 14px; }
.notice { display: flex; gap: 13px; margin-top: 26px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 17px 19px; box-shadow: var(--sh-1); position: relative; }
.notice::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 99px; background: var(--accent-grad); }
.notice svg { color: var(--accent-text); flex-shrink: 0; }
.notice p { color: var(--text-2); margin-top: 4px; font-size: 14px; }

.errorpage { text-align: center; max-width: 520px; margin: clamp(40px,10vw,90px) auto; }
.errorpage__code { font-size: clamp(64px,16vw,120px); font-weight: 800; line-height: 1; letter-spacing: -0.05em; color: var(--text-3); }
.errorpage__title { font-size: clamp(24px,5vw,34px); margin-top: 6px; }
.errorpage__blurb { color: var(--text-2); margin-top: 10px; }
.errorpage__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.errorpage__detail { text-align: left; margin-top: 24px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; font-size: 12px; overflow-x: auto; color: var(--text-2); font-family: var(--font-mono); }

.footer { border-top: 1px solid var(--hairline); background: var(--surface); margin-top: clamp(34px,6vw,62px); }
.footer__inner { max-width: var(--maxw); margin-inline: auto; padding: clamp(28px,5vw,46px) clamp(16px,4vw,28px); display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .footer__inner { grid-template-columns: 1.3fr 3fr; } }
.footer__tagline { color: var(--text-2); font-size: 13.5px; margin-top: 12px; max-width: 320px; }
.footer__cols { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
@media (min-width: 640px) { .footer__cols { grid-template-columns: repeat(5,1fr); } }
.footer__coltitle { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-bottom: 12px; }
.footer__col li { margin-bottom: 9px; }
.footer__col a { color: var(--text-2); font-size: 13.5px; }
.footer__col a:hover { color: var(--accent-text); }
.footer__bar { border-top: 1px solid var(--hairline); padding: 16px clamp(16px,4vw,28px); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; color: var(--text-3); font-size: 12.5px; max-width: var(--maxw); margin-inline: auto; }

/* 7. TABLET (rail) + DESKTOP (full sidebar) -------------------------------- */
@media (min-width: 768px) {
    .app { display: flex; }
    .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; flex-shrink: 0;
        width: var(--rail-w); border-right: 1px solid var(--hairline); background: color-mix(in srgb, var(--surface) 60%, transparent);
        -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); padding: 14px 10px; overflow: hidden; }
    .sidebar__top { display: flex; align-items: center; justify-content: center; height: 42px; }
    .sidebar__collapse { display: none; }
    .sidebar .brand__word { display: none; }
    .sidebar__nav { flex: 1; overflow-y: auto; overflow-x: hidden; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; }
    .navgroup__items { display: none; }
    .navgroup__head { display: flex; align-items: center; justify-content: center; width: 100%; height: 46px; border-radius: var(--r); color: var(--text-2); position: relative; transition: background .15s, color .15s; }
    .navgroup__head .navgroup__label { display: none; }
    .navgroup__head:hover { background: var(--surface-2); color: var(--text); }
    .navgroup__head.is-active { background: var(--accent-soft); color: var(--accent-text); }
    .navgroup__head[data-tip]::after { content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%) scale(.92); transform-origin: left center;
        background: var(--text); color: var(--bg); padding: 6px 11px; border-radius: 9px; font-size: 12.5px; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .14s, transform .14s; box-shadow: var(--sh-2); z-index: 50; }
    .navgroup__head[data-tip]:hover::after { opacity: 1; transform: translateY(-50%) scale(1); }
    .sidebar__foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
    .sidebar__foot .btn span, .sidebar__foot .navlink span { display: none; }
    .sidebar__foot .btn { width: 46px; padding: 0; }
    .sidebar__foot .navlink--muted { width: 46px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: var(--r); color: var(--text-2); }

    .topbar__menu, .topbar__brand, .topbar__searchlink, .topbar__title, .topbar .search { display: none; }
    .topbar .topbar__hide-sm { display: inline-flex; }
    .topbar__cmdk { display: inline-flex; align-items: center; gap: 9px; height: 40px; flex: 1; max-width: 440px; padding: 0 8px 0 14px; border-radius: var(--r-pill);
        background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3); font-size: 14px; transition: border-color .15s, color .15s, box-shadow .15s; }
    .topbar__cmdk:hover { border-color: var(--accent-line); color: var(--text); box-shadow: 0 0 0 4px var(--accent-soft); }
    .topbar__cmdk .topbar__cmdk-label { flex: 1; text-align: left; }
    .topbar__cmdk kbd { font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; color: var(--text-2); background: var(--surface); }
    .bottomnav, .sheet, .scrim { display: none !important; }
    .main { padding-bottom: clamp(22px,4vw,38px); }
}

@media (min-width: 1024px) {
    .sidebar { width: var(--sidebar-w); padding: 16px 12px; overflow-y: auto; }
    .sidebar__top { justify-content: space-between; padding: 0 8px; }
    .sidebar .brand__word { display: inline; }
    .sidebar__collapse { display: inline-flex; width: 32px; height: 32px; }
    .sidebar__nav { gap: 11px; }
    .navgroup__head { justify-content: flex-start; gap: 11px; padding: 0 11px; height: 40px; font-weight: 640; color: var(--text); }
    .navgroup__head .navgroup__label { display: inline; }
    .navgroup__head[data-tip]::after { display: none; }
    .navgroup__icon { color: var(--text-2); display: inline-flex; }
    .navgroup__head.is-active .navgroup__icon { color: var(--accent-text); }
    .navgroup__items { display: flex; flex-direction: column; gap: 1px; margin: 3px 0 2px; padding-left: 7px; }
    .navlink { display: flex; align-items: center; gap: 10px; padding: 7px 11px; border-radius: var(--r-sm); color: var(--text-2); font-size: 13.5px; font-weight: 500; transition: background .14s, color .14s; }
    .navlink:hover { background: var(--surface-2); color: var(--text); }
    .navlink.is-active { color: var(--accent-text); font-weight: 600; background: var(--accent-soft); }
    .navlink__dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .4; margin-left: 5px; flex-shrink: 0; }
    .navlink.is-active .navlink__dot { opacity: 1; }
    .sidebar__foot { align-items: stretch; }
    .sidebar__foot .btn { width: 100%; padding: 0 17px; }
    .sidebar__foot .btn span, .sidebar__foot .navlink span { display: inline; }
    .sidebar__foot .navlink--muted { width: auto; justify-content: flex-start; gap: 10px; padding: 8px 11px; font-size: 13.5px; }

    .app.is-rail .sidebar { width: var(--rail-w); padding: 14px 10px; }
    .app.is-rail .brand__word, .app.is-rail .navgroup__label, .app.is-rail .navgroup__items,
    .app.is-rail .sidebar__foot .btn span, .app.is-rail .sidebar__foot .navlink span { display: none; }
    .app.is-rail .navgroup__head { justify-content: center; padding: 0; height: 46px; }
    .app.is-rail .navgroup__head[data-tip]::after { display: block; }
    .app.is-rail .sidebar__collapse { transform: rotate(180deg); }
    .app.is-rail .sidebar__top { justify-content: center; }
    .app.is-rail .sidebar__foot .btn { width: 46px; padding: 0; }
}

/* 8. STUDY (Phase A) ------------------------------------------------------- */
.kind-notes    { --kc: var(--k-notes);    --kbg: var(--k-notes-bg); }
.kind-papers   { --kc: var(--k-papers);   --kbg: var(--k-papers-bg); }
.kind-syllabus { --kc: var(--k-syll);     --kbg: var(--k-syll-bg); }
.kind-shared   { --kc: var(--accent-text); --kbg: var(--accent-soft); }

.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; margin: 14px 0 18px; }
.toolbar__main { min-width: 0; }
.toolbar__context { color: var(--text-2); font-size: 14px; margin-top: 6px; }
.hubhead { display: flex; align-items: center; gap: 12px; font-size: clamp(24px, 4.5vw, 34px); letter-spacing: -0.035em; font-weight: 680; }
.hubhead__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r); background: var(--kbg); color: var(--kc); flex-shrink: 0; }
.search--mini { height: 40px; max-width: 260px; }
.subhead { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); margin: 26px 0 12px; }
.subhead svg { color: var(--text-3); }

.folder-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.foldercard { display: flex; align-items: center; gap: 12px; padding: 13px 14px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); transition: transform .16s var(--ease), box-shadow .2s, border-color .2s; }
.foldercard:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--accent-line); }
.foldercard__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-text); flex-shrink: 0; }
.foldercard__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.foldercard__name { font-weight: 560; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foldercard__count { color: var(--text-3); font-size: 12.5px; }
.foldercard__open { color: var(--text-3); flex-shrink: 0; }
.foldercard:hover .foldercard__open { color: var(--accent-text); }

.filelist { display: flex; flex-direction: column; gap: 8px; }
.filerow { display: flex; align-items: center; gap: 13px; padding: 12px 15px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); transition: transform .14s var(--ease), box-shadow .2s, border-color .2s; }
.filerow:hover { transform: translateY(-1px); box-shadow: var(--sh-2); border-color: var(--accent-line); }
.filerow__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-sm); background: var(--kbg); color: var(--kc); flex-shrink: 0; }
.filerow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.filerow__title { font-weight: 550; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filerow__meta { color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filerow__tags { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.tag { font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--hairline); padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.filerow__stat { display: inline-flex; align-items: center; gap: 3px; color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.filerow__stat svg { color: var(--ok); }
.filerow__open { color: var(--text-3); flex-shrink: 0; transition: transform .2s, color .2s; }
.filerow:hover .filerow__open { color: var(--accent-text); transform: translateX(2px); }
@media (max-width: 560px) { .filerow__tags .tag { display: none; } }

.facets { display: inline-flex; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 3px; gap: 2px; margin-top: 16px; flex-wrap: wrap; }
.facet { padding: 7px 14px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 550; color: var(--text-2); transition: background .15s, color .15s; }
.facet:hover { color: var(--text); }
.facet.is-active { background: var(--surface); color: var(--accent-text); box-shadow: var(--sh-1); }

.resultcount { color: var(--text-2); font-size: 14.5px; margin: 18px 0 14px; }
.resultcount strong { color: var(--text); }

.emptystate { text-align: center; padding: 40px 20px; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.emptystate__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r-lg); background: var(--surface-2); color: var(--text-3); }

/* study landing big cards */
.study-cards { margin-top: 4px; }
.bigcard { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); transition: transform .16s var(--ease), box-shadow .2s, border-color .2s; }
.bigcard:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-color: var(--accent-line); }
.bigcard__icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: var(--r); background: var(--kbg); color: var(--kc); flex-shrink: 0; }
.bigcard__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.bigcard__title { font-weight: 650; font-size: 17px; letter-spacing: -0.02em; }
.bigcard__desc { color: var(--text-2); font-size: 13.5px; }
.bigcard__open { color: var(--text-3); }
.bigcard:hover .bigcard__open { color: var(--accent-text); }

.kpill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; background: var(--kbg); color: var(--kc); }

/* viewer */
.viewer { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 18px; }
@media (min-width: 900px) { .viewer { grid-template-columns: 1fr 320px; align-items: start; } }
.viewer__title { margin-top: 10px; }
.preview { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 380px; gap: 16px; }
.preview:has(.preview__frame) { padding: 14px; }
.preview__frame { width: 100%; height: min(78vh, 820px); border: 1px solid var(--hairline); border-radius: var(--r); background: var(--bg-2); display: block; }
@media (max-width: 767px) { .preview__frame { height: 70vh; } }
.preview__doc { width: min(260px, 80%); aspect-ratio: 3 / 4; background: var(--bg-2); border: 1px solid var(--hairline); border-radius: var(--r); box-shadow: var(--sh-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 22px; text-align: center; }
.preview__doc-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: var(--r); background: var(--kbg); color: var(--kc); }
.preview__doc-name { font-weight: 560; font-size: 14px; line-height: 1.35; }
.preview__doc-meta { color: var(--text-3); font-size: 12.5px; }
.preview__hint { display: inline-flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 13px; }
.preview__hint svg { color: var(--text-3); }
.vinfo { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 900px) { .vinfo { position: sticky; top: calc(var(--topbar-h) + 16px); } }
.vinfo__quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vinfo__quick .btn { height: 40px; padding: 0 12px; }
.vinfo__rows { display: flex; flex-direction: column; margin-top: 2px; }
.vinfo__row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 9px 2px; border-bottom: 1px solid var(--hairline); font-size: 13.5px; }
.vinfo__row:last-child { border-bottom: 0; }
.vinfo__row .k { color: var(--text-3); }
.vinfo__row .v { font-weight: 550; text-align: right; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--bottomnav-h) + var(--safe-b) + 18px); transform: translateX(-50%) translateY(16px); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 550; box-shadow: var(--sh-pop); opacity: 0; transition: opacity .2s, transform .2s; z-index: 90; pointer-events: none; max-width: 88vw; text-align: center; }
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 768px) { .toast { bottom: 24px; } }

/* 9. FORMS (upload, etc.) -------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 20px; max-width: 720px; margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font-weight: 560; font-size: 14px; }
.input { height: 44px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 15px; transition: border-color .15s, box-shadow .15s; width: 100%; }
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.is-err { border-color: var(--danger); }
.input--file { height: auto; padding: 10px 14px; }
.input--file::file-selector-button { font: inherit; margin-right: 12px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer; }
.field__err { color: var(--danger); font-size: 13px; }
.formgrid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .formgrid { grid-template-columns: 1fr 1fr; } }
.typecards { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .typecards { grid-template-columns: repeat(4, 1fr); } }
.typecard { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; position: relative; }
.typecard input { position: absolute; opacity: 0; pointer-events: none; }
.typecard__ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--kbg); color: var(--kc); }
.typecard__label { font-size: 13px; font-weight: 550; }
.typecard:hover { border-color: var(--accent-line); }
.typecard:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.typecard:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--accent-soft); }
.source-panel { margin-top: 12px; }
.facet input { position: absolute; opacity: 0; }
.facet { cursor: pointer; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.form__note { color: var(--text-3); font-size: 13px; }
.form__note a { color: var(--accent-text); }
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; margin-bottom: 18px; }
.alert--err { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.success { text-align: center; max-width: 540px; margin: clamp(30px, 8vw, 70px) auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.success__icon { display: grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.success__title { font-size: clamp(24px, 5vw, 32px); }
.success__text { color: var(--text-2); }
.success__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* 10. TOOLS (calculators, CV) ---------------------------------------------- */
.toolgrid { margin-top: 4px; }
.toolcard { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.toolcard--wide { grid-column: 1 / -1; }
.toolcard__title { font-size: 16px; font-weight: 640; letter-spacing: -0.02em; }
.toolcard__note { color: var(--text-3); font-size: 12.5px; }
.calc__field { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; font-weight: 550; }
.calc__field small { color: var(--text-3); font-weight: 400; }
.calc__row2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.calc__grid4 { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .calc__grid4 { grid-template-columns: repeat(4, 1fr); } }
.input--area { height: auto; padding: 10px 14px; resize: vertical; line-height: 1.5; }
.result { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; padding: 14px 16px; background: var(--surface-2); border-radius: var(--r); }
.result--lg { align-items: center; padding: 22px; }
.result__value { font-size: clamp(26px, 6vw, 38px); font-weight: 720; letter-spacing: -0.04em; color: var(--accent-text); font-variant-numeric: tabular-nums; line-height: 1.05; }
.result__label { font-size: 12.5px; color: var(--text-2); }
.statusbar { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; }
.statusbar__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: currentColor; }
.statusbar.is-safe { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.statusbar.is-warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.statusbar.is-danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }

.reftable-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.reftable { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
.reftable th, .reftable td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--hairline); }
.reftable th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; }
.reftable tr:last-child td { border-bottom: 0; }
.toolcard .reftable { border: 1px solid var(--hairline); border-radius: var(--r); overflow: hidden; }

.faqlist { display: flex; flex-direction: column; gap: 8px; }
.faq { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); padding: 0 16px; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0; font-weight: 550; font-size: 14.5px; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { color: var(--text-3); transition: transform .2s; flex-shrink: 0; }
.faq[open] summary svg { transform: rotate(90deg); }
.faq p { color: var(--text-2); font-size: 14px; padding: 0 0 16px; }

/* CV builder */
.cvwrap { display: grid; gap: 18px; grid-template-columns: 1fr; margin-top: 6px; }
@media (min-width: 940px) { .cvwrap { grid-template-columns: 1fr 1fr; align-items: start; } }
.cvform { display: flex; flex-direction: column; gap: 14px; }
.cvpreview-wrap { background: var(--surface-2); border-radius: var(--r-lg); padding: 16px; display: flex; justify-content: center; }
@media (min-width: 940px) { .cvpreview-wrap { position: sticky; top: calc(var(--topbar-h) + 16px); } }
.cv-preview { background: #fff; color: #1a1a1a; width: 100%; max-width: 460px; border-radius: 8px; box-shadow: var(--sh-2); padding: 32px 30px; font-size: 12.5px; line-height: 1.5; }
.cv-name { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: #111; }
.cv-headline { color: #0066cc; font-weight: 600; margin-top: 2px; }
.cv-contact { color: #555; font-size: 11.5px; margin-top: 6px; }
.cv-sec { margin-top: 16px; }
.cv-sec h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #0066cc; border-bottom: 1px solid #e5e5e5; padding-bottom: 4px; margin-bottom: 8px; }
.cv-sec p { color: #333; }
.cv-list { display: flex; flex-direction: column; gap: 5px; }
.cv-list li { color: #333; padding-left: 14px; position: relative; }
.cv-list li::before { content: "•"; position: absolute; left: 2px; color: #0066cc; }
.cv-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-skill { background: #eef3fb; color: #0a4da3; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; }

@media print {
    body * { visibility: hidden !important; }
    .cv-preview, .cv-preview * { visibility: visible !important; }
    .cv-preview { position: absolute; left: 0; top: 0; width: 100%; max-width: none; box-shadow: none; border-radius: 0; padding: 0; }
}

/* 11. DIRECTORY (colleges & courses) -------------------------------------- */
.dgrid { display: grid; gap: 11px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.dcard { display: flex; align-items: center; gap: 13px; padding: 14px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); transition: transform .16s var(--ease), box-shadow .2s, border-color .2s; }
.dcard:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--accent-line); }
.dcard__avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 15px; flex-shrink: 0; letter-spacing: -0.02em; }
.dcard__avatar--course { background: var(--surface-2); color: var(--text-2); }
.dcard__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.dcard__name { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 4px; }
.dcard__meta { color: var(--text-3); font-size: 12.5px; }
.dcard__tags { display: flex; gap: 7px; margin-top: 3px; }
.dcard__open { color: var(--text-3); flex-shrink: 0; }
.dcard:hover .dcard__open { color: var(--accent-text); }
.metachip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border-radius: 6px; padding: 2px 8px; }
.metachip svg { color: var(--warn); }
.verified { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--ok); color: #fff; flex-shrink: 0; }
.verified--lg { width: 20px; height: 20px; }

/* leaderboard */
.leaderboard { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 18px 20px; margin-top: 6px; }
.leaderboard__head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.leaderboard__head svg { color: var(--warn); }
.leaderboard__head h2 { font-size: 17px; }
.leaderboard__list { display: flex; flex-direction: column; gap: 10px; }
.lbrow { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; }
.lbrow__rank { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.lbrow__rank--1 { background: #f5c518; color: #3a2c00; }
.lbrow__rank--2 { background: #c9ccd1; color: #2c2f34; }
.lbrow__rank--3 { background: #e0a060; color: #3a1d00; }
.lbrow__name { font-weight: 550; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbrow__name:hover { color: var(--accent-text); }
.lbrow__bar { grid-column: 2 / 3; height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.lbrow__bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.lbrow__xp { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) { .lbrow { grid-template-columns: 26px 1fr auto; } .lbrow__bar { display: none; } }

/* entity hero (college / course) */
.entityhero { display: flex; align-items: center; gap: 16px; margin: 16px 0 18px; flex-wrap: wrap; }
.entityhero__avatar { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 22px; flex-shrink: 0; letter-spacing: -0.02em; }
.entityhero__avatar--course { background: var(--surface-2); color: var(--text-2); }
.entityhero__body { flex: 1; min-width: 220px; }
.entityhero__name { font-size: clamp(24px, 4.5vw, 34px); letter-spacing: -0.035em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entityhero__meta { color: var(--text-2); font-size: 14px; margin-top: 7px; display: flex; align-items: center; gap: 6px; }
.entityhero__meta svg { color: var(--text-3); }
.entityhero__rating { color: var(--text-2); font-size: 14px; margin-top: 4px; display: inline-flex; align-items: center; gap: 5px; }
.entityhero__rating svg { color: var(--warn); }
.entityhero__rating strong { color: var(--text); }

.stattiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
@media (min-width: 640px) { .stattiles { grid-template-columns: repeat(4, 1fr); } }
.stattile { background: var(--surface-2); border-radius: var(--r); padding: 16px; text-align: center; }
.stattile__v { font-size: clamp(20px, 4vw, 26px); font-weight: 700; letter-spacing: -0.03em; color: var(--accent-text); }
.stattile__l { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.entity-desc { color: var(--text-2); font-size: 15px; max-width: 720px; margin-top: 18px; }

/* compare */
.compare-pick { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 4px 0 20px; }
@media (min-width: 640px) { .compare-pick { grid-template-columns: repeat(3, 1fr); } }
.compare-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; background: var(--surface); }
.compare th, .compare td { padding: 12px 16px; border-bottom: 1px solid var(--hairline); text-align: left; }
.compare thead th { font-weight: 650; background: var(--surface-2); }
.compare thead th a:hover { color: var(--accent-text); }
.compare tr:last-child td { border-bottom: 0; }
.compare__k { color: var(--text-3); font-weight: 550; white-space: nowrap; }

/* 12. CAMPUS (events, committees, feed, groups, competitions) -------------- */
.btn--sm { height: 38px; padding: 0 14px; font-size: 13.5px; }
.dcard--static { cursor: default; }
.dcard--static:hover { transform: none; box-shadow: var(--sh-1); border-color: var(--hairline); }
.stattile__v--sm { font-size: clamp(15px, 3vw, 18px); }

/* events */
.egrid { display: grid; gap: 11px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ecard { display: flex; gap: 14px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); transition: transform .16s var(--ease), box-shadow .2s, border-color .2s; }
.ecard:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--accent-line); }
.ecard__date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 54px; height: 56px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-text); flex-shrink: 0; }
.ecard__day { font-size: 20px; font-weight: 720; letter-spacing: -0.03em; line-height: 1; }
.ecard__mon { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ecard__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ecard__top { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.ecard__fee { font-size: 12px; font-weight: 600; color: var(--ok); }
.ecard__title { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ecard__meta { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ecard__meta svg { flex-shrink: 0; }
.ecard__open { color: var(--text-3); flex-shrink: 0; align-self: center; }
.ecard:hover .ecard__open { color: var(--accent-text); }

/* feed */
.feed { display: flex; flex-direction: column; gap: 11px; max-width: 660px; }
.post { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px 18px; }
.post__head { display: flex; align-items: center; gap: 11px; }
.post__avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; flex-shrink: 0; }
.post__who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.post__author { font-weight: 600; font-size: 14px; }
.post__meta { color: var(--text-3); font-size: 12px; }
.post__content { margin-top: 11px; font-size: 14.5px; color: var(--text); line-height: 1.55; }
.post__actions { display: flex; gap: 18px; margin-top: 12px; }
.post__actions button { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; font-weight: 550; transition: color .15s; }
.post__actions button:hover { color: var(--accent-text); }
.composer { display: flex; gap: 11px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px 18px; max-width: 660px; margin-bottom: 16px; }
.composer__body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.composer__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* competitions */
.ccard { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); transition: transform .16s var(--ease), box-shadow .2s, border-color .2s; }
.ccard:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--accent-line); }
.ccard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.ccard__prize { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--text); font-size: 15px; }
.ccard__prize svg { color: var(--warn); }
.ccard__title { font-weight: 650; font-size: 16.5px; letter-spacing: -0.02em; }
.ccard__theme { color: var(--text-2); font-size: 13.5px; }
.ccard__foot { color: var(--text-3); font-size: 12.5px; margin-top: 6px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--live { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.status--upcoming { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.status--closed { background: var(--surface-2); color: var(--text-3); }

/* 13. ACCOUNT, AUTH, BILLING, CONTENT (Phase E) --------------------------- */
.banner-demo { display: flex; align-items: center; gap: 8px; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-line); border-radius: var(--r-sm); padding: 9px 14px; font-size: 13px; font-weight: 550; margin-bottom: 16px; }
.banner-demo--admin { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.filerow--static { cursor: default; }
.filerow--static:hover { transform: none; box-shadow: var(--sh-1); border-color: var(--hairline); }

.acct-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.acct-head__avatar { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 19px; flex-shrink: 0; }
.acct-head__body { flex: 1; min-width: 160px; }
.acct-head__name { font-size: clamp(22px, 4vw, 28px); letter-spacing: -0.03em; }
.acct-head__meta { color: var(--text-2); font-size: 14px; margin-top: 3px; }
.acct-tabs { display: flex; gap: 3px; overflow-x: auto; border-bottom: 1px solid var(--hairline); margin-bottom: 20px; scrollbar-width: none; }
.acct-tabs::-webkit-scrollbar { display: none; }
.acct-tab { padding: 11px 14px; font-size: 14px; font-weight: 550; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; transition: color .15s, border-color .15s; }
.acct-tab:hover { color: var(--text); }
.acct-tab.is-active { color: var(--accent-text); border-bottom-color: var(--accent); }

.threadlist { display: flex; flex-direction: column; gap: 7px; max-width: 660px; }
.thread { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); box-shadow: var(--sh-1); text-align: left; width: 100%; transition: border-color .15s; }
.thread:hover { border-color: var(--accent-line); }
.thread__avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; flex-shrink: 0; }
.thread__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.thread__name { font-weight: 600; font-size: 14px; }
.thread__name small { color: var(--text-3); font-weight: 400; }
.thread__last { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread__ago { display: flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 12px; flex-shrink: 0; }
.thread__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* pricing */
.pricing { display: grid; gap: 14px; grid-template-columns: 1fr; max-width: 980px; margin: 8px auto 0; }
@media (min-width: 800px) { .pricing { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.plan { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 24px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.plan--featured { border: 2px solid var(--accent); box-shadow: var(--sh-3); }
.plan__tag { position: absolute; top: -11px; left: 24px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; padding: 4px 12px; border-radius: var(--r-pill); }
.plan__name { font-size: 17px; }
.plan__price { display: flex; align-items: baseline; gap: 6px; }
.plan__amt { font-size: 32px; font-weight: 760; letter-spacing: -0.04em; }
.plan__per { color: var(--text-3); font-size: 13.5px; }
.plan__features { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.plan__features li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text-2); }
.plan__features svg { color: var(--ok); flex-shrink: 0; margin-top: 2px; }

/* auth */
.authwrap { display: flex; justify-content: center; padding: clamp(20px, 6vw, 60px) 0; }
.authcard { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-2); padding: 28px; text-align: center; }
.authcard__mark { display: inline-flex; margin-bottom: 14px; }
.authcard__title { font-size: 24px; letter-spacing: -0.03em; }
.authcard__sub { color: var(--text-2); font-size: 14px; margin: 8px 0 20px; }
.authbtn { gap: 10px; }
.authdiv { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 16px 0; }
.authdiv::before, .authdiv::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.authcard .form { text-align: left; gap: 14px; }
.authcard__alt { font-size: 14px; color: var(--text-2); margin-top: 18px; }
.authcard__alt a, .authcard__legal a { color: var(--accent-text); }
.authcard__legal { font-size: 12px; color: var(--text-3); margin-top: 14px; }
.authcard--wide { max-width: 460px; }
.authcard--wide .form select.input { width: 100%; }

/* signed-in avatar in the top bar */
.topbar__avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: var(--surface-2); border: 1px solid var(--hairline); flex: 0 0 auto; }
.topbar__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.topbar__initials { font-size: 12px; font-weight: 650; color: var(--text-2); letter-spacing: .02em; }

/* user profile pictures fill their avatar circle (initials show when no picture) */
.post__avatar, .thread__avatar, .entityhero__avatar, .acct-head__avatar, .article__avatar, .artcard__avatar { overflow: hidden; }
.avatar__img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* 1:1 chat thread */
.chat { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.chat__head { display: flex; align-items: center; gap: 10px; }
.flip { transform: rotate(180deg); }
.chat__title { font-size: 18px; letter-spacing: -0.02em; }
.chat__log { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; min-height: 200px; }
.chat__msg { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 78%; }
.chat__msg--me { align-self: flex-end; align-items: flex-end; }
.chat__bubble { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 16px; padding: 9px 13px; font-size: 14.5px; line-height: 1.45; }
.chat__msg--me .chat__bubble { background: var(--accent); color: #fff; border-color: transparent; }
.chat__ago { font-size: 11px; color: var(--text-3); padding: 0 4px; }
.chat__compose { display: flex; gap: 8px; position: sticky; bottom: 0; padding-top: 8px; }
.chat__compose .input { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* flash message */
.flash { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--hairline); background: var(--surface-2); font-size: 14px; color: var(--text); }
.flash__msg { flex: 1; }
.flash__close { color: var(--text-3); font-size: 20px; line-height: 1; background: none; border: 0; cursor: pointer; padding: 0 4px; }
.flash__close:hover { color: var(--text); }
.flash--success { border-color: color-mix(in srgb, #16a34a 40%, var(--hairline)); background: color-mix(in srgb, #16a34a 10%, var(--surface)); }
.flash--error { border-color: color-mix(in srgb, #dc2626 40%, var(--hairline)); background: color-mix(in srgb, #dc2626 10%, var(--surface)); }
.flash--warning { border-color: color-mix(in srgb, #d97706 40%, var(--hairline)); background: color-mix(in srgb, #d97706 10%, var(--surface)); }

/* article / blog */
/* ---- editorial article (blog post) ---- */
.article { max-width: 736px; margin: 0 auto; }
.article__head { padding-bottom: 22px; margin-bottom: 28px; border-bottom: 1px solid var(--hairline); }
.article__title { font-size: clamp(28px, 5vw, 41px); line-height: 1.12; letter-spacing: -0.035em; font-weight: 770; margin-top: 14px; }
.article__lead { color: var(--text-2); font-size: 18.5px; line-height: 1.6; margin-top: 16px; }
.article__metabar { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.article__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: 0 0 auto; letter-spacing: .02em; }
.article__byline { display: flex; flex-direction: column; line-height: 1.35; }
.article__author { font-weight: 600; font-size: 14px; color: var(--text); }
.article__sub { color: var(--text-3); font-size: 13px; }

/* prose body — styles the editor HTML (headings, lists, tables, quotes, links, images) */
.article__body { font-size: 16.5px; line-height: 1.75; color: var(--text-2); }
.article__body > :first-child { margin-top: 0; }
.article__body p { margin: 0 0 18px; }
.article__body h2 { font-size: 24px; font-weight: 720; letter-spacing: -0.022em; color: var(--text); line-height: 1.25; margin: 40px 0 14px; scroll-margin-top: 84px; }
.article__body h3 { font-size: 19.5px; font-weight: 660; letter-spacing: -0.015em; color: var(--text); margin: 30px 0 10px; }
.article__body h4 { font-size: 16.5px; font-weight: 660; color: var(--text); margin: 24px 0 8px; }
.article__body a { color: var(--accent-text); text-decoration: none; border-bottom: 1px solid var(--accent-line); transition: border-color .15s; }
.article__body a:hover { border-bottom-color: var(--accent); }
.article__body strong { color: var(--text); font-weight: 660; }
.article__body ul, .article__body ol { margin: 0 0 18px; padding-left: 26px; }
.article__body li { margin: 7px 0; padding-left: 4px; }
.article__body li::marker { color: var(--text-3); }
.article__body ul li::marker { color: var(--accent); }
.article__body blockquote { margin: 24px 0; padding: 12px 20px; border-left: 3px solid var(--accent); background: var(--surface-2); color: var(--text); border-radius: 0 var(--r) var(--r) 0; }
.article__body blockquote p:last-child { margin-bottom: 0; }
.article__body img { max-width: 100%; height: auto; display: block; margin: 24px auto; border-radius: var(--r-lg); border: 1px solid var(--hairline); }
.article__body hr { border: 0; border-top: 1px solid var(--hairline); margin: 34px 0; }
.article__body code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--hairline); }
.article__body pre { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 16px; overflow-x: auto; margin: 24px 0; }
.article__body pre code { background: none; border: 0; padding: 0; }

/* tables — bordered card, header tint, zebra rows, horizontal scroll on mobile */
.tablewrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--hairline); border-radius: var(--r-md); box-shadow: var(--sh-1); -webkit-overflow-scrolling: touch; }
.article__body table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.article__body th, .article__body td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--hairline); vertical-align: top; line-height: 1.5; }
.article__body th { background: var(--surface-2); font-weight: 660; color: var(--text); }
.article__body tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.article__body tbody tr:last-child td { border-bottom: 0; }

.article__cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--hairline); }
.article__related { margin: 46px auto 0; max-width: 736px; }
.article__related-title { font-size: 18px; font-weight: 660; letter-spacing: -0.02em; margin-bottom: 14px; }

/* ---- blog cards (index) ---- */
.artcard { display: flex; flex-direction: column; gap: 9px; align-items: flex-start; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 22px; transition: transform .16s var(--ease), box-shadow .2s, border-color .2s; }
.artcard:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--accent-line); }
.artcard__title { font-weight: 670; font-size: 17.5px; letter-spacing: -0.02em; line-height: 1.32; color: var(--text); }
.artcard__excerpt { color: var(--text-2); font-size: 14px; line-height: 1.55; }
.artcard__meta { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; margin-top: auto; padding-top: 4px; }
.artcard__avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; font-size: 11px; flex: 0 0 auto; }
.artcard--featured { grid-column: 1 / -1; padding: 26px; }
.artcard--featured .artcard__title { font-size: clamp(21px, 3.2vw, 27px); letter-spacing: -0.03em; }
.artcard--featured .artcard__excerpt { font-size: 15.5px; max-width: 64ch; }
@media (min-width: 720px) { .artcard--featured { gap: 12px; } }
