/* XPLP app: page blocks ported from the mocks' <style> heads, plus the few rules that replace the mocks' inline styles. */

/* ---------- landing (index.html) ---------- */
.hero h1{font-size:clamp(30px,3.6vw,42px);letter-spacing:-.03em;line-height:1.08;margin-top:-6px}
.hero h1 em{font-style:normal;background:linear-gradient(transparent 60%,var(--tint) 60%);padding:0 2px}
.hero .lede{font-size:17px;color:var(--text);max-width:46ch;margin:14px 0 22px}
.hero .cta{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.section{padding:52px 0 0}
.section-head{display:flex;align-items:baseline;gap:6px 16px;margin-bottom:18px;flex-wrap:wrap}
.section-head .meta{font-size:13px}
.section-head>a:last-child{margin-left:auto}
.section-head h2{margin:0;font-size:22px}

/* ---------- sign in, sign up, reset (login.html) ---------- */
.auth{min-height:calc(100vh - var(--topbar));display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.auth .side{background:var(--band);color:#fff;padding:56px 48px;position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-end}
.auth .side h2{color:#fff;font-size:clamp(24px,3vw,34px);max-width:16ch;letter-spacing:-.02em}
.auth .side p{color:rgba(255,255,255,.8);max-width:44ch}
.auth .form{display:flex;align-items:center;justify-content:center;padding:40px 20px}
.auth .box{width:min(400px,100%)}
.auth .box h1{font-size:26px}
.auth .box .btn{width:100%}
.auth .side .pattern{position:absolute;inset:0;opacity:.14;background:repeating-linear-gradient(135deg,transparent 0 60px,#fff 60px 62px),radial-gradient(circle at 70% 30%,transparent 180px,#fff 181px,#fff 183px,transparent 184px)}
.auth .side .side-copy{position:relative}
.auth .meta{margin-top:18px}
.or{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:13px;margin:18px 0}
.or::before,.or::after{content:"";flex:1;border-top:1px solid var(--border)}
@media (max-width:1023px){.auth{grid-template-columns:1fr}.auth .side{display:none}}
:root[data-theme="dark"] .auth .side{border-right:1px solid var(--border)}:root[data-theme="dark"] .auth .side .pattern{opacity:.08}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) .auth .side{border-right:1px solid var(--border)}:root:not([data-theme="light"]) .auth .side .pattern{opacity:.08}}

/* ---------- signed-in home (home.html) ---------- */
.feed{max-width:720px;margin:0 auto;padding:0 20px 80px}
.chipbar{position:sticky;top:var(--topbar);z-index:30;background:var(--bg);border-bottom:1px solid var(--border);margin-bottom:4px}
.chips{position:relative;display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:14px 0 12px}
.chips::-webkit-scrollbar{display:none}
.chips button,.chips a{flex:none;display:inline-flex;align-items:center;height:32px;padding:0 14px;border-radius:16px;border:1px solid var(--border);background:var(--bg);color:var(--text);font-weight:600;font-size:13px;cursor:pointer;white-space:nowrap;text-decoration:none}
.chips a:hover{border-color:var(--ink);color:var(--ink)}
.chips button[aria-pressed="true"],.chips a[aria-pressed="true"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.chip-arrow{position:absolute;top:calc(50% + 1px);transform:translateY(-50%);z-index:2;width:28px;height:28px;padding:0;border-radius:50%;border:1px solid var(--border);background:var(--bg);color:var(--ink);display:flex;align-items:center;justify-content:center;cursor:pointer}
.chip-arrow[hidden]{display:none}
.chip-arrow.l{left:0;box-shadow:10px 0 10px 4px var(--bg),-6px 0 0 4px var(--bg)}
.chip-arrow.r{right:0;box-shadow:-10px 0 10px 4px var(--bg),6px 0 0 4px var(--bg)}
.chip-arrow:hover{border-color:var(--ink)}
.chip-arrow svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.chips .more{margin-left:auto;color:var(--accent-ink);border:0;padding:0 4px}
.caught{text-align:center;padding:34px 0 10px;color:var(--muted);font-size:13px}
.caught b{display:block;color:var(--ink);font-size:16px;margin-bottom:4px}
@media (max-width:767px){.feed{padding:0 14px 80px}}

/* ---------- app chrome: replaces the mocks' inline styles ---------- */
.topbar nav.nav-gap{margin-left:18px}
.acct form{margin:0}
/* flash toast (flash.js): warn keeps the dark toast with a warn edge */
.toast.warn{box-shadow:inset 4px 0 0 var(--warn)}
.err{color:var(--danger);font-size:14px;font-weight:600;margin:0 0 14px}
.pilot-lede{margin:0 0 14px}
.sheet-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:6px}
#pilot-done .sheet-actions{margin-top:12px}

/* ---------- topics (topics.html) ---------- */
.thead{padding:36px 0 22px}
.thead h1{font-size:clamp(26px,3.6vw,34px);letter-spacing:-.02em;margin:0}
.thead .row{display:flex;gap:16px 40px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.thead form{flex:1;min-width:260px;max-width:460px}
/* /topics: one scrolling row of equal tiles per group, snap, arrows on hover (desktop), edge fade */
.trow{margin-top:28px}
.trow h2{font-size:20px;margin:0 0 12px}.trow h2 .cnt{font-size:13px;font-weight:600;color:var(--muted)}
.carousel{position:relative}
.carousel .track{display:flex;gap:16px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding:0 2px;scrollbar-width:none;padding:2px 2px 6px}
.carousel .track::-webkit-scrollbar{display:none}
.carousel .track>.topic-tile{flex:0 0 calc((100% - 64px) / 5);scroll-snap-align:start}
.carousel .car-arrow{top:calc(50% - 2px);width:36px;height:36px;opacity:0;transition:opacity .15s}
.carousel .car-arrow.l{left:-14px}.carousel .car-arrow.r{right:-14px}
.carousel:hover .car-arrow,.carousel .car-arrow:focus-visible{opacity:1}
@media (max-width:1023px){.carousel .track>.topic-tile{flex-basis:calc((100% - 32px) / 3)}}
@media (max-width:767px){.carousel .track{gap:10px;margin:0 -20px;padding:2px 20px 6px;scroll-padding:0 20px}.carousel .track>.topic-tile{flex-basis:44%}.carousel .car-arrow{display:none}}
@media (hover:none){.carousel .car-arrow{display:none}}
@media (prefers-reduced-motion:reduce){.carousel .car-arrow{transition:none}}
.group{margin-top:34px}
.group .gh{display:flex;align-items:baseline;gap:14px;margin-bottom:14px}
.group .gh h2{margin:0;font-size:20px}
.group .gh h2 a{color:inherit}
.group .gh>a{font-size:13px;font-weight:600;margin-left:auto}
.waiting{margin-top:40px;background:var(--surface);border-radius:var(--radius-lg);padding:22px 24px;display:flex;gap:24px;align-items:center;flex-wrap:wrap}
.waiting h3{margin:0}
.waiting .btn{margin-left:auto}
@media (max-width:767px){.thead form{min-width:0;max-width:none;flex-basis:100%}.waiting .btn{margin-left:0}}

/* ---------- one topic (topic.html) ---------- */
.topic-head{padding:40px 0 26px;border-bottom:1px solid var(--border)}
.crumbs{font-size:13px;color:var(--muted);margin-bottom:8px}
.crumbs a{color:var(--muted)}.crumbs a:hover{color:var(--accent)}
.topic-head .row{display:flex;gap:18px;align-items:flex-start;justify-content:space-between;flex-wrap:wrap}
.topic-head h1{font-size:clamp(28px,4vw,38px);letter-spacing:-.02em;margin:0 0 6px}
.topic-head .row>div:first-child{flex:1 1 420px;min-width:0;max-width:820px}
.topic-head .follow{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.topic-head .follow .fsplit{width:auto}
.topic-head .follow .fsplit button{padding:0 18px}
.topic-head.has-cover{position:relative;isolation:isolate;background:var(--band) center/cover no-repeat;color:#fff;border-bottom:0;padding:72px 0 30px}
.topic-head.has-cover::before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(22,32,56,.25),rgba(22,32,56,.85))}
.topic-head.has-cover h1{color:#fff}
.topic-head.has-cover .crumbs,.topic-head.has-cover .crumbs a,.topic-head.has-cover .meta{color:rgba(255,255,255,.85)}
.topic-head.has-cover .fsplit span{background:var(--bg)}
/* Narrower: label and up to 6 chips on one line, then +N more expands the full list inline (CSS only: #kids-more) */
.children{display:flex;gap:8px;align-items:flex-start;margin-top:14px;min-width:0}
.children>.meta{flex:none;align-self:flex-start;line-height:28px}
.children .kids{display:flex;gap:8px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;min-width:0;align-items:center}
.children .kids::-webkit-scrollbar{display:none}
.children .kids .chip{flex:none}
.children .extra{display:none}
.children .all{cursor:pointer}
#kids-more:checked~.kids{flex-wrap:wrap;align-self:flex-start;overflow:visible;-webkit-mask-image:none;mask-image:none}
#kids-more:checked~.kids .extra{display:inline-flex}
#kids-more:checked~.all{display:none}
.children>.all{flex:none}
#kids-more:focus-visible~.all{outline:2px solid var(--accent);outline-offset:2px}
.layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:40px;padding-top:28px;padding-bottom:60px}
.lhead{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:0 0 10px;border-bottom:1px solid var(--border);font-size:13px;color:var(--muted)}
.lhead span:first-child{color:var(--ink);font-weight:700}
.side h4{margin-bottom:6px}
.side h4:not(:first-child){margin-top:26px}
.side .editor-card{margin-bottom:12px}
.side .pilot-line{margin:12px 0 0}
.chip-row{display:flex;gap:8px;flex-wrap:wrap}
@media (max-width:1023px){.layout{grid-template-columns:minmax(0,1fr);gap:28px}}

/* ---------- reader onboarding (onboarding.html, onboarding-editors.html) ---------- */
.ob{max-width:1140px;margin:0 auto;padding:34px 20px 40px}
body:has(.bar){padding-bottom:var(--barh,72px)}
.ob h1{font-size:clamp(24px,3.4vw,32px);letter-spacing:-.02em;margin-bottom:6px}
.ob .lede{color:var(--text);max-width:62ch;margin-bottom:14px}
.langs{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:22px;font-size:14px}
#lang-chips{display:contents}
.langs .chip.select .x{display:none}.langs .chip.on .x{display:inline}
.langlist{margin-top:8px;max-height:52vh;overflow:auto}
.langlist label{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--border);cursor:pointer;color:var(--ink);font-size:15px}
.langlist label small{margin-left:auto;color:var(--muted)}
.langlist .empty{padding:18px 0;color:var(--muted);font-size:14px;text-align:left}
.tsearch{max-width:560px;margin:4px 0 8px}
.deeper{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 4px}
.deeper label{cursor:pointer}
.deeper input{position:absolute;opacity:0;pointer-events:none}
.deeper label:has(input:checked){background:var(--accent);border-color:var(--accent);color:#fff}
.deeper label:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}
#branches{margin-top:22px}
.parent{display:flex;align-items:baseline;gap:12px;margin:26px 0 12px}
.parent h2{font-size:18px;margin:0}
.parent small{color:var(--muted)}
.tgrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.tgrid label{position:relative;cursor:pointer;display:block}
.tgrid input{position:absolute;opacity:0}
.tgrid .t{position:relative;display:block;aspect-ratio:16/9;border-radius:var(--radius);overflow:hidden;background:var(--surface-2) center/cover no-repeat;color:#fff;isolation:isolate;transition:transform .15s ease,box-shadow .15s ease}
.tgrid label:not(.maxed):hover .t{transform:translateY(-2px);box-shadow:0 8px 18px rgba(22,32,56,.2)}
.tgrid input:checked + .t{box-shadow:0 0 0 3px var(--accent)}
.tgrid label:hover input:checked + .t{box-shadow:0 0 0 3px var(--accent),0 8px 18px rgba(22,32,56,.2)}
.tgrid label.maxed{cursor:not-allowed}.tgrid label.maxed .t{opacity:.4;filter:grayscale(.6)}
.deeper label.maxed{cursor:not-allowed;opacity:.45}
@media (prefers-reduced-motion:reduce){.tgrid .t{transition:none}.tgrid label:not(.maxed):hover .t{transform:none}}
.tgrid .t::before{content:"";position:absolute;inset:0;background:rgba(22,32,56,.5);transition:background .2s}
.tgrid .t.plain{background:var(--surface)}
.tgrid .t.plain::before{background:transparent}
.tgrid .t.plain b{color:var(--ink)}.tgrid .t.plain small{color:var(--muted)}
.tgrid .t b{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:12px 16px 26px;font-size:18px;font-weight:700;letter-spacing:-.01em;text-shadow:0 1px 2px rgba(0,0,0,.25)}
.tgrid .t small{position:absolute;left:0;right:0;bottom:10px;text-align:center;font-size:12px;color:rgba(255,255,255,.85)}
.tgrid .t .ck{position:absolute;right:8px;top:8px;width:24px;height:24px;border-radius:50%;background:#fff;color:var(--accent);display:none;align-items:center;justify-content:center;font-weight:800;font-size:13px;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.tgrid input:checked + .t::before{background:rgba(18,150,182,.82)}
.tgrid input:checked + .t.plain::before{background:var(--accent)}
.tgrid input:checked + .t.plain b{color:#fff}.tgrid input:checked + .t.plain small{color:rgba(255,255,255,.85)}
.tgrid input:checked + .t .ck{display:flex}
.tgrid input:focus-visible + .t{outline:2px solid var(--accent);outline-offset:2px}
.tgrid .t:hover::before{background:rgba(18,150,182,.45)}
.bar{position:fixed;left:0;right:0;bottom:0;background:var(--bg);border-top:1px solid var(--border);padding:12px 20px;z-index:40}
.bar .in{max-width:1140px;margin:0 auto;display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.bar .n{font-size:22px;font-weight:800;color:var(--ink);line-height:1}
.bar .n small{display:block;font-size:11px;color:var(--muted);font-weight:700;margin-top:2px}
.bar .picked{display:flex;gap:6px;flex-wrap:wrap;flex:1;min-width:0}
.bar .picked .x{cursor:pointer}
.bar .err{margin:0}
.bar>.in>.btn{margin-left:auto}
.bar .acts{margin-left:auto;display:flex;gap:10px}
.bar .acts .btn{margin:0}
.bar .acts [hidden]{display:none}
.because{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:26px;font-size:14px}
.ob .sub{margin-top:36px}
.ob .sub h2{font-size:18px}
@media (max-width:1023px){.tgrid,.ob .wgrid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:767px){.ob .wgrid{grid-template-columns:minmax(0,1fr)}.tgrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.tgrid .t b{font-size:15px}.bar .picked{display:none}}

/* ---------- signed-in home: topic prompt ---------- */
.pick-prompt{display:flex;gap:16px;align-items:center;justify-content:space-between;flex-wrap:wrap;background:var(--tint);border-radius:var(--radius-lg);padding:16px 20px;margin:18px 0 4px}
.pick-prompt b{color:var(--ink);font-size:16px}
/* profile-completion card (FR-NET-28): title, count, bar and hide on one line, then one row of chips; stacked on phone */
.nudge{background:var(--tint);border-radius:var(--radius-lg);padding:14px 16px;margin:18px 0 4px}
.np-head{display:flex;align-items:center;gap:12px}
.np-head b{color:var(--ink);font-size:15px;white-space:nowrap}
.np-n{font-size:12px;color:var(--muted);font-weight:600;white-space:nowrap}
.np-bar{flex:1;min-width:60px;height:6px;border:0;border-radius:3px;background:var(--accent-soft);overflow:hidden;-webkit-appearance:none;appearance:none}
.np-bar::-webkit-progress-bar{background:var(--accent-soft);border-radius:3px}
.np-bar::-webkit-progress-value{background:var(--accent);border-radius:3px;transition:width .3s}
.np-bar::-moz-progress-bar{background:var(--accent);border-radius:3px}
.np-hide{margin:0}
.np-x{width:28px;height:28px;border:0;background:none;color:var(--muted);font-size:20px;line-height:1;border-radius:var(--radius);cursor:pointer}
.np-x:hover{background:var(--accent-soft);color:var(--ink)}
.np-chips{display:flex;gap:6px;margin-top:10px;overflow-x:auto;scrollbar-width:none}
.np-chip{display:inline-flex;align-items:center;gap:4px;flex:none;height:30px;padding:0 11px;border-radius:15px;border:1px solid var(--border-strong);background:var(--bg);color:var(--ink);font-size:12.5px;font-weight:600;white-space:nowrap}
.np-chip:hover{border-color:var(--accent);color:var(--accent-ink);text-decoration:none}
.np-chip.done{background:transparent;border-color:transparent;color:var(--muted);font-weight:500;padding:0 6px}
.np-chip svg{width:14px;height:14px;stroke:var(--success);fill:none;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
@media (max-width:640px){
  .np-head{flex-wrap:wrap;row-gap:8px}.np-head b{flex:1}.np-bar{order:3;flex-basis:100%}
  .np-chips{flex-direction:column;align-items:stretch}.np-chip{height:40px;border-radius:var(--radius)}
}

/* ---------- account settings (account.html) ---------- */
.set{display:grid;grid-template-columns:220px minmax(0,1fr);gap:40px;padding-top:30px;padding-bottom:60px;max-width:1040px;margin:0 auto}
.snav a{display:block;padding:10px 12px;border-radius:var(--radius);color:var(--text);font-weight:600;font-size:15px}
.snav a:hover{background:var(--surface);text-decoration:none}
.snav a[aria-current]{color:var(--accent-ink);background:var(--tint)}
.snav h4{font-size:12px;color:var(--muted);margin:16px 12px 6px}
.set .crumb{font-size:14px;color:var(--muted);margin-bottom:8px}
.set .crumb b{color:var(--ink);font-weight:600}
.set .box{background:var(--surface);border-radius:var(--radius-lg);padding:24px 26px;margin-bottom:22px}
.set .box h2{font-size:18px;margin-bottom:14px}
.set .wt{background:var(--bg);border-radius:var(--radius);padding:4px 18px 4px;margin-bottom:12px}
.set .wt .row{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:14px;align-items:center;padding:12px 0;border-bottom:1px solid var(--border)}
.set .wt .row:last-child{border-bottom:0}
.set .wt .row a{font-weight:600;font-size:15px}
.set .wt .rm{width:30px;height:30px;border-radius:50%;border:1px solid var(--accent);background:none;color:var(--accent);cursor:pointer;font-size:18px;line-height:1}
.set .addrow{display:flex;gap:8px;margin:0}
.set .two{display:grid;grid-template-columns:1fr 1fr;gap:0 22px}
.set .excl{background:var(--bg);border-radius:var(--radius);padding:12px 14px;min-height:92px;display:flex;gap:8px;flex-wrap:wrap;align-content:flex-start}
.set .excl .chip a{color:inherit}
.set .chip .x{border:0;background:none;color:inherit;cursor:pointer;padding:0 0 0 2px;font:inherit}
.set .nrow{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--border);font-size:14px}
.set .nrow:last-child{border-bottom:0}
.set .nrow b{display:block;color:var(--ink);font-weight:600}
.set .nrow small{display:block}
.set .err{margin:6px 0 0}
.set .box>.err{margin:0 0 14px}
.pfhead{display:flex;gap:18px;align-items:center;margin-bottom:18px}
.handle-line{display:flex;align-items:center;gap:6px}
.links-in{display:grid;gap:8px}
.langpick{display:flex;gap:8px;flex-wrap:wrap}
.langpick label{cursor:pointer}
.langpick input{position:absolute;opacity:0;pointer-events:none}
.langpick label:has(input:checked){background:var(--accent);border-color:var(--accent);color:#fff}
.langpick label:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}
.toggles{display:flex;flex-direction:column;gap:12px;align-items:flex-start;margin-top:6px}
.form-actions{margin-top:18px}
@media (max-width:1023px){.set{grid-template-columns:1fr;gap:16px}.snav{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none}.snav h4{display:none}.snav a{white-space:nowrap}.set .two{grid-template-columns:1fr}}
@media (max-width:767px){.set .box{padding:18px 16px}}

/* ---------- public profile (profile.html) ---------- */
.profile{max-width:1000px;padding-bottom:60px}
.pcard{border:1px solid var(--border);border-radius:var(--radius-lg);padding:26px 28px;margin-top:30px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px;align-items:start;position:relative}
.pcard h1{font-size:clamp(24px,3vw,30px);margin:0 0 2px;letter-spacing:-.02em}
.pcard .loc{color:var(--accent);font-weight:600;font-size:14px}
.pcard .act{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.pcard .act.fsplit{gap:0;flex-wrap:nowrap}
.pcard .big{width:96px;height:96px;font-size:30px}
.pcard .nums{display:flex;gap:18px;flex-wrap:wrap;margin:10px 0 12px;font-size:14px;color:var(--muted)}
.pcard .nums a{color:var(--muted);text-decoration:none}.pcard .nums a:hover{color:var(--accent-ink);text-decoration:none}
.pcard .nums b{color:var(--ink);font-weight:700}
.pcard .topics{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.pcard .loc+.act,.pcard .loc+.topics{margin-top:14px}
.pcard .fsplit{width:auto}.pcard .fsplit button{height:38px;padding:0 20px;font-size:14px}.pcard .fsplit span{height:38px;font-size:13px;padding:0 12px}
.pcard .act .btn{height:38px}
.pcard .links{display:flex;margin:0 0 0 auto;gap:8px}
.pcard .links a{width:32px;height:32px;border-radius:50%;border:1px solid var(--border);display:inline-flex;align-items:center;justify-content:center;color:var(--muted)}
.pcard .links a:hover{color:var(--accent);border-color:var(--accent)}
.pcard .links svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8}
.implied{margin-top:12px;font-size:13px;color:var(--text);background:var(--tint);border-radius:var(--radius);padding:8px 12px;max-width:62ch}
.implied a{font-weight:600}
.profile .bio{padding:4px 2px 0;margin-top:18px;max-width:72ch}
.profile .bio p{font-size:15px;margin:0;color:var(--text);white-space:pre-line}
.profile .sec{margin-top:40px}
.profile .sec .sh{display:flex;align-items:baseline;gap:14px;margin-bottom:14px}
.profile .sec .sh h2{margin:0;font-size:20px}
@media (max-width:767px){.pcard{grid-template-columns:1fr;padding:20px}.pcard>div:first-child{padding-right:76px}.pcard>div>.nums,.pcard>div>.topics,.pcard>div>.act{margin-right:-76px}.pcard .big{position:absolute;right:16px;top:16px;width:64px;height:64px;font-size:20px}}

/* ---------- workspace bar (inbox.html): the collection menu holds links ---------- */
.menu a{display:flex;align-items:center;gap:10px;width:100%;padding:9px 14px;color:#fff;font-weight:600}
.menu a:hover{background:rgba(255,255,255,.08);text-decoration:none}
.menu a[aria-current]{background:rgba(255,255,255,.08)}

/* ---------- collection settings (collection-setup.html) and /new-collection ---------- */
.cset .steps button[aria-selected="true"]{color:var(--ink);background:var(--surface)}
.cset .pane:not(.two){max-width:740px}
.cset .two{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:32px;align-items:start}
.cset .two[hidden]{display:none}
.cset .two .side{position:sticky;top:calc(var(--topbar) + 70px)}
.cset .found{border:1px solid var(--border);border-radius:var(--radius);margin:-6px 0 16px;display:none}
.cset .found.show{display:block}
.cset .found .cand{display:flex;gap:10px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--border);font-size:14px;margin:0}
.cset .found>:last-child{border-bottom:0}
.cset .found b{color:var(--ink);font-weight:600;overflow-wrap:anywhere}
.cset .found .cand>span{min-width:0}
.cset .found .cand>.btn,.cset .found .cand>small{margin-left:auto;flex:none}
.cset .found .notice{margin:0;border-radius:0}
.cset .quota{display:flex;justify-content:space-between;gap:12px;font-size:13px;padding:6px 0;border-bottom:1px solid var(--border)}
.cset .quota:last-child{border:0}
.cset .quota b{color:var(--ink);white-space:nowrap}
.cset .panel h4{margin:0 0 8px}
@media (max-width:1023px){.cset .two{grid-template-columns:1fr}.cset .two .side{position:static}}
.disc-line{display:flex;gap:10px}.disc-line .input{flex:1;min-width:0}
.source-row.head{color:var(--muted);font-size:13px;font-weight:600}
.source-row .rm{width:32px;height:32px}
#source-list+.empty{padding:28px 20px}
.secs{padding:6px 14px}
.secs .err{margin:8px 0}
.source-row.secrow{grid-template-columns:24px minmax(0,1fr) minmax(0,1fr) 100px}
.secrow:last-child{border:0}
.secrow .acts{display:flex;gap:2px;justify-content:flex-end}
.secrow .iconbtn{width:30px;height:30px}
.secrow .iconbtn[disabled]{opacity:.3;cursor:default}
.secrow .input{height:32px;padding:0 8px}
.secadd{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}.secadd .input{max-width:220px}
.tchips{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.tchips:empty{display:none}
.tchips .x{border:0;background:none;padding:0;font:inherit;color:inherit;opacity:.6;cursor:pointer}
.tchips .x:hover{opacity:1}
.tadd{position:relative}
.tadd .found{position:absolute;left:0;right:0;top:100%;margin:4px 0 0;background:var(--bg);z-index:40;box-shadow:var(--shadow);max-height:300px;overflow:auto}
.tadd .found button{display:flex;width:100%;gap:10px;align-items:center;padding:9px 12px;border:0;border-bottom:1px solid var(--border);background:none;font:inherit;font-size:14px;font-weight:600;color:var(--ink);text-align:left;cursor:pointer}
.tadd .found button:hover,.tadd .found button:focus{background:var(--surface);outline:0}
.tadd .found small{margin-left:auto;color:var(--muted);font-weight:500}
.tadd .found .none{padding:9px 12px;font-size:14px;color:var(--muted)}
.cset .toggles{display:grid;gap:10px}
.cset .addr{display:flex;align-items:center;gap:6px;font-weight:600}
.morelangs{display:contents}
.morelangs summary{list-style:none}
.morelangs summary::-webkit-details-marker{display:none}
.morelangs[open] summary{display:none}
.morelangs .langpick{display:contents}

/* ---------- collection cover (public-collection.html) ---------- */
.band.ccover{padding:44px 0 34px;overflow:visible}
.ccover .sep{color:rgba(255,255,255,.6)}
.ccover .head{display:grid;grid-template-columns:96px minmax(0,1fr);gap:0 24px;align-items:start}
.ccover .mark{grid-row:1/3;width:96px;height:96px;margin-top:4px;background:#fff;border-radius:var(--radius);display:flex;align-items:center;justify-content:center;color:#162038;font-weight:800;font-size:28px}
.ccover h1{font-size:clamp(26px,4vw,34px);line-height:1.15;margin:0 0 6px}
.ccover p{color:rgba(255,255,255,.85);max-width:62ch;margin:0}
.ccover .foot{grid-column:2;display:flex;align-items:center;justify-content:space-between;gap:14px 24px;flex-wrap:wrap;margin-top:22px;padding-top:18px;border-top:1px solid rgba(255,255,255,.18)}
.ccover .who{display:flex;align-items:center;gap:10px;font-size:14px;min-width:0;flex-wrap:wrap}
.ccover .who a,.ccover .who b{white-space:nowrap;color:#fff;font-weight:600}
.ccover .who .avatar{background:#fff;color:#162038;width:28px;height:28px;font-size:11px}
.ccover .stat{font-size:13px;color:rgba(255,255,255,.75)}
.ccover .cchips{display:inline-flex;gap:6px;flex-wrap:wrap}
.ccover .cchips .chip{background:rgba(255,255,255,.14);color:#fff;height:24px;font-size:12px}
.ccover .follow{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.ccover .fsplit{width:auto}
.ccover .fsplit button{background:#fff;color:#162038;border-color:#fff;padding:0 18px;height:38px;font-size:14px}
.ccover .fsplit button:hover{background:#eef1f6}
.ccover .fsplit button.on{background:transparent;color:#fff;border-color:rgba(255,255,255,.5)}
.ccover .fsplit button[data-folmenu][data-on="1"]::after{content:"";display:inline-block;width:6px;height:6px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg);margin:0 0 3px 9px}
.ccover .fsplit span{height:38px;background:transparent;color:#fff;border-color:rgba(255,255,255,.5)}
.ccover .share{background:transparent;color:#fff;border-color:rgba(255,255,255,.5)}
.csub{display:flex;gap:28px;align-items:center;margin:28px 0 0}
.csub .tabs{margin:0;flex:1}
.folwrap{position:relative}
.folmenu{position:absolute;right:0;top:calc(100% + 8px);width:300px;max-width:calc(100vw - 32px);background:var(--bg);color:var(--ink);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow);padding:8px;display:none;z-index:70;text-align:left}
.folmenu.open{display:block}
.folmenu .h{font-size:12px;color:var(--muted);font-weight:700;padding:6px 10px 4px}
.folmenu button{display:flex;align-items:flex-start;gap:10px;width:100%;padding:9px 10px;border:0;background:none;color:var(--ink);font:inherit;font-size:14px;font-weight:600;text-align:left;border-radius:var(--radius);cursor:pointer;line-height:1.3}
.folmenu button:hover{background:var(--surface)}
.folmenu button b{display:block;font-weight:600}
.folmenu .ck{width:18px;height:18px;flex:none;border:1.5px solid var(--border-strong);border-radius:50%;margin-top:1px;position:relative}
.folmenu [aria-checked="true"] .ck{border-color:var(--accent);background:var(--accent)}
.folmenu [aria-checked="true"] .ck::after{content:"";position:absolute;left:5px;top:2px;width:4px;height:8px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}
.folmenu hr{border:0;border-top:1px solid var(--border);margin:6px 0}
.folmenu .danger{color:var(--danger)}
@media (max-width:767px){.band.ccover{padding:28px 0 24px}.ccover .head{grid-template-columns:64px minmax(0,1fr);gap:0 14px}.ccover .mark{grid-row:1;width:64px;height:64px;font-size:20px;margin-top:0}.ccover .foot{grid-column:1/-1;margin-top:16px;padding-top:14px}.folmenu{right:auto;left:0}.ccover .who{display:grid;grid-template-columns:28px minmax(0,1fr);gap:4px 10px}.ccover .who .sep{display:none}.ccover .who .stat,.ccover .who .cchips{grid-column:2}}

/* search (search.html) */
.shead{padding:30px 0 0}
.shead form{max-width:720px}
.shead .search-line input{height:54px;font-size:20px;font-weight:600}
.shead .search-line>svg{width:22px;height:22px}
.scount{margin:12px 0 0}
.sres{max-width:820px;padding-bottom:60px}
.sres .block{margin-top:26px}
.sres .block h2{font-size:15px;color:var(--muted);font-weight:700;border-bottom:1px solid var(--border);padding-bottom:8px;display:flex;align-items:center}
.sres .block h2 a{margin-left:auto;font-size:13px;font-weight:600}
.sres .block .empty{padding:24px 0;text-align:left}
.sres .block .empty h3{font-size:15px;margin:0}
.sres .topic-row>div,.sres .coll-row>div,.sres .editor-row>div{min-width:0}
.sres .topic-row small,.sres .coll-row small,.sres .editor-row small{overflow-wrap:anywhere}

/* ---------- cards: no pinned height; the grid stretches a row to equal height and only the variable parts have fixed slots ---------- */
.editor-card b{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.editor-card small{max-width:100%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:calc(2 * 1.4em);line-height:1.4}
.editor-card div.on{width:100%;height:26px;overflow:hidden;margin:8px 0 0}
.editor-card div.on a{line-height:20px}
/* the mock's .editor-card .on (topic chips) also matches the Following button; undo that on the button */
.editor-card .fsplit button.on{display:inline-block;margin:0;height:34px;max-height:none;min-height:0;gap:0}
.editor-card .stat{margin:6px 0 0}
.editor-card .why,.coll-card .why{max-width:100%;min-height:1.4em;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.editor-card .why{margin:2px 0 0}
.editor-card .act{margin-top:auto;padding-top:13px}
.coll-card .cover b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.coll-card .cover small{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.coll-card .cover>span{max-width:100%;min-width:0}
.coll-card .cover{overflow:hidden}
@media (max-width:767px){.coll-card .cover small{-webkit-line-clamp:2}}
.coll-card .by>a,.coll-card .by>span:not(.avatar){min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---------- followers sheet: fixed size whatever the results; search on top, only the list scrolls ---------- */
.sheet .box.followers{height:min(72vh,600px)}
@media (max-width:767px){.sheet .box.followers{height:92vh}}

/* ---------- /start/editors ---------- */
.obe .obstep{font-size:13px;color:var(--muted);margin:0 0 8px}
.obe h1{margin-bottom:8px}
.obe .lede{color:var(--muted);margin:0}
.obe .because{margin:24px 0}
.obe .sub{margin-top:0}
.obe .sub + .sub,.obe .sub + .empty{margin-top:40px}
.obe .section-head{margin-bottom:16px}
.obe .section-head h2{font-size:22px}
.obe .section-head .cnt{color:var(--muted);font-weight:600}
.obe .wgrid>*{max-width:360px}

/* account menu entries for phone widths only (signed-in Home: the logo is the way home above that) */
@media (min-width:768px){.acct .ph-only{display:none}}

/* language row on /account (the /start row and sheet, langs.js) and label chips inside a .field */
.field .langs{margin-bottom:0}
.langs .chip.add{width:28px;padding:0;justify-content:center;font-size:17px;line-height:1;text-decoration:none}
.field label.chip,.langpick label.chip{display:inline-flex;align-items:center;margin:0;line-height:1;font-size:13px;color:var(--text)}

/* /account#digest: topic and editor lists scroll past about eight rows; the add controls stay below */
[data-pane="digest"] .wt,[data-pane="digest"] .excl{max-height:320px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent}
[data-pane="digest"] .wt::-webkit-scrollbar,[data-pane="digest"] .excl::-webkit-scrollbar{width:8px}
[data-pane="digest"] .wt::-webkit-scrollbar-thumb,[data-pane="digest"] .excl::-webkit-scrollbar-thumb{background:var(--border-strong);border-radius:4px}
[data-pane="digest"] .excl{margin-bottom:12px}
.langs .chip.add{border-color:var(--border-strong)}

/* landing hero: columns centred on each other, buttons a fixed 28px under the lede, smaller art, stable height */
.hero .top{align-items:center}
.hero .copy{justify-content:center}
.hero .copy h1{margin-top:0}
.hero .copy .lede{margin:14px 0 0}
.hero .copy .cta{margin-top:28px}
.hero .art{max-width:368px}
/* about 30% shorter (founder, 24 Oct 2026): less padding, tighter type and spacing, art scaled to the copy's height */
.hero{padding:24px 0 28px}
.hero .top{gap:24px}
.hero .copy .lede{margin:12px 0 0}
.hero .copy .cta{margin-top:20px}
.hero .art{max-width:280px}
@media (min-width:1024px){.hero .top{min-height:300px}}
@media (max-width:1023px){.hero .top{gap:14px}.hero .art{max-width:200px}}
@media (max-width:767px){
  .hero{padding:14px 0 22px}
  .hero h1{font-size:27px;margin-top:0}
  .hero .lede{font-size:15px;line-height:1.5}
  .hero .copy .lede{margin-top:10px}
  .hero .copy .cta{margin-top:16px}
  .hero .art{max-width:132px}
}

/* inline validation (app.js): the field's border turns danger; the message uses the server's .err style */
.input.is-invalid,input.is-invalid,textarea.is-invalid,select.is-invalid{border-color:var(--danger)}
.input.is-invalid:focus,input.is-invalid:focus,textarea.is-invalid:focus{outline-color:var(--danger);box-shadow:0 0 0 3px color-mix(in srgb,var(--danger) 18%,transparent)}
.field .err[data-for]{margin:6px 0 0;font-size:13px}

/* profile pictures: an uploaded picture fills any .avatar; 96px on /account#profile with Change / Remove */
.avatar{overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover;display:block;border-radius:50%;pointer-events:none} /* clicks land on the .avatar itself (the topbar menu toggle compares the target) */
.avatar.xl{width:96px;height:96px;font-size:30px}
.pfpic{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.pfpic label.btn{margin:0;cursor:pointer}
.pfpic input:focus-visible+label{outline:2px solid var(--accent);outline-offset:2px}
.pfhead+.err{margin:-8px 0 16px}
.pcard h1 .chip.private{height:24px;font-size:12px;vertical-align:middle;margin-left:6px;position:relative;top:-3px;letter-spacing:0}

/* language row: the add chip and the chips' remove glyph sit optically centred */
.langs .chip.add{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;line-height:1}
.langs .chip.add svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;display:block}
.langs .chip.on .x{display:inline-flex;align-items:center;justify-content:center;width:12px;height:12px;line-height:1;font-size:14px;padding:0}

/* /account#digest: heading row with a 36px ghost button on the right; "Editors I follow" as a capped list */
.set .box .bh{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.set .box .bh h2{margin:0}
.set .box .bh .cnt{color:var(--muted);font-weight:600}
.set .box .bh .btn{height:36px;padding:0 14px;font-size:13px;flex:none}
.set .elist{border-top:1px solid var(--border)}
.set .erow{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--border)}
.set .erow .avatar{width:32px;height:32px;font-size:11px}
.set .erow>div{min-width:0;flex:1}
.set .erow b{display:block;color:var(--ink);font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.set .erow b a{color:inherit}
.set .erow small{display:block;color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.set .erow .x{flex:none;width:30px;height:30px;border-radius:50%;border:1px solid var(--border-strong);background:none;color:var(--muted);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;font-size:17px;line-height:1;padding:0 0 1px}
.set .erow .x:hover{color:var(--danger);border-color:var(--danger)}
.set .erow.empty{color:var(--muted)}
.set .see-all{display:inline-block;margin-top:12px;font-weight:600;font-size:14px}
.toast .undo{pointer-events:auto;margin-left:12px;background:none;border:0;color:inherit;font:inherit;text-decoration:underline;cursor:pointer;padding:0}
.toast.show:has(.undo){pointer-events:auto}

/* suggested sources on the Sources step (collection-setup mock, step 2): rows between discovery and the editor's list */
.sugg-sources{margin:0 0 20px}
.sugg-sources h3{font-size:15px;margin:0 0 6px;color:var(--ink)}
.sugg-sources ul{list-style:none;margin:0;padding:0;border:1px solid var(--border);border-radius:var(--radius)}
.src-sugg{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr) auto;gap:0 16px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--border);font-size:14px;transition:opacity .2s}
.src-sugg:last-child{border-bottom:0}
.src-sugg.out,.src-sugg.htmx-swapping{opacity:0}
.src-sugg .who{min-width:0}
.src-sugg .who b{display:block;color:var(--ink);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.src-sugg .who small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.src-sugg .who small,.src-sugg .why{color:var(--muted);font-size:13px}
.src-sugg .act{margin:0}
.src-sugg .act fieldset{display:flex;gap:6px;align-items:center;border:0;margin:0;padding:0;min-width:0}
.src-sugg .x{width:32px;height:32px;border:0;background:none;color:var(--muted);font-size:20px;line-height:1;border-radius:var(--radius);cursor:pointer}
.src-sugg .x:hover{background:var(--border);color:var(--ink)}
.src-sugg .row-err{grid-column:1/-1}.src-sugg .row-err:empty{display:none}
.src-sugg .row-err .err{margin:8px 0 0;font-size:13px}
.sugg-sources .more{display:inline-block;margin-top:8px;font-size:13px}
/* in flight: the pressed control spins via the global .is-loading (app.js, xplp.css); the row's controls are disabled
   (hx-disabled-elt on the fieldset). The Show more link is not a .btn, so it keeps its own ring here. */
.sugg-sources .more.htmx-request{position:relative;color:transparent!important;pointer-events:none}
.sugg-sources .more.htmx-request::after{content:"";position:absolute;inset:0;margin:auto;width:14px;height:14px;box-sizing:border-box;border:2px solid var(--muted);border-top-color:transparent;border-radius:50%;animation:xspin .7s linear infinite}
.src-sugg fieldset:disabled .btn,.src-sugg fieldset:disabled .x{cursor:default}
.src-sugg fieldset:disabled .x{opacity:.5}
#sugg-lazy{min-height:1px}
@media (max-width:640px){
  .src-sugg{grid-template-columns:minmax(0,1fr) auto;row-gap:4px}
  .src-sugg .why{grid-column:1/-1;order:3}
  .src-sugg .row-err{order:4}
  .src-sugg .btn.sm{height:44px;padding:0 16px}
  .src-sugg .x{width:44px;height:44px}
}

/* /topics/follow (FR-NET-31): search, branches as collapsible sections of chips, a summary bar (sticky under the top
   bar on desktop, fixed at the bottom on phone) */
.tfollow{max-width:860px;margin:0 auto;padding:24px 20px 80px}
.tf-head{position:sticky;top:var(--topbar);z-index:20;background:var(--bg);display:flex;align-items:center;gap:16px;padding:10px 0;border-bottom:1px solid var(--border)}
.tf-head h1{margin:0;font-size:24px}
.tf-bar{margin-left:auto}.tf-bar .in{display:flex;align-items:center;gap:14px}
#tf-sum{font-size:14px;color:var(--text);white-space:nowrap}#tf-sum b{color:var(--ink)}
.tf-search{margin:16px 0 4px}
#tf-results:not(:empty){padding:10px 0 14px;border-bottom:1px solid var(--border)}
.tf-none{margin:0}
.tf-chips{display:flex;flex-wrap:wrap;gap:8px;padding:2px 0 14px}
.tf-branch{border-bottom:1px solid var(--border)}
.tf-branch>summary{display:flex;align-items:center;gap:10px;padding:14px 0;cursor:pointer;list-style:none;color:var(--ink);font-weight:700;font-size:16px}
.tf-branch>summary::-webkit-details-marker{display:none}
.tf-branch>summary .cnt{font-size:12px;font-weight:600;color:var(--accent-ink);background:var(--tint);border-radius:10px;padding:2px 8px}
.tf-branch>summary .chev{margin-left:auto;width:18px;height:18px;stroke:var(--muted);fill:none;stroke-width:2;transition:transform .15s}
.tf-branch[open]>summary .chev{transform:rotate(180deg)}
.tf-branch .chip.branch{font-weight:700}
.tf-more{margin:-6px 0 14px}
.tf-more>summary{display:inline-flex;align-items:center;height:30px;padding:0 12px;border-radius:15px;border:1px dashed var(--border-strong);color:var(--muted);font-size:13px;font-weight:600;cursor:pointer;list-style:none}
.tf-more>summary::-webkit-details-marker{display:none}
.tf-more[open]>summary{display:none}
@media (max-width:640px){
  .tfollow{padding:16px 14px 96px}
  .tf-head{position:static;border-bottom:0;padding:0}
  .tf-bar{position:fixed;left:0;right:0;bottom:0;z-index:40;background:var(--bg);border-top:1px solid var(--border);box-shadow:var(--shadow);padding:10px 14px calc(10px + env(safe-area-inset-bottom))}
  .tf-bar .in{justify-content:space-between}
  .chip.topic.toggle{height:36px;border-radius:18px;padding:0 14px}
}
@media (prefers-reduced-motion:reduce){.tf-branch>summary .chev{transition:none}}
