/* EduApp Studio portal
   Layout: fixed left rail, wide work area; phone previews sit beside the controls they reflect.
   Palette: chalkboard green on green-tinted paper neutrals. Each phone keeps its own app colours. */

:root {
    --bg: #F1F4F0; --surface: #FFFFFF; --surface2: #E7ECE6; --ink: #16201B; --muted: #58665F; --line: #D3DBD3;
    --accent: #1D6A54; --accent-ink: #FFFFFF; --accent-soft: #DCECE4;
    --good: #2B7A46; --good-soft: #DFF0E4; --warn: #9A5F0C; --warn-soft: #F6EAD4; --bad: #AC3B2A; --bad-soft: #F6E0DA; --info: #2A5A89; --info-soft: #DEE8F3;
    --overlay: rgba(16, 24, 20, .45);
    --f-display: 'Bricolage Grotesque', system-ui, sans-serif;
    --f-body: 'Hanken Grotesk', system-ui, sans-serif;
    --f-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0F1512; --surface: #161E1A; --surface2: #1F2924; --ink: #E4EBE6; --muted: #97A59E; --line: #2B3732;
        --accent: #5CBB97; --accent-ink: #0B1A13; --accent-soft: #1D3A2F;
        --good: #6CC28A; --good-soft: #1C3325; --warn: #E0A64A; --warn-soft: #3A2D16; --bad: #EC8A77; --bad-soft: #3D221C; --info: #83B4E4; --info-soft: #1B2C3E;
        --overlay: rgba(0, 0, 0, .6); color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0F1512; --surface: #161E1A; --surface2: #1F2924; --ink: #E4EBE6; --muted: #97A59E; --line: #2B3732;
    --accent: #5CBB97; --accent-ink: #0B1A13; --accent-soft: #1D3A2F;
    --good: #6CC28A; --good-soft: #1C3325; --warn: #E0A64A; --warn-soft: #3A2D16; --bad: #EC8A77; --bad-soft: #3D221C; --info: #83B4E4; --info-soft: #1B2C3E;
    --overlay: rgba(0, 0, 0, .6); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.5; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; margin-bottom: 10px; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { flex: none; }
.mono { font-family: var(--f-mono); font-size: 12.5px; }
.mono.big { font-size: 16px; font-weight: 500; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.eyebrow { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.min0 { min-width: 0; }
.wrap { overflow-wrap: anywhere; }
.boot { padding: 48px; text-align: center; color: var(--muted); }

/* ---------------- shell ---------------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; overflow: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; }
.brand-in { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; min-width: 0; }
.brand-in b { font-family: var(--f-display); font-size: 16px; display: block; line-height: 1.1; }
.brand-in small { font-size: 11.5px; color: var(--muted); }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 14px; flex: none; }
.brand-mark.big { width: 48px; height: 48px; font-size: 18px; background: var(--accent-ink); color: var(--accent); }
.mob { display: none; }
.mob-wrap { gap: 2px; }
.mob .badge { position: absolute; margin: -18px 0 0 16px; }
.mob { position: relative; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--surface2); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.side-foot form { margin: 0; }
.who { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.who b { display: block; font-size: 13px; line-height: 1.2; }
.who small { font-size: 11.5px; color: var(--muted); }
.av { width: 32px; height: 32px; border-radius: 50%; background: var(--surface2); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.main { min-width: 0; padding-block: 24px 64px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 72ch; }
.page-head .row { margin-top: 6px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; text-decoration: none; margin-bottom: 6px; color: var(--muted); }
.back-link:hover { color: var(--accent); }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between, .between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.center, .center { justify-content: center; text-align: center; }
.row.nowrap, .nowrap { flex-wrap: nowrap; }
.row.align-end { align-items: flex-end; }
.row.gap-l { gap: 18px; margin-top: 6px; }
.push-end { margin-top: auto; padding-top: 6px; }
.grow { flex: 1; min-width: 160px; }
.grow2 { flex: 2; min-width: 200px; }
.top-gap { margin-top: 16px; }
.gap-b { margin-bottom: 16px; }
.divider { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack.tight { gap: 8px; }
.center-col { align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 28px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h3, .card-h h2 { margin: 0; }
.narrow-card { max-width: 480px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state h2 { color: var(--ink); }
.center-page { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi b { display: block; font-family: var(--f-display); font-size: 24px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi.alert { border-color: var(--warn); background: var(--warn-soft); }
.money3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.money3 b { display: block; font-family: var(--f-display); font-size: 18px; font-variant-numeric: tabular-nums; }
.line-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; color: inherit; text-decoration: none; }
.line-item.link:hover { color: var(--accent); }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline > div { border-left: 2px solid var(--line); padding-left: 10px; display: flex; flex-direction: column; gap: 3px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; border: 1px solid var(--line); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------------- controls ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 7px 13px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; color: var(--ink); text-decoration: none; }
.btn:hover { background: var(--surface2); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.pri:hover { filter: brightness(1.07); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: none; }
.btn.danger { color: var(--bad); }
.btn.wide { width: 100%; padding: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.iconbtn { border: 0; background: none; cursor: pointer; padding: 5px; border-radius: 6px; color: var(--muted); display: grid; place-items: center; }
.iconbtn:hover { background: var(--surface2); color: var(--ink); }
label.f, div.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); min-width: 0; }
.in { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; font-size: 14px; width: 100%; min-width: 0; color: var(--ink); font-weight: 400; }
.in.static { background: var(--surface2); }
.in.auto { width: auto; }
.in.search { max-width: 340px; }
.in.color { height: 38px; padding: 3px; cursor: pointer; }
textarea.in { resize: vertical; }
.code-area { font-size: 12px; line-height: 1.5; }
.validation-message { color: var(--bad); font-weight: 500; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.fgrid.align-end { align-items: end; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.check.strong { font-weight: 600; margin-top: 10px; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 38px; height: 22px; border-radius: 11px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; background: var(--surface2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 7px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--surface2); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.t-good { background: var(--good-soft); color: var(--good); }
.t-warn { background: var(--warn-soft); color: var(--warn); }
.t-bad { background: var(--bad-soft); color: var(--bad); }
.t-info { background: var(--info-soft); color: var(--info); }
.t-accent { background: var(--accent-soft); color: var(--accent); }
.note { background: var(--info-soft); color: var(--info); border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------------- tables ---------------- */
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tbl.flat { border: 0; border-radius: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface2); }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface2); }
td.r, th.r { text-align: right; }
td.c, th.c { text-align: center; }
td.c input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------------- pipeline and steps ---------------- */
.pipe { display: grid; grid-template-columns: repeat(7, minmax(96px, 1fr)); gap: 6px; overflow-x: auto; }
.pipe a { background: var(--surface2); border-radius: 8px; padding: 10px; color: var(--muted); text-decoration: none; }
.pipe a b { font-family: var(--f-display); font-size: 22px; display: block; color: var(--ink); }
.pipe a.has { background: var(--accent-soft); }
.pipe a.has b { color: var(--accent); }
.steps { display: flex; gap: 4px; margin: 6px 0 4px; }
.steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface2); }
.steps i.done { background: var(--accent); }
.steps i.cur { background: var(--warn); }
.steps i.bad { background: var(--bad); }
.steps-labels { display: flex; gap: 4px; font-size: 11.5px; color: var(--muted); }
.steps-labels span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps-labels span.cur { color: var(--ink); font-weight: 700; }
.stepbar { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.stepbar span { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface2); color: var(--muted); }
.stepbar span.on { background: var(--accent); color: var(--accent-ink); }
.stepbar span.done { background: var(--accent-soft); color: var(--accent); }

