/* ==================================================================
   Fyreside student portal — refresh layer (2026-10)
   Follows the website editor's PORTAL preview: wordmark + mono eyebrow,
   a welcome line in the template face, hairline cards in the template's
   corner radius, 5px accent progress bars, accent CTAs.

   Scope: .pt-r — set only on the signed-in portal root (Microsite layout)
   and the editor's /dashboard/website/portal-preview root. Loaded after
   portal-themed.css; every rule is prefixed .portal-themed.pt-r so it out-
   ranks the base rule it restyles.

   Theme inputs (all existing creator settings, nothing new):
   - template  → root class a | b | c   (Atelier · Hearth · Studio)
   - mode      → theme-light | theme-dark (storefront palettes kept as-is)
   - accent    → --accent / --on-accent from the layout (MicrositeAccent)
   - fonts     → --pt-hf / --pt-wf / --pt-bf from the layout (font picks)
   ================================================================== */

/* ---------- 1. Tokens ---------- */
.portal-themed.pt-r {
    --pt-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --pt-bf: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --pt-hf: 'Instrument Serif', Georgia, 'Iowan Old Style', serif;   /* headings */
    --pt-wf: var(--pt-hf);                                            /* wordmark + mastheads */
    --pt-hw: 400;              /* heading weight */
    --pt-ww: 400;              /* wordmark / masthead weight */
    --pt-hls: -0.015em;        /* heading tracking */
    --pt-rad: 2px;             /* cards (design: Atelier 2 · Hearth 3 · Studio 0) */
    --pt-btn-rad: 4px;         /* accent CTA */
    --pt-eb-font: var(--pt-mono);
    --pt-eb-size: 10px;
    --pt-eb-track: .13em;
    --pt-eb-case: uppercase;
    --pt-eb-color: var(--ink-3);
    --on-accent: #ffffff;
    --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--bg));
    --pt-track: color-mix(in srgb, var(--ink) 11%, transparent);
    --pt-shadow: none;
    font-family: var(--pt-bf);
    -webkit-font-smoothing: antialiased;
}
/* Hearth — warm journal: Fraunces body headings, script wordmark + eyebrows */
.portal-themed.pt-r.b {
    --pt-hf: 'Fraunces', Georgia, serif;
    --pt-wf: 'Caveat', 'Segoe Script', 'Bradley Hand', cursive;
    --pt-ww: 500;
    --pt-hls: -0.01em;
    --pt-rad: 3px;
    --pt-eb-font: 'Caveat', 'Segoe Script', cursive;
    --pt-eb-size: 17px;
    --pt-eb-track: 0;
    --pt-eb-case: none;
    --pt-eb-color: var(--accent);
}
/* Studio — bold magazine: grotesk 800, square corners */
.portal-themed.pt-r.c {
    --pt-hf: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --pt-wf: var(--pt-hf);
    --pt-hw: 700;
    --pt-ww: 800;
    --pt-hls: -0.035em;
    --pt-rad: 0px;
    --pt-btn-rad: 0px;
}

/* Contrast: muted text ≥ ~6:1 on each template's background (was ~3.3:1).
   Backgrounds, ink and surfaces stay the storefront's own values. */
