/* Inspiration page — header tools, ask strip, cards, reference page, agent drawer. Loads after the page styles. */

/* G mark */
.g-ico{width:22px;height:22px;flex:none;display:block}

/* ── header ─────────────────────────────────────────────────────────────── */
.lockup-sep,.lockup-sys{display:none}
.header-ctas{gap:10px}
#hdrAdd{display:contents}
.pill.hdr-add{gap:8px}
.pill.hdr-add span{font-size:1.25em;line-height:1;transform:none!important}
.acct{position:relative}
.acct-btn{display:inline-flex;align-items:center;gap:10px;height:44px;padding:0 14px 0 6px;border:1px solid var(--line);border-radius:99px;background:#fff;font:inherit;font-size:14px;color:var(--ink);cursor:pointer;transition:border-color .2s,box-shadow .2s}
.acct-btn:hover,.acct.open .acct-btn{border-color:var(--ink)}
.acct-btn.ghost{padding:0 18px;border-color:transparent;background:none}
.acct-btn.ghost:hover{border-color:var(--line);background:#fff}
.acct-btn i{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-style:normal;font-weight:500;background:linear-gradient(180deg,#17A9DA,#AC59AE);color:#fff}
.acct-btn span{display:flex;flex-direction:column;align-items:flex-start;line-height:1.15;text-align:left}
.acct-btn small{font-size:11px;color:var(--muted)}
.acct-menu{position:absolute;right:0;top:calc(100% + 8px);min-width:220px;padding:6px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 40px rgba(16,47,56,.14);display:none;z-index:40}
.acct.open .acct-menu{display:grid}
.acct-menu button{display:block;width:100%;padding:11px 14px;border:0;border-radius:9px;background:none;text-align:left;font:inherit;font-size:14px;color:var(--ink);cursor:pointer}
.acct-menu button:hover{background:var(--card)}
.acct-menu [data-out]{color:#9b2c2c}
@media(min-width:2200px){.acct-btn{height:58px;font-size:17px}.acct-btn i{width:42px;height:42px}}
@media(max-width:900px){.acct-btn span{display:none}.acct-btn{padding:0 6px}.acct-btn.ghost{padding:0 14px}}

/* the old in-page bar is replaced by the header tools and toasts */
.manage-bar{display:none!important}
body.ig-signed-in #referenceForm label:has(input[name=code]),
body.ig-signed-in #referenceForm label:has(input[name=added_by]){display:none}

/* ── hero ───────────────────────────────────────────────────────────────── */
.ask-strip{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:clamp(24px,2vw,40px);animation-delay:.3s}
.ask-strip-lbl{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 16px 0 10px;margin-right:6px;border:0;border-radius:99px;background:var(--ink);color:var(--paper);font:inherit;font-size:14px;cursor:pointer;transition:transform .2s}
.ask-strip-lbl:hover{transform:translateY(-2px)}
.ask-strip-lbl .g-ico{width:24px;height:24px;padding:3px;border-radius:50%;background:#fff}
.ask-strip .try{height:40px;background:#fff}
.sync-line{display:flex;align-items:center;gap:8px;margin-top:14px;font-size:13px;color:var(--muted)}
.sync-line i{width:7px;height:7px;border-radius:50%;background:#cfcabd}
.sync-line.ok i{background:#2E9E4F}

/* ── cards: the hover outline covers the whole card, image included ───── */
.ref{position:relative;isolation:isolate}
.ref::after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:inset 0 0 0 2px var(--yellow);opacity:0;transition:opacity .2s;pointer-events:none;z-index:3}
.ref:hover{box-shadow:inset 0 0 0 1px var(--line),0 18px 36px rgba(16,47,56,.12)}
.ref:hover::after{opacity:1}
.ref:focus-visible{outline:none}
.ref:focus-visible::after{opacity:1;box-shadow:inset 0 0 0 3px var(--ink)}
.grid.list .ref::after{display:none}

/* ── reference page ─────────────────────────────────────────────────────── */
.rf-actions{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px 28px}
.rf-links{display:flex;align-items:center;gap:24px;font-size:15px}
button.text-link{background:none;border:0;border-bottom:1px solid currentColor;padding:0 0 2px;font:inherit;color:var(--ink);cursor:pointer}
.ai-action{display:inline-flex;align-items:center;gap:12px;height:56px;padding:0 26px 0 10px;border:0;border-radius:99px;background:var(--ink);color:var(--paper);font:inherit;font-size:17px;cursor:pointer;box-shadow:0 0 0 0 rgba(172,89,174,0);transition:transform .2s,box-shadow .25s,background .2s}
.ai-action .g-ico{width:38px;height:38px;padding:6px;border-radius:50%;background:#fff}
.ai-action:hover{transform:translateY(-2px);box-shadow:0 0 0 4px rgba(23,169,218,.18),0 14px 30px rgba(172,89,174,.25)}
.ai-action[disabled]{opacity:.6;pointer-events:none}
@media(min-width:2200px){.ai-action{height:68px;font-size:21px}.ai-action .g-ico{width:46px;height:46px}.rf-links{font-size:19px}}
.pending{display:block}
.pending p{margin:0}
.pending-act{display:flex;align-items:center;flex-wrap:wrap;gap:16px;margin-top:22px}
.pending-act .rf-src{margin:0}
.rf-sub{margin:calc(clamp(20px,2vw,40px)*-.55) 0 clamp(20px,2vw,36px);font-size:clamp(14px,.95vw,18px);color:var(--muted);max-width:70ch}
.vis-in{animation:visIn .5s cubic-bezier(.22,.9,.3,1) both}
@keyframes visIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}

.gallery{columns:3 260px;column-gap:16px}
.gallery figure{break-inside:avoid;margin:0 0 16px}
.gallery button{display:block;width:100%;padding:0;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--card);cursor:zoom-in;position:relative}
.gallery button::after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:inset 0 0 0 2px var(--yellow);opacity:0;transition:opacity .2s}
.gallery button:hover::after{opacity:1}
.gallery img{display:block;width:100%;height:auto;max-height:520px;object-fit:cover;object-position:top}
.gallery figcaption{margin-top:8px;font-size:13px;color:var(--muted);line-height:1.4}

.build{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,.65fr);gap:clamp(20px,3vw,64px);align-items:start}
.outline{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.outline li{display:grid;grid-template-columns:36px minmax(0,1fr);gap:12px;align-items:baseline;padding:14px 18px;border:1px solid var(--line);border-radius:12px;background:#fff}
.outline li span{font-size:12px;color:var(--muted)}
.outline li b{font-weight:400;font-size:clamp(15px,1.05vw,20px);line-height:1.35}
.outline li.lv1{background:var(--ink);border-color:var(--ink);color:var(--paper)}
.outline li.lv1 span{color:#b7b5ad}
.outline li.lv1 b{font-family:Oswald,sans-serif;font-weight:300;font-size:clamp(20px,1.5vw,30px)}
.facts.glance{margin-top:0;grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:900px){.build{grid-template-columns:1fr}}

.swatches{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.swatch{display:grid;gap:4px;padding:0 0 12px;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff;text-align:left;font:inherit;color:var(--ink);cursor:copy;transition:transform .2s,box-shadow .2s}
.swatch:hover{transform:translateY(-3px);box-shadow:0 12px 26px rgba(16,47,56,.12)}
.swatch i{display:block;height:96px;margin-bottom:8px}
.swatch.light i{box-shadow:inset 0 -1px 0 var(--line)}
.swatch b,.swatch small{padding:0 14px}
.swatch b{font-weight:400;font-size:15px;font-variant-numeric:tabular-nums}
.swatch small{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.typefaces{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin-top:16px}
.typefaces div{display:grid;gap:6px;padding:20px;border-radius:14px;background:var(--card)}
.typefaces small{font-size:12px;color:var(--muted)}
.typefaces b{font-family:Oswald,sans-serif;font-weight:300;font-size:clamp(24px,1.8vw,38px);line-height:1.1;letter-spacing:-.01em;word-break:break-word}

.ig-lightbox{max-width:min(1200px,94vw);max-height:92dvh;padding:16px;border:0;border-radius:18px;background:var(--paper)}
.ig-lightbox::backdrop{background:#04050ad0}
.ig-lightbox img{display:block;max-width:100%;max-height:calc(92dvh - 100px);margin:0 auto;border-radius:10px}
.ig-lightbox p{margin:12px 4px 0;font-size:14px;color:var(--muted)}
.ig-lightbox .agent-x{position:absolute;top:24px;right:24px;background:#fff}

/* ── toast ──────────────────────────────────────────────────────────────── */
.ig-toast{position:fixed;left:50%;bottom:28px;z-index:60;max-width:min(560px,calc(100% - 32px));padding:12px 20px;border-radius:99px;background:var(--ink);color:var(--paper);font-size:14px;box-shadow:0 14px 34px rgba(4,5,10,.25);transform:translate(-50%,20px);opacity:0;pointer-events:none;transition:opacity .25s,transform .25s}
.ig-toast.on{opacity:1;transform:translate(-50%,0)}
.ig-err{color:#9b2c2c;min-height:1em;margin:0}

/* ── agent drawer ───────────────────────────────────────────────────────── */
.agent-top{gap:10px}
.agent-top b{font-size:24px}
.agent-state{margin-left:auto}
.agent-exp{width:36px;height:36px;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:99px;background:none;color:var(--ink);cursor:pointer}
.agent-exp:hover{background:var(--yellow);border-color:var(--yellow)}
.agent-exp svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.agent-intro{padding:22px 18px 6px}
.agent-intro-ico .g-ico{width:44px;height:44px;padding:8px;border-radius:14px;background:#fff;border:1px solid var(--line)}
.agent-intro h3{margin:14px 0 6px;font-size:clamp(24px,1.7vw,34px);letter-spacing:-.01em}
.agent-intro p{margin:0;font-size:14px;line-height:1.5;color:var(--muted)}
.agent.has-chat .agent-intro{display:none}
.agent-log{gap:18px}
.agent-tries{display:grid;grid-template-columns:1fr;gap:8px;padding:6px 18px 14px}
.agent-tries .try{display:flex;align-items:center;justify-content:space-between;gap:12px;height:auto;min-height:52px;padding:12px 16px;border:1px solid var(--line);border-radius:14px;background:#fff;font-size:15px;line-height:1.35;text-align:left;color:var(--ink)}
.agent-tries .try::after{content:"↗";flex:none;color:var(--muted);transition:transform .2s}
.agent-tries .try:hover{border-color:var(--ink);background:#fff}
.agent-tries .try:hover::after{transform:translate(2px,-2px);color:var(--ink)}
.msg{font-size:15.5px;line-height:1.6}
.msg.bot{position:relative;padding-left:42px}
.msg.bot::before{content:"";position:absolute;left:0;top:0;width:30px;height:30px;border-radius:9px;background:#fff var(--g-uri) center/22px no-repeat;border:1px solid var(--line)}
.msg.bot p{margin:0 0 12px}
.msg.bot ul{padding-left:18px}
.msg.bot li{margin-bottom:8px}
.msg.bot li::marker{color:#AC59AE}
.cites{display:flex;gap:10px;overflow-x:auto;margin-top:12px;padding:2px 2px 8px;scroll-snap-type:x mandatory}
.cite{flex:0 0 190px;display:flex;flex-direction:column;gap:0;padding:0;border-radius:14px;overflow:hidden;scroll-snap-align:start;background:#fff;position:relative}
.cite::after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:inset 0 0 0 1px var(--line);pointer-events:none;transition:box-shadow .2s}
.cite:hover{box-shadow:0 10px 22px rgba(16,47,56,.12)}
.cite:hover::after{box-shadow:inset 0 0 0 2px var(--yellow)}
.cite img,.cite>span:first-child{display:block;width:100%;aspect-ratio:16/10;object-fit:cover;object-position:top;border-radius:0;background:var(--card)}
.cite>span:last-child{display:block;padding:10px 12px 12px}
.cite b{font-size:14px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.cite small{display:block;margin-top:4px;font-size:12px}

/* immersive view */
body.agent-immersive{overflow:hidden}
.agent.immersive{top:0;left:0;right:0;bottom:0;width:100%;z-index:50;border-left:0;box-shadow:none;background:var(--paper)}
.agent.immersive .agent-top{padding:16px max(24px,calc((100% - 980px)/2));border-bottom:1px solid var(--line)}
.agent.immersive .agent-top b{font-size:30px}
.agent.immersive .agent-log,.agent.immersive .agent-intro,.agent.immersive .agent-tries,.agent.immersive .agent-note{padding-left:max(24px,calc((100% - 900px)/2));padding-right:max(24px,calc((100% - 900px)/2))}
.agent.immersive .agent-form{padding:16px max(24px,calc((100% - 900px)/2)) 24px}
.agent.immersive .agent-intro{padding-top:clamp(40px,10vh,120px);text-align:center}
.agent.immersive .agent-intro-ico .g-ico{margin:0 auto;width:64px;height:64px;padding:12px;border-radius:20px}
.agent.immersive .agent-intro h3{font-size:clamp(36px,3.4vw,64px)}
.agent.immersive .agent-intro p{font-size:17px;max-width:60ch;margin:0 auto}
.agent.immersive .agent-tries{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding-top:28px}
.agent.immersive .agent-tries .try{min-height:72px;font-size:17px;padding:16px 20px}
.agent.immersive .msg{font-size:17px}
.agent.immersive .msg.you{max-width:70%}
.agent.immersive .cites{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));overflow:visible}
.agent.immersive .cite{flex:none}
.agent.immersive .agent-form textarea{font-size:17px;min-height:56px;padding:15px 18px}
.agent.immersive .agent-note{text-align:center}
@media(max-width:700px){.agent.immersive .agent-tries{grid-template-columns:1fr}}

/* ═════ Clean layout ═════════════════════════════════════════════════════ */

/* the page opens on a shelf: no hero, no counters */
.pg-head,#count,.rail-ask{display:none!important}
.lib{padding-top:clamp(28px,3vw,64px)}
.lib .group:first-child .group-head{padding-top:0}
.lib .group:first-child .group-head h2{font-size:clamp(52px,4.6vw,120px);line-height:1.05;letter-spacing:-.022em}

/* header: Ask Agent with the G */
.pill.ask-agent{gap:10px;padding-left:8px}
.pill.ask-agent .g-ico{width:32px;height:32px;padding:5px;border-radius:50%;background:#fff}
@media(min-width:2200px){.pill.ask-agent .g-ico{width:42px;height:42px;padding:7px}}

/* rail */
.rail{display:flex;flex-direction:column}
#railList{display:flex;flex-direction:column;gap:2px;min-height:100%}
.rail-add{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;height:52px;margin:0 0 18px;border:0;border-radius:14px;background:var(--ink);color:var(--paper);font:inherit;font-size:15px;cursor:pointer;box-shadow:0 8px 20px rgba(4,5,10,.14);transition:transform .2s,box-shadow .2s,background .2s}
.rail-add span{font-size:22px;line-height:1;font-weight:300}
.rail-add:hover{transform:translateY(-2px);background:#1b1d26;box-shadow:0 12px 26px rgba(4,5,10,.2)}
.rail a,.rail button.rl{min-height:40px;padding:9px 12px 9px 14px;border-radius:10px;font-size:15px;line-height:1.3;transition:background .15s,color .15s}
.rail a:hover,.rail button.rl:hover{background:rgba(4,5,10,.045)}
.rail .on,.rail .spy{background:#fff;color:var(--ink);font-weight:500;box-shadow:inset 0 0 0 1px var(--line),0 2px 6px rgba(16,47,56,.05)}
.rail .on::before,.rail .spy::before{content:"";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:2px;background:var(--yellow)}
.rail i{min-width:26px;height:22px;padding:0 7px;display:inline-flex;align-items:center;justify-content:center;border-radius:99px;background:rgba(4,5,10,.06);font-size:12px}
.rail .on i,.rail .spy i{background:var(--yellow);color:var(--ink)}
.rail-lbl{margin:22px 14px 8px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#8a877c}
.rail-find{margin:0 0 6px}
#sort{margin:0 2px}
.rail-foot{margin-top:auto;padding:22px 4px 4px;display:grid;gap:12px}
.rail-who{display:flex;align-items:center;gap:10px;padding:10px;border-radius:12px;background:#fff;box-shadow:inset 0 0 0 1px var(--line)}
.rail-who i{width:34px;height:34px;flex:none;border-radius:50%;display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,#17A9DA,#AC59AE);color:#fff;font-style:normal;font-weight:500;padding:0;min-width:0}
.rail-who span{display:grid;line-height:1.25;min-width:0}
.rail-who b{font-weight:500;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rail-who small{font-size:12px;color:var(--muted)}
.rail-who-links{display:flex;flex-wrap:wrap;gap:6px 14px;padding:0 4px}
.rail-who-links button,.rail-access{padding:0;border:0;background:none;font:inherit;font-size:13px;color:var(--muted);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.rail-who-links button:hover,.rail-access:hover{color:var(--ink)}
.rail-access{justify-self:start;margin-left:4px}
.rail-sync{display:flex;align-items:center;gap:8px;margin:0 4px;font-size:12px;color:#8a877c}
.rail-sync i{width:7px;height:7px;flex:none;border-radius:50%;background:#2E9E4F;padding:0;min-width:0}

/* cards: the G button */
.ref-img{position:relative}
.ref-ai{position:absolute;top:12px;right:12px;z-index:4;width:42px;height:42px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:#fff;box-shadow:0 4px 14px rgba(4,5,10,.18);cursor:pointer;opacity:.92;transform:scale(.94);transition:transform .2s,opacity .2s,box-shadow .2s}
.ref-ai .g-ico{width:26px;height:26px}
.ref:hover .ref-ai{opacity:1;transform:scale(1)}
.ref-ai:hover,.ref-ai:focus-visible{transform:scale(1.08)!important;box-shadow:0 0 0 4px rgba(23,169,218,.22),0 8px 20px rgba(172,89,174,.3);outline:none}
.grid.list .ref-ai{top:6px;right:6px;width:32px;height:32px}
.grid.list .ref-ai .g-ico{width:20px;height:20px}
.ref-img.noimg .ref-ai{opacity:1}

/* reference page: open and edit live on the screenshot */
.rf-actions{margin-top:clamp(24px,2.2vw,44px)}
.rf-shot{position:relative}
.rf-shot-link{display:block;position:relative;color:inherit;text-decoration:none}
.rf-shot-link img{display:block;width:100%;height:auto}
.rf-shot-dom{display:none}
.rf-shot.noshot .rf-shot-link{aspect-ratio:16/10;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--card),#fff)}
.rf-shot.noshot .rf-shot-dom{display:block;font-family:Oswald,sans-serif;font-weight:300;font-size:clamp(26px,2.2vw,46px);color:var(--muted)}
.rf-open{position:absolute;left:50%;top:50%;transform:translate(-50%,-40%);display:inline-flex;align-items:center;gap:10px;height:48px;padding:0 22px;border-radius:99px;background:var(--ink);color:var(--paper);font-size:15px;opacity:0;transition:opacity .2s,transform .25s;box-shadow:0 12px 28px rgba(4,5,10,.3)}
.rf-shot-link::after{content:"";position:absolute;inset:0;background:rgba(4,5,10,.28);opacity:0;transition:opacity .2s}
.rf-shot-link:hover::after,.rf-shot-link:focus-visible::after{opacity:1}
.rf-shot-link:hover .rf-open,.rf-shot-link:focus-visible .rf-open{opacity:1;transform:translate(-50%,-50%)}
.rf-open{z-index:2}
.rf-shot figcaption{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.rf-cap-links{display:flex;align-items:center;gap:18px}
.rf-cap-links .text-link{font-size:13px;color:var(--ink)}

/* the breakdown being written */
.bd-live{display:flex;align-items:flex-start;gap:18px;padding:clamp(22px,2vw,40px);border-radius:18px;background:linear-gradient(120deg,#fff,var(--card));box-shadow:inset 0 0 0 1px var(--line);max-width:980px}
.bd-live b{display:block;font-weight:500;font-size:clamp(18px,1.3vw,24px);margin-bottom:6px}
.bd-live p{margin:0;color:var(--body);font-size:clamp(15px,1vw,19px);line-height:1.55}
.bd-live .text-link{margin-top:12px}
.bd-ico{width:52px;height:52px;flex:none;display:flex;align-items:center;justify-content:center;border-radius:16px;background:#fff;box-shadow:inset 0 0 0 1px var(--line)}
.bd-ico .g-ico{width:30px;height:30px}
.bd-live:not(.failed) .bd-ico{animation:bdPulse 1.6s ease-in-out infinite}
@keyframes bdPulse{0%,100%{box-shadow:inset 0 0 0 1px var(--line),0 0 0 0 rgba(23,169,218,.25)}50%{box-shadow:inset 0 0 0 1px var(--line),0 0 0 10px rgba(172,89,174,0)}}

/* annotated screens */
.figures{margin:0 0 clamp(28px,2.6vw,52px)}
.figures h3{font-size:clamp(20px,1.4vw,28px);letter-spacing:-.01em;margin-bottom:16px}
.fig-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr));gap:18px}
.fig-grid figure{margin:0;display:grid;gap:12px;align-content:start}
.fig-grid button{position:relative;display:block;padding:0;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--card);cursor:zoom-in}
.fig-grid img{display:block;width:100%;aspect-ratio:16/10;object-fit:cover;object-position:top}
.fig-grid i{position:absolute;left:12px;top:12px;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--yellow);color:var(--ink);font-style:normal;font-size:13px;font-weight:500;box-shadow:0 2px 8px rgba(4,5,10,.2)}
.fig-grid figcaption{display:grid;gap:4px}
.fig-grid figcaption b{font-weight:500;font-size:16px}
.fig-grid figcaption span{font-size:14px;line-height:1.5;color:var(--body)}

/* agent drawer: who you are talking about, and your chats */
.agent-ctx{display:flex;align-items:center;gap:10px;padding:10px 18px;border-bottom:1px solid var(--line);background:#fff}
.ctx-ref{flex:1;min-width:0;display:flex;align-items:center;gap:10px;color:inherit;text-decoration:none}
.ctx-ref img,.ctx-dom{width:52px;height:34px;flex:none;border-radius:7px;object-fit:cover;object-position:top;border:1px solid var(--line);background:var(--card)}
.ctx-dom{display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--muted);text-transform:uppercase}
.ctx-ref.lib .ctx-dom{width:34px;background:#fff}
.ctx-ref.lib .ctx-dom .g-ico{width:20px;height:20px}
.ctx-ref span:last-child{display:grid;min-width:0;line-height:1.25}
.ctx-ref small{font-size:11px;color:var(--muted)}
.ctx-ref b{font-weight:500;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
a.ctx-ref:hover b{text-decoration:underline}
.ctx-chats{position:relative;flex:none}
.ctx-btn{height:34px;padding:0 12px;border:1px solid var(--line);border-radius:99px;background:none;font:inherit;font-size:13px;color:var(--ink);cursor:pointer;display:inline-flex;align-items:center;gap:6px}
.ctx-btn:hover,.ctx-chats.open .ctx-btn{border-color:var(--ink)}
.ctx-btn i{min-width:18px;height:18px;padding:0 5px;border-radius:99px;background:var(--yellow);font-style:normal;font-size:11px;display:inline-flex;align-items:center;justify-content:center}
.ctx-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:5;width:290px;max-height:360px;overflow:auto;padding:6px;border-radius:14px;background:#fff;border:1px solid var(--line);box-shadow:0 18px 40px rgba(16,47,56,.16);display:none}
.ctx-chats.open .ctx-menu{display:grid}
.ctx-menu button{display:grid;gap:2px;padding:10px 12px;border:0;border-radius:9px;background:none;text-align:left;font:inherit;font-size:14px;color:var(--ink);cursor:pointer}
.ctx-menu button:hover{background:var(--card)}
.ctx-menu b{font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ctx-menu small{font-size:12px;color:var(--muted)}
.ctx-menu [data-new]{font-weight:500;border-bottom:1px solid var(--line);border-radius:9px 9px 0 0;margin-bottom:4px}
.agent.immersive .agent-ctx{padding-left:max(24px,calc((100% - 900px)/2));padding-right:max(24px,calc((100% - 900px)/2))}

/* Ask button with the G */
.ask-go{gap:8px;padding:0 18px 0 8px}
.ask-go .g-ico{width:28px;height:28px;padding:4px;border-radius:50%;background:#fff}
#railList>*{flex-shrink:0}
.rail .rail-add{min-height:52px}

/* ═════ v4: alignment, list header, rail, cards, agent panel, breakdown ═════ */

/* header edges line up with the rail content and the page content */
@media(min-width:1101px){
  .site-header{padding-left:calc(clamp(12px,.9vw,18px) + 4px);padding-right:clamp(24px,3vw,90px)}
}

/* list header: title (count) with view + order on the right; stays on scroll */
body.one-shelf #out .group:not(.just-added)>.group-head{display:none}
.lib{padding-top:0}
.lib-bar{position:sticky;top:var(--hdr-h);z-index:12;display:flex;align-items:flex-end;justify-content:space-between;gap:20px 32px;flex-wrap:wrap;margin:0 calc(clamp(24px,3vw,90px)*-1) clamp(28px,2.6vw,48px);padding:clamp(28px,3vw,60px) clamp(24px,3vw,90px) 20px;background:var(--paper);border-bottom:1px solid transparent;transition:padding .25s,border-color .25s,box-shadow .25s}
.lib-bar.stuck{padding-top:14px;padding-bottom:14px;border-bottom-color:var(--line);box-shadow:0 8px 20px rgba(16,47,56,.05)}
.lib-title{min-width:0}
.lib-title h1{font-size:clamp(48px,4.4vw,112px);line-height:1.05;letter-spacing:-.022em;transition:font-size .25s}
.lib-count{font-family:Geist,Arial,sans-serif;font-size:.32em;letter-spacing:0;color:var(--muted);vertical-align:.55em;margin-left:.15em}
.lib-title p{margin-top:12px;max-width:62ch;font-size:clamp(15px,1.05vw,20px);color:var(--body);transition:opacity .2s}
.lib-bar.stuck .lib-title h1{font-size:clamp(28px,2.1vw,44px)}
.lib-bar.stuck .lib-title p{display:none}
.lib-tools{display:flex;align-items:center;gap:12px}
.lib-sort{display:flex;align-items:center;gap:8px;height:42px;padding:0 6px 0 16px;border:1px solid var(--line);border-radius:99px;background:#fff;font-size:13px;color:var(--muted)}
.lib-sort select{height:40px;border:0;background:none;font:inherit;font-size:14px;color:var(--ink);cursor:pointer;outline:0;padding-right:4px}
.lib-sort:focus-within{border-color:var(--ink)}
.lib-views{display:flex;gap:2px;padding:3px;border:1px solid var(--line);border-radius:99px;background:#fff}
.lib-views .rl{width:40px;height:34px;min-height:0;padding:0;display:flex;align-items:center;justify-content:center;border:0;border-radius:99px;background:none;cursor:pointer;color:var(--muted);position:relative;box-shadow:none!important}
.lib-views .rl::before{display:none!important}
.lib-views .rl svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.lib-views .rl:hover{color:var(--ink);background:rgba(4,5,10,.05)}
.lib-views .rl.on{background:var(--ink);color:var(--paper);font-weight:400}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.group-head{padding-bottom:20px;margin-bottom:clamp(24px,2.4vw,44px);border-bottom:0}
.group{margin-bottom:clamp(40px,4vw,80px)}

/* rail */
.rail-add{height:46px!important;min-height:46px;margin:0 4px 16px;border:1px solid var(--ink);border-radius:99px;background:transparent;color:var(--ink);box-shadow:none;font-size:15px;gap:8px}
.rail-add svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.rail-add:hover{background:var(--yellow);border-color:var(--yellow);color:var(--ink);transform:translateY(-1px);box-shadow:none}
.rail-find{height:44px;margin:0 4px 10px;padding:0 14px;border:1px solid transparent;border-radius:12px;background:rgba(4,5,10,.05);transition:background .2s,border-color .2s,box-shadow .2s}
.rail-find:hover{background:rgba(4,5,10,.07)}
.rail-find:focus-within{background:#fff;border-color:var(--ink);box-shadow:0 0 0 4px rgba(255,200,0,.25)}
.rail-find svg{width:17px;height:17px;stroke:var(--ink)}
.rail-find input{font-size:15px}
.rail-find input::placeholder{color:#8a877c}
.rail-lbl{margin-top:18px}

/* cards: full outline at rest, G next to the contributor */
.ref::before{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:inset 0 0 0 1px var(--line);pointer-events:none;z-index:3}
.ref:hover::before{opacity:0}
.ref{box-shadow:none}
.ref:hover{box-shadow:0 18px 36px rgba(16,47,56,.12)}
.ref-meta{align-items:center}
.ref-meta .ref-ai,.ref-meta .ref-ai span{border:0;background:none;padding:0;border-radius:0}
.ref-meta .ref-ai{position:relative;top:auto;right:auto;margin-left:auto;width:auto;height:32px;display:inline-flex;align-items:center;gap:0;padding:0 2px;border-radius:99px;box-shadow:none;opacity:1;transform:none;cursor:pointer;color:var(--ink);overflow:hidden;transition:gap .25s,padding .25s,background .2s}
.ref-meta .ref-ai .g-ico{width:26px;height:26px;position:relative;z-index:1}
.ref-meta .ref-ai::after{content:"";position:absolute;top:-20%;left:-60%;width:40%;height:140%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.95),transparent);transform:skewX(-20deg);opacity:0;z-index:2;pointer-events:none}
.ref-ai-t{max-width:0;overflow:hidden;white-space:nowrap;font-size:13px;line-height:1;color:var(--ink);transition:max-width .3s}
.ref:hover .ref-meta .ref-ai::after,.ref-meta .ref-ai:focus-visible::after{animation:gShine .9s ease}
.ref-meta .ref-ai:hover,.ref-meta .ref-ai:focus-visible{gap:8px;padding:0 12px 0 4px;background:var(--card);outline:none;transform:none!important;box-shadow:none}
.ref-meta .ref-ai:hover .ref-ai-t,.ref-meta .ref-ai:focus-visible .ref-ai-t{max-width:90px}
@keyframes gShine{0%{left:-60%;opacity:1}100%{left:130%;opacity:1}}
.grid.list .ref-meta .ref-ai{margin-left:0}

/* ── agent panel ── */
.agent{background:#fff}
.agent-top{padding:14px 16px 14px 20px;gap:6px;border-bottom:1px solid var(--line);background:#fff}
.agent-top b{font-size:26px;margin-right:auto}
.agent-state{margin:0 8px 0 0;font-size:12px}
.agent-ico{width:36px;height:36px;display:flex;align-items:center;justify-content:center;border:0;border-radius:10px;background:none;color:var(--ink);cursor:pointer;transition:background .15s}
.agent-ico:hover{background:rgba(4,5,10,.06)}
.agent-ico svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.agent-x.agent-ico{border:0;font-size:16px}
.agent-x.agent-ico:hover,.agent-exp:hover{background:rgba(4,5,10,.06);border-color:transparent}
.agent-hist{position:relative}
.hist-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:6;width:300px;max-height:380px;overflow:auto;padding:6px;border-radius:14px;background:#fff;border:1px solid var(--line);box-shadow:0 18px 40px rgba(16,47,56,.16);display:none}
.agent-hist.open .hist-menu{display:grid}
.hist-menu button{display:grid;gap:2px;padding:10px 12px;border:0;border-radius:9px;background:none;text-align:left;font:inherit;font-size:14px;color:var(--ink);cursor:pointer}
.hist-menu button:hover{background:rgba(4,5,10,.05)}
.hist-menu b{font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hist-menu small{font-size:12px;color:var(--muted)}
.hist-menu [data-new] b{font-weight:500}
.agent-ctx{display:none!important}
.agent-intro{padding:28px 20px 8px}
.ctx-title{display:flex;align-items:center;gap:14px}
.ctx-title img,.ctx-title .ctx-dom{width:64px;height:42px;flex:none;border-radius:8px;object-fit:cover;object-position:top;border:1px solid var(--line);background:#fff}
.ctx-title .ctx-dom{display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--muted);text-transform:uppercase}
.ctx-title.lib .ctx-dom{width:42px}
.ctx-title.lib .ctx-dom .g-ico{width:24px;height:24px}
.ctx-title span:last-child{display:grid;gap:2px;min-width:0}
.ctx-title small{font-size:12px;color:var(--muted)}
.ctx-title b{font-family:Oswald,sans-serif;font-weight:300;font-size:24px;line-height:1.15;letter-spacing:-.01em}
.ctx-title em{font-style:normal;font-size:12px;color:var(--muted)}
.tries-lbl{margin:26px 0 10px;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:#8a877c}
.agent-intro .agent-tries{padding:0;display:grid;gap:8px}
.agent-intro .agent-tries .try{min-height:48px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:#fff;font-size:15px}
.agent-intro .agent-tries .try:hover{border-color:var(--ink);background:#fff}
.agent.has-chat .agent-intro{display:none}
.agent-ctxline{display:none;align-items:center;gap:8px;padding:10px 20px;border-bottom:1px solid var(--line);font-size:13px;color:var(--muted);min-width:0}
.agent-ctxline a,.agent-ctxline b{color:var(--ink);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none}
.agent-ctxline a:hover{text-decoration:underline}
.agent.has-chat .agent-ctxline{display:flex}
.agent-log{padding:20px;background:#fff}
.agent-note{padding:0 20px 6px;background:#fff;font-size:12px}
.agent.has-chat .agent-note{display:none}
.agent-form{position:relative;display:block;margin:6px 16px 16px;padding:0;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:0 6px 22px rgba(16,47,56,.08);transition:border-color .2s,box-shadow .2s}
.agent-form:focus-within{border-color:var(--ink);box-shadow:0 8px 26px rgba(16,47,56,.12)}
.agent-form textarea{display:block;width:100%;min-height:104px;max-height:220px;padding:16px 18px 56px;border:0;border-radius:18px;background:transparent;font-size:16px;line-height:1.5;resize:none}
.agent-form textarea:focus{border:0}
.agent-form .ask-go{position:absolute;right:10px;bottom:10px;height:42px}
.trail{display:grid;gap:8px;padding:2px 0}
.trail span{display:flex;align-items:center;gap:10px;font-size:14px;color:#a5a296;transition:color .3s}
.trail span i{width:16px;height:16px;flex:none;border-radius:50%;border:1.6px solid currentColor;position:relative;padding:0;min-width:0;background:none}
.trail span.on{color:var(--ink)}
.trail span.on i{border-color:#AC59AE;border-top-color:transparent;animation:spin .8s linear infinite}
.trail span.done{color:var(--muted)}
.trail span.done i{background:#2E9E4F;border-color:#2E9E4F}
.trail span.done i::after{content:"";position:absolute;left:4px;top:1px;width:4px;height:8px;border:solid #fff;border-width:0 1.6px 1.6px 0;transform:rotate(45deg)}
@keyframes spin{to{transform:rotate(360deg)}}
.nexts{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.nexts small{flex-basis:100%;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:#8a877c}
.next-q{padding:9px 14px;border:1px solid var(--line);border-radius:99px;background:#fff;font:inherit;font-size:14px;line-height:1.3;color:var(--ink);text-align:left;cursor:pointer;transition:border-color .2s,background .2s}
.next-q:hover{border-color:var(--ink);background:rgba(255,200,0,.18)}
.msg.bot:not(:last-child) .nexts{display:none}
.agent.immersive .agent-intro,.agent.immersive .agent-ctxline{padding-left:max(24px,calc((100% - 860px)/2));padding-right:max(24px,calc((100% - 860px)/2))}
.agent.immersive .agent-form{margin-left:max(24px,calc((100% - 860px)/2));margin-right:max(24px,calc((100% - 860px)/2))}
.agent.immersive .agent-intro{text-align:left;padding-top:clamp(40px,10vh,110px)}
.agent.immersive .ctx-title b{font-size:clamp(30px,2.6vw,48px)}
.agent.immersive .agent-intro .agent-tries{grid-template-columns:repeat(2,minmax(0,1fr))}
.agent.immersive .agent-form textarea{min-height:120px;font-size:18px}

/* ── the breakdown: study material ── */
.bd-study{display:grid;gap:clamp(28px,2.6vw,48px);margin-bottom:clamp(28px,2.6vw,48px)}
.bd-after{margin:clamp(36px,3.4vw,64px) 0 0}
.bd-tags{display:flex;flex-wrap:wrap;gap:8px}
.bd-tags span{padding:6px 12px;border-radius:99px;background:var(--card);font-size:13px}
.bd-block h3{display:flex;align-items:baseline;gap:10px;font-size:clamp(22px,1.6vw,32px);letter-spacing:-.01em;margin-bottom:16px}
.bd-block h3 small{font-family:Geist,Arial,sans-serif;font-size:14px;color:var(--muted)}
.fig-rail{display:grid;grid-auto-flow:column;grid-auto-columns:min(420px,82%);gap:18px;overflow-x:auto;padding:4px 2px 14px;scroll-snap-type:x mandatory;scrollbar-width:thin}
.fig-rail figure{margin:0;display:grid;gap:12px;align-content:start;scroll-snap-align:start}
.fig-rail button{position:relative;display:block;padding:0;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--card);cursor:zoom-in}
.fig-rail img{display:block;width:100%;aspect-ratio:16/10;object-fit:cover;object-position:top;transition:transform .5s}
.fig-rail button:hover img{transform:scale(1.03)}
.fig-rail i{position:absolute;left:12px;top:12px;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--yellow);color:var(--ink);font-style:normal;font-size:13px;font-weight:500;box-shadow:0 2px 8px rgba(4,5,10,.2)}
.fig-rail figcaption{display:grid;gap:4px}
.fig-rail figcaption b{font-weight:500;font-size:16px}
.fig-rail figcaption span{font-size:14px;line-height:1.5;color:var(--body)}
.figures{display:none}
.tpl{padding:clamp(22px,2.2vw,40px);border-radius:20px;background:#fff;box-shadow:inset 0 0 0 1px var(--line)}
.tpl-head{display:grid;gap:6px;margin-bottom:20px}
.tpl-head h3{margin:0}
.tpl-head p{margin:0;font-size:14px;color:var(--muted)}
.tpl-kind{justify-self:start;padding:4px 10px;border-radius:99px;background:var(--ink);color:var(--paper);font-size:12px}
.tpl-steps{list-style:none;margin:0;padding:0;display:grid}
.tpl-steps li{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:16px;align-items:start;padding:16px 0;border-top:1px solid var(--line)}
.tpl-n{font-size:13px;color:var(--muted);padding-top:3px}
.tpl-steps b{display:block;font-weight:500;font-size:clamp(16px,1.1vw,20px);margin-bottom:4px}
.tpl-steps p{margin:0;font-size:clamp(14px,.95vw,17px);line-height:1.55;color:var(--body)}
.tpl-steps q{display:inline-block;margin-top:8px;padding:6px 12px;border-radius:8px;background:var(--ink);color:var(--paper);font-size:13px;quotes:"“" "”"}
.tpl-steps em{font-style:normal;font-size:13px;padding:4px 10px;border-radius:99px;background:var(--yellow);font-variant-numeric:tabular-nums}
.tpl-copy{margin-top:16px}
.vocab{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:12px;margin:0}
.vocab div{padding:18px 20px;border-radius:14px;background:var(--card)}
.vocab dt{font-family:Oswald,sans-serif;font-weight:300;font-size:clamp(20px,1.4vw,28px);margin-bottom:6px}
.vocab dd{margin:0;font-size:14px;line-height:1.5;color:var(--body)}
.bd-enrich{display:flex;align-items:center;gap:14px;margin-bottom:24px;font-size:15px;color:var(--body)}
.bd-enrich .bd-ico{width:40px;height:40px;border-radius:12px;animation:bdPulse 1.6s ease-in-out infinite}
.bd-enrich .bd-ico .g-ico{width:24px;height:24px}
.rf-sec .story article{padding:clamp(18px,1.6vw,28px) 0;border-top:1px solid var(--line)}
.rf-sec .story article:first-child{border-top:0;padding-top:0}
.lib .group:first-child .group-head h2{font-size:clamp(36px,3.2vw,64px)}
.ctx-title.ctx-lib .ctx-dom{width:42px}
.ctx-title.ctx-lib .ctx-dom .g-ico{width:24px;height:24px}
.ctx-title>span:last-child{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}
.ctx-sub{font-size:12px;color:var(--muted);line-height:1.4}
/* empty state: context at the top, starting prompts right above the input */
.agent-intro{flex:1;display:flex;flex-direction:column;min-height:0;overflow-y:auto}
.agent-intro .tries-lbl{margin-top:auto;padding-top:24px}
.agent:not(.has-chat) .agent-log{display:none}
.agent.immersive .agent-intro{padding-top:clamp(32px,8vh,96px)}
.lib-bar.stuck .lib-count{font-size:.5em;vertical-align:.3em}
.agent.immersive,.agent.immersive .agent-log,.agent.immersive .agent-note,.agent.immersive .agent-intro{background:#fff}
.agent.immersive .agent-intro,.agent.immersive .tries-lbl,.agent.immersive .agent-form textarea,.agent-form textarea,.agent.immersive .agent-note{text-align:left}
.agent.immersive .agent-note{padding-left:max(24px,calc((100% - 860px)/2))}
.agent.immersive .agent-intro .tries-lbl{margin:auto 0 10px;max-width:none}
.agent-form textarea,.agent-form textarea::placeholder{text-align:left!important}

/* ═════ v5: white shell, app name, one rail selection, search in the title bar, agent chats, media stage, templates ═════ */

/* white shell */
:root{--paper:#fff}
html,body,.rail,.lib-bar,.agent,.site-footer{background:#fff}
.site-header{background:rgba(255,255,255,.95);border-bottom:1px solid var(--line)}
.tags span,.panel,.steps article{background:#fff}

/* header: logo | app name */
.lockup{gap:16px}
.lockup .lockup-sep{display:block;width:1px;height:30px;background:var(--line)}
.lockup .lockup-sys{display:block}
.app-name{font-family:Oswald,sans-serif;font-weight:300;font-size:clamp(19px,1.35vw,28px);line-height:1;letter-spacing:-.005em;color:var(--ink);text-decoration:none;white-space:nowrap}
.app-name:hover{color:var(--ink);opacity:.75}
@media(max-width:760px){.app-name{font-size:15px;white-space:normal;max-width:9em}.lockup{gap:10px}}

/* rail: roomier rows, one selection only */
#railList{padding:0 4px}
.rail a,.rail button.rl{padding:11px 14px 11px 20px;margin:1px 0}
.rail .on::before,.rail .spy::before{left:8px;top:11px;bottom:11px}
.rail-all{margin-bottom:6px!important}
.rail [data-shelf=""].on,.rail [data-shelf=""].spy{background:none;box-shadow:none;font-weight:400}
.rail [data-shelf=""].on::before,.rail [data-shelf=""].spy::before{display:none}
.rail [data-shelf=""].on i{background:rgba(4,5,10,.06);color:inherit}
.rail [data-shelf=""]:hover{background:rgba(4,5,10,.045)}
#railList .rail-lbl:first-of-type{margin-top:10px}

/* search sits in the title bar, before the order and view controls */
.lib-tools{flex-wrap:wrap;justify-content:flex-end}
.lib-find{width:clamp(190px,15vw,300px);height:42px;margin:0}
.lib-bar.stuck .lib-find{height:40px}

/* agent: hamburger, chats panel, new chat */
.agent{position:fixed}
.agent-top b{margin-right:auto}
.agent-burger{margin-left:-6px}
.agent-chats{position:absolute;left:0;right:0;bottom:0;top:64px;z-index:8;display:flex;flex-direction:column;gap:2px;padding:14px 14px 24px;overflow-y:auto;background:#fff;visibility:hidden;opacity:0;transform:translateX(-14px);transition:opacity .2s,transform .2s,visibility .2s}
.agent.chats-open .agent-chats{visibility:visible;opacity:1;transform:none}
.agent.chats-open .agent-burger{background:rgba(4,5,10,.07)}
.chats-new{display:flex;align-items:center;gap:10px;height:46px;padding:0 16px;margin-bottom:6px;border:1px solid var(--line);border-radius:99px;background:#fff;font:inherit;font-size:15px;color:var(--ink);cursor:pointer;transition:border-color .2s,background .2s}
.chats-new:hover{border-color:var(--ink);background:rgba(255,200,0,.16)}
.chats-new svg,.chat-del svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.chats-lbl{margin:16px 12px 6px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#8a877c}
.chat-row{display:flex;align-items:center;gap:4px;border-radius:12px;transition:background .15s}
.chat-row:hover{background:rgba(4,5,10,.04)}
.chat-row.on{background:rgba(255,200,0,.16)}
.chat-open{flex:1;min-width:0;display:grid;gap:3px;padding:10px 12px;border:0;background:none;text-align:left;font:inherit;color:var(--ink);cursor:pointer}
.chat-open b{font-weight:400;font-size:14.5px;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-open small{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-del{width:34px;height:34px;flex:none;display:flex;align-items:center;justify-content:center;border:0;border-radius:9px;background:none;color:var(--muted);cursor:pointer;opacity:0;transition:opacity .15s,background .15s}
.chat-row:hover .chat-del,.chat-del:focus-visible{opacity:1}
.chat-del:hover{background:#fff;color:#9b2c2c}
.chats-empty{margin:8px 12px;font-size:14px;line-height:1.5;color:var(--muted)}
.agent.immersive .agent-chats{padding-left:max(24px,calc((100% - 860px)/2));padding-right:max(24px,calc((100% - 860px)/2))}

/* agent: start state */
.intro-foot{margin-top:auto;padding-top:24px}
.agent-intro .tries-lbl{margin:18px 0 8px;padding-top:0}
.intro-foot .tries-lbl:first-child{margin-top:0}
.intro-foot .agent-tries{padding:0}
.shelf-chips{display:flex;flex-wrap:wrap;gap:6px}
.shelf-chip{padding:7px 12px;border:1px solid var(--line);border-radius:99px;background:#fff;font-size:13px;line-height:1.2;color:var(--ink);text-decoration:none;transition:border-color .2s,background .2s}
.shelf-chip:hover{border-color:var(--ink);background:rgba(255,200,0,.16)}

/* agent: a one-line input that grows only when you type more */
.agent-form{display:flex;align-items:flex-end;gap:8px;margin:8px 16px 16px;padding:5px 5px 5px 20px;border-radius:26px}
.agent-form textarea,.agent.immersive .agent-form textarea{flex:1;min-width:0;min-height:0;height:42px;max-height:140px;padding:10px 0;border:0;border-radius:0;font-size:15.5px;line-height:1.4;background:transparent}
.agent-form .ask-go{position:static;flex:none;height:42px}
.agent.immersive .agent-form textarea{font-size:17px}

/* reference page: title row, then a large media stage */
.rf-head{display:block}
.rf-head>div{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);column-gap:clamp(28px,4vw,90px);align-items:end}
.rf-head>div>h1{grid-column:1;grid-row:1/span 4;align-self:end}
.rf-head>div>:not(h1){grid-column:2}
.rf-head .rf-actions{margin-top:clamp(16px,1.4vw,28px)}
.rf-head .rf-shot{margin-top:clamp(28px,2.6vw,52px)}
@media(max-width:1100px){.rf-head>div{grid-template-columns:1fr}.rf-head>div>*{grid-column:1!important;grid-row:auto!important}}
.stage{border-radius:20px;box-shadow:0 22px 50px rgba(16,47,56,.10)}
.stage-main{position:relative;background:#fff}
.stage .rf-shot-link{display:flex;justify-content:center;background:#fff}
.stage .rf-shot-link img{width:100%;height:auto;max-height:min(78vh,900px);object-fit:contain}
.stage .rf-shot-link img.lowres{max-width:1040px}
.stage-play{position:absolute;left:50%;top:50%;z-index:3;transform:translate(-50%,-50%);display:inline-flex;align-items:center;gap:12px;height:64px;padding:0 26px 0 12px;border:0;border-radius:99px;background:var(--ink);color:#fff;font:inherit;font-size:17px;cursor:pointer;box-shadow:0 16px 36px rgba(4,5,10,.35);transition:transform .2s,box-shadow .2s}
.stage-play:hover{transform:translate(-50%,-50%) scale(1.04);box-shadow:0 18px 40px rgba(4,5,10,.4)}
.stage-play svg{width:42px;height:42px;padding:11px;border-radius:50%;background:var(--yellow);fill:var(--ink)}
.stage.playing .stage-play{display:none}
.stage.has-play .rf-open{top:auto;bottom:22px;transform:translate(-50%,8px)}
.stage.has-play .rf-shot-link:hover .rf-open{transform:translate(-50%,0)}
.stage-live{display:flex;justify-content:center;padding:clamp(12px,1.6vw,28px);background:#fff}
.stage-live iframe{display:block;width:100%;aspect-ratio:16/9;border:0;border-radius:12px;background:#04050a}
.stage-live.tall iframe{width:min(100%,560px);aspect-ratio:auto;height:min(80vh,860px);background:#fff;border:1px solid var(--line)}
.stage-bar{display:flex;gap:8px;overflow-x:auto;padding:12px;border-top:1px solid var(--line);background:#fff;scrollbar-width:thin}
.stage-tab{flex:none;display:flex;align-items:center;gap:10px;height:58px;max-width:280px;padding:4px 16px 4px 4px;border:1px solid var(--line);border-radius:12px;background:#fff;font:inherit;font-size:13px;line-height:1.3;color:var(--ink);text-align:left;cursor:pointer;transition:border-color .2s,box-shadow .2s}
.stage-tab:hover{border-color:var(--ink)}
.stage-tab.on{border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.stage-tab img{width:76px;height:48px;flex:none;border-radius:8px;object-fit:cover;object-position:top;background:var(--card)}
.stage-tab span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stage-tab.watch{padding-left:8px;gap:10px}
.stage-tab.watch svg{width:38px;height:38px;flex:none;padding:10px;border-radius:50%;background:var(--yellow);fill:var(--ink)}
.stage-tab.watch span{font-weight:500}
.stage-tab.watch small{font-size:12px;color:var(--muted)}

/* templates */
.tpl-tools{display:flex;flex-wrap:wrap;gap:8px;margin-top:22px}
.tpl-btn{height:40px;padding:0 18px;border:1px solid var(--line);border-radius:99px;background:#fff;font:inherit;font-size:14px;color:var(--ink);cursor:pointer;transition:border-color .2s,background .2s}
.tpl-btn:hover{border-color:var(--ink);background:rgba(255,200,0,.16)}
.tpl-copy{display:none}
.tpl-steps li{transition:background .2s}
.tpl-steps li.hl{background:rgba(255,200,0,.12)}

/* shot list: a storyboard with a timeline and burnt-in captions */
.sb-ruler{display:flex;gap:3px;height:10px;margin:4px 0 8px}
.sb-ruler span{border-radius:3px;background:linear-gradient(90deg,#17A9DA,#AC59AE)}
.sb-ruler span:nth-child(even){opacity:.6}
.sb-ruler i{display:none}
.sb-time{display:flex;justify-content:space-between;margin-bottom:20px;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.sb-frames{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,270px),1fr));gap:22px 18px}
.sb-frame{position:relative;aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;padding:22px 20px 44px;border-radius:12px;overflow:hidden;background:radial-gradient(120% 120% at 15% 0%,#2c3150,#04050a 70%);color:#fff;text-align:center}
.sb-frame b{font-family:Oswald,sans-serif;font-weight:300;font-size:clamp(18px,1.25vw,24px);line-height:1.15}
.sb-frame q{position:absolute;left:8%;right:8%;bottom:10px;padding:5px 8px;border-radius:5px;background:rgba(0,0,0,.75);font-size:12px;line-height:1.35;quotes:none}
.sb-tc{position:absolute;left:10px;top:10px;padding:3px 8px;border-radius:99px;background:rgba(255,255,255,.14);font-size:11px;font-variant-numeric:tabular-nums}
.sb-n{position:absolute;right:12px;top:10px;font-size:11px;color:rgba(255,255,255,.55)}
.sb-frames p{margin:10px 2px 0;font-size:14px;line-height:1.55;color:var(--body)}

/* motion spec: curve, a live preview and the timing */
.mo-rows{display:grid}
.mo-row{display:grid;grid-template-columns:44px minmax(0,1fr) minmax(230px,320px);gap:18px;align-items:center;padding:18px 0;border-top:1px solid var(--line)}
.mo-row b{display:block;font-weight:500;font-size:clamp(16px,1.1vw,20px);margin-bottom:4px}
.mo-row p{margin:0;font-size:clamp(14px,.95vw,17px);line-height:1.55;color:var(--body)}
.mo-viz{display:grid;grid-template-columns:60px minmax(0,1fr);gap:8px 14px;align-items:center}
.mo-curve{width:60px;height:60px;grid-row:1/span 2;fill:none;stroke:#AC59AE;stroke-width:2.4;stroke-linecap:round}
.mo-curve .mo-axis{stroke:var(--line);stroke-width:1.2}
.mo-track{position:relative;height:24px;border-radius:99px;background:rgba(4,5,10,.05)}
.mo-track i{position:absolute;left:4px;top:4px;width:16px;height:16px;border-radius:50%;background:var(--ink);transition:left var(--mo-d,.3s) var(--mo-e,ease-out)}
.mo-row:hover .mo-track i{left:calc(100% - 20px)}
.mo-meta{display:flex;align-items:baseline;gap:8px;min-width:0}
.mo-meta em{font-style:normal;font-size:13px;padding:3px 9px;border-radius:99px;background:var(--yellow);font-variant-numeric:tabular-nums;flex:none}
.mo-meta small{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mo-bar{display:none}
@media(max-width:860px){.mo-row{grid-template-columns:36px minmax(0,1fr)}.mo-viz{grid-column:2}}

/* page template: a wireframe beside the sections */
.pt{display:grid;grid-template-columns:minmax(220px,.65fr) minmax(0,1.35fr);gap:clamp(20px,3vw,56px);align-items:start}
.pt-browser{position:sticky;top:calc(var(--hdr-h) + 110px);display:grid;gap:8px;padding:0 12px 12px;border:1px solid var(--line);border-radius:14px;background:#fff}
.pt-chrome{display:flex;gap:5px;padding:11px 0 3px}
.pt-chrome i{width:8px;height:8px;border-radius:50%;background:var(--line)}
.pt-block{display:flex;align-items:center;gap:10px;min-height:46px;padding:10px 12px;border-radius:8px;background:#f1edf8;font-size:12.5px;line-height:1.3;transition:background .2s}
.pt-block span{font-size:11px;color:var(--muted)}
.pt-block b{font-weight:500}
.pt-bhero{min-height:116px;align-items:flex-end;background:linear-gradient(135deg,#ece4f8,#dcf0f8)}
.pt-b0{min-height:78px}.pt-b1{min-height:58px}.pt-b2{min-height:66px}
.pt-block.hl{background:var(--yellow)}
@media(max-width:900px){.pt{grid-template-columns:1fr}.pt-browser{position:static}}

/* flow: screens left to right */
.flow{list-style:none;margin:0;padding:0 0 10px;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(210px,1fr);gap:34px;overflow-x:auto;scrollbar-width:thin}
.flow li{position:relative}
.flow li:not(:last-child)::after{content:"→";position:absolute;right:-26px;top:72px;font-size:18px;color:var(--muted)}
.flow-screen{display:grid;gap:9px;align-content:start;height:164px;padding:14px;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:0 8px 20px rgba(16,47,56,.06)}
.flow-screen span{font-size:11px;color:var(--muted)}
.flow-screen b{font-weight:500;font-size:15px;line-height:1.3}
.flow-screen i{height:8px;border-radius:4px;background:#f1edf8}
.flow-screen i:nth-of-type(2){width:72%}.flow-screen i:nth-of-type(3){width:48%}
.flow p{margin:12px 2px 0;font-size:14px;line-height:1.55;color:var(--body)}

/* anatomy: the reference beside its numbered parts */
.an{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(20px,3vw,56px);align-items:start}
.an-img{position:sticky;top:calc(var(--hdr-h) + 110px);border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff}
.an-img img{display:block;width:100%;height:auto}
.an-num{width:28px;height:28px;padding:0;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--yellow);color:var(--ink);font-weight:500}
.an-list li{grid-template-columns:44px minmax(0,1fr)}
@media(max-width:900px){.an{grid-template-columns:1fr}.an-img{position:static}}

/* checklist: tick as you go */
.ck-progress{height:6px;border-radius:99px;background:rgba(4,5,10,.07);overflow:hidden}
.ck-progress span{display:block;height:100%;background:linear-gradient(90deg,#17A9DA,#AC59AE);transition:width .3s}
.ck-count{margin:8px 0 4px;font-size:13px;color:var(--muted)}
.ck{list-style:none;margin:0;padding:0}
.ck li{border-top:1px solid var(--line)}
.ck label{position:relative;display:grid;grid-template-columns:28px minmax(0,1fr);gap:14px;padding:16px 0;cursor:pointer}
.ck input{position:absolute;opacity:0;pointer-events:none}
.ck-box{position:relative;width:24px;height:24px;margin-top:2px;border:1.6px solid var(--ink);border-radius:7px;transition:background .15s}
.ck input:checked+.ck-box{background:var(--ink)}
.ck input:checked+.ck-box::after{content:"";position:absolute;left:7px;top:3px;width:6px;height:11px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}
.ck input:focus-visible+.ck-box{box-shadow:0 0 0 3px rgba(255,200,0,.6)}
.ck b{display:block;margin-bottom:4px;font-weight:500;font-size:clamp(16px,1.1vw,20px)}
.ck label>span:last-child>span{font-size:clamp(14px,.95vw,17px);line-height:1.55;color:var(--body)}
.ck input:checked~span:last-child b{text-decoration:line-through;text-decoration-color:rgba(4,5,10,.35)}

.stage-live.tall iframe.fit{max-height:none;border:0}

/* ═════ v6: tooltips, search, agent look, full-screen agent inside the shell, reference page ═════ */

/* tooltips */
[data-tip]{position:relative}
[data-tip]::after{content:attr(data-tip);position:absolute;left:50%;top:calc(100% + 8px);z-index:45;transform:translate(-50%,-4px);padding:6px 10px;border-radius:8px;background:var(--ink);color:#fff;font:400 12px/1.2 Geist,Arial,sans-serif;letter-spacing:0;text-transform:none;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .15s,transform .15s}
[data-tip]:hover::after,[data-tip]:focus-visible::after{opacity:1;transform:translate(-50%,0)}
.agent-top .agent-x[data-tip]::after,.lib-views .rl:last-child[data-tip]::after{left:auto;right:0;transform:translate(0,-4px)}
.agent-top .agent-x[data-tip]:hover::after,.lib-views .rl:last-child[data-tip]:hover::after{transform:none}
.agent-burger[data-tip]::after{left:0;transform:translate(0,-4px)}
.agent-burger[data-tip]:hover::after{transform:none}

/* search: a rounded field like Order and the view switch */
.lib-find{width:clamp(240px,19vw,360px);height:42px;margin:0;padding:0 16px;border:1px solid var(--line);border-radius:99px;background:#fff;transition:width .25s,border-color .2s,box-shadow .2s}
.lib-find:hover{background:#fff;border-color:#c9c5ba}
.lib-find:focus-within{width:clamp(280px,24vw,420px);background:#fff;border-color:var(--ink);box-shadow:0 0 0 4px rgba(255,200,0,.25)}
.lib-find svg{width:16px;height:16px}
.lib-find input{font-size:14px}

/* agent: a plain G, friendlier bubbles, AI prompts */
@keyframes gFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
@keyframes twinkle{0%,100%{transform:scale(1) rotate(0)}50%{transform:scale(1.25) rotate(18deg)}}
.agent-title{display:flex;align-items:center;gap:10px;font-weight:300}
.agent-title .g-ico{width:28px;height:28px}
.ctx-title.ctx-lib .ctx-dom{width:52px;height:52px;border:0;background:none;box-shadow:none;border-radius:0}
.ctx-title.ctx-lib .ctx-dom .g-ico{width:48px;height:48px;animation:gFloat 4s ease-in-out infinite}
.g-ico path:last-child{transform-box:fill-box;transform-origin:center}
.ctx-title.ctx-lib .g-ico path:last-child,.agent-title .g-ico path:last-child{animation:twinkle 2.8s ease-in-out infinite}
.msg.bot::before{border:0;background-color:transparent;background-size:28px}
.msg.you{max-width:85%;padding:12px 18px;border-radius:20px 20px 6px 20px;background:#FFF1BF;color:var(--ink);font-size:15.5px;line-height:1.5}
.agent-tries .try,.agent-intro .agent-tries .try{justify-content:flex-start;gap:12px;border-radius:14px}
.agent-tries .try::before,.next-q::before{content:"";width:20px;height:20px;flex:none;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop stop-color='%2317A9DA'/%3E%3Cstop offset='1' stop-color='%23AC59AE'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M11 2c.9 5.2 2.8 7.1 8 8-5.2.9-7.1 2.8-8 8-.9-5.2-2.8-7.1-8-8 5.2-.9 7.1-2.8 8-8Z' fill='url(%23a)'/%3E%3Cpath d='M19.5 15c.3 1.7.9 2.3 2.6 2.6-1.7.3-2.3.9-2.6 2.6-.3-1.7-.9-2.3-2.6-2.6 1.7-.3 2.3-.9 2.6-2.6Z' fill='%23FFC800'/%3E%3C/svg%3E") center/contain no-repeat}
.agent-tries .try::after{margin-left:auto}
.agent-tries .try:hover{background:#fffbea}
.next-q{display:inline-flex;align-items:center;gap:8px}
.next-q::before{width:16px;height:16px}

/* full screen: the site header stays; chats on the left; a big composer at the bottom */
.agent.immersive{--side:300px;--px:max(32px,calc((100% - var(--side) - 1040px)/2));top:var(--hdr-h);left:0;right:0;bottom:0;width:auto;z-index:19;border:0;box-shadow:none;background:#fff}
.agent.immersive .agent-top{padding:18px 28px 18px 32px;border-bottom:1px solid var(--line)}
.agent.immersive .agent-title{font-size:clamp(36px,2.8vw,54px);gap:14px}
.agent.immersive .agent-title .g-ico{width:clamp(40px,3vw,56px);height:clamp(40px,3vw,56px)}
.agent.immersive .agent-burger{display:none}
.agent.immersive .agent-ico{width:44px;height:44px}
.agent.immersive .agent-x{width:56px;height:56px;margin-left:8px;border:1px solid var(--line);border-radius:50%;font-size:22px}
.agent.immersive .agent-x:hover{background:var(--ink);color:#fff;border-color:var(--ink)}
.agent.immersive .agent-chats{visibility:visible;opacity:1;transform:none;right:auto;width:var(--side);padding:20px 16px 24px;border-right:1px solid var(--line)}
.agent.immersive .agent-intro,.agent.immersive .agent-ctxline,.agent.immersive .agent-log,.agent.immersive .agent-note{margin-left:var(--side);padding-left:var(--px);padding-right:var(--px)}
.agent.immersive .agent-intro{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(32px,4vw,80px);align-content:center;padding-top:32px;padding-bottom:24px;text-align:left}
.agent.immersive .intro-foot{margin-top:0;padding-top:0}
.agent.immersive .ctx-title{align-items:flex-start;gap:20px}
.agent.immersive .ctx-title b{font-size:clamp(40px,3.4vw,72px);line-height:1.05;white-space:normal}
.agent.immersive .ctx-title small{font-size:14px}
.agent.immersive .ctx-sub{font-size:16px;max-width:42ch;margin-top:10px}
.agent.immersive .ctx-title img{width:120px;height:78px}
.agent.immersive .ctx-title.ctx-lib .ctx-dom,.agent.immersive .ctx-title.ctx-lib .ctx-dom .g-ico{width:72px;height:72px}
.agent.immersive .agent-intro .agent-tries{grid-template-columns:1fr;gap:10px}
.agent.immersive .agent-tries .try{min-height:62px;font-size:17px;padding:14px 18px}
.agent.immersive .agent-ctxline{border-bottom:1px solid var(--line)}
.agent.immersive .msg{font-size:18px;line-height:1.65}
.agent.immersive .msg.you{max-width:70%}
.agent.immersive .agent-note{text-align:left;padding-bottom:4px}
.agent.immersive .agent-form{margin:10px var(--px) 28px calc(var(--side) + var(--px));padding:10px 10px 10px 28px;border-width:1.5px;border-radius:28px;box-shadow:0 14px 40px rgba(16,47,56,.12)}
.agent.immersive .agent-form textarea{height:64px;max-height:200px;padding:20px 0;font-size:20px;font-weight:400}
.agent.immersive .agent-form .ask-go{height:64px;padding:0 30px 0 12px;font-size:18px;border-radius:99px}
.agent.immersive .agent-form .ask-go .g-ico{width:40px;height:40px;padding:6px}
@media(max-width:1000px){
  .agent.immersive{--side:0px}
  .agent.immersive .agent-chats{visibility:hidden;opacity:0}
  .agent.immersive.chats-open .agent-chats{visibility:visible;opacity:1;right:0;width:auto}
  .agent.immersive .agent-burger{display:flex}
  .agent.immersive .agent-intro{grid-template-columns:1fr}
}

/* reference page: centred title row, an Ask button like the header's */
.rf-head>div{align-items:center}
.rf-head>div>h1{align-self:center}
.ai-action{position:relative;overflow:hidden;gap:10px;height:56px;padding:0 26px 0 18px;background:var(--yellow);color:var(--ink);font-weight:400}
.ai-action .g-ico{width:30px;height:30px;padding:0;border-radius:0;background:none}
.ai-action .g-ico path:last-child{animation:twinkle 2.8s ease-in-out infinite}
.ai-action::after{content:"";position:absolute;top:-30%;left:-40%;width:30%;height:160%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.7),transparent);transform:skewX(-20deg);animation:aiShine 5s ease-in-out infinite;pointer-events:none}
@keyframes aiShine{0%,70%{left:-40%}100%{left:130%}}
.ai-action:hover{background:var(--yellow);transform:translateY(-2px);box-shadow:0 12px 28px rgba(255,200,0,.45)}
@media(prefers-reduced-motion:reduce){.ai-action::after,.g-ico path:last-child,.ctx-title.ctx-lib .ctx-dom .g-ico{animation:none!important}}

/* the breakdown: numbered sections and points */
#refMain .wrap{counter-reset:sec}
#refMain .rf-sec{counter-increment:sec}
#refMain .rf-sec>h2::before{content:counter(sec,decimal-leading-zero);display:block;margin-bottom:12px;font-family:Geist,Arial,sans-serif;font-size:13px;letter-spacing:.12em;color:var(--muted)}
.story{counter-reset:st}
.rf-sec .story article{counter-increment:st;grid-template-columns:52px minmax(0,.8fr) minmax(0,1.2fr)}
.rf-sec .story article::before{content:counter(st,decimal-leading-zero);padding-top:12px;font-size:13px;color:var(--muted)}
@media(max-width:1300px){.rf-sec .story article{grid-template-columns:40px minmax(0,1fr)}.rf-sec .story article p{grid-column:2}}
.tpl-about{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 26px}
.tpl-about div{padding:16px 18px;border-radius:14px;background:#f6f3fb}
.tpl-about dt{margin-bottom:6px;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.tpl-about dd{margin:0;font-size:15px;line-height:1.5;color:var(--ink)}
@media(max-width:900px){.tpl-about{grid-template-columns:1fr}}
.ck-step{display:block;margin-bottom:2px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.agent.immersive.has-chat .agent-intro{display:none}
.pill.ask-agent:hover,.pill.ask-agent:focus-visible{background:var(--yellow);border-color:var(--yellow);color:var(--ink);transform:translateY(-1px);box-shadow:0 10px 24px rgba(255,200,0,.4)}

/* until the layout is ready, show a quiet loader instead of the unstyled markup */
body:not(.ig-ready) #listMain,body:not(.ig-ready) #refMain,body:not(.ig-ready) #rail{visibility:hidden}
body:not(.ig-ready)::after{content:"";position:fixed;left:50%;top:50%;width:36px;height:36px;margin:-18px 0 0 -18px;border-radius:50%;border:3px solid var(--line);border-top-color:#AC59AE;animation:spin .8s linear infinite;z-index:5}

/* ═════ v7: intelligaia.com Ask Agent look, thin full-screen bar, answer cards ═════ */

/* header button, exactly like intelligaia.com: yellow pill, plain G, text, arrow */
.pill.ask-agent,.header-ctas .pill.ask-agent{gap:8px;padding:0 20px 0 16px}
.pill.ask-agent .g-ico,.header-ctas .pill.ask-agent .g-ico{width:24px;height:24px;padding:0;border-radius:0;background:none}
@media(min-width:2200px){.pill.ask-agent .g-ico{width:30px;height:30px;padding:0}}

/* composer, like intelligaia.com/ask: G inside, soft purple edge, round yellow send */
.agent-form{display:flex;align-items:center;gap:10px;padding:8px 8px 8px 14px;border:1px solid #B7AEC7;border-radius:22px;background:#fff;box-shadow:inset 3px 0 10px rgba(164,119,212,.1),inset -3px 0 10px rgba(105,201,214,.1)}
.agent-form:focus-within{border-color:#8F82AE;box-shadow:inset 3px 0 10px rgba(164,119,212,.16),inset -3px 0 10px rgba(105,201,214,.16),0 8px 24px rgba(16,47,56,.08)}
.form-g{display:flex;flex:none}
.form-g .g-ico{width:26px;height:26px}
.agent-form textarea,.agent.immersive .agent-form textarea{align-self:center}
.agent-form .ask-go,.agent.immersive .agent-form .ask-go{width:46px;height:46px;min-width:0;padding:0;flex:none;display:flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:var(--yellow);color:var(--ink);font-size:22px;line-height:1;box-shadow:none;transition:transform .15s,box-shadow .2s}
.agent-form .ask-go:hover{transform:scale(1.06);background:var(--yellow);color:var(--ink);box-shadow:0 8px 18px rgba(255,200,0,.4)}
.agent-form .ask-go[disabled]{opacity:.5}
.agent-form .ask-go .g-ico{display:none}
.agent.immersive .agent-form{padding:12px 12px 12px 20px;border-width:1px;border-radius:22px;box-shadow:inset 3px 0 10px rgba(164,119,212,.1),inset -3px 0 10px rgba(105,201,214,.1)}
.agent.immersive .form-g .g-ico{width:32px;height:32px}
.agent.immersive .agent-form textarea{height:60px;padding:16px 0;font-size:22px}
.agent.immersive .agent-form .ask-go{width:64px;height:64px;font-size:30px}

/* answers sit in a soft card that ends level with your bubble */
.msg.bot{position:relative;margin-left:42px;padding:16px 20px;border:1px solid #ECE7F4;border-radius:6px 18px 18px 18px;background:#FAF8FD}
.msg.bot::before{left:-42px;top:2px}
.msg.bot>:last-child{margin-bottom:0}
.msg.bot p:last-child{margin-bottom:0}
.msg.bot .cites{padding-bottom:4px}
.agent.immersive .msg.bot{padding:20px 26px}
.msg.you{align-self:flex-end}

/* full screen: one thin bar with the title, what we are talking about, and New chat */
.top-ctx{display:none}
.agent.immersive .agent-top{min-height:0;padding:10px 20px 10px 28px;gap:8px}
.agent.immersive .agent-top b.agent-title{margin-right:0;font-size:24px;gap:10px}
.agent.immersive .agent-title .g-ico{width:28px;height:28px}
.agent.immersive .top-ctx{display:flex;align-items:center;gap:8px;min-width:0;margin:0 auto 0 8px;padding-left:16px;border-left:1px solid var(--line);font-size:14px;line-height:1.3}
.agent.immersive .top-ctx .tc-lbl{color:var(--muted)}
.agent.immersive .top-ctx .tc-name{color:var(--ink);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:46vw}
.agent.immersive .agent-ctxline{display:none!important}
.new-t{display:none}
.agent.immersive .agent-new{width:auto;height:40px;padding:0 16px;gap:8px;border:1px solid var(--line);border-radius:99px;font:inherit;font-size:14px}
.agent.immersive .agent-new .new-t{display:inline}
.agent.immersive .agent-new:hover{border-color:var(--ink);background:#fff}
.agent.immersive .agent-new[data-tip]::after{display:none}
.agent.immersive .agent-chats .chats-new{display:none}
.agent.immersive .agent-ico{width:40px;height:40px}
.agent.immersive .agent-x{width:40px;height:40px;margin-left:4px;font-size:16px}
.agent.immersive .agent-chats .chats-lbl:first-of-type{margin-top:4px}
.agent.immersive .agent-ico.agent-new{width:auto;white-space:nowrap;flex:none}
.agent.immersive .agent-new svg{width:16px;height:16px}

/* the title bar shrinks instantly (no height animation), so it cannot fight the scroll position */
.lib-bar,.lib-title h1,.lib-title p{transition:none}
.lib-bar{transition:box-shadow .2s,border-color .2s}
html{overflow-anchor:none}

/* the card the agent is talking about stays marked while the panel is open */
.ref.asking::after{opacity:1}
.ref.asking::before{opacity:0}
.ref.asking{box-shadow:0 18px 36px rgba(16,47,56,.12)}
.ref.asking .ref-meta .ref-ai{gap:8px;padding:0 12px 0 4px;background:var(--yellow)}
.ref.asking .ref-meta .ref-ai .ref-ai-t{max-width:120px}

/* ═════ v8: phone layout, export, static checklist, section numbers on top ═════ */
svg.ln{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* animated hamburger, no box */
.rail-btn{border:0;background:none;width:40px;height:40px;padding:0;border-radius:10px}
.rail-btn:hover{background:rgba(4,5,10,.05)}
.hb{position:relative;display:block;width:22px;height:16px}
.hb i{position:absolute;left:0;right:0;height:1.8px;border-radius:2px;background:var(--ink);transition:top .25s .1s,transform .25s,opacity .2s}
.hb i:nth-child(1){top:0}.hb i:nth-child(2){top:7px;right:6px}.hb i:nth-child(3){top:14px}
.rail-open .hb i{transition:top .25s,transform .25s .1s,opacity .2s}
.rail-open .hb i:nth-child(1){top:7px;transform:rotate(45deg)}
.rail-open .hb i:nth-child(2){opacity:0}
.rail-open .hb i:nth-child(3){top:7px;transform:rotate(-45deg)}

/* header pieces that only show on phones */
.pill.contact svg{display:none}
.pill.ask-agent .ask-t{display:inline-flex;align-items:center;gap:6px;transform:none!important}

/* title bar extras */
.sort-i,.lib-more{display:none}
.lib-export{width:42px;height:42px;flex:none;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:50%;background:#fff;color:var(--ink);cursor:pointer;transition:border-color .2s,background .2s}
.lib-export:hover{border-color:var(--ink);background:rgba(255,200,0,.16)}

/* export button on a reference, and the export menu */
.exp-btn{display:inline-flex;align-items:center;gap:8px;height:56px;padding:0 22px;border:1px solid var(--ink);border-radius:99px;background:#fff;color:var(--ink);font:inherit;font-size:16px;cursor:pointer;transition:background .2s}
.exp-btn:hover{background:rgba(255,200,0,.16)}
.rf-actions{gap:12px;justify-content:flex-start}
.exp-menu{position:fixed;z-index:70;width:290px;padding:8px;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:0 18px 44px rgba(16,47,56,.18);display:none}
.exp-menu.on{display:grid;gap:2px}
.exp-h{margin:6px 10px 6px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.exp-menu button{display:flex;align-items:center;gap:12px;padding:10px;border:0;border-radius:10px;background:none;text-align:left;font:inherit;color:var(--ink);cursor:pointer}
.exp-menu button:hover{background:#faf8fd}
.exp-menu button span{display:grid;gap:1px}
.exp-menu b{font-weight:500;font-size:14.5px}
.exp-menu small{font-size:12px;color:var(--muted)}
.ig-mail .mail-what{margin:0 0 14px}
.ig-mail .mail-note{margin:10px 0 0;font-size:13px;color:var(--muted)}

/* PDF: only the export document prints */
#printDoc{display:none}
@media print{
  body.printing>*:not(#printDoc){display:none!important}
  body.printing{background:#fff}
  body.printing #printDoc{display:block;color:#04050a;font:10.5pt/1.55 Geist,Arial,sans-serif}
  @page{margin:16mm 16mm 18mm}
  #printDoc h1,#printDoc h2,#printDoc h3{font-family:Oswald,sans-serif;font-weight:300;letter-spacing:-.01em;margin:0}
  .pd-cover{padding-bottom:14pt;margin-bottom:16pt;border-bottom:1pt solid #ccc}
  .pd-eyebrow,.pd-shelf,.pd-kind{font-size:8.5pt;letter-spacing:.08em;text-transform:uppercase;color:#666;margin:0 0 4pt}
  .pd-cover h1{font-size:28pt}
  .pd-meta{margin:6pt 0 0;color:#555}
  .pd-ref{padding:6pt 0 14pt;border-bottom:1pt solid #ddd;margin-bottom:12pt}
  .pd-ref+.pd-ref{break-before:page}
  .pd-ref h2{font-size:20pt;line-height:1.15}
  .pd-url{margin:3pt 0 8pt;font-size:8.5pt;color:#555;word-break:break-all}
  .pd-img{display:block;max-width:100%;max-height:200pt;margin:6pt 0 10pt;border:1pt solid #ddd;border-radius:6pt}
  .pd-lede{font-size:12pt;margin:0 0 8pt}
  #printDoc h3{font-size:13pt;margin:12pt 0 4pt}
  #printDoc p{margin:0 0 6pt}
  #printDoc ul,#printDoc ol{margin:0 0 6pt;padding-left:16pt}
  #printDoc li{margin:0 0 3pt}
  .pd-tpl{margin:12pt 0;padding:10pt 12pt;border:1pt solid #ddd;border-radius:8pt;break-inside:avoid}
  .pd-tpl dl,.pd-vocab{margin:4pt 0 8pt}
  #printDoc dt{font-weight:600;margin-top:4pt}
  #printDoc dd{margin:0 0 2pt}
}

/* section numbers sit above the heading, so the text keeps the full width */
.rf-sec .story article{grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);row-gap:10px}
.rf-sec .story article::before{grid-column:1/-1;padding:0;font-size:12px;letter-spacing:.12em}
@media(max-width:1300px){.rf-sec .story article{grid-template-columns:1fr}.rf-sec .story article p{grid-column:auto}}

/* checklist: a static, numbered list */
.ck-static{list-style:none;margin:0;padding:0;counter-reset:none}
.ck-static li{display:grid;grid-template-columns:36px minmax(0,1fr);gap:14px;padding:16px 0;border-top:1px solid var(--line)}
.ck-num{width:28px;height:28px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--ink);color:#fff;font-size:13px;font-weight:500}
.ck-static b{display:block;margin-bottom:4px;font-weight:500;font-size:clamp(16px,1.1vw,20px)}
.ck-static div>span{font-size:clamp(14px,.95vw,17px);line-height:1.55;color:var(--body)}

/* ── phones ── */
@media(max-width:760px){
  :root{--hdr-h:64px}
  .site-header{height:var(--hdr-h);padding:0 10px 0 6px;gap:6px}
  .lockup{gap:10px;min-width:0}
  .brand img{width:96px;height:24px}
  .brand span{display:none}
  .lockup .lockup-sep{height:26px}
  .app-name{font-size:14px;line-height:1.08;white-space:normal;max-width:none}
  .app-name span{display:block}
  .header-ctas{gap:2px;margin-left:auto}
  .header-ctas .pill.contact{display:inline-flex!important;width:42px;height:42px;padding:0;border:0;align-items:center;justify-content:center;background:none}
  .header-ctas .pill.contact svg{display:block;width:23px;height:23px}
  .header-ctas .pill.contact .contact-t{display:none}
  .header-ctas .pill.ask-agent{width:46px;height:46px;padding:0;border:0;background:none;box-shadow:none;justify-content:center}
  .header-ctas .pill.ask-agent:hover{background:none;box-shadow:none;transform:none}
  .header-ctas .pill.ask-agent .ask-t{display:none}
  .header-ctas .pill.ask-agent .g-ico{width:34px;height:34px;animation:gFloat 3.6s ease-in-out infinite}
  .header-ctas .pill.ask-agent .g-ico path:last-child{animation:twinkle 2.6s ease-in-out infinite}

  /* list: title and description, then one row of icon tools */
  .lib-bar{margin:0 -16px 18px;padding:22px 16px 12px;gap:14px 10px;align-items:center}
  .lib-title{flex:1;min-width:0}
  .lib-title h1{font-size:40px}
  .lib-title p{margin-top:8px;font-size:15px}
  .lib-tools{flex:1 0 100%;flex-wrap:nowrap;justify-content:flex-start;gap:8px}
  .lib-find{width:42px;height:42px;flex:none;padding:0;justify-content:center;transition:none}
  .lib-find input{width:0;padding:0;flex:0}
  .lib-find:focus-within,.lib-find.filled{flex:1;width:auto;padding:0 14px;justify-content:flex-start}
  .lib-find:focus-within input,.lib-find.filled input{flex:1;width:auto}
  .lib-tools.searching>:not(.lib-find){display:none}
  .lib-sort{position:relative;width:42px;height:42px;padding:0;justify-content:center;flex:none}
  .lib-sort .sort-l{display:none}
  .lib-sort .sort-i{display:block}
  .lib-sort select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
  .lib-views{margin-left:auto;flex:none}
  .lib-views .rl{width:36px;height:34px}
  /* frozen on scroll: title and one tools button; the button opens the row */
  .lib-bar.stuck{padding:10px 16px}
  .lib-bar.stuck .lib-title h1{font-size:24px}
  .lib-bar.stuck .lib-more{display:flex;width:42px;height:42px;flex:none;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:50%;background:#fff;color:var(--ink)}
  .lib-bar.stuck.tools-open .lib-more{background:var(--ink);border-color:var(--ink);color:#fff}
  .lib-bar.stuck:not(.tools-open) .lib-tools{display:none}
  .group-head h2{font-size:30px}

  /* reference page: nothing scrolls sideways */
  .rf-actions{gap:10px}
  .ai-action,.exp-btn{height:50px;font-size:15px}
  .fig-rail{grid-auto-flow:row;grid-auto-columns:auto;grid-template-columns:1fr;overflow:visible;padding:0}
  .stage-bar{flex-wrap:wrap;overflow:visible;padding:10px;gap:8px}
  .stage-tab{flex:1 1 calc(50% - 4px);max-width:none;height:52px;padding-right:10px}
  .stage-tab img{width:52px;height:38px}
  .stage-play{height:54px;font-size:15px;padding:0 20px 0 10px}
  .stage-play svg{width:36px;height:36px;padding:9px}
  .flow{grid-auto-flow:row;grid-auto-columns:auto;grid-template-columns:1fr;overflow:visible;gap:30px}
  .flow li:not(:last-child)::after{content:"↓";right:auto;left:22px;top:auto;bottom:-27px}
  .flow-screen{height:auto;min-height:100px}
  .tpl{padding:18px}
  .tpl-btn{height:38px;padding:0 14px;font-size:13px}
  .mo-viz{grid-template-columns:52px minmax(0,1fr)}
  .rf-sec .story article{row-gap:8px}

  /* Ask Agent: always full screen on a phone */
  .agent.immersive{top:0;z-index:40;--side:0px;--px:16px}
  .agent.immersive .agent-top{padding:8px 8px 8px 12px;gap:2px}
  .agent.immersive .agent-top b.agent-title{font-size:20px;gap:8px}
  .agent.immersive .agent-title .g-ico{width:24px;height:24px}
  .agent.immersive .top-ctx,.agent.immersive .agent-exp,.agent.immersive .agent-state{display:none}
  .agent.immersive .agent-ico.agent-new{width:40px;padding:0;border:0}
  .agent.immersive .agent-new .new-t{display:none}
  .agent.immersive .agent-burger{display:flex}
  .agent.immersive .agent-top b.agent-title{margin-right:auto}
  .agent.immersive.has-chat .agent-ctxline{display:flex!important;padding:8px 16px}
  .agent.immersive .agent-intro{grid-template-columns:1fr;gap:18px;align-content:end;padding:20px 16px 8px}
  .agent.immersive .ctx-title{gap:14px}
  .agent.immersive .ctx-title b{font-size:28px}
  .agent.immersive .ctx-sub{font-size:14px}
  .agent.immersive .ctx-title img{width:76px;height:50px}
  .agent.immersive .ctx-title.ctx-lib .ctx-dom,.agent.immersive .ctx-title.ctx-lib .ctx-dom .g-ico{width:44px;height:44px}
  .agent.immersive .agent-tries .try{min-height:50px;padding:10px 14px;font-size:15px}
  .agent.immersive .agent-log{padding:16px}
  .agent.immersive .msg{font-size:15.5px}
  .agent.immersive .msg.you{max-width:88%}
  .agent.immersive .msg.bot{margin-left:0;padding:14px 16px}
  .agent.immersive .msg.bot::before{display:none}
  .agent.immersive .cites,.cites{display:grid;grid-template-columns:1fr 1fr;overflow:visible}
  .cite{flex:none}
  .agent.immersive .agent-note{display:none}
  .agent.immersive .agent-form{margin:6px 10px calc(10px + env(safe-area-inset-bottom));padding:6px 6px 6px 12px}
  .agent.immersive .form-g .g-ico{width:24px;height:24px}
  .agent.immersive .agent-form textarea{height:44px;padding:11px 0;font-size:16px}
  .agent.immersive .agent-form .ask-go{width:46px;height:46px;font-size:22px}
  .agent.immersive .agent-chats{padding-top:12px}
}
@media(max-width:760px){
  .agent.immersive .agent-intro .agent-tries,.agent.immersive .intro-foot .agent-tries{padding:0;margin:0}
  .agent.immersive .intro-foot{padding-bottom:4px}
  .stage-tab{min-width:0}
}

/* ═════ v9: phone header and phone agent ═════ */
/* the agent's hamburger is the header's, and turns into a cross while the chats list is open */
.agent-burger .hb i{background:var(--ink)}
.agent.chats-open .agent-burger .hb i{transition:top .25s,transform .25s .1s,opacity .2s}
.agent.chats-open .agent-burger .hb i:nth-child(1){top:7px;transform:rotate(45deg)}
.agent.chats-open .agent-burger .hb i:nth-child(2){opacity:0}
.agent.chats-open .agent-burger .hb i:nth-child(3){top:7px;transform:rotate(-45deg)}
.agent-burger{margin-right:6px}
.agent.chats-open .agent-burger{background:none}

@media(max-width:760px){
  /* header: menu, the app name, and two clear icons */
  .site-header{padding:0 10px 0 8px;gap:10px}
  .lockup .brand,.lockup .lockup-sep{display:none}
  .rail-btn{width:44px;height:44px;flex:none}
  .app-name{font-size:20px;line-height:1.04;letter-spacing:-.005em}
  .header-ctas{gap:8px}
  .header-ctas .pill.contact{width:44px;height:44px}
  .header-ctas .pill.contact svg{width:27px;height:27px}
  .header-ctas .pill.ask-agent{width:48px;height:48px}
  .header-ctas .pill.ask-agent .g-ico{width:40px;height:40px}

  /* agent: the full visible height, so the input is never cut off */
  .agent.immersive{top:0;bottom:auto;height:100vh;height:100dvh}
  .agent.immersive .agent-top{min-height:64px;padding:10px 10px 10px 8px;gap:4px}
  .agent.immersive .agent-burger{width:44px;height:44px;margin-right:10px}
  .agent.immersive .agent-top b.agent-title{font-size:23px;gap:10px}
  .agent.immersive .agent-title .g-ico{width:30px;height:30px}
  .agent.immersive .agent-ico.agent-new{width:44px;height:44px;border:0}
  .agent.immersive .agent-new svg{width:22px;height:22px}
  .agent.immersive .agent-x{width:44px;height:44px;margin-left:6px;border:1px solid var(--line);border-radius:50%;font-size:17px}

  /* start: what we are talking about at the top, three prompts under it */
  .agent.immersive .agent-intro{display:flex;flex-direction:column;justify-content:flex-start;gap:26px;padding:26px 18px 12px}
  .agent.immersive .intro-foot{margin-top:0;padding-top:0}
  .agent.immersive .ctx-title{flex-direction:column;align-items:flex-start;gap:14px}
  .agent.immersive .ctx-title img{width:100%;height:auto;max-height:190px;aspect-ratio:16/9;border-radius:14px;object-fit:cover;object-position:top}
  .agent.immersive .ctx-title small{font-size:14px}
  .agent.immersive .ctx-title b{font-size:32px;line-height:1.08}
  .agent.immersive .ctx-sub{font-size:17px;line-height:1.5;max-width:none;margin-top:8px}
  .agent.immersive .ctx-title.ctx-lib .ctx-dom,.agent.immersive .ctx-title.ctx-lib .ctx-dom .g-ico{width:56px;height:56px}
  .agent.immersive .ctx-title.ctx-lib b{font-size:38px}
  .agent.immersive .tries-lbl{margin:0 0 10px;font-size:12px}
  .agent.immersive .agent-intro .agent-tries{gap:10px}
  .agent.immersive .agent-tries .try:nth-child(n+4){display:none}
  .agent.immersive .agent-tries .try{min-height:56px;padding:12px 16px;font-size:16px;line-height:1.35}
  .agent.immersive.has-chat .agent-ctxline{font-size:13px}
  .agent.immersive .msg{font-size:16px;line-height:1.6}
  .agent.immersive .agent-form{flex:none;margin:8px 12px calc(12px + env(safe-area-inset-bottom))}
}

/* touch screens: no hover tooltips */
@media(hover:none){[data-tip]::after{display:none!important}}
@media(max-width:760px) and (max-height:740px){
  .agent.immersive .ctx-title img{max-height:110px}
  .agent.immersive .ctx-title b{font-size:25px}
  .agent.immersive .ctx-title.ctx-lib b{font-size:32px}
  .agent.immersive .agent-intro{gap:18px;padding-top:18px}
  .agent.immersive .agent-tries .try{min-height:50px;font-size:15px}
}

/* phones: a small + at the right of the title for Add reference */
.lib-add{display:none}
@media(max-width:760px){
  .lib-add{display:flex;width:42px;height:42px;flex:none;align-self:flex-start;margin-top:6px;align-items:center;justify-content:center;border:0;border-radius:50%;background:var(--yellow);color:var(--ink);cursor:pointer;box-shadow:0 6px 16px rgba(255,200,0,.35)}
  .lib-add svg{width:22px;height:22px;stroke-width:2}
  .lib-bar.stuck .lib-add{margin-top:0;align-self:center}
}

/* ═════ v10: what is new, and the add-reference steps ═════ */
.new-badge{position:absolute;left:14px;top:14px;z-index:2;padding:5px 11px;border-radius:99px;background:var(--yellow);color:var(--ink);font-size:12px;font-weight:500;letter-spacing:.02em;box-shadow:0 4px 12px rgba(4,5,10,.15)}
.ref-img{position:relative}
.new-pill{display:inline-block;vertical-align:middle;margin:-6px 10px 0 0;padding:5px 12px;border-radius:99px;background:var(--yellow);font:500 13px/1 Geist,Arial,sans-serif;letter-spacing:.02em}
.just-added{margin-bottom:clamp(36px,4vw,64px);padding-bottom:clamp(28px,3vw,48px);border-bottom:1px solid var(--line)}
.new-mark{width:8px;height:8px;flex:none;margin-left:auto;margin-right:8px;border-radius:50%;background:linear-gradient(135deg,#17A9DA,#AC59AE);font-size:0;color:transparent;overflow:hidden}

/* add reference: steps, quick details, agent help, preview */
.add-wizard{width:min(760px,calc(100vw - 32px))}
.add-steps{list-style:none;display:flex;gap:6px;margin:4px 0 18px;padding:0;flex-wrap:wrap}
.add-steps li{display:flex;align-items:center;gap:8px;padding:6px 12px 6px 6px;border:1px solid var(--line);border-radius:99px;font-size:13px;color:var(--muted)}
.add-steps b{width:22px;height:22px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:rgba(4,5,10,.06);font-size:12px;font-weight:500;color:var(--ink)}
.add-steps li.on{border-color:var(--ink);color:var(--ink)}
.add-steps li.on b{background:var(--yellow)}
.add-steps li.done b{background:var(--ink);color:#fff}
.qd{display:grid;grid-template-columns:132px minmax(0,1fr);gap:16px;align-items:start;margin:-4px 0 18px;padding:14px;border:1px solid #ECE7F4;border-radius:16px;background:#FAF8FD}
.qd img,.qd-noimg{width:132px;height:86px;border-radius:10px;object-fit:cover;object-position:top;background:#fff;border:1px solid var(--line)}
.qd-noimg{display:flex;align-items:center;justify-content:center;font-family:Oswald,sans-serif;font-size:28px;text-transform:uppercase;color:var(--muted)}
.qd small{display:block;font-size:12px;color:var(--muted);margin-bottom:4px}
.qd b{display:block;font-weight:500;font-size:16px;line-height:1.35}
.qd p{margin:6px 0 0;font-size:14px;line-height:1.5;color:var(--body)}
.qd .qd-why{display:flex;gap:8px;align-items:flex-start;color:var(--ink)}
.qd .qd-why svg,.ai-alt svg,.add-ai svg{width:16px;height:16px;flex:none;margin-top:2px;color:#AC59AE}
.qd .qd-warn{color:#9b2c2c;font-weight:500}
.qd .qd-note{color:var(--muted)}
.qd.loading{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:14px}
.qd.dup{border-color:#f0c9c9;background:#fdf6f6}
.qd-spin{width:18px;height:18px;border-radius:50%;border:2px solid var(--line);border-top-color:#AC59AE;animation:spin .8s linear infinite}
@media(max-width:600px){.qd{grid-template-columns:1fr}.qd img,.qd-noimg{width:100%;height:auto;aspect-ratio:16/9}}
.add-ai{margin:6px 0 16px;padding:14px 16px;border:1px dashed #B7AEC7;border-radius:16px;background:#fff}
.add-ai>p{margin:0 0 10px;font-size:14px;color:var(--body)}
.add-ai>div{display:flex;flex-wrap:wrap;gap:8px}
.add-ai .tpl-btn{display:inline-flex;align-items:center;gap:8px}
.add-ai .tpl-btn.busy{opacity:.6;pointer-events:none}
.add-ai .add-ai-msg{margin:10px 0 0;font-size:13px;color:var(--muted);min-height:1em}
.add-ai .add-ai-msg:empty{display:none}
textarea.ai-filled{background:#FAF8FD;border-color:#B7AEC7}
.ai-alt{display:flex;gap:10px;align-items:flex-start;margin-top:8px;padding:10px 12px;border-radius:12px;background:#FAF8FD;font-size:14px;line-height:1.5}
.ai-alt span{display:flex;gap:8px;flex:1}
.ai-alt .try{flex:none}
.add-preview{margin:6px 0 18px;padding:16px;border-radius:18px;background:#f6f3fb}
.add-pv-h{margin:0 0 12px;font-weight:500}
.add-pv-h small{font-weight:400;color:var(--muted);margin-left:6px}
.add-preview .grid{grid-template-columns:minmax(0,340px)}
.add-preview .ref{pointer-events:none}
.add-pv-notes{display:grid;gap:10px;margin:16px 0 0}
.add-pv-notes dt{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.add-pv-notes dd{margin:2px 0 0;font-size:14.5px;line-height:1.5}
.add-pv-after{margin:14px 0 0;font-size:13px;color:var(--muted)}

/* ═════ v11: large monitors — use the full width, scale the menu ═════ */
@media(min-width:1101px){
  :root{--rail-w:clamp(236px,15vw,460px)}
  /* the content runs from the menu to the same right edge as the header's Ask Agent */
  .wrap{max-width:none}
  /* the menu grows with the screen (unchanged up to ~1800px) */
  .rail{padding:clamp(18px,1.4vw,40px) clamp(12px,.8vw,24px) 40px}
  .rail a,.rail button.rl{min-height:clamp(40px,2.2vw,60px);padding:clamp(9px,.5vw,14px) clamp(12px,.75vw,20px) clamp(9px,.5vw,14px) clamp(20px,1vw,28px);font-size:clamp(15px,.83vw,22px);border-radius:clamp(10px,.6vw,14px)}
  .rail .on::before,.rail .spy::before{left:clamp(8px,.45vw,12px)}
  .rail i{min-width:clamp(26px,1.4vw,38px);height:clamp(22px,1.2vw,32px);padding:0 clamp(7px,.4vw,10px);font-size:clamp(12px,.62vw,16px)}
  .rail-add{height:clamp(46px,2.5vw,66px)!important;min-height:0;font-size:clamp(15px,.83vw,22px)!important;margin-bottom:clamp(16px,1vw,26px)}
  .rail-add svg{width:clamp(16px,.85vw,22px);height:clamp(16px,.85vw,22px)}
  .rail-lbl{font-size:clamp(11px,.58vw,15px);margin-top:clamp(18px,1.2vw,30px)}
  .rail-foot,.rail-foot a,.rail-foot button{font-size:clamp(13px,.7vw,18px)}
  .rail-sync{font-size:clamp(12px,.62vw,16px)}
  .new-mark{width:clamp(8px,.42vw,11px);height:clamp(8px,.42vw,11px)}
  /* title-bar controls grow a little with the screen too */
  .lib-find,.lib-sort,.lib-export{height:clamp(42px,2.2vw,58px)}
  .lib-export{width:clamp(42px,2.2vw,58px)}
  .lib-find{width:clamp(240px,19vw,520px)}
  .lib-find input,.lib-sort,.lib-sort select{font-size:clamp(14px,.75vw,19px)}
  .lib-views .rl{width:clamp(44px,2.3vw,60px);height:clamp(36px,1.9vw,50px)}
}

/* ═════ v12: Add reference — a wide two-pane workflow ═════ */
dialog.nova-dialog.add-wizard{--awpad:clamp(22px,2vw,44px);--awfs:clamp(15px,.78vw,19px);width:min(1600px,calc(100vw - 48px));height:min(94dvh,1240px);max-height:none;padding:0;display:flex;flex-direction:column;overflow:hidden;border-radius:22px;font-size:var(--awfs)}
dialog.nova-dialog.add-wizard:not([open]){display:none}
.add-wizard>#manageHint{display:none}
.add-wizard .manage-top{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:calc(var(--awpad) * .8) var(--awpad) 0}
.add-wizard .manage-top h2{margin:0;font-size:clamp(30px,2.1vw,48px)}
.aw-x{width:48px;height:48px;flex:none;display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;background:#fff;color:var(--ink);cursor:pointer;transition:background .15s,transform .15s}
.aw-x:hover{background:var(--ink);color:#fff;transform:rotate(90deg)}
.aw-x svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
/* workflow: four connected steps */
.aw-flow{list-style:none;display:grid;grid-template-columns:repeat(4,1fr);margin:clamp(14px,1.2vw,24px) 0 0;padding:0 var(--awpad) clamp(16px,1.3vw,26px);border-bottom:1px solid var(--line);counter-reset:s}
.aw-flow li{position:relative;display:flex;align-items:center;gap:12px;color:var(--muted);font-size:.93em;min-width:0}
.aw-flow li:not(:last-child)::after{content:"";flex:1;height:2px;margin:0 14px;border-radius:2px;background:linear-gradient(90deg,var(--ink) 50%,var(--line) 50%) right/200% 100% no-repeat;transition:background-position .5s ease}
.aw-flow li.done:not(:last-child)::after{background-position:left}
.aw-flow b{position:relative;width:34px;height:34px;flex:none;display:grid;place-items:center;border-radius:50%;border:1.5px solid var(--line);background:#fff;font-weight:500;color:var(--ink);transition:background .25s,border-color .25s}
.aw-flow b svg{position:absolute;width:18px;height:18px;fill:none;stroke:#fff;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;opacity:0;transition:opacity .2s}
.aw-flow em{font-style:normal;white-space:nowrap}
.aw-flow li.on{color:var(--ink);font-weight:500}
.aw-flow li.on b{background:var(--yellow);border-color:var(--yellow);box-shadow:0 0 0 5px rgba(255,203,5,.22)}
.aw-flow li.done{color:var(--ink)}
.aw-flow li.done b{background:var(--ink);border-color:var(--ink)}
.aw-flow li.done b span{opacity:0}
.aw-flow li.done b svg{opacity:1}
/* panes */
.aw-grid{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,1fr)}
.aw-left{overflow:auto;min-height:0;overscroll-behavior:contain}
.aw-side{overflow:auto;min-height:0;padding:var(--awpad);background:#F5F3EE;border-left:1px solid var(--line);overscroll-behavior:contain}
.add-wizard .aw-left form{display:flex;flex-direction:column;gap:clamp(16px,1.2vw,24px);padding:var(--awpad) var(--awpad) 0;min-height:100%}
.add-wizard label.aw-field{display:grid;gap:8px;font-size:.93em;font-weight:500;color:var(--ink)}
.add-wizard input,.add-wizard select,.add-wizard textarea{font-size:var(--awfs);border-radius:12px;padding:.8em .95em;border:1px solid #DAD7CF;background:#fff;font-weight:400;transition:border-color .15s,box-shadow .15s}
.add-wizard input:focus,.add-wizard select:focus,.add-wizard textarea:focus{outline:0;border-color:var(--ink);box-shadow:0 0 0 4px rgba(4,5,10,.07)}
.add-wizard input[name=url]{padding:1em 1.1em;font-size:1.05em}
.add-wizard textarea{min-height:5.2em;line-height:1.5}
.aw-flash{animation:awflash 1.2s ease}
@keyframes awflash{0%{background:#F3E9FA;border-color:#AC59AE}100%{background:#fff}}
/* link preview under the URL */
.aw-link{display:grid;grid-template-columns:clamp(150px,11vw,220px) minmax(0,1fr);gap:clamp(14px,1vw,20px);margin-top:-6px;padding:12px;border:1px solid #E6E1F0;border-radius:16px;background:#FBFAFD}
.aw-link-img{position:relative;aspect-ratio:16/10;border-radius:10px;overflow:hidden;background:#EEEAF4;display:grid;place-items:center}
.aw-link-img>span{font-family:Oswald,sans-serif;font-size:30px;text-transform:uppercase;color:#9a94a8}
.aw-link-img img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.aw-play{position:absolute;width:44px;height:44px;border-radius:50%;background:rgba(4,5,10,.72)}
.aw-play::after{content:"";position:absolute;left:17px;top:13px;border:9px solid transparent;border-left:14px solid #fff;border-right:0}
.aw-link-txt{min-width:0;display:flex;flex-direction:column;gap:5px}
.aw-link-txt small{display:flex;align-items:center;gap:6px;font-size:.8em;color:var(--muted);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.aw-fav{width:14px;height:14px;border-radius:3px}
.aw-link-txt b{font-weight:500;font-size:1.02em;line-height:1.35}
.aw-link-txt p{margin:0;font-size:.88em;line-height:1.5;color:var(--body);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.aw-link-foot{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:auto;padding-top:4px}
.aw-state{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 10px;border-radius:99px;font-size:.78em;font-weight:500}
.aw-state svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.4}
.aw-state.ok{background:#E6F4EA;color:#1f7a3d}
.aw-state.busy{background:#F1ECF7;color:#6b4a7a}
.aw-state.busy .qd-spin{width:12px;height:12px}
.aw-state.part{background:#FFF4D6;color:#7a5b00}
.aw-state.bad{background:#FBE9E9;color:#9b2c2c}
.aw-retry,.aw-regen{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:1px solid var(--line);border-radius:99px;background:#fff;font:inherit;font-size:.8em;color:var(--ink);cursor:pointer}
.aw-retry:hover,.aw-regen:hover{border-color:var(--ink)}
.aw-retry svg,.aw-regen svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.aw-regen.busy svg{animation:spin .8s linear infinite}
.aw-muted{margin:2px 0 0!important;font-size:.82em!important;color:var(--muted)!important;-webkit-line-clamp:4!important}
.aw-warn{margin:6px 0 0;color:#9b2c2c;font-weight:500;font-size:.9em}
/* title + shelf */
.aw-row{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(220px,1fr);gap:clamp(14px,1vw,20px);align-items:start}
.aw-inwrap{position:relative}
.aw-inwrap input{padding-right:8.6em}
.aw-regen{position:absolute;right:8px;top:50%;transform:translateY(-50%)}
.aw-says{margin:2px 0 0;padding:10px 12px;border-radius:10px;background:#FBFAFD;border:1px solid #EEE9F5;font-weight:400;font-size:.88em;line-height:1.5;color:var(--body)}
.aw-says b{display:block;font-size:.78em;letter-spacing:.06em;text-transform:uppercase;color:#8a6b98;font-weight:500;margin-bottom:2px}
.aw-select{position:relative}
.aw-select select{appearance:none;-webkit-appearance:none;padding-right:2.6em;cursor:pointer;background-image:none;text-overflow:ellipsis}
.aw-select::after{content:"";position:absolute;right:16px;top:50%;width:8px;height:8px;margin-top:-6px;border-right:1.8px solid var(--ink);border-bottom:1.8px solid var(--ink);transform:rotate(45deg);pointer-events:none}
.aw-hint{display:flex;gap:6px;align-items:flex-start;margin:0;font-weight:400;font-size:.8em;line-height:1.45;color:var(--muted)}
.aw-hint svg,.aw-ai svg,.aw-read-h svg{width:15px;height:15px;flex:none;fill:none;stroke:#AC59AE;stroke-width:1.6;margin-top:1px}
/* notes */
.aw-notes{display:grid;gap:clamp(12px,1vw,18px);margin:4px 0 0;padding:clamp(16px,1.2vw,24px);border:1px solid #E6E1F0;border-radius:18px;background:#FDFCFE;min-width:0}
.aw-notes.busy{background:linear-gradient(90deg,#FDFCFE,#F6F0FB,#FDFCFE) 0/200% 100%;animation:awshine 1.6s linear infinite}
@keyframes awshine{to{background-position:-200% 0}}
.aw-notes-h{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.aw-notes legend{float:left;padding:0;font-family:Oswald,sans-serif;font-size:1.35em;letter-spacing:-.01em}
.aw-ai{display:flex;gap:8px;flex-wrap:wrap}
.aw-chip{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 14px;border:1px solid #D9CCE6;border-radius:99px;background:#fff;font:inherit;font-size:.86em;color:var(--ink);cursor:pointer}
.aw-chip:hover{border-color:#AC59AE;background:#FAF5FD}
.aw-chip:disabled{opacity:.5;cursor:default}
.aw-ai-msg{margin:-4px 0 0;font-size:.84em;color:#6b4a7a}
.aw-ai-msg:empty{display:none}
/* who + actions */
.aw-who{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.aw-who[hidden]{display:none}
.aw-who-line{margin:0;font-size:.88em;color:var(--muted)}
.aw-who-line b{color:var(--ink);font-weight:500}
.add-wizard #manageError:empty{display:none}
.aw-actions{position:sticky;bottom:0;z-index:2;display:flex!important;align-items:center;gap:12px;flex-wrap:wrap;margin:auto calc(var(--awpad) * -1) 0;padding:clamp(14px,1vw,20px) var(--awpad);background:linear-gradient(transparent,var(--paper) 22%);border-top:1px solid var(--line);background:var(--paper)}
.aw-actions .pill{height:clamp(46px,2.6vw,56px);padding:0 clamp(22px,1.6vw,32px);font-size:var(--awfs)}
.aw-foot{flex:1;margin:0;text-align:right;font-size:.8em;color:var(--muted)}
/* right pane */
.aw-side-h{margin:0 0 16px;font-family:Oswald,sans-serif;font-size:clamp(24px,1.6vw,34px);line-height:1.1}
.aw-side-h small,.aw-side-sub small{font-family:Geist,Arial,sans-serif;font-size:13px;color:var(--muted);margin-left:8px;font-weight:400}
.aw-side-sub{margin:clamp(20px,1.6vw,30px) 0 10px;font-size:.78em;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
.aw-side-sub small{text-transform:none;letter-spacing:0}
.aw-read{padding:clamp(16px,1.2vw,22px);border-radius:16px;background:#fff;border:1px solid #E6E1F0}
.aw-read-h{display:flex;align-items:center;gap:8px;margin:0 0 8px;font-weight:500;font-size:.92em}
.aw-read-h em{font-style:normal;font-weight:400;color:var(--muted);font-size:.9em}
.aw-read-says{margin:0 0 12px;font-size:1.02em;line-height:1.55}
.aw-read dl{display:grid;gap:8px;margin:0}
.aw-read dt,.aw-pv-notes dt{font-size:.72em;letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
.aw-read dd{margin:2px 0 0;font-size:.92em}
.aw-read dd small{color:var(--muted)}
.aw-sk{display:grid;gap:8px}
.aw-sk i{height:12px;border-radius:6px;background:linear-gradient(90deg,#efedf2,#f8f6fa,#efedf2) 0/200% 100%;animation:awshine 1.4s linear infinite}
.aw-sk i:nth-child(2){width:80%}.aw-sk i:nth-child(3){width:55%}
.aw-card{grid-template-columns:minmax(0,min(100%,440px))!important}
.aw-card .ref{pointer-events:none;background:#fff}
.aw-pv-notes{display:grid;gap:12px;margin:0;padding:clamp(14px,1vw,20px);border-radius:16px;background:#fff;border:1px solid var(--line)}
.aw-pv-notes dd{margin:2px 0 0;font-size:.92em;line-height:1.5;white-space:pre-wrap}
.aw-pv-notes .empty dd{color:#b2afa6;font-style:italic}
.aw-after{margin:18px 0 0;font-size:.84em;line-height:1.5;color:var(--muted)}
.aw-empty{height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:10px;color:var(--muted);padding:0 10%}
.aw-empty b{font-family:Oswald,sans-serif;font-weight:400;font-size:clamp(24px,1.6vw,32px);color:var(--ink)}
.aw-empty p{margin:0;max-width:40ch;line-height:1.55}
.aw-empty-ico svg{width:54px;height:54px}
.aw-pulse{animation:awpulse .9s ease}
@keyframes awpulse{0%{box-shadow:inset 0 0 0 3px var(--yellow)}100%{box-shadow:inset 0 0 0 0 transparent}}
/* publishing progress */
.aw-prog{list-style:none;margin:0;padding:0;display:grid;gap:0}
.aw-prog li{position:relative;display:grid;grid-template-columns:40px 1fr;gap:14px;padding:0 0 22px;color:var(--muted)}
.aw-prog li:not(:last-child)::before{content:"";position:absolute;left:19px;top:40px;bottom:2px;width:2px;background:var(--line)}
.aw-prog li.done:not(:last-child)::before{background:var(--ink)}
.aw-prog b{width:40px;height:40px;display:grid;place-items:center;border-radius:50%;border:1.5px solid var(--line);background:#fff;font-weight:500}
.aw-prog b svg{width:18px;height:18px;fill:none;stroke:#fff;stroke-width:2.4;stroke-linecap:round}
.aw-prog li.done b{background:var(--ink);border-color:var(--ink)}
.aw-prog li.on b{border-color:#AC59AE}
.aw-prog li.on,.aw-prog li.done{color:var(--ink)}
.aw-prog strong{display:block;font-weight:500;margin-top:8px}
.aw-prog span{display:block;font-size:.86em;color:var(--muted);margin-top:2px;line-height:1.45}
.aw-done-acts{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.aw-prog+.grid{margin-top:8px}
/* the manage list reuses the dialog: back to a plain, narrow panel */
dialog.nova-dialog.add-wizard:has(#referenceForm[hidden]){width:min(760px,calc(100vw - 32px));height:auto;max-height:88dvh;padding:32px;display:block;overflow:auto}
dialog.add-wizard:has(#referenceForm[hidden]) .aw-flow,dialog.add-wizard:has(#referenceForm[hidden]) .aw-grid{display:none}
dialog.add-wizard:has(#referenceForm[hidden]) .manage-top{padding:0}
@media(max-width:1100px){
  dialog.nova-dialog.add-wizard{width:calc(100vw - 24px);height:calc(100dvh - 24px)}
  .aw-grid{grid-template-columns:1fr;overflow:auto}
  .aw-grid{align-content:start}
  .aw-left,.aw-side{overflow:visible;min-height:auto}
  .aw-side{border-left:0;border-top:1px solid var(--line)}
  .aw-actions{position:sticky}
}
@media(max-width:760px){
  dialog.nova-dialog.add-wizard{width:100vw;height:100dvh;max-width:none;border-radius:0;margin:0;--awpad:18px}
  .aw-flow{gap:0}.aw-flow em{display:none}.aw-flow li.on em{display:inline;position:absolute;top:40px;left:0;font-size:12px}
  .aw-flow{padding-bottom:30px}
  .aw-row,.aw-who{grid-template-columns:1fr}
  .aw-link{grid-template-columns:1fr}
  .aw-inwrap input{padding-right:3.6em}.aw-regen span{display:none}
  .aw-foot{display:none}
}
.rf-says{max-width:68ch;font-size:clamp(17px,1.1vw,23px);line-height:1.6;margin:0}
.rf-curator{margin-top:18px;max-width:68ch}
.aw-flow em,.aw-read-h em{background:none!important;text-decoration:none!important;box-shadow:none!important;padding:0!important}
.aw-flow li.done b{box-shadow:none}