/* ---------------- templates ---------------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 16px; }
.tpl { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.thumb { display: block; height: 332px; position: relative; overflow: hidden; background: var(--surface2); border-bottom: 1px solid var(--line); }
.thumb .phwrap { position: absolute; left: 50%; top: 14px; transform: translateX(-50%) scale(.5); transform-origin: top center; }
.thumb:hover { background: var(--accent-soft); }
.tpl-b { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.swatch { display: inline-flex; gap: 3px; }
.swatch i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); }
.pkgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 10px; margin-top: 8px; }
.pkg { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; background: var(--surface); display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--ink); }
.pkg.on { border-color: var(--accent); background: var(--accent-soft); }
.pkg-name { font-size: 15px; }
.pkg-price { font-family: var(--f-display); font-size: 20px; }
.pkg ul { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--muted); }
.radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); }
.radio.on { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pol { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 14px; }
.pol ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.vault { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }

/* ---------------- modal and toasts ---------------- */
.ov { position: fixed; inset: 0; background: var(--overlay); z-index: 50; display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 24px 16px; }
.mdl { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 920px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.mdl.narrow { max-width: 620px; }
.mdl-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--surface); border-radius: 16px 16px 0 0; }
.mdl-h h2 { font-size: 20px; }
.mdl-b { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.mdl-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 16px 16px; flex-wrap: wrap; }
.toasts { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; width: min(520px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); cursor: pointer; text-align: center; }
.toast.err { background: var(--bad); color: #fff; }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--warn-soft); color: var(--warn); padding: 10px 20px; z-index: 90; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 8px; }

/* ---------------- tickets ---------------- */
.tk-wrap { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.tk-item { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--ink); margin-bottom: 6px; }
.tk-item:hover { border-color: var(--accent); }
.tk-item.on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.tk-item.static:hover { border-color: var(--line); }
.thread { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.msg { padding: 10px 12px; border-radius: 10px; background: var(--surface2); max-width: 85%; white-space: pre-wrap; }
.msg.mine { align-self: flex-end; background: var(--accent-soft); }
.msg small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; white-space: normal; }
.sys { align-self: center; font-size: 11.5px; color: var(--muted); }

/* ---------------- builder ---------------- */
.bld { display: grid; grid-template-columns: minmax(280px, 350px) 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.bld-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sticky-col { position: sticky; top: 16px; align-items: center; }
.blk { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 9px; padding: 4px 6px; background: var(--surface); }
.blk.on { border-color: var(--accent); background: var(--accent-soft); }
.blk .nm { flex: 1; min-width: 0; cursor: pointer; font-size: 13px; text-align: left; border: 0; background: none; padding: 4px; font-weight: 600; }
.blk .nm small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabchips { display: flex; gap: 6px; flex-wrap: wrap; }
.tabchips button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 12.5px; font-weight: 600; display: flex; gap: 5px; align-items: center; }
.tabchips button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.colors label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.colors input { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 2px; background: var(--surface); cursor: pointer; }
pre.code { margin: 0; background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow: auto; max-height: 560px; font-family: var(--f-mono); font-size: 12px; line-height: 1.55; white-space: pre; }

/* ---------------- login ---------------- */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.login-l { background: var(--accent); color: var(--accent-ink); padding: 48px max(40px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 20px; justify-content: center; }
.login-l h1 { font-size: 40px; line-height: 1.05; }
.login-l p { opacity: .88; max-width: 44ch; font-size: 15px; }
.login-l ul { margin: 0; padding-left: 18px; opacity: .9; display: flex; flex-direction: column; gap: 6px; }
.login-r { padding: 40px; display: grid; place-items: center; }
.login-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; }
.login-card form { margin: 0; }
.demo-logins { border: 1px dashed var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.demo-logins td { padding: 4px 6px; border: 0; }

/* =====================================================================
   PHONE PREVIEW — every colour comes from the app config (CSS variables)
   ===================================================================== */
.phwrap { width: 300px; height: 620px; border-radius: 42px; background: #0c0d0f; padding: 9px; box-shadow: 0 18px 40px rgba(0, 0, 0, .28), inset 0 0 0 2px #2a2c30; flex: none; max-width: 100%; }
.phwrap.static { pointer-events: none; }
.ph { width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: var(--pb); color: var(--pt); font-family: var(--pf); display: flex; flex-direction: column; position: relative; font-size: 13px; line-height: 1.4; }
.ph button { font-family: inherit; color: inherit; }
.ph-st { height: 28px; flex: none; display: flex; justify-content: space-between; align-items: center; padding: 0 22px; font-size: 11px; font-weight: 700; background: var(--p); color: #fff; }
.ph-st-r { display: flex; gap: 5px; align-items: center; }
.ph-body { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; position: relative; }
.ph-body::-webkit-scrollbar { display: none; }
.ph-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--p); color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.ph-bar .sp { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-bar button { border: 0; background: none; color: #fff; cursor: pointer; padding: 2px; display: grid; }
.p-timer { display: flex; gap: 4px; align-items: center; font-size: 12px; }
.ph-nav { flex: none; display: flex; background: var(--pc); border-top: 1px solid color-mix(in srgb, var(--pt) 8%, transparent); padding: 4px 2px 8px; }
.ph-nav button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 600; color: var(--pm); cursor: pointer; padding: 5px 0; min-width: 0; }
.ph-nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-nav button.on { color: var(--p); }
.ph.floating .ph-nav { position: absolute; left: 12px; right: 12px; bottom: 12px; border-radius: 999px; border: 0; padding: 6px 4px; box-shadow: 0 8px 22px rgba(0, 0, 0, .18); }
.ph.floating .ph-nav button.on { color: #fff; background: var(--p); border-radius: 999px; }
.ph.floating .ph-nav button.on span { display: none; }
.p-bottom-space { height: 16px; }
.ph.floating .p-bottom-space { height: 84px; }

.p-h { font-size: 15px; display: block; }
.p-m { color: var(--pm); font-size: 11.5px; }
.p-m.strong { font-weight: 700; }
.p-sec { padding: 14px 14px 4px; display: flex; justify-content: space-between; align-items: center; min-height: 6px; }
.p-sec b { font-size: 14px; font-weight: 700; }
.p-sec span { font-size: 11px; color: var(--p); font-weight: 700; }
.p-card { background: var(--pc); border-radius: var(--pr); box-shadow: 0 1px 3px rgba(0, 0, 0, .07); overflow: hidden; }
.p-hero { background: var(--p); color: #fff; padding: 6px 14px 16px; border-radius: 0 0 calc(var(--pr) + 6px) calc(var(--pr) + 6px); }
.p-hero .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.p-hero small { opacity: .85; font-size: 11px; }
.p-hero h4 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.2; }
.p-bell { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; flex: none; }
.p-search { margin-top: 10px; background: #fff; color: #8a8f99; border-radius: calc(var(--pr) - 2px); padding: 9px 11px; display: flex; gap: 7px; align-items: center; font-size: 12px; }
.p-hscroll { display: flex; gap: 10px; overflow-x: auto; padding: 4px 14px 6px; scrollbar-width: none; }
.p-hscroll::-webkit-scrollbar { display: none; }
.p-banner { flex: none; width: 236px; height: 112px; border-radius: var(--pr); padding: 14px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(135deg, var(--p), var(--s)); position: relative; overflow: hidden; }
.p-banner:nth-child(2n) { background: linear-gradient(135deg, var(--s), var(--p)); }
.p-banner::after { content: ""; position: absolute; right: -24px; top: -24px; width: 96px; height: 96px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.p-banner b { font-size: 15px; font-weight: 800; line-height: 1.2; }
.p-banner span { font-size: 11px; opacity: .9; }
.p-chips { display: flex; gap: 7px; overflow-x: auto; padding: 4px 14px 6px; scrollbar-width: none; }
.p-chips::-webkit-scrollbar { display: none; }
.p-chip { flex: none; border: 1px solid color-mix(in srgb, var(--pt) 16%, transparent); background: var(--pc); color: var(--pt); padding: 5px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.p-chip.on { background: var(--p); border-color: var(--p); color: #fff; }
.p-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 4px 14px; }
.p-tile { background: var(--pc); border-radius: var(--pr); padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; text-align: center; cursor: pointer; border: 0; color: var(--pt); box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.p-tile i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--p) 13%, transparent); color: var(--p); }
.p-course { flex: none; width: 200px; cursor: pointer; border: 0; padding: 0; text-align: left; display: block; }
.p-course.full { width: auto; display: grid; grid-template-columns: 92px 1fr; }
.p-cimg { display: flex; height: 84px; background: linear-gradient(135deg, var(--p), var(--s)); padding: 8px; position: relative; color: #fff; align-items: flex-end; font-weight: 800; font-size: 12px; line-height: 1.15; }
.p-course.full .p-cimg { height: auto; min-height: 92px; }
.p-tag { position: absolute; top: 7px; left: 7px; background: #fff; color: var(--p); font-size: 9.5px; font-weight: 800; padding: 2px 7px; border-radius: 99px; }
.p-cbody { padding: 9px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.p-cbody b { font-size: 12.5px; line-height: 1.25; }
.p-cbody small { color: var(--pm); font-size: 10.5px; }
.p-price { display: flex; gap: 6px; align-items: baseline; margin-top: 2px; flex-wrap: wrap; }
.p-price b { color: var(--p); font-size: 14px; }
.p-price.big b { font-size: 20px; }
.p-price s { color: var(--pm); font-size: 10.5px; }
.p-price em { font-style: normal; color: #1a8a4a; font-size: 10px; font-weight: 700; }
.p-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 14px; }
.p-list.top { padding-top: 12px; }
.p-li { display: flex; gap: 10px; align-items: center; padding: 10px; cursor: pointer; border: 0; width: 100%; text-align: left; color: var(--pt); font-size: 12px; }
.p-li .ico { width: 40px; height: 40px; border-radius: calc(var(--pr) - 2px); display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--p) 12%, transparent); color: var(--p); }
.p-li .ico.dark { background: var(--s); color: #fff; }
.p-li .tx { flex: 1; min-width: 0; }
.p-li .tx b { display: block; font-size: 12.5px; line-height: 1.25; }
.p-li .tx small { color: var(--pm); font-size: 10.5px; }
.p-acc { color: var(--p); }
.p-live { background: #e5332a; color: #fff; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 4px; flex: none; }
.p-live.dim { background: rgba(0, 0, 0, .45); }
.p-btn { border: 0; background: var(--p); color: #fff !important; border-radius: calc(var(--pr) - 2px); padding: 6px 11px; font-size: 11px; font-weight: 700; cursor: pointer; flex: none; }
.p-btn.wide { width: 100%; padding: 12px; font-size: 13px; }
.p-btn.pad { padding: 11px 20px; font-size: 13px; }
.p-btn.line { background: none; color: var(--p) !important; border: 1.5px solid var(--p); }
.p-btn[disabled] { opacity: .4; }
.p-quiz { margin: 4px 14px; padding: 12px; }
.p-quiz > b { font-size: 12.5px; display: block; margin-bottom: 8px; }
.p-opt { display: block; width: 100%; text-align: left; border: 1.5px solid color-mix(in srgb, var(--pt) 14%, transparent); background: none; border-radius: calc(var(--pr) - 3px); padding: 8px 10px; margin-bottom: 6px; font-size: 12px; cursor: pointer; color: var(--pt); }
.p-opt.ok { border-color: #1a8a4a; background: #e3f5ea; color: #145c33; }
.p-opt.no { border-color: #d4483b; background: #fbe6e3; color: #8e2a20; }
.p-opt.sel { border-color: var(--p); background: color-mix(in srgb, var(--p) 10%, transparent); }
.p-result { font-size: 11px; font-weight: 700; }
.p-result.ok { color: #1a8a4a; }
.p-result.no { color: #c0392b; }
.p-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 4px 14px; }
.p-stats.flush { padding: 0; }
.p-stat { padding: 10px 6px; text-align: center; }
.p-stat b { display: block; font-size: 15px; color: var(--p); font-weight: 800; }
.p-stat small { font-size: 10px; color: var(--pm); }
.p-bar { display: block; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--pt) 10%, transparent); margin-top: 6px; overflow: hidden; }
.p-bar.thick { height: 8px; }
.p-bar i { display: block; height: 100%; background: var(--p); border-radius: 3px; }
.p-chapter { display: block; padding: 10px 12px; border: 0; width: 100%; text-align: left; cursor: pointer; color: var(--pt); }
.p-chapter > small { color: var(--pm); font-size: 10.5px; }
.row-p { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row-p b { font-size: 12.5px; }
.row-p small { color: var(--pm); }
.p-notice { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.p-notice b { font-size: 12.5px; }
.p-notice small { color: var(--pm); font-size: 10.5px; }
.p-ntag { font-size: 9.5px; font-weight: 800; color: var(--p); text-transform: uppercase; letter-spacing: .04em; }
.p-ntag.light { color: #fff; opacity: .9; }
.p-tt-wrap { margin: 4px 14px; }
.p-tt { display: grid; grid-template-columns: 58px 1fr; gap: 10px; padding: 9px 10px; align-items: center; font-size: 12px; border-top: 1px solid color-mix(in srgb, var(--pt) 8%, transparent); }
.p-tt:first-child { border-top: 0; }
.p-tt span { font-weight: 800; color: var(--p); font-size: 11px; }
.p-tt small { color: var(--pm); }
.p-teach { flex: none; width: 76px; text-align: center; font-size: 10.5px; display: flex; flex-direction: column; align-items: center; }
.p-teach i { width: 56px; height: 56px; border-radius: 50%; margin-bottom: 5px; display: grid; place-items: center; font-style: normal; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--p), var(--s)); font-size: 16px; }
.p-teach small { color: var(--pm); }
.p-cta { margin: 6px 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; background: color-mix(in srgb, var(--s) 14%, var(--pc)); }
.p-cta b { font-size: 14px; }
.p-cta small { color: var(--pm); }
.p-pad { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.p-pad.tight { padding-bottom: 0; gap: 2px; }
.p-pad.center { text-align: center; }
.p-note { padding: 10px 12px; font-size: 11.5px; color: var(--pm); }
.p-feat { display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.p-feat span { color: var(--p); display: grid; }
.p-profile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 14px 10px; }
.p-profile i { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--p), var(--s)); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 22px; }
.p-profile b { font-size: 16px; }
.p-profile small { color: var(--pm); }
.p-menu { margin: 6px 14px; }
.p-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 12px; border-bottom: 1px solid color-mix(in srgb, var(--pt) 8%, transparent); font-size: 12.5px; cursor: pointer; text-align: left; }
.p-menu button:last-child { border-bottom: 0; }
.p-menu button span { flex: 1; }
.p-contact { margin: 8px 14px 4px; padding: 12px; display: flex; flex-direction: column; gap: 2px; background: color-mix(in srgb, var(--p) 8%, var(--pc)); }
.p-contact small { color: var(--pm); }
.p-splash { background: linear-gradient(180deg, var(--p) 0, var(--p) 46%, var(--pb) 46%); display: flex; flex-direction: column; align-items: center; padding: 36px 18px 18px; gap: 16px; min-height: 100%; }
.p-logo { width: 76px; height: 76px; border-radius: 22px; background: #fff; color: var(--p); display: grid; place-items: center; font-weight: 800; font-size: 28px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.p-splash h3 { color: #fff; font-size: 20px; font-weight: 800; margin: 0; text-align: center; font-family: inherit; }
.p-splash > p { color: rgba(255, 255, 255, .88); font-size: 12px; text-align: center; margin-top: -10px; }
.p-login { width: 100%; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.p-in { border: 1.5px solid color-mix(in srgb, var(--pt) 16%, transparent); border-radius: calc(var(--pr) - 2px); padding: 10px 12px; font-size: 13px; display: flex; gap: 8px; }
.p-in.muted { color: var(--pm); font-size: 12px; padding: 8px 10px; }
.p-in.grow { flex: 1; min-width: 0; }
.p-otp { display: flex; gap: 8px; justify-content: center; }
.p-otp span { width: 42px; height: 46px; border: 1.5px solid var(--p); border-radius: 10px; display: grid; place-items: center; font-size: 18px; font-weight: 800; }
.p-hint { font-size: 10px; color: var(--pm); text-align: center; }
.p-hcover { height: 150px; background: linear-gradient(135deg, var(--p), var(--s)); color: #fff; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }
.p-hcover b { font-size: 16px; font-weight: 800; line-height: 1.2; }
.p-tabs { display: flex; border-bottom: 1px solid color-mix(in srgb, var(--pt) 10%, transparent); background: var(--pc); }
.p-tabs button { flex: 1; border: 0; background: none; padding: 10px; font-size: 12px; font-weight: 700; color: var(--pm); cursor: pointer; border-bottom: 2px solid transparent; }
.p-tabs button.on { color: var(--p); border-color: var(--p); }
.p-sticky { flex: none; background: var(--pc); padding: 10px 14px; display: flex; align-items: center; gap: 10px; box-shadow: 0 -2px 10px rgba(0, 0, 0, .08); }
.p-sticky .grow { flex: 1; min-width: 0; }
.p-pr { font-size: 16px; color: var(--p); }
.p-video { aspect-ratio: 16 / 9; background: #0b0b0c; display: grid; place-items: center; color: #fff; position: relative; max-width: 100%; }
.p-video .pl, .p-reel-full .pl { width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.p-video .lb { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; align-items: center; font-size: 10px; }
.p-center { text-align: center; font-size: 11px; opacity: .85; }
.p-chat { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.p-chat div { font-size: 11.5px; }
.p-chat b { color: var(--p); }
.p-chat.bubbles div { max-width: 82%; padding: 8px 10px; border-radius: 14px; line-height: 1.35; }
.p-chat.bubbles .bot { background: var(--pc); align-self: flex-start; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.p-chat.bubbles .mine { background: var(--p); color: #fff; align-self: flex-end; }
.p-q { padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.p-q h5 { margin: 0; font-size: 14px; line-height: 1.35; font-family: inherit; }
.p-qbar { display: flex; gap: 5px; }
.p-qbar span { flex: 1; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--pt) 12%, transparent); }
.p-qbar span.done { background: color-mix(in srgb, var(--p) 45%, transparent); }
.p-qbar span.cur { background: var(--p); }
.p-qnav { display: flex; gap: 8px; padding: 10px 14px; background: var(--pc); border-top: 1px solid color-mix(in srgb, var(--pt) 8%, transparent); flex: none; align-items: center; }
.p-qnav .p-btn { flex: 1; padding: 10px; }
.p-qnav .p-btn:only-of-type { flex: none; }
.p-score { width: 120px; height: 120px; border-radius: 50%; margin: 10px auto; display: grid; place-items: center; text-align: center; background: conic-gradient(var(--p) calc(var(--sc) * 1%), color-mix(in srgb, var(--pt) 10%, transparent) 0); }
.p-score > div { width: 96px; height: 96px; border-radius: 50%; background: var(--pb); display: grid; place-items: center; align-content: center; font-weight: 800; font-size: 22px; }
.p-score small { font-size: 10px; color: var(--pm); font-weight: 600; }
.p-key { padding: 10px 12px; text-align: left; font-size: 12px; }
.p-key div { display: flex; gap: 8px; padding: 4px 0; }
.p-key .ok { color: #1a8a4a; }
.p-key .no { color: #c0392b; }
.p-key .skip { color: var(--pm); }
.p-pdf { margin: 14px; background: #fff; color: #222; border-radius: 6px; padding: 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); display: flex; flex-direction: column; gap: 7px; }
.p-pdf i { display: block; height: 6px; border-radius: 3px; background: #e4e6ea; }
.p-sheet { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; z-index: 5; }
.p-sheet > div { background: var(--pc); width: 100%; border-radius: 18px 18px 0 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.p-pay { display: flex; justify-content: space-between; align-items: center; border: 1.5px solid color-mix(in srgb, var(--pt) 14%, transparent); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; font-weight: 600; }
.p-pay span { color: var(--p); display: grid; }
.p-toast { position: absolute; left: 14px; right: 14px; bottom: 76px; background: #1d1f24; color: #fff; font-size: 11.5px; padding: 9px 12px; border-radius: 9px; z-index: 6; text-align: center; }
.p-empty { margin: 4px 14px; padding: 14px; border: 1.5px dashed color-mix(in srgb, var(--pt) 20%, transparent); border-radius: var(--pr); font-size: 11px; color: var(--pm); text-align: center; }

/* Trending blocks */
.p-stories { display: flex; gap: 12px; overflow-x: auto; padding: 4px 14px 6px; scrollbar-width: none; }
.p-stories::-webkit-scrollbar { display: none; }
.p-storyc { flex: none; width: 62px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; border: 0; background: none; cursor: pointer; padding: 0; }
.p-storyc i { width: 58px; height: 58px; border-radius: 50%; padding: 2.5px; background: conic-gradient(from 200deg, var(--p), var(--s), var(--p)); display: grid; }
.p-storyc.seen i { background: color-mix(in srgb, var(--pt) 22%, transparent); }
.p-storyc i span { border-radius: 50%; background: var(--pc); border: 2px solid var(--pb); display: grid; place-items: center; font-style: normal; font-weight: 800; color: var(--p); font-size: 15px; }
.p-reel { flex: none; width: 128px; height: 210px; border-radius: var(--pr); padding: 10px; color: #fff; border: 0; cursor: pointer; text-align: left; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; position: relative; overflow: hidden; background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, .55)), linear-gradient(160deg, var(--s), var(--p)); }
.p-reel:nth-child(2n) { background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, .55)), linear-gradient(200deg, var(--p), var(--s)); }
.p-reel b { font-size: 12.5px; line-height: 1.25; }
.p-reel small { font-size: 10px; opacity: .85; }
.p-reel-len { position: absolute; top: 8px; left: 8px; display: flex; gap: 3px; align-items: center; background: rgba(0, 0, 0, .35); padding: 2px 6px; border-radius: 99px; font-size: 10px; }
.p-reel-full { min-height: 100%; background: linear-gradient(180deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .7)), linear-gradient(160deg, var(--s), var(--p)); color: #fff; position: relative; display: grid; place-items: center; }
.p-reel-top { position: absolute; top: 12px; left: 14px; right: 14px; display: flex; justify-content: space-between; font-size: 11px; }
.p-reel-cap { position: absolute; left: 14px; right: 64px; bottom: 24px; display: flex; flex-direction: column; gap: 4px; }
.p-reel-cap b { font-size: 16px; line-height: 1.25; }
.p-reel-side { position: absolute; right: 12px; bottom: 24px; display: flex; flex-direction: column; gap: 16px; align-items: center; font-size: 10px; }
.p-reel-side span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.p-story { min-height: 100%; background: linear-gradient(170deg, var(--p), var(--s)); color: #fff; display: flex; flex-direction: column; }
.p-story-bars { display: flex; gap: 4px; padding: 10px 12px; }
.p-story-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); }
.p-story-bars i.done, .p-story-bars i.cur { background: #fff; }
.p-story-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.p-story-body b { font-size: 22px; }
.p-story-body p { font-size: 13px; opacity: .9; }
.p-story-av { width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-weight: 800; font-size: 24px; }
.p-story .p-btn { background: #fff; color: var(--p) !important; }
.p-streak { margin: 4px 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.p-streak .row-p b { font-size: 15px; }
.p-flame { color: var(--s); display: grid; }
.p-xp { color: var(--p); font-weight: 800; font-size: 12px; white-space: nowrap; }
.p-week { display: flex; justify-content: space-between; }
.p-week span { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--pm); }
.p-week i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--pt) 9%, transparent); color: #fff; }
.p-week i.on { background: var(--p); }
.p-bento { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 14px; }
.p-bento-i { background: var(--pc); border-radius: var(--pr); padding: 12px; border: 0; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 2px; color: var(--pt); box-shadow: 0 1px 3px rgba(0, 0, 0, .07); }
.p-bento-i .ic { color: var(--p); margin-bottom: 4px; }
.p-bento-i.wide { grid-column: span 2; }
.p-bento-i.accent { background: linear-gradient(135deg, var(--p), color-mix(in srgb, var(--p) 70%, var(--s))); color: #fff; }
.p-bento-i.accent .ic { color: #fff; }
.p-bento-i b { font-size: 12.5px; }
.p-bento-i b.v { font-size: 20px; font-weight: 800; line-height: 1.1; }
.p-bento-i small { font-size: 10.5px; opacity: .75; }
.p-podium { display: flex; justify-content: center; align-items: flex-end; gap: 8px; padding: 8px 14px 0; }
.p-pod { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; text-align: center; min-width: 0; }
.p-pod i { width: 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, var(--p) 18%, var(--pc)); color: var(--p); display: grid; place-items: center; font-style: normal; font-weight: 800; }
.p-pod.p1 i { width: 54px; height: 54px; background: var(--s); color: #fff; }
.p-pod b { font-size: 11.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-pod small { color: var(--pm); }
.p-pod span { width: 100%; background: color-mix(in srgb, var(--p) 14%, var(--pc)); border-radius: 8px 8px 0 0; font-weight: 800; color: var(--p); padding-top: 6px; height: 28px; }
.p-pod.p1 span { height: 44px; background: var(--p); color: #fff; }
.p-pod.p2 span { height: 34px; }
.p-lb { margin: 0 14px; }
.p-lb div { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid color-mix(in srgb, var(--pt) 8%, transparent); font-size: 12px; }
.p-lb div:first-child { border-top: 0; }
.p-lb div span { width: 18px; color: var(--pm); font-weight: 700; }
.p-lb div b { flex: 1; }
.p-lb div small { color: var(--p); font-weight: 700; }
.p-lb div.me { background: color-mix(in srgb, var(--p) 9%, transparent); }
.p-doubt { margin: 8px 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: linear-gradient(135deg, color-mix(in srgb, var(--p) 12%, var(--pc)), color-mix(in srgb, var(--s) 12%, var(--pc))); }
.p-doubt b { font-size: 14px; }
.p-doubt small { color: var(--pm); }
.p-doubt .p-in { width: 100%; background: var(--pc); }
.p-spark { color: var(--p); display: grid; }

/* ---------------- responsive ---------------- */
@media (max-width: 1240px) {
    .bld { grid-template-columns: minmax(0, 1fr) 320px; }
    .bld-exp { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .side { position: sticky; top: env(safe-area-inset-top, 0px); height: auto; z-index: 20; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
    body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
    .mob { display: grid; }
    .nav, .side-foot { display: none; }
    .nav.open, .side-foot.open { display: flex; }
    .main { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
    .split, .tk-wrap, .bld { grid-template-columns: minmax(0, 1fr); }
    .sticky-col { position: static; }
    .login { grid-template-columns: minmax(0, 1fr); }
    .login-l { padding: 32px max(16px, env(safe-area-inset-left, 0px)); }
    .login-l h1 { font-size: 30px; }
    .login-r { padding: 24px max(16px, env(safe-area-inset-right, 0px)); }
    .money3 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ---------------- phase 2 ---------------- */
.p-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; padding: 8px; }
.p-hero-logo { width: 36px; height: 36px; border-radius: 10px; background: #fff; object-fit: contain; padding: 3px; flex: none; }
.p-hero .grow { flex: 1; }
.nav-bell { position: relative; }
.badge { min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; padding: 0 5px; margin-left: auto; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.notif:first-child { border-top: 0; }
.notif.unread { background: var(--accent-soft); }
.notif .dot2 { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; }
.notif.read .dot2 { background: transparent; }
.notif b { display: block; }
.files { display: flex; flex-direction: column; gap: 6px; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.file a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.upload input[type=file] { font-size: 13px; max-width: 100%; }
.logo-box { width: 96px; height: 96px; border-radius: 16px; border: 1px dashed var(--line); display: grid; place-items: center; background: var(--surface2); overflow: hidden; color: var(--muted); font-size: 12px; text-align: center; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 200px; padding-top: 10px; }
.chart .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.chart .bar { width: 100%; max-width: 38px; background: var(--accent); border-radius: 6px 6px 0 0; min-height: 2px; }
.chart .col.zero .bar { background: var(--line); }
.chart small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.chart .v { font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar .track { height: 10px; border-radius: 5px; background: var(--surface2); overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.hbar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .num { text-align: right; white-space: nowrap; }
.pkg-edit { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }

/* Invoice (printable) */
.invoice { background: #fff; color: #1b1f1d; border: 1px solid var(--line); border-radius: 12px; padding: 36px; max-width: 860px; font-size: 13.5px; }
.invoice h1 { font-size: 26px; }
.invoice .muted { color: #5b6661; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-bottom: 2px solid #1b1f1d; padding-bottom: 18px; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 18px 0; }
.invoice table { margin-top: 8px; }
.invoice th { background: #f1f4f2; color: #4b5651; }
.invoice td, .invoice th { border-bottom: 1px solid #dde3df; }
.inv-totals { margin-left: auto; width: min(100%, 320px); margin-top: 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; }
.inv-totals .grand { font-size: 16px; font-weight: 800; border-top: 2px solid #1b1f1d; padding-top: 6px; }
.inv-foot { margin-top: 26px; padding-top: 14px; border-top: 1px solid #dde3df; display: flex; flex-direction: column; gap: 6px; }
.stamp { display: inline-block; padding: 4px 10px; border: 2px solid; border-radius: 6px; font-weight: 800; letter-spacing: .06em; }
.stamp.paid { color: #2b7a46; }
.stamp.due { color: #ac3b2a; }

@media print {
    .side, .no-print, .toasts, #blazor-error-ui { display: none !important; }
    .shell { display: block; }
    .main { padding: 0; }
    body { background: #fff; }
    .invoice { border: 0; padding: 0; max-width: none; }
}

@media (max-width: 700px) {
    .inv-parties { grid-template-columns: 1fr; }
    .invoice { padding: 18px; }
    .chart { gap: 3px; }
    .chart .v { display: none; }
}
.card.flush { padding: 0; overflow: hidden; }
.row.align-start { align-items: flex-start; }
.ph .grow { flex: 1; min-width: 0; }

/* ---------------- phase 3: richer template sections ---------------- */
.p-cont { flex: none; width: 210px; padding: 12px; border: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.p-cont .tx b { display: block; font-size: 12.5px; line-height: 1.25; }
.p-cont .tx small { color: var(--pm); font-size: 10.5px; }
.p-cont-play { width: 30px; height: 30px; border-radius: 50%; background: var(--p); color: #fff; display: grid; place-items: center; }
.p-countdown { margin: 4px 14px; border-radius: var(--pr); padding: 14px; display: flex; gap: 14px; align-items: center; color: #fff; background: linear-gradient(120deg, var(--s), var(--p)); }
.p-countdown b { display: block; font-size: 14px; }
.p-countdown small { display: block; font-size: 11px; opacity: .9; }
.p-cd-days { width: 70px; height: 70px; border-radius: 18px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; align-content: center; text-align: center; flex: none; }
.p-cd-days b { font-size: 26px; line-height: 1; font-weight: 800; }
.p-cd-cta { display: inline-block; margin-top: 6px; background: #fff; color: var(--p); border-radius: 99px; padding: 3px 10px; font-size: 10.5px; font-weight: 800; }
.p-badge { flex: none; width: 78px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; font-size: 10.5px; opacity: .55; }
.p-badge.on { opacity: 1; }
.p-badge i { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--pt) 10%, transparent); color: var(--pm); transform: rotate(-6deg); }
.p-badge.on i { background: linear-gradient(135deg, var(--s), var(--p)); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--p) 35%, transparent); }
.p-badge b { font-size: 10.5px; line-height: 1.2; }
.p-badge small { color: var(--pm); font-size: 9.5px; }
.p-topper { flex: none; width: 110px; border-radius: var(--pr); padding: 12px 8px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; background: linear-gradient(180deg, color-mix(in srgb, var(--s) 22%, var(--pc)), var(--pc)); box-shadow: 0 1px 3px rgba(0, 0, 0, .07); position: relative; }
.p-topper i { width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--s); background: var(--pc); color: var(--p); display: grid; place-items: center; font-style: normal; font-weight: 800; }
.p-rank { background: var(--p); color: #fff; font-size: 10px; font-weight: 800; border-radius: 99px; padding: 2px 8px; margin-top: -10px; }
.p-topper b { font-size: 11.5px; line-height: 1.2; }
.p-topper small { color: var(--pm); font-size: 10px; }
.p-review { flex: none; width: 220px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.p-review p { margin: 0; font-size: 11.5px; line-height: 1.45; }
.p-stars { color: #f2a900; font-size: 13px; letter-spacing: 1px; }
.p-stars span { color: color-mix(in srgb, var(--pt) 18%, transparent); }
.p-review .row-p { justify-content: flex-start; }
.p-review i { width: 30px; height: 30px; border-radius: 50%; background: var(--p); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 11px; flex: none; }
.p-review b { display: block; font-size: 11.5px; }
.p-review small { color: var(--pm); font-size: 10px; }
.p-plan { padding: 12px; display: flex; flex-direction: column; gap: 8px; position: relative; border: 1.5px solid transparent; }
.p-plan.best { border-color: var(--p); }
.p-best { position: absolute; top: -1px; right: 12px; background: var(--p); color: #fff; font-size: 9.5px; font-weight: 800; padding: 3px 8px; border-radius: 0 0 8px 8px; }
.p-plan-price { font-weight: 800; color: var(--p); font-size: 15px; }
.p-plan-price small { color: var(--pm); font-weight: 600; font-size: 10px; }
.p-plan ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; }
.p-plan li { display: flex; gap: 6px; align-items: center; }
.p-plan li .ic { color: var(--p); }
.p-plan .p-btn { align-self: stretch; padding: 9px; }
.p-offer { margin: 4px 14px; border-radius: var(--pr); padding: 12px 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1.5px dashed var(--p); background: color-mix(in srgb, var(--p) 7%, var(--pc)); }
.p-offer b { display: block; font-size: 13.5px; }
.p-offer small { display: block; font-size: 10.5px; color: var(--pm); }
.p-offer .p-ends { color: #c0392b; font-weight: 700; }
.p-code { border: 0; background: var(--p); color: #fff; font-weight: 800; letter-spacing: .06em; padding: 8px 10px; border-radius: 8px; font-size: 11.5px; cursor: pointer; flex: none; }
.p-faq { margin: 4px 14px; }
.p-faq button { display: flex; flex-direction: column; gap: 4px; width: 100%; border: 0; background: none; text-align: left; padding: 11px 12px; border-top: 1px solid color-mix(in srgb, var(--pt) 8%, transparent); cursor: pointer; }
.p-faq button:first-child { border-top: 0; }
.p-faq b { font-size: 12px; }
.p-faq small { color: var(--pm); font-size: 11px; line-height: 1.45; }

/* Template screen gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gallery .shot { width: 196px; height: 405px; position: relative; overflow: hidden; }
.gallery .shot .phwrap { max-width: none; width: 300px; position: absolute; left: 0; top: 0; transform: scale(.653); transform-origin: top left; }
.gallery figcaption { font-size: 12px; font-weight: 600; color: var(--muted); }
.heart { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.heart.on { color: #e5484d; border-color: #e5484d; background: color-mix(in srgb, #e5484d 10%, var(--surface)); }
.tpl { position: relative; }
.tpl .heart { position: absolute; top: 10px; right: 10px; z-index: 2; }

/* ---------------- phase 3: service management ---------------- */
.cr-flow { display: flex; gap: 4px; flex-wrap: wrap; }
.cr-flow span { flex: 1; min-width: 90px; text-align: center; padding: 7px 6px; border-radius: 8px; background: var(--surface2); color: var(--muted); font-size: 12px; font-weight: 600; }
.cr-flow span.done { background: var(--accent-soft); color: var(--accent); }
.cr-flow span.cur { background: var(--accent); color: var(--accent-ink); }
.cr-flow span.bad { background: var(--bad-soft); color: var(--bad); }
.split.wide { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.sub-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.self-start { align-self: flex-start; }
.cr-timeline { display: flex; flex-direction: column; gap: 14px; }
.cr-timeline > div { display: flex; gap: 10px; }
.cr-timeline > div.internal { background: var(--warn-soft); border-radius: 8px; padding: 8px; margin: -4px -8px; }
.dot3 { width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin-top: 5px; flex: none; }
.dot3.st { background: var(--accent); }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.svc { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.svc b.big { font-family: var(--f-display); font-size: 22px; }
.meter { height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter.warn i { background: var(--warn); }
.meter.bad i { background: var(--bad); }
.release { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; display: flex; flex-direction: column; gap: 4px; }
.release + .release { margin-top: 12px; }
.stars { display: inline-flex; gap: 2px; }
.stars button { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--line); padding: 0 1px; }
.stars button.on { color: #f2a900; }
.stars.static span { font-size: 15px; color: var(--line); }
.stars.static span.on { color: #f2a900; }
.tabs360 { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs360 button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs360 button.on { color: var(--accent); border-color: var(--accent); }
.tag { display: inline-block; background: var(--surface2); border-radius: 6px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; margin: 2px 4px 2px 0; }
.note-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.note-card.pinned { border-color: var(--warn); background: var(--warn-soft); }
.fu { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.fu:first-child { border-top: 0; }
.fu input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; }
.fu.done b { text-decoration: line-through; color: var(--muted); }
.overdue { color: var(--bad); font-weight: 700; }
@media (max-width: 900px) { .split.wide { grid-template-columns: minmax(0, 1fr); } }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }

/* ---------- Phase 4: catalogue, course content, test series, schedule, analysis ---------- */
.p-see { border: 0; background: none; font: inherit; font-size: 11px; color: var(--p); font-weight: 700; cursor: pointer; padding: 0; }
.p-banner.img::after { display: none; }
.p-mode { display: inline-block; font-size: 9px; font-weight: 800; color: var(--p); background: color-mix(in srgb, var(--p) 11%, transparent); padding: 1px 6px; border-radius: 99px; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .03em; }
.p-catgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 14px; }
.p-catc { border: 0; text-align: left; padding: 10px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; color: var(--pt); font-family: inherit; }
.p-catc b { display: block; font-size: 12.5px; }
.p-catc small { display: block; font-size: 10px; color: var(--pm); line-height: 1.3; }
.p-catc.row { flex-direction: row; align-items: center; gap: 10px; }
.p-cat-ic { width: 34px; height: 34px; border-radius: calc(var(--pr) - 3px); display: grid; place-items: center; background: color-mix(in srgb, var(--p) 12%, transparent); color: var(--p); flex: none; }
.p-cat-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px 6px; }
.p-cat-head b { display: block; font-size: 15px; }
.p-cat-head small { font-size: 10.5px; color: var(--pm); }
.p-exam { flex: none; width: 138px; border: 0; text-align: left; padding: 12px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; color: var(--pt); font-family: inherit; }
.p-exam b { font-size: 13px; margin-top: 4px; }
.p-exam small { font-size: 10px; color: var(--pm); }
.p-exam-go { font-size: 10.5px; font-weight: 800; color: var(--p); margin-top: 4px; }
.p-series { flex: none; width: 210px; padding: 12px; display: flex; flex-direction: column; gap: 4px; border: 1.5px solid color-mix(in srgb, var(--p) 22%, transparent); }
.p-series b { font-size: 12.5px; line-height: 1.25; }
.p-series small { font-size: 10px; color: var(--pm); }
.p-series .p-btn { margin-top: 6px; }
.p-users { display: flex; align-items: center; gap: 4px; color: var(--p) !important; font-weight: 700; }
.top-gap-p { margin-top: 8px; }
.p-tabs button small { font-size: 10px; opacity: .7; margin-left: 2px; }
.p-syl { padding: 12px 14px 0; display: flex; flex-direction: column; gap: 8px; }
.p-subj-h { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 10px; text-align: left; color: var(--pt); cursor: pointer; font-family: inherit; }
.p-subj-h .tx { flex: 1; min-width: 0; }
.p-subj-h b { display: block; font-size: 12.5px; }
.p-subj-h small { font-size: 10px; color: var(--pm); }
.p-subj-i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--p); color: #fff; font-size: 11px; font-weight: 800; flex: none; }
.p-subj.open { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--p) 40%, transparent); }
.p-chap-h { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--pm); padding: 8px 12px 4px; border-top: 1px solid color-mix(in srgb, var(--pt) 8%, transparent); }
.p-item { display: flex; gap: 9px; align-items: center; width: 100%; border: 0; background: none; padding: 6px 12px; text-align: left; color: var(--pt); cursor: pointer; font-family: inherit; }
.p-card.p-item { padding: 9px 10px; }
.p-item .tx { flex: 1; min-width: 0; }
.p-item b { display: block; font-size: 11.5px; font-weight: 600; line-height: 1.25; }
.p-item small { font-size: 9.5px; color: var(--pm); }
.p-item .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--p) 12%, transparent); color: var(--p); }
.p-item .ic.pdf { background: #fdecea; color: #c0392b; }
.p-item .ic.quiz { background: #fff4dc; color: #b26a00; }
.p-item.locked b { color: var(--pm); }
.p-item.locked .ic { background: color-mix(in srgb, var(--pt) 8%, transparent); color: var(--pm); }
.p-syl-sum { display: grid; grid-template-columns: repeat(4, 1fr); padding: 10px 4px; text-align: center; }
.p-syl-sum b { display: block; font-size: 15px; color: var(--p); font-weight: 800; }
.p-syl-sum small { font-size: 9.5px; color: var(--pm); }
.p-vbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .25); }
.p-vbar i { display: block; height: 100%; background: var(--p); }
.p-vact { display: flex; justify-content: space-between; margin-top: 10px; padding: 8px 2px; border-top: 1px solid color-mix(in srgb, var(--pt) 8%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--pt) 8%, transparent); }
.p-vact span { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 9.5px; color: var(--pm); font-weight: 600; }
.p-days { display: flex; gap: 6px; overflow-x: auto; padding: 12px 14px 6px; scrollbar-width: none; }
.p-days button { flex: none; min-width: 54px; border: 1px solid color-mix(in srgb, var(--pt) 12%, transparent); background: var(--pc); color: var(--pt); border-radius: calc(var(--pr) - 2px); padding: 6px 8px; display: flex; flex-direction: column; align-items: center; cursor: pointer; font-family: inherit; }
.p-days button small { font-size: 9.5px; color: var(--pm); }
.p-days button b { font-size: 15px; }
.p-days button.on { background: var(--p); border-color: var(--p); color: #fff; }
.p-days button.on small { color: rgba(255, 255, 255, .85); }
.p-seg { display: flex; gap: 4px; margin: 4px 14px 0; padding: 3px; border-radius: 99px; background: color-mix(in srgb, var(--pt) 7%, transparent); }
.p-seg button { flex: 1; border: 0; background: none; border-radius: 99px; padding: 5px 4px; font-size: 10.5px; font-weight: 700; color: var(--pm); cursor: pointer; font-family: inherit; }
.p-seg button.on { background: var(--pc); color: var(--p); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.p-sched .p-time { width: 52px; flex: none; display: flex; flex-direction: column; font-size: 11px; }
.p-sched .p-time b { font-size: 11.5px; }
.p-sched .p-time small { font-size: 9.5px; color: var(--pm); }
.p-sched.live { box-shadow: 0 0 0 1.5px #e5332a; }
.p-sched.live .p-time b { color: #e5332a; }
.p-sched.done .tx b { color: var(--pm); }
.p-sched .p-btn { display: inline-flex; align-items: center; gap: 4px; }
.p-recs { display: flex; align-items: center; gap: 8px; border: 0; padding: 10px 12px; color: var(--p); font-size: 11.5px; font-weight: 700; cursor: pointer; text-align: left; font-family: inherit; }
.small-t { font-size: 10px; font-weight: 700; }
.p-pad.tight-b { padding-bottom: 4px; }
.p-rankbox { display: grid; grid-template-columns: repeat(4, 1fr); padding: 10px 4px; margin-top: 4px; }
.p-rankbox b { display: block; font-size: 13.5px; color: var(--p); font-weight: 800; }
.p-rankbox small { font-size: 9px; color: var(--pm); }
.p-topic { margin-bottom: 8px; }
.p-bar.good i { background: #1a8a4a; }
.p-bar.weak i { background: #d4483b; }
.p-tip { display: flex; gap: 8px; padding: 10px; font-size: 11px; align-items: flex-start; color: var(--pt); background: color-mix(in srgb, var(--s) 14%, var(--pc)); }
.p-tip svg { color: var(--s); flex: none; }
.p-sol { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; }
.p-sol > b { font-size: 12px; margin-bottom: 2px; }
.p-qn { font-size: 10.5px; padding: 1px 7px; border-radius: 99px; background: color-mix(in srgb, var(--pt) 8%, transparent); }
.p-qn.ok { background: #e3f5ea; color: #145c33; }
.p-qn.no { background: #fbe6e3; color: #8e2a20; }
.p-sopt { padding: 5px 8px; border-radius: 6px; font-size: 11px; color: var(--pm); }
.p-sopt.ok { background: #e3f5ea; color: #145c33; font-weight: 700; }
.p-sopt.no { background: #fbe6e3; color: #8e2a20; }
.p-explain { margin-top: 4px; padding: 7px 8px; border-radius: 6px; background: color-mix(in srgb, var(--p) 8%, transparent); color: var(--pt); font-size: 10.5px; line-height: 1.4; }

/* ---------- Phase 4: builder ---------- */
.iconbtn.lg { padding: 8px; border: 1px solid var(--line); background: var(--surface); }
.iconbtn[disabled] { opacity: .35; cursor: default; }
.wide-seg { display: flex; width: 100%; }
.wide-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; }
.blk { cursor: default; }
.blk .grip { color: var(--muted); cursor: grab; display: grid; place-items: center; padding: 2px; }
.blk.dragging { opacity: .45; }
.blk.drop { box-shadow: 0 -3px 0 var(--accent); }
.tabchips button.dragging { opacity: .45; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.wiz-feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 8px; margin-top: 6px; }
.wiz-feat { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; background: var(--surface); font-weight: 400; }
.wiz-feat.on { border-color: var(--accent); background: var(--accent-soft); }
.wiz-feat input { margin-top: 3px; accent-color: var(--accent); }
.wiz-feat b { display: block; font-size: 13px; color: var(--ink); }
.wiz-feat small { display: block; font-size: 11.5px; color: var(--muted); }
.ce-seg { display: flex; flex-wrap: wrap; }
.ce-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); position: relative; }
.ce-row.open { border-color: var(--accent); }
.ce-head { display: flex; align-items: center; gap: 6px; }
.ce-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: var(--ink); }
.ce-title b { display: block; font-size: 13px; }
.ce-title small { display: block; font-size: 11.5px; color: var(--muted); }
.ce-tools { display: flex; gap: 0; justify-content: flex-end; margin: -4px -4px 0 0; }
.ce-tools.inline { margin: 0; }
.ce-sub { border-left: 3px solid var(--accent-soft); padding: 4px 0 4px 10px; display: flex; flex-direction: column; gap: 6px; }
.ce-item { display: grid; grid-template-columns: 92px 1fr 90px auto auto; gap: 6px; align-items: center; }
.ce-item.opt { grid-template-columns: auto 1fr auto; }
.ce-item .check { font-size: 12px; margin: 0; }
.ce-item .check input { margin-top: 0; }
.ce-h { margin: 8px 0 0; font-size: 13.5px; }
.ce-thumb { width: 44px; height: 30px; border-radius: 6px; flex: none; background: linear-gradient(135deg, var(--accent), #ff8a00); background-size: cover; background-position: center; display: grid; place-items: center; color: #fff; }
.ce-thumb.big { width: 96px; height: 56px; }
.ce-img { display: flex; gap: 10px; align-items: flex-start; }
.upload-btn { position: relative; overflow: hidden; align-self: flex-start; cursor: pointer; }
.upload-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fgrid.tight { grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr)); gap: 8px; }
.in.sm-in { min-width: 0; }
.stack.tight { gap: 6px; }
@media (max-width: 560px) { .ce-item { grid-template-columns: 1fr 1fr; } }
.card.stack > .btn.sm, .ce-row > .btn.sm { align-self: flex-start; }
.p-book { flex: none; width: 118px; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--pt); font-family: inherit; display: block; }
.p-book-cover { display: flex; align-items: flex-end; height: 138px; padding: 9px; position: relative; color: #fff; background: linear-gradient(180deg, var(--s), var(--p)); background-size: cover; background-position: center; }
.p-book-cover b { font-size: 11.5px; font-weight: 800; line-height: 1.2; }
.p-book .p-cbody b { font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