.portal-themed.pt-r.a.theme-light { --ink-2:#433b32; --ink-3:#5e564b; }
.portal-themed.pt-r.b.theme-light { --ink-2:#55452f; --ink-3:#66563f; --on-accent:#17130e; } /* white on #c87545 is 3.4:1 */
.portal-themed.pt-r.c.theme-light { --ink-2:#36342e; --ink-3:#59554c; }
.portal-themed.pt-r.a.theme-dark  { --ink-2:#c7bdae; --ink-3:#a59d90; }
.portal-themed.pt-r.b.theme-dark  { --ink-2:#cdbda2; --ink-3:#b3a48b; }
.portal-themed.pt-r.c.theme-dark  { --ink-2:#c9c0ad; --ink-3:#a8a092; }
/* Hairlines from the design */
.portal-themed.pt-r.theme-light { --line: rgba(0,0,0,.11); --line-2: rgba(0,0,0,.07); }
.portal-themed.pt-r.theme-dark  { --line: rgba(255,255,255,.13); --line-2: rgba(255,255,255,.08); --pt-track: rgba(255,255,255,.13); --on-accent: #17130e; }
/* Hearth eyebrow in accent is display-size script; on dark the accent is already light. */

/* ---------- 2. Base ---------- */
.portal-themed.pt-r,
.portal-themed.pt-r .scr { background: var(--bg); color: var(--ink); }
.portal-themed.pt-r p,
.portal-themed.pt-r li,
.portal-themed.pt-r input,
.portal-themed.pt-r select,
.portal-themed.pt-r textarea,
.portal-themed.pt-r button { font-family: var(--pt-bf); }
.portal-themed.pt-r :is(h1, h2, h3, h4) {
    font-family: var(--pt-hf) !important;
    font-weight: var(--pt-hw) !important;
    letter-spacing: var(--pt-hls);
    color: var(--ink);
}
/* Studio/Hearth base rules force their own weights on headings; the template weight wins here. */
.portal-themed.pt-r.b :is(h1, h2, h3, h4),
.portal-themed.pt-r.c :is(h1, h2, h3, h4) { font-weight: var(--pt-hw); }
.portal-themed.pt-r :is(h1, h2, h3, h4) em { font-style: italic; color: var(--accent); }
.portal-themed.pt-r.c :is(h1, h2, h3, h4) em { font-style: normal; }
.portal-themed.pt-r ::selection { background: var(--accent); color: var(--on-accent); }

/* Visible focus everywhere (keyboard only) */
.portal-themed.pt-r :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}
.portal-themed.pt-r.theme-dark :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline-color: var(--ink);
}

/* Utility helpers kept for JS that toggles them (checkout pages). */
.portal-themed.pt-r .hidden { display: none !important; }
.portal-themed.pt-r .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- 3. Shell: top bar, tab bar, sidebar ---------- */
.portal-themed.pt-r .portal-main > .portal-topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px 13px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.portal-themed.pt-r .portal-topbar .n {
    min-width: 0;
    font-family: var(--pt-wf) !important;
    font-weight: var(--pt-ww);
    font-size: 19px; line-height: 1.1; letter-spacing: -0.01em;
    text-transform: none;
    color: var(--ink);
}
.portal-themed.pt-r.b .portal-topbar .n { font-size: 23px; }
.portal-themed.pt-r.c .portal-topbar .n { font-size: 17px; letter-spacing: -0.03em; }
.portal-themed.pt-r .portal-topbar .n span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-themed.pt-r .portal-topbar .n .brand-logo { width: 26px; height: 26px; border-radius: var(--pt-rad); }
.portal-themed.pt-r .portal-topbar .r { gap: 12px; flex-shrink: 0; }
.portal-themed.pt-r .pt-eb {
    font-family: var(--pt-mono);
    font-size: 10px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase;
    color: var(--ink-3); white-space: nowrap;
}
.portal-themed.pt-r .portal-topbar .av {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--ink); color: var(--bg);
    font-family: var(--pt-mono); font-size: 11px; font-weight: 600;
}
.portal-themed.pt-r.c .portal-topbar .av { border-radius: 0; }
@media (max-width: 359px) { .portal-themed.pt-r .pt-eb { display: none; } }

.portal-themed.pt-r .tabbar {
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    gap: 0;
}
.portal-themed.pt-r .tabbar .tb {
    position: relative;
    color: var(--ink-3);
    font-size: 10.5px; font-weight: 500; letter-spacing: 0;
    border-radius: 0;
}
.portal-themed.pt-r .tabbar .tb svg { width: 21px; height: 21px; stroke-width: 1.8; }
.portal-themed.pt-r .tabbar .tb.active { color: var(--ink); font-weight: 600; }
.portal-themed.pt-r .tabbar .tb.active::before {
    content: ""; position: absolute; top: -7px; left: 30%; right: 30%;
    height: 2px; background: var(--accent);
}

/* ---------- 4. Screen frame ---------- */
.portal-themed.pt-r .scr { font-size: 14px; }
/* Tablet: drop the floating phone frame — the page is the page. */
@media (min-width: 768px) and (max-width: 1023px) {
    .portal-themed.pt-r { padding: 0; }
    .portal-themed.pt-r .scr {
        max-width: 720px;
        border-radius: 0; box-shadow: none; overflow: visible;
        min-height: calc(100vh - 58px);
    }
    .portal-themed.pt-r .tabbar { max-width: none; }
    .portal-themed.pt-r .portal-main > .portal-topbar { padding-left: max(24px, calc(50% - 344px)); padding-right: max(24px, calc(50% - 344px)); }
}

/* Desktop sidebar: quiet, bg-toned, hairline — the wordmark leads. */
@media (min-width: 1024px) {
    .portal-themed.pt-r .portal-side,
    .portal-themed.pt-r.a .portal-side,
    .portal-themed.pt-r.b .portal-side,
    .portal-themed.pt-r.c .portal-side {
        background: var(--bg);
        color: var(--ink);
        --nav-ink-3: var(--ink-2);
        border-right: 1px solid var(--line);
        padding: 22px 14px 18px;
    }
    .portal-themed.pt-r .portal-side .brand {
        padding: 2px 10px 18px; margin-bottom: 8px;
        border-bottom: 1px solid var(--line);
        align-items: flex-start;
    }
    .portal-themed.pt-r .portal-side .brand .lg { width: 30px; height: 30px; flex-basis: 30px; border-radius: 50%; }
    .portal-themed.pt-r.c .portal-side .brand .lg { border-radius: 0; }
    .portal-themed.pt-r .portal-side .brand .n {
        font-family: var(--pt-wf); font-weight: var(--pt-ww);
        font-size: 20px; line-height: 1.1; letter-spacing: -0.01em; color: var(--ink);
    }
    .portal-themed.pt-r.b .portal-side .brand .n { font-size: 25px; }
    .portal-themed.pt-r.c .portal-side .brand .n { font-size: 17px; letter-spacing: -0.03em; }
    .portal-themed.pt-r .portal-side .brand .sb { font-size: 11.5px; line-height: 1.4; color: var(--ink-3); margin-top: 4px; }
    .portal-themed.pt-r .portal-side .lbl {
        font-family: var(--pt-mono); font-size: 10px; letter-spacing: .13em; color: var(--ink-3);
        padding: 14px 10px 8px;
    }
    .portal-themed.pt-r .portal-side .lnk {
        position: relative;
        padding: 9px 10px; border-radius: var(--pt-rad);
        font-size: 13.5px; color: var(--ink-2);
    }
    .portal-themed.pt-r .portal-side .lnk:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
    .portal-themed.pt-r .portal-side .lnk.active,
    .portal-themed.pt-r.b .portal-side .lnk.active {
        background: var(--surface);
        color: var(--ink); font-weight: 600;
        box-shadow: inset 0 0 0 1px var(--line);
    }
    .portal-themed.pt-r .portal-side .lnk.active::before {
        content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; background: var(--accent);
    }
    .portal-themed.pt-r .portal-side .foot {
        font-family: var(--pt-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
        color: var(--ink-3); border-top: 1px solid var(--line);
    }
    /* Desktop keeps the shell top bar hidden (the sidebar carries the wordmark). */
    .portal-themed.pt-r.portal-root .portal-main > .portal-topbar { display: none; }
}

/* ---------- 5. Shared type: eyebrows, mastheads ---------- */
.portal-themed.pt-r :is(.greeting .kick, .shelf .sh .k, .sh .k, .sh .eye, .lib .head .kick, .lib .head .k,
    .subs .head .kick, .rcp .head .k, .pro .head .eye, .pro .section .title, .cat .mp-subs__kick,
    .pt-eyebrow) {
    font-family: var(--pt-eb-font);
    font-size: var(--pt-eb-size);
    letter-spacing: var(--pt-eb-track);
    text-transform: var(--pt-eb-case);
    color: var(--pt-eb-color);
    font-weight: 500;
    opacity: 1;
}
/* Eyebrow with a rule (storefront: "— VOL. 01") on the page mastheads */
.portal-themed.pt-r :is(.greeting .kick, .lib .head .kick, .subs .head .kick, .rcp .head .k, .pt-eyebrow.rule) {
    display: flex; align-items: center; gap: 11px;
}
.portal-themed.pt-r :is(.greeting .kick, .lib .head .kick, .subs .head .kick, .rcp .head .k, .pt-eyebrow.rule)::before {
    content: ""; width: 30px; height: 1.5px; background: var(--ink); flex-shrink: 0;
}
.portal-themed.pt-r.b :is(.greeting .kick, .lib .head .kick, .subs .head .kick, .rcp .head .k, .pt-eyebrow.rule)::before { background: var(--accent); }

/* Page mastheads in the wordmark face, accent on the emphasised phrase */
.portal-themed.pt-r :is(.home .greeting h1, .lib .head h1, .subs .head h1, .rcp .head h1, .cat .top h1, .pro .head h1, .pt-h1) {
    font-family: var(--pt-wf) !important;
    font-weight: var(--pt-ww) !important;
    letter-spacing: var(--pt-hls);
    line-height: 1.02;
    color: var(--ink);
}
.portal-themed.pt-r.b :is(.home .greeting h1, .lib .head h1, .subs .head h1, .rcp .head h1, .cat .top h1, .pro .head h1, .pt-h1) { line-height: .98; }

/* ---------- 6. Buttons ---------- */
.portal-themed.pt-r .btn {
    border-radius: var(--pt-btn-rad);
    font: 600 13.5px/1.2 var(--pt-bf);
    letter-spacing: 0; text-transform: none;
    padding: 12px 18px; min-height: 44px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.portal-themed.pt-r .btn.primary { background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); }
.portal-themed.pt-r .btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.portal-themed.pt-r .btn.ink { background: var(--ink); color: var(--bg); }
.portal-themed.pt-r .btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.portal-themed.pt-r .btn.ghost:hover { border-color: var(--ink-3); }
.portal-themed.pt-r .btn-sm { padding: 8px 12px; min-height: 36px; font-size: 12.5px; }
.portal-themed.pt-r.c .btn { text-transform: uppercase; letter-spacing: .06em; font-size: 12px; font-weight: 700; }

/* ---------- 7. Cards (one family: surface, hairline, template radius) ---------- */
.portal-themed.pt-r :is(.home .cont, .lib .list .cont, .home .lib .c, .cat .grid .c, .cat .mp-plan, .subs .plan,
    .home .streak, .home .promo, .home .event-card, .pro .menu, .pro-set .menu, .pro .cert .ct,
    .play .daystep, .play .markdone, .play .checkin, .play .out .wk, .pt-card) {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--pt-rad);
    box-shadow: none;
}
.portal-themed.pt-r :is(.home .cont, .lib .list .cont, .home .lib .c, .cat .grid .c) { transition: border-color .15s ease; }
.portal-themed.pt-r :is(.home .cont, .lib .list .cont, .home .lib .c, .cat .grid .c):hover { border-color: color-mix(in srgb, var(--ink) 28%, transparent); }
.portal-themed.pt-r :is(.cat .grid .c .cv, .home .lib .c .cv, .home .promo .c) { border-radius: 0; }
/* Hearth's dashed dividers and Studio's ink outlines give way to the shared hairline */
.portal-themed.pt-r.b :is(.home .cont, .lib .list .cont, .home .lib .c, .cat .grid .c, .home .promo, .home .streak, .pro .menu),
.portal-themed.pt-r.c :is(.home .cont, .lib .list .cont, .home .lib .c, .cat .grid .c, .home .promo, .home .streak, .pro .menu) {
    border: 1px solid var(--line);
    border-radius: var(--pt-rad);
}
.portal-themed.pt-r.c .pro .menu { border: 0; }
.portal-themed.pt-r.b .pro .menu .m { border-bottom-style: solid; }
.portal-themed.pt-r.b .pro .stats > div { border-style: none solid none none; }
.portal-themed.pt-r.b .pro .stats > div:last-child { border-style: none; }
.portal-themed.pt-r.b .play .tabs { border-style: none none solid; }

/* Cover tags: small mono chip */
.portal-themed.pt-r :is(.cont .cover .tag, .home .cont .cover .tag) {
    border-radius: 2px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    color: var(--ink);
    font-family: var(--pt-mono); font-size: 9.5px; letter-spacing: .13em;
    padding: 4px 8px;
}
.portal-themed.pt-r.c .cont .cover .tag { border-radius: 0; }
.portal-themed.pt-r.b .cont .cover .tag,
.portal-themed.pt-r.c .cont .cover .tag { display: inline-flex; }

/* ---------- 8. Progress — 5px accent on a hairline track ---------- */
.portal-themed.pt-r .pt-bar {
    display: block; height: 5px; border-radius: 99px;
    background: var(--pt-track); overflow: hidden; margin-top: 12px;
}
.portal-themed.pt-r .pt-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.portal-themed.pt-r .pt-bar.is-done > i { background: var(--good, var(--accent)); }
/* Body bar replaces the old 3px strip on the cover */
.portal-themed.pt-r :is(.home .cont .cover .bar, .lib .list .cont .cover .bar, .home .lib .c .cv .pr) { display: none !important; }
.portal-themed.pt-r.b .cont .body .k,
.portal-themed.pt-r.c .cont .body .k { display: block; }
.portal-themed.pt-r :is(.play .outline-head .progress, .play .daystep .ctr .pips i) { border-radius: 99px; }
.portal-themed.pt-r .play .outline-head .progress { height: 5px; background: var(--pt-track); }
.portal-themed.pt-r .home .streak .days i { border-radius: 99px; background: var(--pt-track); height: 5px; width: auto; flex: 1; }
.portal-themed.pt-r .home .streak .days i.on { background: var(--accent); }

/* ---------- 9. HOME (/portal) ---------- */
.portal-themed.pt-r .home .greeting { padding: 22px 16px 4px; }
.portal-themed.pt-r .home .greeting .kick { margin-bottom: 14px; }
.portal-themed.pt-r .home .greeting h1 { font-size: 38px; margin: 0; }
.portal-themed.pt-r.b .home .greeting h1 { font-size: 44px; }
.portal-themed.pt-r .home .greeting h1 .pt-dot { color: var(--accent); }
.portal-themed.pt-r .home .greeting h1 em {
    display: block; margin-top: 14px;
    font-family: var(--pt-bf); font-style: normal; font-weight: 400;
    font-size: 16px; line-height: 1.5; letter-spacing: 0;
    color: var(--ink-2);
}
.portal-themed.pt-r .home .empty { margin: 18px 16px 0; padding: 28px 18px; border: 1px dashed var(--line); border-radius: var(--pt-rad); background: var(--surface); }
.portal-themed.pt-r .home .hero { padding: 0 16px; }
.portal-themed.pt-r .home .cont { margin-top: 18px; display: block; color: var(--ink); overflow: hidden; }
.portal-themed.pt-r .home .cont .cover { background: var(--surface-2); }
.portal-themed.pt-r .home .cont .cover .play { background: var(--accent); color: var(--on-accent); }
.portal-themed.pt-r .home .cont .body { padding: 15px 15px 16px; }
.portal-themed.pt-r .home .cont .body .k { font-family: var(--pt-mono); font-size: 10px; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; }
.portal-themed.pt-r .home .cont .body h3 { font-size: 22px; line-height: 1.15; margin: 6px 0 8px; }
.portal-themed.pt-r .home .cont .body .meta { font-size: 12px; color: var(--ink-3); flex-wrap: wrap; gap: 4px 14px; justify-content: flex-start; }
.portal-themed.pt-r .home .cont .body .meta b { font-family: var(--pt-hf); font-weight: var(--pt-hw); font-size: 15px; color: var(--ink); }
.portal-themed.pt-r .home .streak { margin: 12px 16px 0; padding: 15px; gap: 8px; }
.portal-themed.pt-r .home .hero .streak { margin: 12px 0 0; }
.portal-themed.pt-r .home .streak .t { font-family: var(--pt-mono); font-size: 10px; letter-spacing: .13em; color: var(--ink-3); }
.portal-themed.pt-r .home .streak b { font-family: var(--pt-hf); font-weight: var(--pt-hw); font-size: 22px; letter-spacing: var(--pt-hls); color: var(--ink); }
.portal-themed.pt-r .home .streak .d { font-size: 12.5px; color: var(--ink-2); }
.portal-themed.pt-r.c .home .streak { background: var(--surface); color: var(--ink); text-transform: none; letter-spacing: 0; font-family: var(--pt-bf); }
.portal-themed.pt-r.c .home .streak .t { color: var(--ink-3); }
.portal-themed.pt-r.c .home .streak b { color: var(--ink); font-family: var(--pt-hf); }
.portal-themed.pt-r.c .home .streak .d { color: var(--ink-2); }
.portal-themed.pt-r.c .home .streak .days i { background: var(--pt-track); }
.portal-themed.pt-r.c .home .streak .days i.on { background: var(--accent); }

.portal-themed.pt-r .home .sh { padding: 28px 16px 12px; padding-right: 110px; border-bottom: 0; }
.portal-themed.pt-r .home .sh h2 { font-size: 24px; margin: 4px 0 0; line-height: 1.1; }
.portal-themed.pt-r .home .sh .all {
    top: 30px; font-family: var(--pt-mono); font-size: 10px; letter-spacing: .12em; color: var(--ink-2);
    text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px;
}
.portal-themed.pt-r .home .sh .all:hover { color: var(--ink); text-decoration-color: var(--accent); }

/* Library rows on home: per-offer cards (title · meta · bar) */
.portal-themed.pt-r .home .lib { padding: 0 16px; gap: 10px; }
.portal-themed.pt-r .home .lib .c {
    grid-template-columns: 52px minmax(0, 1fr); gap: 4px 14px; align-items: center;
    padding: 14px 15px; color: var(--ink);
}
.portal-themed.pt-r .home .lib .c .cv { width: 52px; height: 52px; grid-row: 1; border-radius: 0; background-color: var(--surface-2); }
.portal-themed.pt-r .home .lib .c .b { display: block; grid-column: 2; min-width: 0; }
.portal-themed.pt-r .home .lib .c .b .k { display: block; font-family: var(--pt-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.portal-themed.pt-r.b .home .lib .c .b .k { font-family: var(--pt-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.portal-themed.pt-r .home .lib .c .b h4 { font-family: var(--pt-hf); font-weight: var(--pt-hw); font-size: 17px; letter-spacing: var(--pt-hls); line-height: 1.2; margin: 0; color: var(--ink); }
.portal-themed.pt-r .home .lib .c .b .p { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 4px; }
.portal-themed.pt-r .home .lib .c .b .p span { font-family: var(--pt-bf); font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.portal-themed.pt-r .home .lib .c .b .p b { font-family: var(--pt-hf); font-weight: var(--pt-hw); font-size: 15px; color: var(--ink); }
.portal-themed.pt-r .home .lib .c .pt-bar { grid-column: 1 / -1; margin-top: 10px; }
@media (max-width: 1023px) {
    .portal-themed.pt-r .home .lib .c .cv:not([style*="url"]) { display: none; }
    .portal-themed.pt-r .home .lib .c:has(.cv:not([style*="url"])) .b { grid-column: 1 / -1; }
}

/* Events */
.portal-themed.pt-r .home .event-card { color: var(--ink); overflow: hidden; }
.portal-themed.pt-r .home .event-date { border-radius: 0; background: transparent; border-right-color: var(--line); }
.portal-themed.pt-r .home .event-date span { color: var(--ink-3); }
.portal-themed.pt-r .home .event-date b { font-family: var(--pt-hf); font-weight: var(--pt-hw); }
.portal-themed.pt-r .home .event-body .k { font-family: var(--pt-mono); color: var(--ink-3); }
.portal-themed.pt-r .home .event-body h4 { font-family: var(--pt-hf); font-weight: var(--pt-hw); }
.portal-themed.pt-r .home .event-body p { color: var(--ink-2); }
.portal-themed.pt-r .home .event-cta { color: var(--accent); font-family: var(--pt-mono); letter-spacing: .1em; }

/* Testimonials: keep the dark card but square it to the template */
.portal-themed.pt-r .home .comm-carousel .comm { border-radius: var(--pt-rad); }
.portal-themed.pt-r .home .comm-carousel .comm p { font-family: var(--pt-hf); font-weight: 400; }
.portal-themed.pt-r.c .home .comm-carousel .comm p { font-family: var(--pt-bf); }
.portal-themed.pt-r .home .comm-carousel .comm .who { color: color-mix(in srgb, var(--bg) 78%, transparent); }
.portal-themed.pt-r .home .comm-carousel > .h { font-family: var(--pt-mono); color: var(--ink-3); }
.portal-themed.pt-r .home .promo { margin: 14px 16px 0; color: var(--ink); border-style: solid; }
.portal-themed.pt-r .home .promo b { font-family: var(--pt-hf); font-weight: var(--pt-hw); }
.portal-themed.pt-r .home .promo .p { font-family: var(--pt-hf); color: var(--accent); }

/* ---------- 10. LIBRARY (/portal/courses) ---------- */
.portal-themed.pt-r .lib .head { padding: 22px 16px 6px; }
.portal-themed.pt-r .lib .head .kick { display: flex; margin-bottom: 12px; }
.portal-themed.pt-r .lib .head h1 { font-size: 34px; margin: 0; }
.portal-themed.pt-r .lib .head .sub { font-family: var(--pt-mono); font-size: 10.5px; letter-spacing: .12em; color: var(--ink-3); margin-top: 10px; }
.portal-themed.pt-r .lib .subtabs { padding: 14px 16px 0; gap: 18px; border-bottom: 1px solid var(--line); }
.portal-themed.pt-r .lib .subtabs .st {
    padding: 10px 0; font-size: 13px; font-weight: 500; color: var(--ink-3);
    font-family: var(--pt-bf); letter-spacing: 0; text-transform: none;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.portal-themed.pt-r .lib .subtabs .st.on { color: var(--ink); border-bottom-color: var(--accent); }
.portal-themed.pt-r .lib .subtabs .st span { border-radius: 99px; font-family: var(--pt-mono); }
.portal-themed.pt-r .lib .subtabs .st.on span { background: var(--accent); color: var(--on-accent); }
.portal-themed.pt-r .lib .list { padding: 16px; gap: 12px; }
.portal-themed.pt-r .lib .list .cont { color: var(--ink); }
.portal-themed.pt-r .lib .list .cont .cover { background: var(--surface-2); }
.portal-themed.pt-r .lib .list .cont .cover .tag.done { background: var(--good); color: #fff; }
.portal-themed.pt-r .lib .list .cont .cover .tag.expired { background: var(--ink-3); color: var(--bg); }
.portal-themed.pt-r .lib .list .cont .body { padding: 15px; }
.portal-themed.pt-r .lib .list .cont .body .k { font-family: var(--pt-mono); font-size: 10px; letter-spacing: .12em; color: var(--ink-3); }
.portal-themed.pt-r .lib .list .cont.done .body .k { color: var(--good); }
.portal-themed.pt-r .lib .list .cont .body h3 { font-size: 20px; margin: 6px 0 6px; line-height: 1.18; }
.portal-themed.pt-r .lib .list .cont .body .meta { font-size: 12px; color: var(--ink-3); gap: 4px 14px; }
.portal-themed.pt-r .lib .list .cont .body .meta b { font-family: var(--pt-hf); font-weight: var(--pt-hw); font-size: 15px; color: var(--ink); }
.portal-themed.pt-r .lib .empty { margin: 20px 16px; padding: 28px 18px; border: 1px dashed var(--line); border-radius: var(--pt-rad); background: var(--surface); display: grid; justify-items: center; gap: 6px; }
.portal-themed.pt-r .lib .empty .k { font-family: var(--pt-mono); font-size: 10px; letter-spacing: .13em; color: var(--ink-3); }
.portal-themed.pt-r .welcome-banner { border-radius: var(--pt-rad) !important; background: var(--surface) !important; border: 1px solid var(--line) !important; border-left: 3px solid var(--accent) !important; margin: 16px 16px 0 !important; }
.portal-themed.pt-r .scr.lib .cont.welcome-video .cover .poster-mark { font-family: var(--pt-wf); font-weight: var(--pt-ww); }

/* ---------- 11. EXPLORE (/portal/marketplace) ---------- */
.portal-themed.pt-r .cat .top { padding: 22px 16px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.portal-themed.pt-r .cat .top h1 { font-size: 32px; }
.portal-themed.pt-r .cat .search { border-radius: var(--pt-btn-rad); background: var(--surface); border-color: var(--line); color: var(--ink-3); padding: 11px 14px; }
.portal-themed.pt-r.b .cat .search { border-radius: 999px; }
.portal-themed.pt-r .cat .search input { color: var(--ink); background: transparent; font-size: 14px; }
.portal-themed.pt-r .cat .chips span,
.portal-themed.pt-r .cat .chips a { border-radius: 999px; background: transparent; border-color: var(--line); color: var(--ink-2); font-family: var(--pt-mono); font-size: 10.5px; letter-spacing: .1em; padding: 7px 12px; }
.portal-themed.pt-r.c .cat .chips a { border-radius: 0; }
.portal-themed.pt-r .cat .chips a.on,
.portal-themed.pt-r .cat .chips span.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.portal-themed.pt-r .cat .flagship { border-radius: var(--pt-rad); }
.portal-themed.pt-r .cat .flagship .body h3 { color: var(--bg); }
.portal-themed.pt-r .cat .flagship .body p { color: color-mix(in srgb, var(--bg) 80%, transparent); }
.portal-themed.pt-r .cat .flagship .body .k { color: color-mix(in srgb, var(--accent) 70%, var(--bg)); }
.portal-themed.pt-r .cat .flagship .body .meta span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.portal-themed.pt-r .cat .flagship .body .row .p span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.portal-themed.pt-r .cat .flagship .cover .live { border-radius: 2px; color: var(--on-accent); }
.portal-themed.pt-r .cat .grid .c { color: var(--ink); }
.portal-themed.pt-r .cat .grid .c .cv { background-color: var(--surface-2); }
.portal-themed.pt-r .cat .grid .c .b { padding: 12px 12px 13px; }
.portal-themed.pt-r .cat .grid .c .b .k { font-family: var(--pt-mono); font-size: 9.5px; color: var(--ink-3); }
.portal-themed.pt-r .cat .grid .c .b h4 { font-size: 16px; line-height: 1.2; margin: 4px 0 6px; }
.portal-themed.pt-r .cat .grid .c .b .p { font-family: var(--pt-hf); font-weight: var(--pt-hw); color: var(--ink); font-size: 15px; }
.portal-themed.pt-r .cat .grid .c .b .r > span:first-child { color: var(--ink-3); }
.portal-themed.pt-r .scr.cat .mp-subs__title { font-family: var(--pt-hf); font-weight: var(--pt-hw); font-size: 24px; }
.portal-themed.pt-r .scr.cat .mp-plan.is-active,
.portal-themed.pt-r .subs .plan.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.portal-themed.pt-r .scr.cat .mp-plan__row h3,
.portal-themed.pt-r .subs .plan .row h3 { font-size: 20px; }
.portal-themed.pt-r .scr.cat .mp-plan__price strong,
.portal-themed.pt-r .subs .plan .price strong { font-family: var(--pt-hf); font-weight: var(--pt-hw); letter-spacing: var(--pt-hls); }
.portal-themed.pt-r :is(.scr.cat .mp-plan__badge, .subs .plan .badge) { border-radius: 2px; color: var(--on-accent); }
.portal-themed.pt-r :is(.scr.cat .mp-plan__cta .btn, .subs .plan .cta .btn, .subs .empty .btn.ghost) { border-radius: var(--pt-btn-rad); min-height: 44px; }
.portal-themed.pt-r :is(.scr.cat .mp-plan__cta .btn.cancel, .subs .plan .cta .btn.cancel) {
    background: transparent; color: var(--ink-2); border: 1px solid var(--line);
}
.portal-themed.pt-r :is(.scr.cat .mp-plan__cta .btn.cancel, .subs .plan .cta .btn.cancel):hover { color: var(--accent); border-color: var(--accent); }
.portal-themed.pt-r :is(.scr.cat .mp-plan__cta .active-line, .subs .plan .cta .active-line) { color: var(--ink-2); }
.portal-themed.pt-r .scr.cat .mp-divider::before,
.portal-themed.pt-r .scr.cat .mp-divider::after { background: var(--line); }

/* ---------- 12. MEMBERSHIPS (/portal/subscriptions) ---------- */
.portal-themed.pt-r .subs .head { padding: 22px 16px 6px; }
.portal-themed.pt-r .subs .head .kick { margin-bottom: 12px; }
.portal-themed.pt-r .subs .head h1 { font-size: 34px; }
.portal-themed.pt-r .subs .head .sub { font-family: var(--pt-mono); color: var(--ink-3); margin-top: 10px; }
.portal-themed.pt-r .subs .grid { padding: 16px; }
.portal-themed.pt-r .subs .plan > .cover { background: var(--surface-2); }
.portal-themed.pt-r .subs .plan > :not(.cover) { margin-left: 16px; margin-right: 16px; }
.portal-themed.pt-r .subs .plan > .active-line { font-family: var(--pt-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.portal-themed.pt-r .subs .empty { border-radius: var(--pt-rad); }

/* ---------- 13. RECEIPTS (/portal/payments) ---------- */
.portal-themed.pt-r .scr.rcp .head { padding: 22px 16px 12px; }
.portal-themed.pt-r .scr.rcp .head .k { margin-bottom: 12px; }
.portal-themed.pt-r .scr.rcp .head h1 { font-size: 34px; margin: 0 0 14px; }
.portal-themed.pt-r .scr.rcp .head .sub { color: var(--ink-2); font-size: 13px; }
.portal-themed.pt-r .scr.rcp .head .sub .t { font-family: var(--pt-mono); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.portal-themed.pt-r .scr.rcp .head .sub b { font-family: var(--pt-hf); font-weight: var(--pt-hw); letter-spacing: var(--pt-hls); font-size: 24px; color: var(--ink); }
.portal-themed.pt-r .scr.rcp .head .sub .c { color: var(--ink-3); font-size: 12px; }
.portal-themed.pt-r .scr.rcp .list { gap: 8px; padding: 6px 16px 8px; }
.portal-themed.pt-r .scr.rcp .list .r { border: 1px solid var(--line); border-radius: var(--pt-rad); background: var(--surface); padding: 14px 15px; }
.portal-themed.pt-r.b .scr.rcp .list .r + .r { border-top-style: solid; }
.portal-themed.pt-r .scr.rcp .list .r .dt b,
.portal-themed.pt-r .scr.rcp .list .r .amt { font-family: var(--pt-hf); font-weight: var(--pt-hw); letter-spacing: var(--pt-hls); color: var(--ink); }
.portal-themed.pt-r .scr.rcp .list .r .bd .ttl { font-family: var(--pt-bf); font-weight: 600; font-size: 14.5px; color: var(--ink); }
.portal-themed.pt-r .scr.rcp .list .r .bd .meta,
.portal-themed.pt-r .scr.rcp .list .r .dt span { color: var(--ink-3); font-size: 9.5px; }
.portal-themed.pt-r .scr.rcp .list .r .bd .badge { border-radius: 2px; font-size: 9px; padding: 4px 7px; }
.portal-themed.pt-r .scr.rcp .list .r .bd .badge.ok { color: var(--ink); background: color-mix(in srgb, var(--good) 18%, transparent); }
.portal-themed.pt-r .scr.rcp .list .r .bd .badge.no { color: var(--ink); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.portal-themed.pt-r .scr.rcp .list .r .bd .badge.pend { color: var(--ink-2); }
.portal-themed.pt-r .scr.rcp .empty { border-radius: var(--pt-rad); background: var(--surface); }
.portal-themed.pt-r .scr.rcp .foot { margin: 14px 16px 0; border-radius: var(--pt-rad); background: transparent; border: 1px dashed var(--line); color: var(--ink-2); font-size: 12.5px; }
@media (min-width: 1024px) {
    .portal-themed.pt-r .scr.rcp { padding-left: 0; margin: 0; }
    .portal-themed.pt-r .scr.rcp .head { padding: 0 40px 18px; }
    .portal-themed.pt-r .scr.rcp .list { padding: 4px 40px 8px; max-width: 900px; }
    .portal-themed.pt-r .scr.rcp .foot { margin: 14px 40px 0; max-width: 820px; }
}

/* ---------- 14. PROFILE + ACCOUNT ---------- */
.portal-themed.pt-r .pro .head { border-bottom: 1px solid var(--line); padding: 22px 16px; }
.portal-themed.pt-r .pro .head .av { background: var(--ink); color: var(--bg); font-family: var(--pt-wf); font-weight: var(--pt-ww); }
.portal-themed.pt-r.c .pro .head .av { border-radius: 0; }
.portal-themed.pt-r .pro .head h1 { font-size: 30px; }
.portal-themed.pt-r .pro .head .h { color: var(--ink-3); }
.portal-themed.pt-r .pro .stats { border-bottom: 1px solid var(--line); }
.portal-themed.pt-r .pro .stats > div { border-right-color: var(--line); }
.portal-themed.pt-r .pro .stats > div b,
.portal-themed.pt-r.b .pro .stats > div b,
.portal-themed.pt-r.c .pro .stats > div b { font-family: var(--pt-hf); font-weight: var(--pt-hw); letter-spacing: var(--pt-hls); color: var(--ink); }
.portal-themed.pt-r .pro .stats > div span { color: var(--ink-3); }
.portal-themed.pt-r .pro .section .title { margin-bottom: 9px; }
.portal-themed.pt-r.c .pro .section { border-bottom-color: var(--line); }
.portal-themed.pt-r :is(.pro .menu .m, .pro-set .menu .m) { border-bottom-color: var(--line); color: var(--ink); min-height: 48px; }
.portal-themed.pt-r :is(.pro .menu .m, .pro-set .menu .m):hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.portal-themed.pt-r .pro .menu .m b,
.portal-themed.pt-r.b .pro .menu .m b,
.portal-themed.pt-r.c .pro .menu .m b { font-family: var(--pt-bf); font-weight: 600; font-size: 13.5px; }
.portal-themed.pt-r .pro .menu .m .r { color: var(--ink-3); }
.portal-themed.pt-r .pro .cert .ct b { font-family: var(--pt-hf); font-weight: var(--pt-hw); }
.portal-themed.pt-r.b .pro .cert .ct { transform: none; }
.portal-themed.pt-r .pro .cert .ct .sig { font-family: 'Caveat', cursive; }
/* Account settings form controls */
.portal-themed.pt-r :is(.m-input, .pro-set input[type="text"], .pro-set input[type="email"], .pro-set input[type="tel"], .pro-set input[type="password"], .pro-set select, .pro-set textarea) {
    background: var(--bg); color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--pt-btn-rad);
    font-family: var(--pt-bf); font-size: 15px; min-height: 44px;
}
.portal-themed.pt-r :is(.m-input, .pro-set input, .pro-set select, .pro-set textarea):focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.portal-themed.pt-r .m-cta { border-radius: var(--pt-btn-rad); }
.portal-themed.pt-r .m-lbl, .portal-themed.pt-r .m-hint { color: var(--ink-3); }

/* ---------- 15. PLAYER ---------- */
.portal-themed.pt-r .play > .top { background: color-mix(in srgb, var(--bg) 94%, transparent); border-bottom-color: var(--line); }
.portal-themed.pt-r .play > .top .x { border-radius: var(--pt-btn-rad); background: transparent; border: 1px solid var(--line); }
.portal-themed.pt-r .play > .top .crumb { color: var(--ink-3); }
.portal-themed.pt-r .play .lhead .crumb b { color: var(--accent); }
.portal-themed.pt-r .play .lhead h1 { font-size: 26px; line-height: 1.12; }
.portal-themed.pt-r.b .play .lhead h1 { font-family: var(--pt-hf); }
.portal-themed.pt-r .play .lhead .meta { color: var(--ink-3); }
.portal-themed.pt-r .play .daystep .nav { background: transparent; }
.portal-themed.pt-r .play .daystep .ctr { border-color: var(--line); }
.portal-themed.pt-r .play .daystep .ctr .pips i { height: 5px; background: var(--pt-track); }
.portal-themed.pt-r .play .daystep .ctr .pips i.on { background: var(--accent); }
.portal-themed.pt-r .play .markdone .ck { border-radius: var(--pt-btn-rad); }
.portal-themed.pt-r .play .markdone.done .ck { color: var(--on-accent); }
.portal-themed.pt-r .play .tabs { background: transparent; border-bottom-color: var(--line); gap: 2px; }
.portal-themed.pt-r .play .tabs .t { border-radius: 0; background: transparent; border: 0; color: var(--ink-3); font-size: 10.5px; letter-spacing: .12em; }
.portal-themed.pt-r .play .tabs .t:hover { background: transparent; color: var(--ink); }
.portal-themed.pt-r .play .tabs .t.on { background: transparent; color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border: 0; }
.portal-themed.pt-r .play .tabs .t .c { border-radius: 99px; background: var(--pt-track); color: var(--ink-2); }
.portal-themed.pt-r .play .tabs .t.on .c,
.portal-themed.pt-r .play .tabs .t.hot .c { background: var(--accent); color: var(--on-accent); }
.portal-themed.pt-r .play .pane p { color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.portal-themed.pt-r .play :is(.pane img, .pane iframe, .pane video) { border-radius: var(--pt-rad); }
.portal-themed.pt-r .play :is(.my-notes textarea, .my-feedback textarea) {
    border-radius: var(--pt-btn-rad); background: var(--surface); border-color: var(--line); font-family: var(--pt-bf);
}
.portal-themed.pt-r .play :is(.my-notes textarea, .my-feedback textarea):focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.portal-themed.pt-r .play :is(.my-notes .status, .my-feedback .status, .my-notes .hint, .my-feedback .hint) { color: var(--ink-3); }
.portal-themed.pt-r .play .checkin .ck-frame { border-radius: var(--pt-rad); border-color: var(--line); }
.portal-themed.pt-r .play :is(.checkin .ck-num, .checkin .ck-pill, .lhead h1 .checkin-mark) { border-radius: 2px; }
.portal-themed.pt-r .play .checkin .ck-num,
.portal-themed.pt-r .play .lhead h1 .checkin-mark:not(.done) { color: var(--on-accent); }
.portal-themed.pt-r .play .outline-head h2 { font-family: var(--pt-hf); font-weight: var(--pt-hw); letter-spacing: var(--pt-hls); }
.portal-themed.pt-r .play .out .wk { overflow: hidden; }
.portal-themed.pt-r .play .out .wkh { background: transparent; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.portal-themed.pt-r .play .out .dayh { border-top-style: solid; border-top-color: var(--line-2); color: var(--ink-3); }
.portal-themed.pt-r .play .out .les { border-radius: var(--pt-rad); padding-left: 6px; padding-right: 6px; }
.portal-themed.pt-r .play .out .les .num { border-radius: var(--pt-btn-rad); border-color: var(--line); }
.portal-themed.pt-r .play .out .les.done .num { color: var(--on-accent); }
.portal-themed.pt-r .play .out .les.now { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.portal-themed.pt-r .play .out .les .name span { color: var(--ink-3); }
@media (min-width: 1024px) {
    .portal-themed.pt-r .play .sidebar { background: var(--bg); border-left-color: var(--line); }
    .portal-themed.pt-r .play .lhead h1 { font-size: 32px; }
}

/* ---------- 16. Shared page kit (Conversations, Checkout, Club) ---------- */
.portal-themed.pt-r .pt-page {
    max-width: 920px; margin: 0 auto;
    padding: 22px 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 28px);
    color: var(--ink);
}
@media (min-width: 768px) { .portal-themed.pt-r .pt-page { padding: 32px 28px 56px; } }
@media (min-width: 1024px) { .portal-themed.pt-r .pt-page { padding: 40px 40px 64px; margin: 0; } }
.portal-themed.pt-r .pt-crumb {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-family: var(--pt-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink-3); margin-bottom: 16px;
}
.portal-themed.pt-r .pt-crumb a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.portal-themed.pt-r .pt-crumb a:hover { color: var(--ink); text-decoration-color: var(--accent); }
.portal-themed.pt-r .pt-crumb [aria-current] { color: var(--ink); }
.portal-themed.pt-r .pt-h1 { font-size: 34px; margin: 0 0 6px; }
@media (min-width: 768px) { .portal-themed.pt-r .pt-h1 { font-size: 44px; } }
.portal-themed.pt-r .pt-h1 .pt-dot { color: var(--accent); }
.portal-themed.pt-r .pt-lede { margin: 12px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); max-width: 62ch; }
.portal-themed.pt-r .pt-head { margin-bottom: 26px; }
.portal-themed.pt-r .pt-head .pt-eyebrow { margin-bottom: 14px; }
.portal-themed.pt-r .pt-stack { display: grid; gap: 14px; }
.portal-themed.pt-r .pt-card { padding: 16px; min-width: 0; }
@media (min-width: 768px) { .portal-themed.pt-r .pt-card { padding: 22px; } }
.portal-themed.pt-r .pt-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.portal-themed.pt-r .pt-card-head h2 { font-size: 21px; line-height: 1.15; margin: 6px 0 0; }
.portal-themed.pt-r .pt-count {
    flex-shrink: 0; min-width: 28px; text-align: center;
    font-family: var(--pt-mono); font-size: 11px; font-weight: 600;
    padding: 4px 8px; border-radius: 99px;
    background: var(--accent-soft); color: var(--ink);
}
.portal-themed.pt-r .pt-muted { color: var(--ink-3); font-size: 13.5px; margin: 0; }
.portal-themed.pt-r .pt-empty {
    border: 1px dashed var(--line); border-radius: var(--pt-rad);
    padding: 18px; font-size: 14px; color: var(--ink-3); background: var(--bg);
}
.portal-themed.pt-r .pt-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    font-family: var(--pt-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}
.portal-themed.pt-r .pt-meta .pt-accent { color: var(--accent); }
.portal-themed.pt-r.theme-light .pt-meta .pt-accent { color: color-mix(in srgb, var(--accent) 80%, var(--ink)); }
.portal-themed.pt-r .pt-quote {
    margin-top: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.55; color: var(--ink);
    background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--pt-rad);
}
.portal-themed.pt-r .pt-quote p { margin: 0; white-space: pre-wrap; }
.portal-themed.pt-r .pt-quote .pt-meta { margin-bottom: 6px; }
.portal-themed.pt-r .pt-quote.is-reply { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.portal-themed.pt-r .pt-quote.is-reply .pt-meta { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.portal-themed.pt-r .pt-link {
    display: inline-flex; margin-top: 8px;
    font-family: var(--pt-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px;
}
.portal-themed.pt-r .pt-item { border: 1px solid var(--line-2); border-radius: var(--pt-rad); background: var(--bg); padding: 14px; }
.portal-themed.pt-r .pt-item h3 { font-size: 18px; margin: 8px 0 2px; line-height: 1.2; }

/* Conversations */
.portal-themed.pt-r .pt-selfie { display: grid; gap: 14px; }
@media (min-width: 640px) { .portal-themed.pt-r .pt-selfie { grid-template-columns: 180px minmax(0, 1fr); } }
.portal-themed.pt-r .pt-selfie-img {
    display: block; overflow: hidden; border: 1px solid var(--line); border-radius: var(--pt-rad); background: var(--surface-2);
    min-height: 160px;
}
.portal-themed.pt-r .pt-selfie-img img { display: block; width: 100%; height: 100%; max-height: 260px; object-fit: contain; }
.portal-themed.pt-r .pt-selfie-img .pt-noimg { display: grid; place-items: center; height: 160px; font-family: var(--pt-mono); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.portal-themed.pt-r .pt-thread { display: grid; gap: 14px; }
.portal-themed.pt-r .pt-msg { display: grid; gap: 4px; max-width: min(520px, 88%); }
.portal-themed.pt-r .pt-msg.is-me { justify-self: end; justify-items: end; }
.portal-themed.pt-r .pt-msg .pt-meta { font-size: 9.5px; }
.portal-themed.pt-r .pt-bubble {
    padding: 10px 14px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere;
    background: var(--surface-2); color: var(--ink);
    border-radius: 14px 14px 14px 3px;
}
.portal-themed.pt-r .pt-msg.is-me .pt-bubble { background: var(--accent); color: var(--on-accent); border-radius: 14px 14px 3px 14px; }
.portal-themed.pt-r.c .pt-bubble,
.portal-themed.pt-r.c .pt-msg.is-me .pt-bubble { border-radius: 0; }
.portal-themed.pt-r .pt-bubble span { white-space: pre-wrap; }
.portal-themed.pt-r .pt-bubble :is(img, video) { display: block; max-width: min(280px, 100%); border-radius: 8px; margin-bottom: 6px; }
.portal-themed.pt-r .pt-bubble audio { max-width: 100%; margin-bottom: 6px; }
.portal-themed.pt-r .pt-bubble .pt-dl { color: inherit; text-decoration: underline; font-size: 13px; }
.portal-themed.pt-r .pt-pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.portal-themed.pt-r .pt-pager a {
    min-width: 44px; min-height: 44px; padding: 0 14px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: var(--pt-btn-rad);
    font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: var(--surface);
}
.portal-themed.pt-r .pt-pager a:hover { color: var(--ink); border-color: var(--ink-3); }
.portal-themed.pt-r .pt-pager a[aria-current] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Checkout */
.portal-themed.pt-r .pt-co { max-width: 760px; }
.portal-themed.pt-r .pt-co-card { padding: 0; }  /* no overflow clip: the total bar is position:sticky */
.portal-themed.pt-r .pt-co-cover { border-radius: var(--pt-rad) var(--pt-rad) 0 0; }
@media (min-width: 640px) { .portal-themed.pt-r .pt-co-cover { border-radius: var(--pt-rad) 0 0 0; } }
.portal-themed.pt-r .pt-co-item { display: grid; }
@media (min-width: 640px) { .portal-themed.pt-r .pt-co-item { grid-template-columns: 200px minmax(0, 1fr); } }
.portal-themed.pt-r .pt-co-cover { aspect-ratio: 16/9; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; }
@media (min-width: 640px) { .portal-themed.pt-r .pt-co-cover { aspect-ratio: auto; min-height: 140px; } }
.portal-themed.pt-r .pt-co-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.portal-themed.pt-r .pt-co-cover svg { width: 44px; height: 44px; color: var(--ink-3); }
.portal-themed.pt-r .pt-co-body { padding: 18px; min-width: 0; }
.portal-themed.pt-r .pt-co-body h2 { font-size: 22px; line-height: 1.15; margin: 8px 0 0; }
.portal-themed.pt-r .pt-co-body p { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.portal-themed.pt-r .pt-co-body ul { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.portal-themed.pt-r .pt-sec { border-top: 1px solid var(--line); padding: 18px; }
.portal-themed.pt-r .pt-sec > * + * { margin-top: 10px; }
.portal-themed.pt-r .pt-note { border-top: 1px solid var(--line); padding: 14px 18px 14px 15px; border-left: 3px solid var(--ink-3); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); }
.portal-themed.pt-r .pt-note b, .portal-themed.pt-r .pt-note strong { display: block; font-weight: 700; margin-bottom: 2px; }
.portal-themed.pt-r .pt-note p { margin: 0; }
.portal-themed.pt-r .pt-note.is-ok   { border-left-color: var(--good); background: color-mix(in srgb, var(--good) 9%, var(--bg)); }
.portal-themed.pt-r .pt-note.is-warn { border-left-color: var(--warn, #b07330); background: color-mix(in srgb, var(--warn, #b07330) 10%, var(--bg)); }
.portal-themed.pt-r .pt-note.is-bad  { border-left-color: #c2410c; background: color-mix(in srgb, #c2410c 9%, var(--bg)); }
.portal-themed.pt-r .pt-note.is-info { border-left-color: var(--accent); background: var(--accent-soft); }
.portal-themed.pt-r .pt-label {
    display: block; margin-bottom: 6px;
    font-family: var(--pt-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}
.portal-themed.pt-r .pt-help { font-size: 12.5px; color: var(--ink-3); margin: 0; }
.portal-themed.pt-r .pt-grid2 { display: grid; gap: 12px; }
@media (min-width: 640px) { .portal-themed.pt-r .pt-grid2 { grid-template-columns: 1fr 1fr; } }
.portal-themed.pt-r .pt-input {
    width: 100%; min-height: 46px; padding: 10px 12px;
    font: 400 15px/1.3 var(--pt-bf); color: var(--ink);
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--pt-btn-rad);
    appearance: none; -webkit-appearance: none;
}
.portal-themed.pt-r select.pt-input {
    padding-right: 34px;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px; background-repeat: no-repeat;
}
.portal-themed.pt-r .pt-input::placeholder { color: color-mix(in srgb, var(--ink-3) 80%, transparent); }
.portal-themed.pt-r .pt-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.portal-themed.pt-r .pt-input:disabled,
.portal-themed.pt-r .pt-input.bg-slate-50 { background-color: var(--surface-2); color: var(--ink-2); }
.portal-themed.pt-r .pt-input.is-code { text-transform: uppercase; letter-spacing: .08em; font-family: var(--pt-mono); }
.portal-themed.pt-r .pt-row { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 640px) { .portal-themed.pt-r .pt-row { flex-direction: row; align-items: center; } .portal-themed.pt-r .pt-row > .pt-input { flex: 1; } }
.portal-themed.pt-r .pt-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 11px 18px;
    font: 600 14px/1.2 var(--pt-bf); letter-spacing: 0;
    border-radius: var(--pt-btn-rad); border: 1px solid var(--line);
    background: transparent; color: var(--ink); cursor: pointer; text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.portal-themed.pt-r .pt-btn:hover { border-color: var(--ink-3); }
.portal-themed.pt-r .pt-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.portal-themed.pt-r .pt-btn.is-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.portal-themed.pt-r .pt-btn.is-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.portal-themed.pt-r .pt-btn.is-ink { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.portal-themed.pt-r .pt-btn.is-big { min-height: 56px; padding: 14px 26px; font-size: 15.5px; }
.portal-themed.pt-r .pt-btn:disabled { opacity: .7; cursor: wait; }
.portal-themed.pt-r.c .pt-btn { text-transform: uppercase; letter-spacing: .06em; font-size: 12.5px; font-weight: 700; }
.portal-themed.pt-r .pt-textlink {
    background: none; border: 0; padding: 6px 0; cursor: pointer;
    font: 600 13.5px/1.3 var(--pt-bf); color: var(--ink-2);
    text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px;
}
.portal-themed.pt-r .pt-textlink:hover { color: var(--ink); text-decoration-color: var(--accent); }
.portal-themed.pt-r .pt-textlink.is-danger:hover { color: #c2410c; text-decoration-color: #c2410c; }
.portal-themed.pt-r .pt-total-bar {
    border-top: 1px solid var(--line); padding: 16px 18px;
    display: flex; flex-direction: column; gap: 14px;
    background: var(--surface);
}
@media (max-width: 1023px) {
    /* sticks above the bottom tab bar on phones/tablets */
    .portal-themed.pt-r .pt-total-bar.is-sticky {
        position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) - 4px); z-index: 20;
        box-shadow: 0 -16px 32px -24px rgba(0,0,0,.45);
    }
}
@media (min-width: 640px) { .portal-themed.pt-r .pt-total-bar { flex-direction: row; align-items: center; justify-content: space-between; padding: 18px 22px; } }
.portal-themed.pt-r .pt-total-bar .pt-btn { width: 100%; }
@media (min-width: 640px) { .portal-themed.pt-r .pt-total-bar .pt-btn { width: auto; } }
.portal-themed.pt-r .pt-total-k { font-family: var(--pt-mono); font-size: 10px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.portal-themed.pt-r .pt-total {
    font-family: var(--pt-wf); font-weight: var(--pt-ww); letter-spacing: var(--pt-hls);
    font-size: 34px; line-height: 1.05; color: var(--ink); margin: 2px 0 0;
}
.portal-themed.pt-r.b .pt-total { font-family: var(--pt-hf); }
.portal-themed.pt-r .pt-secure { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); text-align: center; }
@media (min-width: 640px) { .portal-themed.pt-r .pt-secure { text-align: right; } }
.portal-themed.pt-r .pt-status { padding: 0 18px 16px; margin: 0; font-size: 13px; color: var(--ink-2); background: var(--surface); }
.portal-themed.pt-r .pt-after { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; padding: 0 2px; }
@media (min-width: 640px) { .portal-themed.pt-r .pt-after { flex-direction: row; align-items: center; justify-content: space-between; } }
.portal-themed.pt-r .pt-opts { display: grid; gap: 8px; }
.portal-themed.pt-r .pt-opt {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--pt-rad);
    color: var(--ink); background: var(--bg); text-decoration: none; min-height: 48px;
}
.portal-themed.pt-r .pt-opt:hover { border-color: var(--ink-3); }
.portal-themed.pt-r .pt-opt.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.portal-themed.pt-r .pt-opt b { font-weight: 600; font-size: 14px; display: block; }
.portal-themed.pt-r .pt-opt small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.portal-themed.pt-r .pt-opt .pt-opt-p { font-family: var(--pt-hf); font-weight: var(--pt-hw); font-size: 17px; white-space: nowrap; }
/* JS-toggled status colours (names kept from the old markup so the scripts still work) */
.portal-themed.pt-r .text-red-600 { color: #c2410c !important; }
.portal-themed.pt-r.theme-dark .text-red-600 { color: #ff9b7a !important; }
.portal-themed.pt-r .text-emerald-600 { color: var(--good) !important; }
.portal-themed.pt-r .text-slate-400 { color: var(--ink-3) !important; }
.portal-themed.pt-r .pt-discount { margin: 4px 0 0; font-size: 12.5px; font-weight: 600; color: var(--good); }
.portal-themed.pt-r .pt-ok-text { color: var(--good); font-weight: 600; }
.portal-themed.pt-r .pt-bad-text { color: #c2410c; font-weight: 600; font-size: 12.5px; margin: 0; }
.portal-themed.pt-r.theme-dark .pt-bad-text { color: #ff9b7a; }

/* ---------- 17. Club ---------- */
.portal-themed.pt-r .club-portal { color: var(--ink); }

/* ---------- 18. Desktop polish ---------- */
@media (min-width: 1024px) {
    .portal-themed.pt-r .home { padding-top: 34px; }
    .portal-themed.pt-r .home .greeting h1 { font-size: 52px !important; }
    .portal-themed.pt-r.b .home .greeting h1 { font-size: 60px !important; }
    .portal-themed.pt-r .home .greeting h1 em { display: block; font-size: 17px; margin-top: 16px; }
    .portal-themed.pt-r .home .greeting .kick { margin-bottom: 16px; }
    .portal-themed.pt-r .home .hero { padding: 0; }
    .portal-themed.pt-r .home .cont .body h3 { font-size: 26px !important; }
    .portal-themed.pt-r .home .lib .c { padding: 0 !important; }
    .portal-themed.pt-r .home .lib .c .pt-bar { margin: 0 16px 16px; flex: none; }
    .portal-themed.pt-r .home .lib .c .cv { background-color: var(--surface-2) !important; }
    .portal-themed.pt-r .home .sh { padding: 34px 0 14px !important; }
    .portal-themed.pt-r .home .sh h2 { font-size: 30px !important; }
    .portal-themed.pt-r :is(.lib, .cat, .rcp, .subs, .pro) { padding-top: 34px; }
    .portal-themed.pt-r .lib .head h1,
    .portal-themed.pt-r .subs .head h1,
    .portal-themed.pt-r .rcp .head h1,
    .portal-themed.pt-r .cat .top h1 { font-size: 48px !important; }
    .portal-themed.pt-r .lib .head .sub { display: block; }
    .portal-themed.pt-r .lib .list .cont .body h3 { font-size: 21px; }
    .portal-themed.pt-r :is(.home .lib .c .cv) { height: 170px !important; }
}
@media (min-width: 1440px) {
    .portal-themed.pt-r .home .greeting h1 { font-size: 60px !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .portal-themed.pt-r * { transition: none !important; animation: none !important; }
}
