/* ---------- page layouts: auth, onboarding, dashboard ---------- */
main.page.wide { max-width: 1120px; position: relative; isolation: isolate; }
[x-cloak] { display: none !important; }
.auth { position: relative; isolation: isolate; min-height: calc(100vh - 61px); display: grid; grid-template-columns: 1fr minmax(320px, 440px); gap: var(--s-7); align-items: center; max-width: 1040px; margin: 0 auto; padding: var(--s-6) clamp(14px, 3vw, 24px); }
.auth-side { text-align: center; } .auth-side h2 { font-size: var(--fs-xl); margin-top: var(--s-4); }
.auth-card { background: var(--surface-glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--shadow-3); }
.auth-card h1 { font-size: var(--fs-xl); }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; gap: var(--s-4); } .auth-side { display: none; } }
.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: var(--s-4); margin-top: var(--s-5); }
.path { display: flex; flex-direction: column; gap: 4px; margin: 0; } .path .illus { width: 110px; height: auto; margin-bottom: var(--s-2); } .path h2 { font-size: var(--fs-lg); }
.path > p:last-child, .path > a, .path > button { margin-top: auto; align-self: flex-start; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-4); }
.dash-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.cvtile { display: flex; flex-direction: column; gap: var(--s-3); margin: 0; }
.cvtile-top { display: flex; gap: var(--s-3); align-items: center; } .cvtile .ring { --size: 64px; }
.cvtile-title { font-size: var(--fs-lg); margin: 0 0 4px; } .cvtile-title a { color: var(--fg); text-decoration: none; } .cvtile-title a:hover { color: var(--accent); }
.cvtile-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.bento .card { margin: 0; } .bento .card.empty { grid-column: 1 / -1; }
details > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; }
main.page.wide > .aurora { position: fixed; }
.pagehead { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-4); }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: var(--s-3); overflow-x: auto; padding-bottom: var(--s-3); scroll-snap-type: x proximity; }
.kanban > * { scroll-snap-align: start; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s-4); }
.gallery .tpl { perspective: 800px; } .gallery .tpl .thumb { aspect-ratio: 210/280; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3); padding: 10%; }
.gallery .tpl:hover .thumb { box-shadow: var(--shadow-3), var(--glow); }
.errpage { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: var(--s-6) var(--s-4); position: relative; isolation: isolate; }
.errpage .code { font: 800 clamp(4rem, 14vw, 9rem)/1 var(--font-display); letter-spacing: -.05em; }
.streak { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.meter { display: flex; align-items: center; gap: var(--s-3); padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-glass); font-size: var(--fs-sm); }
.meter .ring { --size: 44px; } .meter .ring b { font-size: 12px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 6px 0 10px 14px; animation: step-in var(--dur-4) var(--ease-out) both; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.timeline li.ok::before { background: var(--emerald); border-color: var(--emerald); } .timeline li.running::before { background: var(--emerald); border-color: var(--emerald); animation: pulse 1.6s infinite; } .timeline li.failed::before { background: var(--danger); border-color: var(--danger); }
.summary-card { text-align: center; background: var(--tint-ok); border-color: var(--emerald); box-shadow: var(--glow); animation: pop-in var(--dur-4) var(--ease-spring); }
.summary-card .big { font: 800 var(--fs-xl) var(--font-display); }
.aurora { position: fixed; } .hero-wrap .aurora { position: absolute; } main.page.wide > .aurora { position: fixed; }
details:not(.sec) > summary { color: var(--accent); font-weight: 600; list-style: none; gap: 8px; } details:not(.sec) > summary::before { content: "▸"; transition: transform var(--dur-2) var(--ease-out); display: inline-block; } details:not(.sec)[open] > summary::before { transform: rotate(90deg); } details:not(.sec) > summary::-webkit-details-marker { display: none; }
@media (max-width: 640px) { .aipanel { position: sticky; bottom: 0; z-index: 30; max-height: 55vh; overflow: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-3); } }

.timeline li > span[aria-hidden=true] { display: none; }
.timeline li.skipped::before { border-style: dashed; }

.kcol { background: var(--surface-glass); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; min-height: 180px; transition: background var(--dur-3), border-color var(--dur-3), transform var(--dur-3) var(--ease-spring); align-self: start; }
.kcol.over { border-color: var(--emerald); background: var(--tint-ok); transform: scale(1.015); }
.kcol h2 { font-size: var(--fs-md); margin: 4px 6px 10px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; margin-bottom: 10px; cursor: grab; box-shadow: var(--shadow-1); animation: pop-in var(--dur-4) var(--ease-spring); transition: transform var(--dur-3) var(--ease-spring), opacity var(--dur-2), box-shadow var(--dur-2); }
.kcard:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.kcard.dragging { opacity: .4; transform: scale(.96) rotate(-1.5deg); cursor: grabbing; }
.sr { position: absolute; left: -9999px; }

/* ---------- dashboard v2 ---------- */
.dash { max-width: 1240px; }
.eyebrow-sm { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 700; margin: 0 0 4px; }
.dash-head h1 { margin: 0 0 4px; font-size: var(--fs-xl); }
.dash-head p.muted { margin: 0; }
.statbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: var(--s-5); }
.stat { background: var(--surface); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat-n { font: 700 var(--fs-xl)/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.stat-l { font-size: var(--fs-sm); color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-5); align-items: start; }
.dash-main { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }
.dash-side { display: flex; flex-direction: column; gap: var(--s-4); position: sticky; top: 80px; }
.cvgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-4); }
.cvtile.card { margin: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.cvtile-thumb { position: relative; display: block; height: 150px; background: linear-gradient(160deg, var(--surface-2), var(--bg-2)); border-bottom: 1px solid var(--line); }
.cvtile-thumb .paper { position: absolute; left: 50%; top: 18px; width: 92px; height: 124px; transform: translateX(-50%); background: #fff; border-radius: 4px; box-shadow: var(--shadow-2); padding: 12px 10px; display: flex; flex-direction: column; gap: 6px; transition: transform var(--dur-3) var(--ease-out); }
.cvtile:hover .paper { transform: translateX(-50%) translateY(-4px) rotate(-1.5deg); }
.cvtile-thumb .paper i { display: block; height: 4px; border-radius: 2px; background: #d8dde8; } .cvtile-thumb .paper i:first-child { height: 7px; width: 60%; background: #1f3a5f; } .cvtile-thumb .paper i.s { width: 40%; background: #10b981; }
.cvtile-thumb .ring { position: absolute; right: 12px; bottom: 10px; --size: 50px; background: var(--surface); border-radius: 50%; box-shadow: var(--shadow-1); } .cvtile-thumb .ring b { font-size: 14px; }
.cvtile-body { padding: 14px 16px 4px; display: flex; flex-direction: column; gap: 6px; }
.cvtile-title { font-size: var(--fs-md); margin: 0; } .cvtile-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.cvtile-actions { display: flex; gap: 4px; flex-wrap: wrap; padding: 10px 12px 14px; margin-top: auto; }
.danger-text { color: var(--danger) !important; }
.newtile { min-height: 290px; display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; border: 2px dashed var(--line-strong); background: transparent; color: var(--muted); box-shadow: none; border-radius: var(--r-md); font-weight: 600; }
.newtile span { font-size: 1.6rem; line-height: 1; color: var(--accent); }
.newtile:hover { color: var(--fg); border-color: var(--emerald); background: var(--tint-ok); box-shadow: none; transform: none; }
.importcard { margin: 0; } .importcard h2 { font-size: var(--fs-lg); margin: 0 0 4px; }
.importrow { display: flex; gap: var(--s-3); align-items: flex-end; flex-wrap: wrap; margin-top: var(--s-3); } .importrow .grow { flex: 1 1 220px; }
.sidecard { margin: 0; padding: 14px 16px; } .sidecard h2 { font-size: var(--fs-md); margin: 0 0 6px; } .sidecard p { font-size: var(--fs-sm); }
.evrow { display: flex; flex-direction: column; gap: 2px; margin: 0 0 10px; } .evrow .badge { align-self: flex-start; }
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } .dash-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
@media (max-width: 640px) { .statbar { grid-template-columns: repeat(2, 1fr); } }

/* ---------- editor toolbar v2 ---------- */
.ed-top { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.ed-title { flex: 1; font: 600 var(--fs-lg) var(--font-display); border-color: transparent; background: transparent; padding-left: 8px; }
.ed-title:hover { border-color: var(--line-strong); }
.iconbtn { width: 40px; min-height: 40px; padding: 0; background: transparent; border: 1px solid var(--line); color: var(--fg); box-shadow: none; border-radius: 10px; }
.iconbtn:hover { background: var(--tint-info); box-shadow: none; color: var(--fg); }
.iconbtn svg, .editor .rail svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ed-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.menu { position: relative; } .menu > summary { list-style: none; min-height: var(--tap); } .menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::before { content: none; } .menu > summary::after { content: "▾"; margin-left: 6px; font-size: .8em; }
.menu-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 220px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow-3); padding: 6px; display: flex; flex-direction: column; animation: pop-in var(--dur-2) var(--ease-out); }
.menu-pop a, .menu-pop button { display: flex; align-items: center; justify-content: flex-start; min-height: 40px; padding: 8px 12px; border-radius: 10px; color: var(--fg); text-decoration: none; font: 500 var(--fs-sm) var(--font-ui); width: 100%; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--tint-ok); color: var(--accent); }
.editor .rail a::before { content: none; }
.editor .rail a { color: var(--muted); }
.editor .panel p.status, .editor .panel p.checks { margin: 4px 0; } .editor .panel p.err:empty { min-height: 0; margin: 0; } .importcard details { margin-top: 4px; }

/* ---------- redesign helpers ---------- */
.ticks { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 28px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--tint-ok); box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .4); }
.ticks li::after { content: ""; position: absolute; left: 6px; top: 8px; width: 6px; height: 9px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.review-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; position: sticky; top: 12px; z-index: 5; background: var(--surface-glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
@media (max-width: 960px) { .review-bar { top: 66px; } }
.prose { padding: clamp(20px, 3vw, 40px); }
.prose ul { padding-left: 1.2em; display: grid; gap: 10px; }
.prose h1 { font-size: var(--fs-xl); }
.public-content > main.page.readable { margin: clamp(24px, 5vw, 64px) auto 72px; }
.paths { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.public-content > main.page.wide { max-width: 1320px; }
