/* Hallmark · v2.0.0 · scope: app · shape: app screen · genre: modern-minimal · theme: Trovia brand · redesign: full · screen: AI Studio conversation · signature: persistent compact composer · fast mode */
/* Hallmark · pre-emit critique: P4 H5 E4 S4 R5 V3 · weakest: V, brand shell retained so conversation density carries the redesign */
/* Hallmark · preserved: existing cream/green and dark tokens, DM Sans, route and request guards; unrelated dashboard findings are outside the Studio redesign. */

:root{
  --studio-scrim:rgba(15,25,19,.32);
  --font-body:"DM Sans",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  color-scheme:light;
  --cost-bg:rgba(255,255,255,.16);
  --primary:#2d6a4f;--primary-hover:#1f4d39;--hover:#f3f4ef;--selected:#f8fbf6;--control-hover:#c3cbbd;
  --toolbar:rgba(255,255,255,.96);--sticky:rgba(255,255,255,.97);--empty:rgba(255,255,255,.6);
  --gallery-control:rgba(255,255,255,.94);--track:#d8ddd3;--toast-bg:#1f4d39;
  --warn-line:#f0dcb6;--error-line:#f0cdc7;--pick-bg:#f3eef8;--pick-ink:#5b3f7a;--pick-line:#e5daf0;

  --green:#2d6a4f; --deep:#1f4d39; --green-50:#f1f7f2; --green-100:#e3efe5; --green-200:#c9dec9;
  --bg:#fffcf5; --cream:#fdf6e3; --sand:#dda15e; --sand-50:#fcf3e6; --sand-ink:#7f5520;
  --ink:#293c32; --muted:#5f6d63; --faint:#647168; --line:#e9ece3; --line-strong:#d6dccf;
  --white:#fff; --surface:#fbfbf7;
  --disabled-bg:#f1f3ee; --disabled-ink:#657267;
  --red:#a8412f; --red-50:#fbecea; --amber-50:#fdf4e4;
  --r-sm:6px; --r:8px; --r-lg:10px; --r-xl:12px;
  --shadow:0 1px 2px rgba(41,60,50,.04),0 2px 8px rgba(41,60,50,.04);
  --shadow-hover:0 2px 4px rgba(41,60,50,.05),0 8px 20px rgba(41,60,50,.07);
  --shadow-pop:0 12px 40px rgba(31,77,57,.18);
  --sidebar:232px;
  --ease:cubic-bezier(.2,.7,.2,1);
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.5 var(--font-body);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;background:none;border:0;padding:0}
button:disabled,[aria-disabled=true]{cursor:not-allowed}
a{color:var(--green)}
:focus-visible{outline:2px solid var(--green);outline-offset:2px;border-radius:4px}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
h1,h2,h3,h4,p{margin:0}
h1{font-size:28px;line-height:1.2;letter-spacing:-.8px;font-weight:800}
h2{font-size:18px;line-height:1.35;letter-spacing:-.3px;font-weight:700}
h3{font-size:15px;line-height:1.4;font-weight:700}
.muted{color:var(--muted)}
.eyebrow{color:var(--green);font-size:11px;text-transform:uppercase;letter-spacing:1.4px;font-weight:700}
.num{font-variant-numeric:tabular-nums}

.ic{display:inline-block;width:16px;height:16px;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
.ic.lg{width:20px;height:20px}.ic.xl{width:26px;height:26px}

/* ---------- Buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:0 16px;border-radius:var(--r);border:1px solid transparent;background:var(--primary);color:#fff;font-size:13px;font-weight:600;white-space:nowrap;transition:background .15s,border-color .15s,box-shadow .15s,transform .15s}
.btn:hover:not(:disabled){background:var(--primary-hover)}
.btn:active:not(:disabled){transform:translateY(1px)}
.btn:disabled{background:var(--disabled-bg);color:var(--disabled-ink);border-color:var(--line-strong);box-shadow:none}
.btn.outline{background:var(--white);color:var(--ink);border-color:var(--line-strong)}
.btn.outline:hover:not(:disabled){background:var(--surface);border-color:var(--control-hover)}
.btn.outline:disabled,.btn.soft:disabled{background:var(--disabled-bg);color:var(--disabled-ink);border-color:var(--line-strong)}
.btn.soft{background:var(--green-50);color:var(--deep);border-color:var(--green-100)}
.btn.soft:hover:not(:disabled){background:var(--green-100)}
.btn.ghost{background:transparent;color:var(--muted)}
.btn.ghost:hover:not(:disabled){background:var(--hover);color:var(--ink)}
.btn.sm{min-height:32px;padding:0 12px;font-size:12px}
.btn.lg{min-height:44px;padding:0 20px;font-size:14px}
.btn .cost{display:inline-flex;flex:0 0 auto;align-items:center;gap:3px;padding:2px 7px;border-radius:4px;background:var(--cost-bg);font-size:11px;font-weight:600;white-space:nowrap}
.btn.outline .cost,.btn.soft .cost{background:var(--cream);color:var(--sand-ink)}
.btn:disabled .cost{background:var(--line);color:var(--disabled-ink)}
.icon-btn{width:36px;height:36px;display:grid;place-items:center;border-radius:var(--r);border:1px solid var(--line);background:var(--white);color:var(--ink);transition:background .15s}
.icon-btn:hover:not(:disabled){background:var(--surface)}
.icon-btn:disabled{color:#c0c7bd}

/* ---------- Brand ---------- */
.logo{display:flex;align-items:center;gap:9px;color:var(--ink);font-size:21px;font-weight:800;letter-spacing:-.8px;text-decoration:none}
.logo .mark{width:30px;height:30px;border-radius:8px;background:var(--primary);color:#fff;display:grid;place-items:center}
.logo .mark svg{width:17px;height:17px}
.logo .dot{color:var(--sand)}

/* ---------- Preview banner ---------- */
.preview-banner{position:sticky;top:0;z-index:40;display:flex;align-items:center;justify-content:center;gap:8px;min-height:32px;padding:6px 16px;background:var(--cream);border-bottom:1px solid #efe2c2;color:var(--sand-ink);font-size:12px;font-weight:600;text-align:center}
.preview-banner strong{font-weight:800}

/* ---------- Auth gate ---------- */
.gate{min-height:100dvh;display:grid;place-items:center;padding:24px}
.gate-card{width:min(420px,100%);text-align:center}
.gate-card .logo{justify-content:center;margin-bottom:28px}
.gate-card h1{font-size:24px;margin-bottom:8px}
.gate-card p{color:var(--muted);margin-bottom:24px}
.spinner{width:22px;height:22px;border-radius:50%;border:2.5px solid var(--green-100);border-top-color:var(--green);animation:spin .8s linear infinite;margin:0 auto 16px}
@keyframes spin{to{transform:rotate(360deg)}}
#clerk-mount{display:flex;justify-content:center}

/* ---------- Shell ---------- */
.shell{display:flex;min-height:100dvh}
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar);background:var(--white);border-right:1px solid var(--line);display:flex;flex-direction:column;padding:22px 14px 18px;z-index:30}
body.has-banner .sidebar{top:32px}
.sidebar .logo{margin:0 8px 32px}
.nav{display:grid;gap:2px}
.nav-label-group{font-size:10px;font-weight:700;letter-spacing:1.2px;text-transform:uppercase;color:var(--faint);padding:0 12px 8px}
.nav-item{position:relative;display:flex;align-items:center;gap:12px;min-height:42px;padding:0 12px;border-radius:var(--r);color:var(--muted);font-size:13.5px;font-weight:600;text-align:left;text-decoration:none;transition:background .15s,color .15s}
.nav-item:hover{background:var(--surface);color:var(--ink)}
.nav-item[aria-current=page]{background:var(--green-50);color:var(--deep)}
.nav-item[aria-current=page]::before{content:"";position:absolute;left:-14px;top:9px;bottom:9px;width:3px;border-radius:0 3px 3px 0;background:var(--green)}
.nav-item .badge-dot{margin-left:auto;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--primary);color:#fff;font-size:11px;font-weight:700;display:grid;place-items:center}
.side-foot{margin-top:auto;display:grid;gap:14px;padding-top:18px;border-top:1px solid var(--line)}
.balance{display:grid;gap:8px;padding:12px;border-radius:var(--r);background:var(--surface);border:1px solid var(--line)}
.balance-top{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.balance-top span{font-size:11px;color:var(--muted);font-weight:600}
.balance-top strong{font-size:15px;font-weight:800}
.meter{height:6px;border-radius:3px;background:var(--green-100);overflow:hidden}
.meter i{display:block;height:100%;background:var(--green);border-radius:3px;transition:width .4s var(--ease)}
.meter.warn i{background:var(--sand)}
.balance small{font-size:11px;color:var(--muted)}
.profile{display:flex;align-items:center;gap:10px;min-width:0}
.avatar{width:32px;height:32px;border-radius:8px;background:var(--sand);color:#3a2610;font-size:12px;font-weight:800;display:grid;place-items:center;flex:0 0 auto;overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover}
.profile-copy{min-width:0}
.profile-copy strong{display:block;font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profile-copy small{display:block;font-size:11px;color:var(--muted)}

.main{flex:1;margin-left:var(--sidebar);min-width:0;display:flex;flex-direction:column}
.container{width:100%;max-width:1360px;margin:0 auto;padding:32px 36px 24px}
.container.narrow{max-width:900px}
.page-footer{margin-top:auto;padding:32px 16px 20px;text-align:center;color:var(--faint);font-size:11.5px}

.mobile-bar{display:none}
.scrim{display:none}

/* ---------- Page header ---------- */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:24px}
.page-head h1{margin-top:6px}
.page-head p.lede{margin-top:6px;color:var(--muted);max-width:560px}

/* ---------- Research tabs ---------- */
.workbench{background:var(--white);border:1px solid var(--line);border-radius:var(--r-xl);box-shadow:var(--shadow)}
.tablist{display:flex;gap:4px;padding:6px;border-bottom:1px solid var(--line);background:var(--surface);border-radius:var(--r-xl) var(--r-xl) 0 0}
.tab{position:relative;display:flex;align-items:center;gap:10px;min-height:48px;padding:0 16px 0 12px;border-radius:var(--r);color:var(--muted);font-weight:700;font-size:13.5px;transition:background .15s,color .15s}
.tab:hover{color:var(--ink);background:var(--hover)}
.tab .tab-ic{width:30px;height:30px;border-radius:7px;display:grid;place-items:center;background:var(--surface);color:var(--muted);transition:inherit}
.tab small{display:block;font-size:11px;font-weight:500;color:var(--faint);margin-top:-1px}
.tab[aria-selected=true]{background:var(--white);color:var(--ink);box-shadow:0 1px 2px rgba(41,60,50,.06),0 0 0 1px var(--line)}
.tab[aria-selected=true] .tab-ic{background:var(--primary);color:#fff}
.tab[data-tab=special][aria-selected=true] .tab-ic{background:var(--sand);color:#3a2610}
.tab .tab-state{margin-left:6px;font-size:10.5px;font-weight:700;padding:2px 7px;border-radius:4px;background:var(--green-50);color:var(--deep)}
.tab .tab-state.loading{background:var(--cream);color:var(--sand-ink)}
.tablist-aside{margin-left:auto;display:flex;align-items:center;padding-right:10px;font-size:12px;color:var(--muted);gap:6px}

.tabpanel{padding:22px 24px 22px}
.panel-intro{display:flex;gap:14px;align-items:flex-start;margin-bottom:18px}
.panel-intro p{color:var(--muted);max-width:720px;font-size:13.5px}
.panel-intro strong{color:var(--ink)}

.search-grid{display:grid;grid-template-columns:minmax(0,1fr) 150px auto;gap:12px;align-items:end}
.field{display:grid;gap:6px;min-width:0}
.field label,.field .label{font-size:12px;font-weight:700;color:var(--ink)}
.field .hint{font-size:11.5px;color:var(--muted)}
.input-wrap{position:relative;display:flex;align-items:center}
.input-wrap .ic{position:absolute;left:14px;color:var(--faint);pointer-events:none}
.input{width:100%;min-height:44px;padding:0 14px;border:1px solid var(--line-strong);border-radius:var(--r);background:var(--white);outline:none;transition:border-color .15s,box-shadow .15s}
.input-wrap .input{padding-left:40px}
.input:hover{border-color:var(--control-hover)}
.input:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(45,106,79,.12)}
.input[aria-invalid=true]{border-color:var(--red);box-shadow:0 0 0 3px rgba(168,65,47,.1)}
.input::placeholder{color:var(--faint)}
.field-error{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--red);font-weight:600}
.search-grid .btn{min-height:44px;min-width:128px}

.options-row{display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px;margin-top:16px;padding-top:16px;border-top:1px dashed var(--line)}
.switch{display:inline-flex;align-items:center;gap:10px;min-height:44px;cursor:pointer;font-size:13px;font-weight:600}
.switch input{position:absolute;opacity:0;width:1px;height:1px}
.switch .track{width:36px;height:20px;border-radius:10px;background:var(--track);position:relative;transition:background .15s;flex:0 0 auto}
.switch .track::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2);transition:transform .15s var(--ease)}
.switch input:checked + .track{background:var(--green)}
.switch input:checked + .track::after{transform:translateX(16px)}
.switch input:focus-visible + .track{outline:2px solid var(--green);outline-offset:2px}
.switch small{font-weight:500;color:var(--muted);font-size:12px}
.inline-field{display:inline-flex;align-items:center;gap:8px;font-size:12.5px;font-weight:600}
.inline-field .input{width:84px;min-height:36px}
.usage{margin-left:auto;display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);padding:6px 10px;border-radius:var(--r);background:var(--surface);border:1px solid var(--line)}
.usage strong{color:var(--ink)}

.filter-group{margin-top:16px}
.filter-group > .label{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:700;margin-bottom:8px}
.filter-group > .label small{font-weight:500;color:var(--muted)}
.filter-chips{display:flex;flex-wrap:wrap;gap:8px}
.fchip{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 14px 0 10px;border:1px solid var(--line-strong);border-radius:var(--r);background:var(--white);font-size:13px;font-weight:600;color:var(--ink);transition:all .15s}
.fchip:hover{border-color:var(--control-hover);background:var(--surface)}
.fchip .box{width:18px;height:18px;border-radius:5px;border:1.5px solid #a9b4a4;display:grid;place-items:center;color:transparent;transition:all .15s}
.fchip .box svg{width:12px;height:12px;stroke-width:3}
.fchip[aria-pressed=true]{border-color:var(--green);background:var(--green-50);color:var(--deep)}
.fchip[aria-pressed=true] .box{background:var(--green);border-color:var(--green);color:#fff}
.fchip .fchip-ic{color:var(--sand-ink)}

/* ---------- Status / notices ---------- */
.notice{display:flex;align-items:flex-start;gap:12px;padding:12px 14px;border-radius:var(--r);border:1px solid var(--line);background:var(--white);font-size:13px}
.notice .ic{margin-top:2px}
.notice.info{background:var(--green-50);border-color:var(--green-100)}
.notice.info .ic{color:var(--green)}
.notice.warn{background:var(--amber-50);border-color:var(--warn-line)}
.notice.warn .ic{color:var(--sand-ink)}
.notice.error{background:var(--red-50);border-color:var(--error-line)}
.notice.error .ic{color:var(--red)}
.notice strong{display:block}
.notice p{color:var(--muted);font-size:12.5px}
.notice .notice-actions{margin-left:auto;display:flex;gap:8px;align-self:center}

/* ---------- Results ---------- */
.results{margin-top:24px}
.results-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin-bottom:14px}
.results-head h2{font-size:16px}
.results-head .query-pill{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.pill{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border-radius:5px;font-size:11px;font-weight:700;background:var(--surface);color:var(--muted)}
.pill.green{background:var(--green-50);color:var(--deep)}
.pill.sand{background:var(--sand-50);color:var(--sand-ink)}
.results-head .spacer{flex:1}
.results-head .cached{font-size:11.5px;color:var(--muted);display:inline-flex;align-items:center;gap:5px}

.stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-bottom:18px}
.stat{display:flex;align-items:center;gap:12px;padding:12px 14px;background:var(--white);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow);min-width:0}
.stat .stat-ic{width:34px;height:34px;border-radius:8px;background:var(--surface);color:var(--muted);display:grid;place-items:center;flex:0 0 auto}
.stat:first-child .stat-ic{background:var(--green-50);color:var(--green)}
.stat small{display:block;font-size:10.5px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stat strong{display:block;font-size:18px;line-height:1.25;font-weight:800;letter-spacing:-.3px;white-space:nowrap}
.stat strong span{font-size:12px;font-weight:600;color:var(--muted);letter-spacing:0}

.split{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:20px;align-items:start}
.toolbar{position:sticky;top:0;z-index:5;display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;padding:8px 8px 8px 12px;margin-bottom:10px;background:var(--toolbar);backdrop-filter:saturate(1.2);border:1px solid var(--line);border-radius:var(--r-lg)}
body.has-banner .toolbar{top:0}
.select-all{display:inline-flex;align-items:center;gap:10px;min-height:36px;font-size:12.5px;font-weight:600;cursor:pointer}
.cb{width:18px;height:18px;accent-color:var(--green);cursor:pointer;margin:0}
.toolbar .sel-count{font-size:12px;font-weight:700;color:var(--deep);background:var(--green-50);padding:3px 8px;border-radius:5px}
.toolbar .sel-count.zero{background:var(--surface);color:var(--muted)}
.toolbar .grow{flex:1}
.sort{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.sort select{min-height:36px;border:1px solid var(--line-strong);border-radius:var(--r);background:var(--white);padding:0 28px 0 10px;font-size:12.5px;font-weight:600;color:var(--ink);appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6d63' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 9px center}

.listings{display:grid;gap:8px;list-style:none;margin:0;padding:0}
.listing{position:relative;display:flex;align-items:stretch;background:var(--white);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow);transition:border-color .15s,box-shadow .15s,background .15s}
.listing:hover{border-color:var(--line-strong);box-shadow:var(--shadow-hover)}
.listing.is-selected{background:var(--selected);border-color:var(--green-200)}
.listing.is-open{border-color:var(--green);box-shadow:0 0 0 1px var(--green),var(--shadow-hover)}
.listing .listing-pick{display:grid;place-items:center;width:48px;flex:0 0 48px;cursor:pointer;border-right:1px solid transparent}
.listing-open{flex:1;min-width:0;display:flex;align-items:center;gap:14px;padding:10px 14px 10px 2px;text-align:left;border-radius:0 var(--r-lg) var(--r-lg) 0}
.thumb{position:relative;width:68px;height:68px;flex:0 0 68px;border-radius:7px;overflow:hidden;background:var(--surface);border:1px solid var(--line)}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.thumb .rank{position:absolute;left:4px;top:4px;min-width:20px;height:18px;padding:0 5px;border-radius:4px;background:rgba(31,45,36,.78);color:#fff;font-size:10.5px;font-weight:700;display:grid;place-items:center}
.listing-body{min-width:0;flex:1;display:grid;gap:5px}
.listing-title{font-size:13.5px;font-weight:700;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.listing-shop{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--muted);min-width:0}
.listing-shop span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.metrics{display:flex;flex-wrap:wrap;gap:5px}
.metric{display:inline-flex;align-items:center;gap:4px;height:22px;padding:0 7px;border-radius:5px;background:var(--surface);color:var(--muted);font-size:11px;font-weight:600;white-space:nowrap}
.metric .ic{width:12px;height:12px}
.metric.price{background:var(--green-50);color:var(--deep);font-weight:800}
.badges{display:flex;flex-wrap:wrap;gap:5px}
.badge{display:inline-flex;align-items:center;gap:4px;height:22px;padding:0 7px;border-radius:5px;font-size:11px;font-weight:700;white-space:nowrap;border:1px solid transparent}
.badge .ic{width:12px;height:12px;stroke-width:2}
.badge.bestseller{background:var(--sand-50);color:var(--sand-ink);border-color:var(--warn-line)}
.badge.pick{background:var(--pick-bg);color:var(--pick-ink);border-color:var(--pick-line)}
.badge.star{background:var(--green-50);color:var(--deep);border-color:var(--green-100)}
.chev{align-self:center;color:#b6bfb2;margin-left:4px;transition:transform .15s,color .15s}
.listing-open:hover .chev{color:var(--green);transform:translateX(2px)}
.list-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 4px;font-size:12px;color:var(--muted)}

/* Skeleton */
.skel{background:linear-gradient(90deg,#f0f2ec 0%,#f7f8f4 50%,#f0f2ec 100%);background-size:200% 100%;animation:shimmer 1.3s ease-in-out infinite;border-radius:5px}
@keyframes shimmer{from{background-position:200% 0}to{background-position:-200% 0}}
.skel-row{display:flex;gap:14px;align-items:center;padding:12px 14px 12px 48px;background:var(--white);border:1px solid var(--line);border-radius:var(--r-lg)}
.progress{display:flex;align-items:center;gap:12px;padding:14px 16px;background:var(--white);border:1px solid var(--line);border-radius:var(--r-lg);margin-bottom:12px}
.progress .spinner{margin:0;width:18px;height:18px;border-width:2px}
.progress strong{font-size:13px}
.progress p{font-size:12px;color:var(--muted)}
.progress .btn{margin-left:auto}

/* States */
.state{display:flex;flex-direction:column;align-items:center;text-align:center;padding:56px 24px;border:1px dashed var(--line-strong);border-radius:var(--r-xl);background:var(--empty)}
.state .state-ic{width:52px;height:52px;border-radius:12px;display:grid;place-items:center;background:var(--green-50);color:var(--green);margin-bottom:16px}
.state.err .state-ic{background:var(--red-50);color:var(--red)}
.state.warn .state-ic{background:var(--sand-50);color:var(--sand-ink)}
.state h2{font-size:17px;margin-bottom:6px}
.state p{color:var(--muted);max-width:460px;font-size:13.5px}
.state .state-actions{display:flex;gap:8px;margin-top:18px;flex-wrap:wrap;justify-content:center}
.suggest{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin-top:16px}
.suggest button{min-height:32px;padding:0 12px;border-radius:6px;border:1px solid var(--line);background:var(--white);font-size:12px;color:var(--muted);font-weight:600}
.suggest button:hover{border-color:var(--green);color:var(--deep);background:var(--green-50)}
.idle-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:24px}
.idle-step{padding:18px;background:var(--white);border:1px solid var(--line);border-radius:var(--r-lg)}
.idle-step .n{width:26px;height:26px;border-radius:7px;background:var(--green-50);color:var(--deep);font-weight:800;font-size:12px;display:grid;place-items:center;margin-bottom:12px}
.idle-step h3{font-size:13.5px;margin-bottom:4px}
.idle-step p{font-size:12.5px;color:var(--muted)}

/* ---------- Inspector ---------- */
.inspector-host{position:sticky;top:16px}
.inspector{background:var(--white);border:1px solid var(--line);border-radius:var(--r-xl);box-shadow:var(--shadow);max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain}
body.has-banner .inspector{max-height:calc(100dvh - 64px)}
.inspector-empty{min-height:420px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:32px;border:1px dashed var(--line-strong);border-radius:var(--r-xl);background:var(--empty)}
.inspector-empty .state-ic{width:44px;height:44px;border-radius:10px;background:var(--white);border:1px solid var(--line);display:grid;place-items:center;color:var(--green);margin-bottom:14px}
.inspector-empty h3{margin-bottom:4px}
.inspector-empty p{font-size:12.5px;color:var(--muted);max-width:280px}
.insp-top{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:8px;padding:10px 12px;background:var(--sticky);border-bottom:1px solid var(--line)}
.insp-top .pos{font-size:12px;color:var(--muted);font-weight:600;flex:1}
.gallery{position:relative;background:var(--hover);aspect-ratio:4/3;overflow:hidden;touch-action:pan-y}
.gallery .stage{position:absolute;inset:0;display:block;width:100%;height:100%;cursor:zoom-in}
.gallery .stage img{width:100%;height:100%;object-fit:cover;display:block}
.gallery .g-nav{position:absolute;top:50%;transform:translateY(-50%);width:40px;height:40px;border-radius:50%;background:var(--gallery-control);box-shadow:0 2px 8px rgba(0,0,0,.12);display:grid;place-items:center;color:var(--ink)}
.gallery .g-nav:disabled{opacity:0;pointer-events:none}
.gallery .g-prev{left:10px}.gallery .g-next{right:10px}
.gallery .g-count{position:absolute;right:10px;bottom:10px;padding:3px 8px;border-radius:5px;background:rgba(31,45,36,.78);color:#fff;font-size:11px;font-weight:700}
.gallery .g-zoom{position:absolute;left:10px;bottom:10px;padding:3px 8px;border-radius:5px;background:var(--gallery-control);color:var(--ink);font-size:11px;font-weight:700;display:flex;gap:4px;align-items:center;pointer-events:none}
.thumbs{display:flex;gap:6px;padding:10px 12px;overflow-x:auto;border-bottom:1px solid var(--line);scrollbar-width:thin}
.thumbs button{width:52px;height:52px;flex:0 0 52px;border-radius:6px;overflow:hidden;border:2px solid transparent;opacity:.72;transition:opacity .15s,border-color .15s}
.thumbs button img{width:100%;height:100%;object-fit:cover;display:block}
.thumbs button[aria-current=true]{border-color:var(--green);opacity:1}
.thumbs button:hover{opacity:1}
.insp-body{padding:18px 18px 22px}
.insp-body h2{font-size:17px;line-height:1.35;margin-bottom:8px}
.shop-row{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;font-size:12.5px;color:var(--muted);margin-bottom:12px}
.shop-row a{font-weight:600;text-decoration:none;display:inline-flex;align-items:center;gap:4px}
.shop-row a:hover{text-decoration:underline}
.facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:14px}
.fact{padding:9px 11px;border-radius:var(--r);background:var(--surface);border:1px solid var(--line);min-width:0}
.fact small{display:block;font-size:10.5px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--muted)}
.fact strong{display:block;font-size:14px;font-weight:800;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.insp-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin-top:14px}
.insp-actions .btn{width:100%;min-width:0;min-height:40px;padding:9px 12px;gap:8px;font-size:12px;white-space:normal;text-align:left;justify-content:flex-start}
.insp-actions .action-label{min-width:0;flex:1;overflow-wrap:anywhere}
.insp-actions .btn[aria-pressed=true]{border-color:var(--green-200)}
.insp-actions .ai-help{margin:0;font-size:11.5px}
#reviews-box .notice{display:grid;grid-template-columns:16px minmax(0,1fr);gap:8px 10px;padding:12px}
#reviews-box .notice>div{min-width:0;overflow-wrap:anywhere}
#reviews-box .notice-actions{grid-column:2;margin:2px 0 0;justify-content:flex-start}
#reviews-box .notice-actions .btn{min-height:36px;white-space:normal;padding:6px 12px}
.review-list{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.review-list li{padding-bottom:12px;border-bottom:1px solid var(--line)}
.review-list li:last-child{padding:0;border:0}
.review-list small{color:var(--muted);font-size:11px}
.review-list p{font-size:13px;line-height:1.6;margin-top:4px;overflow-wrap:anywhere}
.section-label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;font-weight:800;letter-spacing:.8px;text-transform:uppercase;color:var(--muted);margin:22px 0 10px}
.section-label small{font-size:11px;letter-spacing:0;text-transform:none;font-weight:500}
.tags{display:flex;flex-wrap:wrap;gap:5px}
.tag{display:inline-flex;align-items:center;gap:5px;min-height:26px;padding:0 9px;border-radius:5px;font-size:12px;background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.tag.common{background:var(--green-50);border-color:var(--green-100);color:var(--deep)}
.tag .freq{font-size:10.5px;font-weight:800;color:var(--green)}
.tag-key{font-size:11.5px;color:var(--muted);margin-top:8px}
.desc{font-size:13px;line-height:1.65;color:var(--ink);white-space:pre-line;overflow-wrap:anywhere}
.desc.clamped{max-height:9.9em;overflow:hidden;-webkit-mask-image:linear-gradient(#000 65%,transparent)}
.linkish{color:var(--green);font-weight:700;font-size:12.5px;margin-top:6px;min-height:32px}
.linkish:hover{text-decoration:underline}
.inline-result{margin-top:12px}

/* ---------- Dialogs ---------- */
dialog{border:0;padding:0;background:transparent;color:inherit;max-width:none;max-height:none}
dialog::backdrop{background:rgba(24,38,30,.46)}
.modal{width:min(460px,calc(100vw - 32px));background:var(--white);border-radius:var(--r-xl);box-shadow:var(--shadow-pop);overflow:hidden}
.modal-head{display:flex;align-items:flex-start;gap:12px;padding:20px 20px 0}
.modal-head .m-ic{width:40px;height:40px;border-radius:10px;background:var(--green-50);color:var(--green);display:grid;place-items:center;flex:0 0 auto}
.modal-head h2{font-size:17px}
.modal-head p{color:var(--muted);font-size:13px;margin-top:2px}
.modal-body{padding:16px 20px}
.ledger{display:grid;gap:0;border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.ledger div{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;font-size:13px;border-bottom:1px solid var(--line)}
.ledger div:last-child{border-bottom:0;background:var(--surface);font-weight:700}
.ledger span:first-child{color:var(--muted)}
.modal-foot{display:flex;justify-content:flex-end;gap:8px;padding:0 20px 20px}
.lightbox{width:100vw;height:100dvh;background:rgba(18,28,22,.94);display:flex;flex-direction:column;color:#fff}
.lb-top{display:flex;align-items:center;gap:12px;padding:12px 16px}
.lb-top p{flex:1;font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:rgba(255,255,255,.85)}
.lb-top .icon-btn,.lb-nav{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.18);color:#fff}
.lb-top .icon-btn:hover,.lb-nav:hover:not(:disabled){background:rgba(255,255,255,.2)}
.lb-stage{flex:1;position:relative;display:grid;place-items:center;min-height:0;padding:8px 72px;touch-action:pan-y}
.lb-stage img{max-width:100%;max-height:100%;object-fit:contain;border-radius:6px;user-select:none;-webkit-user-drag:none}
.lb-nav{position:absolute;top:50%;transform:translateY(-50%);width:48px;height:48px;border-radius:50%;border:1px solid;display:grid;place-items:center}
.lb-nav:disabled{opacity:.25}
.lb-prev{left:16px}.lb-next{right:16px}
.lb-foot{display:flex;justify-content:center;gap:6px;padding:12px 16px 18px;overflow-x:auto}
.lb-foot button{width:56px;height:56px;flex:0 0 56px;border-radius:6px;overflow:hidden;border:2px solid transparent;opacity:.55}
.lb-foot button[aria-current=true]{border-color:#fff;opacity:1}
.lb-foot img{width:100%;height:100%;object-fit:cover;display:block}
.sheet{width:100vw;height:100dvh;background:var(--white);display:flex;flex-direction:column}
.sheet .inspector{border:0;border-radius:0;box-shadow:none;max-height:none;flex:1}

/* ---------- AI Studio ---------- */
.studio-grid{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:20px;align-items:start}
.card{background:var(--white);border:1px solid var(--line);border-radius:var(--r-xl);box-shadow:var(--shadow)}
.card-head{display:flex;align-items:center;gap:10px;padding:16px 18px;border-bottom:1px solid var(--line)}
.card-head h2{font-size:15px}
.card-head .grow{flex:1}
.card-body{padding:18px}
.ai-selection-list{display:grid;grid-template-columns:minmax(0,1fr);gap:0;list-style:none;margin:0;padding:0;min-width:0;max-width:100%}
.ai-selection-list li{display:flex;align-items:center;gap:12px;min-width:0;max-width:100%;padding:8px 0;border-bottom:1px solid var(--line)}
.ai-selection-list li:first-child{padding-top:0}
.ai-selection-list li:last-child{padding-bottom:0;border:0}
.ai-selection-list .c-copy{flex:1 1 0;min-width:0}
.ai-selection-list .selection-listing{display:block;max-width:100%;text-align:left;font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.6}
.ai-selection-list .selection-listing:hover{text-decoration:underline;text-underline-offset:3px;color:var(--green)}
.ai-selection-list small{display:block;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ai-selection-list .icon-btn{flex:0 0 32px;width:32px;height:32px}
#cohort{max-height:240px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
#insp-title{overflow-wrap:anywhere}
#studio-workflow{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0}
#view-studio .studio-grid{gap:16px}
#view-studio .card-head{padding:12px 16px}
#view-studio .card-body{padding:14px 16px}
#view-studio .field{gap:6px}
#view-studio .field .ai-help{margin:0}
#view-studio .input{min-height:40px;font-size:13px;padding:8px 12px}
#view-studio textarea.input{min-height:64px}
#view-studio .btn.lg{min-height:40px;font-size:13px;padding:8px 14px}
#view-studio .card-head .btn{min-height:34px}
.modules{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.module{position:relative;display:flex;gap:12px;align-items:flex-start;padding:14px;border:1px solid var(--line-strong);border-radius:var(--r-lg);background:var(--white);text-align:left;transition:all .15s}
.module:hover:not(:disabled){border-color:var(--control-hover)}
.module[aria-checked=true]{border-color:var(--green);background:var(--green-50);box-shadow:0 0 0 1px var(--green)}
.module:disabled{background:var(--surface);color:var(--muted)}
.module .m-ic{width:34px;height:34px;border-radius:8px;background:var(--green-50);color:var(--green);display:grid;place-items:center;flex:0 0 auto}
.module:disabled .m-ic{background:var(--surface);color:var(--faint)}
.module strong{display:block;font-size:13.5px}
.module small{display:block;font-size:12px;color:var(--muted);margin-top:2px}
.module .pill{position:absolute;top:12px;right:12px}
.summary-card{position:sticky;top:16px}
.summary-card .ledger{border:0;border-radius:0;margin-bottom:12px}
.summary-card .ledger>div{padding:8px 0;align-items:baseline;font-size:12px}
.summary-card .ledger>div:last-child{background:none}
.summary-card .ledger>div>span:last-child{font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:600}
.summary-card .field-error{margin-bottom:10px;font-size:12px}
.summary-card [data-act=review-run]{width:100%}
.output{display:grid;gap:18px}
.output h3{font-size:14px;margin-bottom:6px}
.output ul{margin:0;padding-left:18px;display:grid;gap:6px;font-size:13.5px}
.output .callout{padding:12px 14px;border-left:3px solid var(--green);background:var(--green-50);border-radius:0 var(--r) var(--r) 0;font-size:13px}
.output .callout strong{display:block;color:var(--deep);font-size:12px;margin-bottom:2px}
.chat-log{display:grid;gap:10px;margin-bottom:12px}
.chat-log:empty{display:none}
.bubble{max-width:88%;padding:10px 14px;border-radius:10px;font-size:13px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere;border:1px solid var(--line);background:#fff}
.bubble.me{justify-self:end;background:var(--green-50);border-color:var(--green-100)}
.bubble .who{display:block;font-size:10.5px;font-weight:800;letter-spacing:.5px;text-transform:uppercase;color:var(--muted);margin-bottom:2px}
.chat-form{display:flex;gap:8px}
.chat-form .input{flex:1}

/* ---------- History ---------- */
.seg{display:inline-flex;gap:2px;padding:3px;border-radius:var(--r);background:var(--surface);border:1px solid var(--line)}
.seg button{min-height:34px;padding:0 12px;border-radius:6px;font-size:12.5px;font-weight:600;color:var(--muted)}
.seg button[aria-pressed=true]{background:var(--white);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.06)}
.history{display:grid;gap:12px;list-style:none;margin:24px 0 0;padding:0}
.h-row{display:flex;align-items:center;gap:24px;width:100%;padding:16px 20px;background:var(--white);border:1px solid var(--line);border-radius:var(--r-lg);text-align:left;transition:border-color .15s}
.h-row:hover,.h-row:focus-within{border-color:var(--green-200)}
.h-open{display:flex;align-items:center;gap:16px;flex:1;min-width:0;min-height:56px;text-align:left;border-radius:6px}
.h-open:hover strong{color:var(--green);text-decoration:underline;text-underline-offset:4px}
.h-row .h-ic{width:38px;height:38px;border-radius:9px;display:grid;place-items:center;background:var(--green-50);color:var(--green);flex:0 0 auto}
.h-row.special .h-ic{background:var(--sand-50);color:var(--sand-ink)}
.h-row .h-copy{flex:1;min-width:0;display:grid;gap:8px}
.h-row strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.h-row .h-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:12px;color:var(--muted)}
.h-meta time{white-space:nowrap}
.history-actions{display:flex;align-items:center;gap:8px;flex-shrink:0;padding-left:16px;border-left:1px solid var(--line)}
.history-actions .icon-btn{width:44px;height:44px;color:var(--muted)}
.history-export{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 12px;border-radius:8px;font-size:12px;font-weight:600;color:var(--muted)}
.history-export:hover,.history-actions .icon-btn:hover{background:var(--surface);color:var(--ink)}
.history-star[aria-pressed=true]{color:var(--sand-ink)}
.history-star[aria-pressed=true] svg{fill:currentColor}
.history-actions .history-delete:hover{background:var(--red-50);color:var(--red)}
.history-actions button:disabled{opacity:.5}
.sidebar .nav-glyph{stroke-width:1.6}
#view-history .page-head,#view-account .page-head{margin-bottom:24px}
#view-history .lede,#view-account .lede{font-size:13px;line-height:1.6;margin-top:8px}

/* ---------- Account ---------- */
.acct-grid{display:grid;grid-template-columns:minmax(240px,.8fr) minmax(0,1.4fr);gap:16px;align-items:stretch}
.acct-grid .span{grid-column:1/-1}
.balance-card .card-head,.billing-card .card-head{border-bottom:0;padding-bottom:0;gap:12px}
.balance-card .card-head{justify-content:space-between}
.balance-card .card-head>.muted{font-size:12px}
.balance-card .card-body,.billing-card .card-body{padding-top:16px}
.balance-card .ai-usage-summary{justify-content:space-between;flex-wrap:wrap;gap:8px;font-size:13px}
.balance-card .ai-usage-summary>span{color:var(--muted)}
.balance-card .account-ai-meter{height:7px;margin-top:14px}
.balance-card .account-ai-remaining{margin:8px 0 20px;font-size:12px;color:var(--muted)}
.balance-card .account-ai-reset{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;border-top:1px solid var(--line);padding-top:14px;font-size:12px}
.balance-card .account-ai-reset>span{color:var(--muted)}
.balance-card .account-ai-reset>strong{font-weight:600}
.balance-card .account-ai-note{margin:10px 0 0;font-size:12px;line-height:1.6;color:var(--muted)}
.billing-body{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px 24px;align-items:center}
.billing-body .kv{grid-template-columns:auto minmax(0,1fr);gap:12px 16px}
.billing-body .kv dt{font-size:12px}
.billing-body .kv dd{text-align:left;overflow-wrap:anywhere}
.billing-actions .btn{white-space:nowrap}
#billing-note{grid-column:1/-1;font-size:12px;line-height:1.6;border-top:1px solid var(--line);padding-top:12px}
.big-num{font-size:34px;font-weight:800;letter-spacing:-1px;line-height:1}
.big-num small{font-size:14px;color:var(--muted);font-weight:600;letter-spacing:0}
.usage-list{display:grid;gap:16px}
.usage-item .u-top{display:flex;justify-content:space-between;gap:8px;font-size:13px;margin-bottom:6px}
.usage-item .u-top span{color:var(--muted)}
.kv{display:grid;grid-template-columns:auto 1fr;gap:10px 16px;font-size:13px}
.kv dt{color:var(--muted)}
.kv dd{margin:0;font-weight:600;text-align:right}

.toast-wrap{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:90;display:grid;gap:8px;pointer-events:none;width:max-content;max-width:calc(100vw - 32px)}
.toast{display:flex;align-items:center;gap:10px;background:var(--toast-bg);color:#fff;padding:10px 16px;border-radius:var(--r);box-shadow:var(--shadow-pop);font-size:13px;font-weight:600;animation:rise .25s var(--ease)}
@keyframes rise{from{opacity:0;transform:translateY(8px)}}

/* ---------- Responsive ---------- */
@media (max-width:1280px){
  .stats{grid-template-columns:repeat(5,minmax(0,1fr))}
  .stat{padding:10px 12px;gap:10px}.stat .stat-ic{display:none}
  .studio-grid{grid-template-columns:minmax(0,1fr) 300px}
}
@media (max-width:1024px){
  :root{--sidebar:72px}
  .sidebar{padding:18px 10px}
  .sidebar .logo{margin:0 auto 28px;justify-content:center}
  .sidebar .wordmark,.nav-text,.nav-label-group,.balance,.profile-copy,.nav-item .badge-dot{display:none}
  .nav-item{justify-content:center;padding:0;min-height:48px}
  .nav-item[aria-current=page]::before{left:-10px}
  .nav-item .tip{position:absolute;left:calc(100% + 10px);top:50%;transform:translateY(-50%);padding:5px 9px;border-radius:6px;background:var(--ink);color:#fff;font-size:12px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .12s}
  .nav-item:hover .tip,.nav-item:focus-visible .tip{opacity:1}
  .side-foot{justify-items:center}
  .side-credit{display:grid!important}
  .container{padding:24px 24px 20px}
  .split{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px}
  .stats{grid-template-columns:repeat(3,minmax(0,1fr))}
  .stat .stat-ic{display:grid}
  .studio-grid{grid-template-columns:1fr}
  .summary-card{position:static}
  .search-grid{grid-template-columns:minmax(0,1fr) 120px auto}
}
.side-credit{display:none;place-items:center;width:44px;height:30px;border-radius:6px;background:var(--cream);color:var(--sand-ink);font-size:11.5px;font-weight:800}
@media (max-width:900px){
  .split{grid-template-columns:1fr}
  .inspector-host{display:none}
  .facts{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px){
  :root{--sidebar:0px}
  .mobile-bar{position:sticky;top:0;z-index:25;display:flex;align-items:center;gap:10px;height:56px;padding:0 12px;background:var(--white);border-bottom:1px solid var(--line)}
  body.has-banner .mobile-bar{top:32px}
  .mobile-bar .logo{flex:1;font-size:19px}
  .mobile-bar .logo .mark{width:28px;height:28px}
  .mobile-bar .icon-btn{width:44px;height:44px}
  .mobile-bar .side-credit{display:grid;height:32px;width:auto;padding:0 10px}
  .sidebar{width:272px;transform:translateX(-100%);visibility:hidden;transition:transform .22s var(--ease),visibility .22s;box-shadow:var(--shadow-pop);padding:22px 14px 18px}
  body.has-banner .sidebar{top:0}
  body.nav-open .sidebar{transform:none;visibility:visible;z-index:60}
  body.nav-open .scrim{display:block;position:fixed;inset:0;background:rgba(24,38,30,.4);z-index:55}
  .sidebar .wordmark,.nav-text,.nav-label-group,.balance,.profile-copy{display:initial}
  .balance{display:grid}
  .sidebar .logo{margin:0 8px 28px;justify-content:flex-start}
  .nav-item{justify-content:flex-start;padding:0 12px;min-height:48px}
  .nav-item .tip{display:none}
  .side-foot{justify-items:stretch}
  .sidebar .side-credit{display:none!important}
  .container{padding:20px 16px}
  h1{font-size:23px}
  .page-head{flex-direction:column;align-items:flex-start;gap:12px;margin-bottom:18px}
  .tablist{overflow-x:auto}
  .tab{flex:1;min-width:0;padding:0 10px}
  .tab small,.tablist-aside{display:none}
  .tabpanel{padding:18px 16px}
  .panel-intro .tab-ic-lg{display:none}
  .search-grid{grid-template-columns:1fr 1fr}
  .search-grid .q-field{grid-column:1/-1}
  .search-grid .btn{min-width:0}
  .usage{margin-left:0;width:100%}
  .stats{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:4px;margin-right:-16px;padding-right:16px}
  .stat{flex:0 0 150px;scroll-snap-align:start}
  .toolbar{top:0}
  .listing .listing-pick{width:44px;flex-basis:44px}
  .thumb{width:60px;height:60px;flex-basis:60px}
  .chev{display:none}
  .idle-steps{grid-template-columns:1fr}
  .modules{grid-template-columns:1fr}
  .acct-grid{grid-template-columns:1fr}
  .lb-stage{padding:8px}
  .lb-nav{width:44px;height:44px}
  .lb-prev{left:8px}.lb-next{right:8px}
  .h-row{flex-wrap:wrap;gap:12px;padding:16px}
  .h-open{flex-basis:100%}
  .history-actions{margin-left:auto;border-left:0;padding-left:0}
  .billing-body{grid-template-columns:1fr}
  .notice{flex-wrap:wrap}
  .notice .notice-actions{margin-left:0;width:100%}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
}
body.scroll-locked{overflow:hidden}

/* Approved iteration: original cream/green workspace, reference-inspired dark navigation. */
:root{--nav-charcoal:#17191a;--nav-hover:#282c2b;--nav-active:#383f3b;--nav-text:#e6e9e5;--nav-muted:#a9b3ac;--sidebar:228px;--nav-width:208px;--control-height:42px}
.sidebar,body.has-banner .sidebar{inset:44px auto 12px 12px;width:var(--nav-width);padding:22px 12px 16px;background:var(--nav-charcoal);color:var(--nav-text);border:1px solid #ffffff12;border-radius:25px;box-shadow:0 10px 30px #17221a0d}
.sidebar .logo{color:var(--nav-text);margin:0 7px 20px;justify-content:flex-start}.sidebar .mark{background:#eef2e8;color:#1c3025}.sidebar .dot{color:#a7cbb3}
.sidebar .nav-label-group{color:var(--nav-muted);font-size:10px;margin-top:20px}.sidebar .nav{gap:7px}.sidebar .nav-item{color:var(--nav-text);min-height:46px;font-size:13px;border-radius:13px;font-weight:500}.sidebar .nav-item:hover{background:var(--nav-hover);color:#fff}.sidebar .nav-item[aria-current=page]{background:var(--nav-active);color:#fff;box-shadow:inset 0 0 0 1px #ffffff10}.sidebar .nav-item[aria-current=page]::before{display:none}.sidebar .nav-item .ic{flex-shrink:0}.sidebar .side-foot{border-color:#ffffff16}.sidebar .balance{background:var(--nav-hover);border-color:#ffffff12}.sidebar .balance-top span,.sidebar .balance small,.sidebar .profile-copy small{color:var(--nav-muted)}.sidebar .meter{background:#404c42}.sidebar .meter i{background:#a7cbb3}.sidebar .profile{padding:0 4px}.sidebar .avatar{border-radius:50%}.sidebar :focus-visible{outline-color:#d9edbd}.sidebar .tip{background:#252b27;color:#fff}
.rail-toggle{min-height:36px;display:flex;align-items:center;gap:10px;padding:0 12px;color:var(--nav-muted);font-size:12px;border-radius:8px}.rail-toggle:hover{background:var(--nav-hover);color:white}.rail-toggle .ic{width:18px}
.main{margin-left:var(--sidebar)}.container{max-width:1600px;padding:24px 28px}.page-head{margin-bottom:16px;align-items:center;gap:12px}.page-head h1{font-size:25px;letter-spacing:-.8px;margin:0;line-height:1.2}.workspace-note{font-size:12px;color:var(--muted)}
#view-research .tabpanel{padding:14px 16px}.search-grid{grid-template-columns:minmax(180px,1fr) 85px auto auto;gap:10px}.search-grid .btn{min-width:96px;min-height:var(--control-height);font-size:13px;padding:0 16px}.search-grid .input{min-height:var(--control-height);font-size:13px}.search-grid .field{gap:4px}.search-grid label{font-size:11px}.filters-toggle b{border-radius:20px;background:var(--green-100);padding:1px 6px;font-size:11px}.workbench{box-shadow:0 2px 8px #293c3204}.results{margin-top:18px}.stats{gap:10px;margin-bottom:16px}.stat{padding:14px 16px;box-shadow:0 2px 6px #293c3205}.stat strong{font-size:22px}.stat small{font-size:10px}.listing{border-radius:12px}.listing.is-open{box-shadow:0 0 0 1px var(--green)}.badge{white-space:nowrap}.metrics{row-gap:6px}.inspector{border-radius:14px}.inspector-head{padding:12px 16px}.page-footer{padding:20px}.usage{display:none!important}
.advanced-filters{margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}.advanced-filters .options-row{border:0;margin:8px 0 16px;padding:0}.advanced-filters .filter-group{margin:0 0 16px!important}.filter-section{border:0;margin:0 0 16px;padding:0;min-width:0}.filter-section legend{font-size:12px;font-weight:700;margin-bottom:10px}.advanced-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.advanced-grid .input{font-size:12px;min-height:40px;padding:0 10px}.advanced-grid label{font-size:11px}.check-options{display:flex;gap:12px 22px;flex-wrap:wrap;font-size:12px}.check-options label{display:flex;gap:8px;align-items:center;min-height:36px}.check-options input{accent-color:var(--green);width:16px;height:16px}.filter-actions{display:flex;gap:10px;align-items:center;border-top:1px solid var(--line);padding-top:14px;margin-top:16px}.active-filter-summary{font-size:11px;color:var(--muted);margin-top:8px}.advanced-error{font-size:12px;color:var(--red);margin-top:10px}.field-errors:has(>[hidden]):not(:has(>:not([hidden]))){margin-top:0!important}
body.nav-compact{--sidebar:100px;--nav-width:76px}body.nav-compact .sidebar{padding:22px 10px 16px}body.nav-compact .sidebar .wordmark,body.nav-compact .sidebar .nav-text,body.nav-compact .sidebar .nav-label-group,body.nav-compact .sidebar .balance,body.nav-compact .sidebar .profile-copy,body.nav-compact .sidebar .badge-dot,body.nav-compact .rail-toggle span{display:none}body.nav-compact .sidebar .logo{margin:0 auto 20px;justify-content:center}body.nav-compact .sidebar .nav-item{justify-content:center;padding:0}body.nav-compact .sidebar .rail-toggle{justify-content:center;padding:0;margin-bottom:20px}body.nav-compact .rail-toggle svg{transform:rotate(180deg)}body.nav-compact .sidebar .profile{justify-content:center}body.nav-compact .sidebar .side-credit{display:block;text-align:center;color:var(--nav-muted);font-size:11px}body.nav-compact .nav-item:hover .tip,body.nav-compact .nav-item:focus-visible .tip{display:block;opacity:1;visibility:visible;left:calc(100% + 18px);top:50%;transform:translateY(-50%)}
@media(min-width:901px){body:not(.nav-compact){--sidebar:228px;--nav-width:208px}body:not(.nav-compact) .sidebar .wordmark,body:not(.nav-compact) .sidebar .nav-text,body:not(.nav-compact) .sidebar .nav-label-group,body:not(.nav-compact) .sidebar .profile-copy{display:initial}body:not(.nav-compact) .sidebar .balance{display:grid}body:not(.nav-compact) .sidebar .nav-item{justify-content:flex-start}body:not(.nav-compact) .sidebar .side-credit{display:none}}
@media(max-width:1100px){.container{padding:22px}.advanced-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:900px){:root,body.nav-compact{--sidebar:0px}.main{margin-left:0}.sidebar,body.has-banner .sidebar{inset:12px auto 12px 12px;width:240px;border-radius:24px;z-index:60}.rail-toggle{display:none}.container{padding:20px 16px}.workspace-note{display:none}.page-head h1{font-size:23px}.advanced-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.search-grid{grid-template-columns:minmax(0,1fr) 76px auto}.search-grid .q-field{grid-column:1/-1}.search-grid .btn{min-width:0;padding:0 14px}.search-grid .field label{font-size:11px}.search-grid .input,.search-grid .btn{min-height:44px}.stats{gap:8px}.stat{padding:12px}.stat strong{font-size:19px}.check-options{gap:8px 16px}.sidebar .balance{display:grid}.sidebar .nav-text,.sidebar .wordmark,.sidebar .profile-copy{display:initial}.sidebar .nav-item{justify-content:flex-start}.sidebar .nav-label-group{display:block}.sidebar .logo{justify-content:flex-start}.sidebar .side-credit{display:none!important}.mobile-bar{background:var(--bg)}.active-filter-summary{line-height:1.5}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}


.sidebar .tip{display:none;position:absolute;padding:6px 10px;border-radius:6px;white-space:nowrap;pointer-events:none;font-size:12px;z-index:70}
.sidebar .nav-text{white-space:nowrap}.balance-top strong{white-space:nowrap}
.tabpanel.has-results{padding-top:10px!important;padding-bottom:10px!important}
.tabpanel.has-results .search-grid label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

@media(max-width:900px){
.shell{display:block}.main{width:100%;margin-left:0}.mobile-bar{width:100%;position:sticky;top:0;display:flex}
.toolbar{top:56px}body.has-banner .toolbar{top:88px}
.sidebar,body.has-banner .sidebar{visibility:hidden;transform:translateX(calc(-100% - 20px))}
body.nav-open .sidebar{visibility:visible;transform:none}
.stats{width:100%;margin-right:0;max-width:100%}.progress{flex-wrap:wrap}.progress>div{min-width:0;flex:1}.progress .btn{margin-left:auto}
}

/* Focused polish: quiet summary, shared brand/toggle row, compact credit balance. */
.sidebar-brand{display:flex;align-items:center;gap:6px;margin:0 2px 24px;min-height:36px;position:relative}
.sidebar .sidebar-brand .logo{margin:0;flex:1;min-width:0;gap:8px;font-size:23px}.sidebar-brand .wordmark{letter-spacing:-.7px}
.sidebar .sidebar-brand .rail-toggle{display:grid;place-items:center;flex:0 0 32px;width:32px;min-height:32px;padding:0;margin:0;border-radius:8px}
.sidebar .nav-label-group{margin-top:0}.sidebar-brand .rail-toggle .ic{width:17px;height:17px}
body.nav-compact .sidebar-brand{margin:0 0 28px;justify-content:center}
body.nav-compact .sidebar .sidebar-brand .logo{flex:none;margin:0;justify-content:center}
body.nav-compact .sidebar .sidebar-brand .rail-toggle{position:absolute;left:calc(100% - 7px);top:1px;width:28px;min-height:30px;background:var(--nav-hover);border:1px solid #ffffff16;box-shadow:0 2px 8px #0002}
.balance-top{align-items:center}.balance-top strong{font-size:17px;font-weight:700}.credit-symbol{display:grid;place-items:center;width:24px;height:24px;color:#bcd9c4}.credit-symbol .ic{width:20px;height:20px}.sidebar .balance{gap:9px;padding:12px}.sidebar .balance small{font-size:10.5px;line-height:1.4}
.research-summary{display:flex;align-items:center;flex-wrap:wrap;gap:8px 0;margin:0 0 14px;padding:0 0 12px;border-bottom:1px solid var(--line)}
.research-summary>div{display:flex;align-items:baseline;gap:7px;padding:0 18px;border-right:1px solid var(--line)}
.research-summary>div:first-child{padding-left:0}.research-summary>div:last-child{border:0;padding-right:0}
.research-summary dt{font-size:12px;color:var(--muted);font-weight:500}.research-summary dd{margin:0;font-size:13px;font-weight:700;white-space:nowrap;letter-spacing:-.1px}
.badge.pick{display:inline-flex;flex:0 0 auto;width:auto;min-width:0;height:22px;align-items:center;justify-content:center;gap:4px;padding:0 7px;white-space:nowrap;line-height:1}
.badge .ic{flex:0 0 12px;display:block}.metrics .badge{max-width:100%}
@media(max-width:1100px){.research-summary>div{padding:0 12px}}
@media(max-width:900px){.sidebar-brand .rail-toggle{display:none!important}.sidebar-brand{margin-bottom:24px}.research-summary{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px}.research-summary>div{padding:0;border:0;justify-content:space-between}.research-summary dt{font-size:11px}.research-summary dd{font-size:12px}}

/* Listing-workflow refinement: controls stay inside their rail and content leads. */
body.nav-compact .sidebar-brand{flex-direction:column;gap:10px;margin-bottom:18px}
body.nav-compact .sidebar .sidebar-brand .rail-toggle{position:static;left:auto;top:auto;width:32px;min-height:32px;margin:0;background:none;border:0;box-shadow:none}
.sidebar .balance{padding:8px 10px;gap:6px;border-radius:10px}
.sidebar .balance-top strong{font-size:14px;font-weight:600;line-height:1.4}
.sidebar .credit-symbol{width:20px;height:20px}.sidebar .credit-symbol .ic{width:17px;height:17px}
.sidebar .meter{height:4px}.sidebar .balance small{font-size:10px;line-height:1.3}
.sidebar .side-foot{gap:10px;padding-top:12px}.sidebar .side-foot .nav-item{width:100%;min-height:42px}
body.nav-compact .sidebar .side-credit{background:var(--nav-hover);color:#c9dcd0;border:0;border-radius:8px;padding:6px 0;font-size:11px}
body.nav-compact .side-foot{justify-items:stretch}
.enrich-cost{font-size:11px;color:var(--muted);font-weight:400}
@media(min-width:901px){
body:not(.nav-compact) .sidebar .nav-item{justify-content:flex-start;padding:0 12px}
.sidebar .side-foot{justify-items:stretch}
.split{grid-template-columns:minmax(0,1fr) clamp(300px,27vw,350px);gap:16px}
.listing .listing-title{-webkit-line-clamp:1}.listing-open{min-height:90px;gap:12px;padding-right:10px}.listing .listing-pick{width:40px;flex-basis:40px}
.listing-open .chev{display:none}
}
.metrics{flex-wrap:nowrap;overflow-x:auto;max-width:100%;min-width:0;scrollbar-width:thin;gap:4px;padding-bottom:2px}
.metrics .metric,.metrics .badge{flex:0 0 auto;font-size:10.5px;padding-inline:6px}
.badge.pick{gap:4px}.badge.pick .ic{width:13px;height:13px;flex-basis:13px}
.insp-body{padding:14px 16px 18px}.insp-body h2{font-size:15px}.shop-row{flex-wrap:nowrap;gap:6px;margin-bottom:8px;min-width:0}
.shop-row .shop-name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}
.shop-row .listing-source{flex:0 0 auto;font-size:11px;min-height:32px;gap:3px}
.shop-row .listing-source .ic{width:13px;height:13px}
.shop-row>.ic{flex-shrink:0}.expand-details{margin-left:auto;flex:0 0 32px;width:32px;height:32px;min-height:32px;border:0;background:var(--surface)}
.facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px;margin-top:12px}
.fact{display:flex;justify-content:space-between;align-items:baseline;gap:6px;padding:7px 0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none}
.fact small{font-size:10.5px;letter-spacing:0;text-transform:none;font-weight:500}.fact strong{font-size:12px;font-weight:650;margin:0}
#lightbox{position:fixed;inset:0;margin:0;width:100vw;height:100dvh;max-height:100dvh;overflow:hidden}
#lightbox .lightbox{display:grid;grid-template-rows:56px minmax(0,1fr) 78px;width:100%;height:100%;min-height:0;overflow:hidden}
#lightbox .lb-top{min-width:0;overflow:hidden;padding:8px 16px}#lightbox .lb-top p{min-width:0}
#lightbox .lb-stage{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-width:0;min-height:0;padding:8px 72px;overflow:hidden}
#lightbox .lb-stage img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;min-width:0;min-height:0;object-fit:contain}
#lightbox .lb-foot{height:78px;min-height:0;padding:8px 16px 14px;align-items:center}
#details-dialog{position:fixed;inset:0;width:min(1240px,calc(100vw - 48px));height:min(900px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);margin:auto;background:var(--bg);border-radius:18px;overflow:auto;box-shadow:0 20px 90px #10201840}
#details-dialog::backdrop{background:#14251c80;backdrop-filter:blur(7px)}
.expanded-header{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;padding:8px 20px;background:var(--bg);border-bottom:1px solid var(--line);font-size:13px;font-weight:650}
#expanded-inspector.inspector{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-content:start;align-items:start;gap:0 24px;border:0;box-shadow:none;background:none;padding:0 24px 24px;max-height:none;overflow:visible}
#expanded-inspector .insp-top{grid-column:1/-1;background:var(--bg);position:static;padding-inline:0;margin-bottom:20px}
#expanded-inspector .insp-top [data-act=insp-close],#expanded-inspector .expand-details{display:none}
#expanded-inspector .gallery{grid-column:1;grid-row:2;aspect-ratio:4/3;border-radius:12px}
#expanded-inspector .gallery img{object-fit:contain}
#expanded-inspector .thumbs{grid-column:1;grid-row:3;border:0;padding:10px 0;background:none}
#expanded-inspector .insp-body{grid-column:2;grid-row:2/span 3;padding:0;min-width:0}
#expanded-inspector h2{font-size:23px;line-height:1.3;margin-bottom:12px}
#expanded-inspector .facts{grid-template-columns:repeat(2,minmax(0,1fr))}
#expanded-inspector .desc.clamped{max-height:none;mask-image:none;-webkit-mask-image:none}
#expanded-inspector [data-act=desc-toggle]{display:none}
@media(max-width:900px){
.split{grid-template-columns:1fr}.metrics .metric,.metrics .badge{font-size:10.5px}
#lightbox .lb-stage{padding:8px 48px}#lightbox .lb-prev{left:4px}#lightbox .lb-next{right:4px}
#details-dialog{width:calc(100vw - 20px);height:calc(100dvh - 20px);max-height:calc(100dvh - 20px);border-radius:14px}
#expanded-inspector.inspector{display:block;padding:0 16px 20px}#expanded-inspector .gallery{max-height:40dvh}#expanded-inspector .insp-body{padding-top:12px}#expanded-inspector h2{font-size:20px}
}


.badge-label-short{display:none}
.image-ai-status{display:flex;align-items:center;justify-content:center;gap:6px;color:var(--muted);font-size:11px;line-height:1.3;padding:6px;border:1px dashed var(--line-strong);border-radius:8px;text-align:center}
.image-ai-status .ic{flex:0 0 15px;width:15px;height:15px}.image-ai-status span{min-width:0}
@media(min-width:901px){body:not(.nav-compact) .side-foot>.side-credit{display:none!important}}
@media(max-width:1200px){
.listing .secondary-metric{display:none}.listing .badge-label-full{display:none}.listing .badge-label-short{display:inline}
.listing .metrics{overflow:visible;gap:3px}.listing .metrics .badge,.listing .metrics .metric{font-size:11px;padding-inline:5px;gap:3px}
}
@media(max-width:600px){.listing .favorites-metric{display:none}}

.page-size-control{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted);white-space:nowrap}
.page-size-control .input{width:58px;min-height:36px;padding:0 6px;font-size:12px}
.pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 2px;font-size:12px;color:var(--muted)}.pagination>div{display:flex;gap:6px}.pagination .icon-btn{width:36px;height:36px}
body.nav-compact .sidebar .side-foot>.side-credit{justify-self:center;display:flex;align-items:center;justify-content:center;width:44px;min-height:30px;box-sizing:border-box;margin:0 auto;padding:4px 6px;gap:3px;text-align:center}
.toolbar{gap:8px}.toolbar .grow{min-width:0}.toolbar .sort>span{display:none}


.plan-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-top:18px}.history-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:6px}.page-size-control{flex-shrink:0}

/* AI workflows follow the existing dashboard controls and spacing. */
.ai-help{font-size:12px;line-height:1.5;color:var(--muted);margin-top:8px}
.ai-help:empty{display:none}
.product-facts-field{margin-top:12px}
.product-facts-field label{display:block}
.product-facts-field textarea{width:100%;min-height:64px;resize:vertical}
.ai-result-head{flex-wrap:wrap;gap:8px}
#output-meta{font-size:12px}
.ai-result-head h2{flex:1}
.ai-result-head #output-meta:not(:empty){flex:1 0 100%;order:1;font-size:11px}
.ai-result-head .grow{display:none}
#output-card:focus{outline-offset:3px}
#output{overflow-wrap:anywhere}
#output .result-text{font-size:14px;line-height:1.65;white-space:pre-wrap;max-width:72ch}
.result-details{display:grid;gap:10px}
.result-details strong{display:block;font-size:12px;color:var(--muted);margin-bottom:2px}
#output ul{margin-top:6px}
.ai-retry{margin-top:14px}
#chat-input{min-width:0;resize:vertical;min-height:68px}
.chat-form{align-items:flex-end}
#chat-error{margin-top:10px}
#chat-send{flex-shrink:0}
#chat-title+ .grow+span{font-size:12px}
.ai-history-list{list-style:none;padding:0;margin:0;display:grid;gap:14px}
.ai-history-list li{display:flex;align-items:center;gap:12px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.ai-history-list li:last-child{border:0;padding-bottom:0}
.ai-history-list li>div{flex:1;min-width:0}
.ai-history-list strong{display:block;font-size:13px;overflow-wrap:anywhere}
.ai-history-list small{display:block;font-size:11px;color:var(--muted);margin-top:3px}
.ai-history-list .btn{flex-shrink:0}
.image-modal{width:min(600px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto}
.image-listing-title{font-weight:600;margin-bottom:12px;overflow-wrap:anywhere}
.image-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:8px}
.image-choice{cursor:pointer;min-width:0;display:grid;overflow:hidden;border:1px solid var(--line-strong);border-radius:var(--r);background:var(--surface)}
.image-choice:has(input:checked){border-color:var(--green);background:var(--green-50)}
.image-choice:has(input:focus-visible){outline:2px solid var(--green);outline-offset:2px}
.image-choice:has(input:disabled){opacity:.55;cursor:not-allowed}
.image-choice img{width:100%;aspect-ratio:4/3;object-fit:cover}
.image-choice span{display:flex;align-items:center;gap:7px;min-height:44px;padding:8px;font-size:13px}
.image-choice input{accent-color:var(--green);width:18px;height:18px;flex-shrink:0}
#image-cost{margin-top:14px}
#view-studio .card,#view-studio .card-body{min-width:0}
#view-studio textarea{caret-color:var(--green)}
#view-studio ::selection{background:var(--green-200);color:var(--deep)}
@media(max-width:600px){
 .insp-actions .btn{min-height:44px}
 .image-choices{grid-template-columns:repeat(2,minmax(0,1fr))}
 .chat-form{flex-direction:column;align-items:stretch}
 #view-studio #chat-input,#view-studio #product-facts,#view-studio #analysis-kind{font-size:16px;width:100%}
 .ai-result-head{align-items:flex-start}
 .ai-result-head .grow{display:none}
 #output-meta{flex-basis:100%}
 #view-studio .card-head{flex-wrap:wrap;gap:8px}
 .bubble{max-width:96%;font-size:14px}
 .image-modal .modal-foot{flex-wrap:wrap}
 #output .result-text{font-size:16px}
}

/* Keep whole-search scope and individual photo prompts compact. */
.image-prompt-result{display:grid;gap:8px;padding:12px 0;border-top:1px solid var(--line)}
.image-prompt-result h4{font-size:13px;margin:0}
.image-prompt-result .btn{justify-self:start}

/* Theme values retain the workspace's green, cream and charcoal hierarchy. */
:root[data-theme=dark]{
 color-scheme:dark;
 --cost-bg:rgba(0,0,0,.16);
 --bg:#141b17;--white:#1c261f;--surface:#263229;--cream:#393322;
 --ink:#edf1e8;--muted:#b4c0b4;--faint:#a8b7aa;
 --green:#91cfaa;--deep:#b4dfc1;--green-50:#263e2f;--green-100:#304c3a;--green-200:#517b5c;
 --primary:#326f4f;--primary-hover:#2b6245;
 --sand:#dda15e;--sand-50:#3d3120;--sand-ink:#efc58c;--amber-50:#352e21;
 --line:#35443a;--line-strong:#627466;--control-hover:#91a395;
 --disabled-bg:#2c372f;--disabled-ink:#b2bdb2;
 --red:#ffb0a0;--red-50:#412a25;--warn-line:#725c37;--error-line:#87584d;
 --pick-bg:#352e42;--pick-ink:#dcc6ef;--pick-line:#655373;
 --hover:#2e3c31;--selected:#253a2c;--track:#627466;
 --toolbar:rgba(28,38,31,.98);--sticky:rgba(28,38,31,.98);--empty:#19221c;
 --gallery-control:#263229;--toast-bg:#2b6245;
 --shadow:0 1px 4px #0002;--shadow-hover:0 3px 14px #0003;--shadow-pop:0 12px 40px #0006;
}
:root[data-theme=dark] .skel{background-image:linear-gradient(90deg,#263229,#35443a,#263229)}
:root[data-theme=dark] .sort select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b4c0b4' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")}
:root[data-theme=dark] dialog::backdrop{background:#0009}
:root[data-theme=dark] .icon-btn:disabled{color:var(--disabled-ink)}
:root[data-theme=dark] .fchip[aria-pressed=true] .box{background:var(--primary)}
:root[data-theme=dark] .input:focus{box-shadow:0 0 0 3px #91cfaa30}
:root[data-theme=dark] .input[aria-invalid=true]{box-shadow:0 0 0 3px #ffb0a030}
.sidebar .side-foot .theme-control{width:100%;min-height:44px}
.theme-control .theme-label{flex:1;white-space:nowrap}
.theme-control .theme-setting{font-size:11px;color:var(--nav-muted);white-space:nowrap}
.theme-control .theme-icon{display:none}
:root[data-theme=light] .theme-control .theme-sun,:root[data-theme=dark] .theme-control .theme-moon{display:block}
body.nav-compact .theme-control .theme-label,body.nav-compact .theme-control .theme-setting{display:none}
@media(max-width:900px){
 body.nav-compact .theme-control .theme-label,body.nav-compact .theme-control .theme-setting{display:block}
 body.nav-compact .sidebar .theme-control{justify-content:flex-start;padding:0 12px}
}

/* Studio is a single workspace: setup on the left, a scrollable document on the right. */
.studio-tabs{display:flex;gap:24px;border-bottom:1px solid var(--line);margin-bottom:20px}
.studio-tabs [role=tab]{position:relative;min-height:44px;padding:0 4px;font-size:13px;font-weight:600;color:var(--muted)}
.studio-tabs [aria-selected=true]{color:var(--green)}
.studio-tabs [aria-selected=true]:after{content:"";position:absolute;bottom:-1px;height:2px;left:0;right:0;background:var(--green)}
.studio-previous{font-size:12px;color:var(--muted);text-underline-offset:3px;padding-block:6px}
.studio-previous:hover{color:var(--green)}
#studio-create,#studio-history{max-width:none;min-width:0}
#studio-workflow{display:grid;grid-template-columns:296px minmax(0,1fr);gap:0;align-items:start;background:var(--white);border:1px solid var(--line-strong);border-radius:var(--r-xl);overflow:hidden}
#studio-workflow:has(#studio-compose[hidden]){grid-template-columns:minmax(0,1fr)}
#studio-workflow:has(#studio-compose[hidden]):has(#output-card[hidden]){display:none}
.studio-compose{border:0;border-radius:0;box-shadow:none;background:var(--surface);height:100%;max-height:clamp(570px,calc(100dvh - 206px),840px);overflow:auto;overscroll-behavior:contain;border-right:1px solid var(--line)}
.studio-section-label{display:block;color:var(--muted);font-size:11px;font-weight:600;letter-spacing:.55px;margin-bottom:6px}
.studio-source{padding:20px 18px 16px;border-bottom:1px solid var(--line);background:transparent}
.studio-source summary{cursor:pointer;min-height:40px;font-size:13px;font-weight:600;line-height:1.65;overflow-wrap:anywhere}
.studio-source summary .pill{margin-left:5px;padding:1px 5px;background:var(--green-50);font-size:11px;white-space:nowrap}
.studio-source summary .muted{display:block;padding-left:15px;font-size:12px;font-weight:400;margin-top:4px}
.studio-source #cohort:not(:empty){padding-top:12px;margin-bottom:8px}
.studio-change-source{display:inline-block;color:var(--green);font-size:12px;text-underline-offset:3px;padding-block:6px}
.studio-analysis{padding:20px 18px}
.studio-analysis label{font-size:13px;font-weight:600}
#view-studio .studio-analysis .input{width:100%;font-size:13px;background:var(--white)}
#view-studio .studio-analysis .ai-help{line-height:1.65}
.studio-run{padding:18px;border-top:1px solid var(--line)}
#run-summary{display:grid;gap:14px}
.studio-run-meta{display:grid;gap:4px;font-size:12px}
.studio-run-meta strong{font-size:15px;font-weight:700}
#run-summary>.btn{width:100%;min-height:42px}
#run-summary>.field-error{font-size:12px}
#view-studio .ai-selection-list li{gap:7px;padding-block:10px}
#view-studio .ai-selection-list .selection-listing{font-size:12px}
.studio-source-thumbnail{width:34px;height:40px;flex:0 0 34px;object-fit:cover;border-radius:4px;background:var(--line)}
#view-studio .ai-selection-list .btn{min-height:30px;font-size:11px;padding:4px 6px;border-color:transparent;background:transparent;color:var(--green)}
#view-studio .ai-selection-list .icon-btn{border:0;background:transparent;width:24px;height:30px;flex-basis:24px}
.studio-document{min-width:0;display:flex;flex-direction:column;height:clamp(570px,calc(100dvh - 206px),840px)}
#output-card{display:flex;flex:1;flex-direction:column;min-height:180px;min-width:0;overflow:hidden}
#view-studio #output-card>.ai-result-head{padding:18px 24px 14px;flex-wrap:wrap;flex-shrink:0;gap:8px;background:var(--white);align-items:center}
.ai-result-head .studio-result-heading{flex:1;min-width:120px}
.ai-result-head h2{font-size:17px;letter-spacing:-.35px}
.ai-result-head .studio-section-label{font-size:10px;margin:0 0 3px}
.ai-result-head #output-meta:not(:empty){flex:1 0 100%;order:1;font-size:12px;line-height:1.5}
.ai-result-head #output-meta:empty{display:none}
#output-card>.output-outline{display:flex;gap:4px;padding:8px 20px;border-bottom:1px solid var(--line);overflow:auto;flex-shrink:0;scrollbar-width:thin;background:var(--surface)}
.output-outline button{flex-shrink:0;min-height:32px;padding:5px 10px;font-size:12px;color:var(--muted);border-radius:5px;transition:background .15s,color .15s}
.output-outline button:hover{color:var(--green);background:var(--green-50)}
.output-outline button[aria-current=true]{color:var(--deep);background:var(--green-100);font-weight:600}
#view-studio #output{flex:1;min-height:0;padding:24px 28px 32px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scroll-padding-block:24px;outline-offset:-3px}
#output>.ai-help{margin:0 0 16px;font-size:12px;padding-bottom:14px;border-bottom:1px solid var(--line)}
#output>.ai-help+.ai-help{color:var(--sand-ink);border:0;padding:0}
#output .output{display:block;max-width:76ch;margin-inline:auto}
#output .result-section{padding-block:20px;border-top:1px solid var(--line);scroll-margin-top:24px}
#output .result-section:first-child{border-top:0;padding-top:0}
#output .result-section>h3{display:flex;align-items:baseline;gap:10px;font-size:15px;font-weight:700;margin-bottom:12px}
.result-section-number{font-size:11px;color:var(--faint);font-weight:500;font-variant-numeric:tabular-nums}
#output .result-text{font-size:14px;line-height:1.8;white-space:pre-wrap;max-width:72ch}
#output .result-section-summary .result-text{font-size:16px;line-height:1.75;font-weight:500;color:var(--ink)}
#output ul{padding-left:20px;margin:0;display:grid;gap:10px}
#output li::marker{color:var(--faint)}
#output .result-details{gap:8px}
#output .result-details>section{display:grid;gap:2px}
#output .result-details strong{font-size:11px;margin:0;font-weight:600;color:var(--muted)}
#output .result-item{padding-block:14px;border-bottom:1px solid var(--line)}
#output .result-item:first-child{padding-top:0}
#output .result-item:last-child{padding-bottom:0;border:0}
#output .result-item-heading{display:flex;align-items:baseline;gap:10px;margin-bottom:10px}
#output .result-item-heading h4{font-size:14px;font-weight:600;flex:1}
#output .result-item-heading a{font-size:12px;white-space:nowrap;text-underline-offset:3px}
#output .result-tags{display:flex;flex-wrap:wrap;gap:8px;padding:0;list-style:none}
#output .result-tags li{padding:6px 10px;border-radius:4px;background:var(--green-50);color:var(--deep);font-size:13px}
#output .image-prompt-result{border-top:0;gap:12px;padding:0}
#output .image-prompt-result .result-text{padding-left:14px;border-left:2px solid var(--green-200);font-size:14px}
#output .image-prompt-result .btn{font-size:12px;justify-self:start}
.studio-ready{padding:22px 0;max-width:48ch;margin:auto}
.studio-ready-mark{color:var(--green);display:inline-flex;align-items:center;justify-content:center;background:var(--green-50);width:44px;height:44px;border-radius:10px;margin-bottom:18px}
.studio-ready h3{font-size:21px;letter-spacing:-.5px;margin-bottom:10px}
.studio-ready p{font-size:13px;line-height:1.8;color:var(--muted)}
.studio-ready ol{list-style:none;padding:0;margin:24px 0 0;display:grid;gap:14px}
.studio-ready li{display:flex;gap:12px;align-items:baseline;font-size:12px;color:var(--muted)}
.studio-ready li>span{font-variant-numeric:tabular-nums;font-size:11px;color:var(--green)}
.studio-ready li strong{display:block;color:var(--ink);font-size:13px;font-weight:600}
#output:has(.studio-ready){display:flex}
#output .progress{padding:30px 0;align-items:center}
#output .progress p{margin-top:6px;font-size:13px;color:var(--muted)}
#output .progress .spinner{margin:0;flex-shrink:0}
#view-studio #chat-card{flex-shrink:0;box-shadow:none;border-top:1px solid var(--line-strong);background:var(--surface)}
#view-studio #chat-card>.card-head{padding:10px 24px 0;border:0;gap:8px}
#chat-title{font-size:13px;font-weight:600}
#chat-cost{font-size:11px}
#view-studio #chat-card>.card-body{padding:10px 24px 14px}
#view-studio #chat-input{min-height:44px;height:44px;max-height:100px;padding:10px 12px;background:var(--white);font-size:13px;line-height:1.6}
#view-studio #chat-send{min-height:44px}
#chat-help{font-size:11px;line-height:1.5;margin-top:7px}
#chat-error{max-height:90px;overflow-y:auto;font-size:12px}
#chat-log{max-height:150px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scroll-padding:8px;outline-offset:-2px;padding:4px 0 10px;margin:0 0 8px}
#chat-log:empty{display:none}
#chat-log .bubble{background:transparent;border:0;padding:8px 0;font-size:13px;max-width:94%;border-radius:0}
#chat-log .bubble.me{background:var(--green-50);padding:8px 12px;border-radius:6px}
#chat-log .bubble .who{font-size:10px;text-transform:none;letter-spacing:0;font-weight:600;margin-bottom:4px}
.studio-empty{padding:40px 24px;max-width:650px;margin:8px auto;text-align:left}
.studio-empty-icon{display:inline-grid;place-items:center;width:44px;height:44px;background:var(--green-50);color:var(--green);border-radius:10px;margin-bottom:20px}
.studio-empty h2{font-size:23px;margin-bottom:10px;letter-spacing:-.6px}
.studio-empty p{font-size:14px;line-height:1.8;color:var(--muted);max-width:48ch;margin-bottom:22px}
.studio-empty-actions{display:flex;flex-wrap:wrap;gap:10px}
#studio-history .card{box-shadow:none}
#studio-history .card-head .ai-help{margin-top:4px}
#studio-history .ai-history-list{gap:0}
#studio-history .ai-history-list li{padding:16px 0}
#studio-history .ai-history-list strong{font-size:14px}
#studio-history .ai-history-list small{font-size:12px;margin-top:5px}
@media(min-width:901px) and (max-width:1150px){
 #studio-workflow{grid-template-columns:260px minmax(0,1fr)}
 #view-studio #output{padding:22px}
 #view-studio #output-card>.ai-result-head{padding-inline:20px}
 #view-studio #chat-card>.card-head,#view-studio #chat-card>.card-body{padding-inline:20px}
}
@media(max-width:900px){
 #studio-workflow{grid-template-columns:minmax(0,1fr)}
 .studio-compose{max-height:none;overflow:visible;border-right:0;border-bottom:1px solid var(--line)}
 .studio-source,.studio-analysis{padding:16px 20px}
 .studio-run{padding:16px 20px}
 #run-summary{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px}
 #run-summary>.btn{width:auto;min-width:145px}
 #run-summary>.field-error{grid-column:1 / -1}
 .studio-document{height:auto;max-height:none}
 #output-card{flex:auto;height:min(68dvh,640px);min-height:300px}
 #output-card:has(.studio-ready){height:auto;min-height:280px}
 #view-studio #output{padding:22px}
 #output>.output{max-width:none}
 #output .result-text{font-size:15px}
 #chat-log{max-height:220px}
 .studio-ready{padding:10px 0}
 .studio-ready h3{font-size:19px}
 .studio-ready ol{margin-top:18px;gap:10px}
 .studio-source-thumbnail{width:40px;height:44px;flex-basis:40px}
 #view-studio .ai-selection-list .icon-btn{min-height:40px;width:32px;flex-basis:32px}
 #view-studio .ai-selection-list .btn{min-height:40px;padding-inline:8px}
}
@media(max-width:600px){
 .studio-tabs{margin-bottom:16px}
 .studio-previous{font-size:11px}
 .studio-empty{padding:24px 4px}
 .studio-empty h2{font-size:21px}
 #view-studio #output-card>.ai-result-head{padding:16px 18px 12px}
 #view-studio #output{padding:20px 18px 26px}
 #output-card>.output-outline{padding-inline:10px}
 .output-outline button{min-height:40px}
 .studio-source,.studio-analysis,.studio-run{padding:16px}
 #run-summary{grid-template-columns:minmax(0,1fr)}
 #run-summary>.btn{width:100%;min-height:44px}
 #view-studio .studio-analysis .input,#view-studio #chat-input{font-size:16px}
 #view-studio #chat-card>.card-head,#view-studio #chat-card>.card-body{padding-inline:16px}
 #view-studio #chat-input{height:68px;min-height:68px}
 #view-studio #chat-send{align-self:flex-end;min-width:128px}
 #output .result-item-heading{flex-wrap:wrap}
 #output .result-item-heading h4{flex-basis:100%}
 #output .result-section-summary .result-text{font-size:16px}
 .studio-ready li{font-size:12px}
 #studio-history .card-head{padding:16px}
}
@media(prefers-reduced-motion:reduce){
 #view-studio *,#view-studio *:before,#view-studio *:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}
}

/* Studio conversation. The response, follow-ups and composer share one reading column. */
#view-studio{max-width:1300px;padding-bottom:48px}
.studio-page-head{align-items:flex-start;margin-bottom:22px}
.studio-subtitle{font-size:13px;color:var(--muted);margin-top:7px}
.studio-toolbar{display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--line);margin-bottom:0;min-height:48px}
.studio-toolbar .studio-tabs{margin:0;border:0;align-self:stretch;gap:22px}
.studio-toolbar #studio-new{margin-left:auto}
.studio-usage{margin-left:auto;position:relative;font-size:12px}
.studio-toolbar #studio-new:not([hidden])+.studio-usage{margin-left:0}
#studio-create{max-width:850px;margin:0 auto}
#studio-workflow,#studio-workflow:has(#studio-compose[hidden]){display:flex;flex-direction:column;background:transparent;border:0;border-radius:0;overflow:visible;gap:0;min-width:0}
#studio-workflow:has(#studio-compose[hidden]):has(#output-card[hidden]){display:flex}
#view-studio .studio-document{height:auto;max-height:none;min-width:0;overflow:visible;width:100%}
.studio-empty{padding:58px 24px 30px;max-width:700px;margin:0 auto;text-align:center}
.studio-empty-icon{background:transparent;width:46px;height:46px;margin-bottom:14px;color:var(--green)}
.studio-empty-icon .ic{width:36px;height:36px;stroke-width:1.5}
.studio-empty h2{font-size:30px;line-height:1.3;letter-spacing:-1px;font-weight:600;text-wrap:balance;margin-bottom:12px}
.studio-empty p{font-size:14px;line-height:1.75;max-width:52ch;margin:0 auto 22px}
.studio-task-suggestions{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;max-width:570px;margin:0 auto 18px}
.studio-task-suggestions button{border:1px solid var(--line-strong);background:var(--surface);border-radius:9px;padding:9px 13px;min-height:40px;font-size:12px;font-weight:500;transition:background .18s,border-color .18s}
.studio-task-suggestions button[aria-pressed=true]{background:var(--green-50);border-color:var(--green-200);color:var(--deep)}
.studio-task-suggestions button:hover{border-color:var(--green-200);background:var(--green-50)}
.studio-research-link{font-size:12px;color:var(--muted);text-decoration:none}.studio-research-link:hover{color:var(--green);text-decoration:underline}
#studio-use-search{font-size:12px;margin-left:12px;color:var(--green);text-decoration:underline;text-underline-offset:3px;min-height:40px}
#view-studio .studio-compose{background:var(--white);border:1px solid var(--line-strong);border-radius:18px;width:100%;height:auto;max-height:none;overflow:visible;box-shadow:0 6px 22px rgba(31,77,57,.045);margin:0 auto;}
.studio-compose-heading{display:none}
#studio-workflow.has-conversation .studio-compose{display:none}
.studio-source{padding:12px 18px 0;border:0}
.studio-source summary{display:flex;align-items:center;gap:7px;font-size:12px;min-height:36px;background:var(--surface);padding:5px 10px;border-radius:8px;width:fit-content;max-width:100%;list-style:none;border:1px solid var(--line)}
.studio-source summary::-webkit-details-marker{display:none}
.studio-source summary:after{content:'⌄';color:var(--muted);margin-left:2px}
.studio-source summary .pill{margin:0;background:var(--green-50);font-size:11px;padding:1px 6px}
.studio-source summary .muted{display:inline;padding:0;margin:0;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.studio-source #cohort:not(:empty){max-height:260px;overflow:auto;padding:8px 0 0;margin:0}
.studio-source-controls{display:flex;align-items:center;gap:10px;padding-top:12px;font-size:12px;flex-wrap:wrap}
#view-studio .studio-source-controls .input{min-height:36px;font-size:12px;padding:5px 9px;max-width:220px}
.studio-change-source{margin-left:auto;font-size:12px}
.studio-analysis{padding:14px 18px 0}
.studio-task-line{display:flex;align-items:center;gap:10px}
.studio-task-line>label{font-size:12px;color:var(--muted)}
#view-studio .studio-task-line .input{background:var(--surface);border-color:var(--line);width:auto;max-width:100%;font-size:13px;font-weight:600;min-height:36px;padding:6px 30px 6px 10px}
#view-studio #analysis-availability{font-size:12px;margin:7px 0 0;line-height:1.6}
#view-studio .studio-prompt{border:0;box-shadow:none;resize:vertical;padding:14px 0 10px;min-height:84px;background:transparent;font-size:15px;line-height:1.65;width:100%;max-height:240px}
#view-studio .studio-prompt:focus{outline:0}
.studio-analysis:has(.studio-prompt:focus-visible){outline:2px solid var(--green);outline-offset:4px;border-radius:8px}
#view-studio .product-facts-field{border-top:1px solid var(--line);padding-top:9px;margin:0 0 10px;font-size:12px}
.product-facts-field summary{cursor:pointer;min-height:30px;font-weight:500;line-height:30px}
.product-facts-field summary .muted{margin-left:5px;font-size:11px;font-weight:400}
#view-studio #product-facts{font-size:13px;background:var(--surface);margin:4px 0 8px;resize:vertical}
.studio-run{border:0;padding:8px 14px 12px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.studio-attach{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
#studio-attach{font-size:12px;min-height:40px;padding:0 8px;color:var(--muted)}
#upload-help{font-size:10px;color:var(--faint)}
#run-summary{display:flex;gap:12px;align-items:center;justify-content:flex-end;flex:1;flex-wrap:wrap;min-width:0}
#run-summary>.btn{width:auto;min-width:86px;min-height:40px;padding:0 16px;border-radius:10px}
.studio-run-note{font-size:11px;color:var(--muted)}
#view-studio .studio-compose-note{flex-basis:100%;font-size:11px;line-height:1.5;text-align:right;margin:0}
.studio-uploads{display:flex;flex-wrap:wrap;gap:9px;margin:0}
.studio-uploads:not(:empty){padding:4px 0 12px}
.studio-upload{position:relative;width:76px;height:76px}
.studio-upload img{width:100%;height:100%;object-fit:cover;border-radius:10px;border:1px solid var(--line-strong)}
.studio-upload>span{position:absolute;bottom:4px;left:5px;background:var(--ink);color:var(--white);font-size:10px;line-height:18px;min-width:18px;text-align:center;border-radius:4px}
.upload-remove{position:absolute;right:-6px;top:-6px;width:28px;height:28px;display:grid;place-items:center;background:var(--white);color:var(--ink);border:1px solid var(--line-strong);border-radius:50%;font-size:18px;box-shadow:var(--shadow)}
.studio-user-turn{max-width:78%;align-self:flex-end;background:var(--green-50);border:1px solid var(--green-100);padding:15px 18px;border-radius:16px 16px 4px 16px;margin:28px 0 30px;overflow-wrap:anywhere;white-space:pre-wrap;font-size:14px;line-height:1.7}
.studio-user-turn .who{display:block;font-size:11px;font-weight:500;color:var(--muted);margin-bottom:3px}
.studio-user-turn>strong{display:block;font-size:14px;font-weight:600}
.studio-user-turn .studio-turn-context{font-size:12px;color:var(--muted)}
.studio-user-turn>p:not(.studio-turn-context){margin-top:9px}.studio-user-turn details{margin-top:9px;font-size:12px}.studio-user-turn summary{cursor:pointer}
#view-studio #output-card{display:block;overflow:visible;min-height:0;height:auto;max-height:none;flex:none;background:transparent;border:0;width:100%}
#view-studio #output-card>.ai-result-head{padding:0 8px 18px;background:transparent;gap:8px;align-items:center;border:0}
.ai-result-head .studio-result-heading{flex:1}
#view-studio #output-title{font-size:18px;letter-spacing:-.4px}
#view-studio #output-status{font-size:11px;font-weight:600;color:var(--green);margin-bottom:5px;letter-spacing:0}
#view-studio #output-meta{font-size:11px;line-height:1.6;color:var(--muted);margin-top:1px}
#view-studio #output-card>.output-outline{display:none}
#view-studio #output{height:auto;max-height:none;overflow:visible;padding:0 8px 26px;outline-offset:5px}
#output .output{max-width:none;margin:0}
#output .result-section{padding-block:21px;scroll-margin-top:24px}
#output .result-section>h3{font-size:15px;font-weight:600;margin-bottom:12px}
#output .result-section-number{font-size:10px}
#output .result-text{font-size:14px;line-height:1.85;max-width:76ch}
#output .result-section-summary .result-text{font-size:15px;font-weight:400;line-height:1.85}
#output .result-tags li{border-radius:7px;padding:7px 11px}
#output .progress{padding:12px 0 32px}
#view-studio #chat-card{background:transparent;border:0;border-top:1px solid var(--line);flex:none;padding:0;}
#view-studio #chat-card>.card-body{padding:0 8px 24px}
#view-studio #chat-log{max-height:none;overflow:visible;margin:0;padding:10px 0 0}
#chat-log .bubble{font-size:14px;line-height:1.85;max-width:100%;padding:20px 0;border:0;background:transparent}
#chat-log .bubble.me{background:var(--green-50);border:1px solid var(--green-100);max-width:78%;padding:14px 18px;border-radius:16px 16px 4px 16px;margin:16px 0 12px auto}
#chat-log .bubble .who{font-size:11px;font-weight:500;color:var(--green);margin-bottom:5px}
#chat-log .bubble.me .who{color:var(--muted)}
#view-studio .chat-form{display:flex;align-items:flex-end;gap:10px;border:1px solid var(--line-strong);border-radius:15px;padding:10px;background:var(--white);margin-top:12px;box-shadow:0 5px 20px rgba(31,77,57,.04)}
#view-studio #chat-input{border:0;background:transparent;resize:vertical;padding:8px;min-height:54px;height:54px;max-height:180px;font-size:14px;box-shadow:none;flex:1;min-width:0;line-height:1.7}
#view-studio #chat-input:focus{outline:0}#view-studio .chat-form:focus-within{border-color:var(--green)}
#view-studio #chat-send{min-height:40px;min-width:72px;border-radius:9px;align-self:flex-end}
#chat-help{font-size:11px;padding:0 10px;margin-top:8px}
.ai-usage-details>summary{display:flex;gap:7px;align-items:center;cursor:pointer;min-height:40px;list-style:none;color:var(--muted);font-size:11px}
.ai-usage-details>summary::-webkit-details-marker{display:none}.ai-usage-details>summary:after{content:'⌄';color:var(--muted);margin-left:2px}
.ai-usage-details>summary strong{font-weight:600;color:var(--ink)}
.usage-dot{width:6px;height:6px;background:var(--green);border-radius:50%;flex-shrink:0}
.ai-usage-popover{position:absolute;z-index:10;right:0;top:44px;width:278px;padding:18px;border:1px solid var(--line-strong);border-radius:12px;background:var(--white);box-shadow:var(--shadow-pop);font-size:12px;color:var(--ink)}
.ai-usage-popover>strong{font-size:14px;font-weight:600}.ai-usage-popover>p{color:var(--muted);font-size:11px;line-height:1.6;margin:5px 0 12px}.ai-usage-popover>p:last-child{margin-bottom:0}
.ai-usage-popover dl{display:grid;grid-template-columns:1fr auto;gap:9px;margin:14px 0 0}.ai-usage-popover dt{color:var(--muted)}.ai-usage-popover dd{margin:0;font-variant-numeric:tabular-nums}
.balance-card .ai-usage-details>summary{font-size:14px;justify-content:flex-start;gap:10px}.balance-card .ai-usage-popover{position:static;width:auto;border:0;box-shadow:none;padding:12px 0 0}.balance-card .ai-usage-popover>strong{display:none}
/* Keep selected count visible on the compact navigation rail. */
body.nav-compact .sidebar .nav-item .badge-dot{display:grid!important;position:absolute;top:2px;right:4px;min-width:18px;height:18px;padding:0 4px;font-size:10px;border:2px solid var(--nav-bg,#151c18);background:var(--green-200);color:var(--deep);line-height:1}
body.nav-compact .sidebar .nav-item .badge-dot[hidden]{display:none!important}
@media(min-width:901px) and (max-width:1199px){body:not(.nav-compact) .sidebar .nav-item .badge-dot{display:grid}}
@media(max-width:900px){
 #view-studio{padding:22px 18px 36px}.studio-empty{padding-top:40px}.studio-empty h2{font-size:27px}.studio-page-head{margin-bottom:16px}.studio-toolbar{gap:8px}.studio-usage{font-size:11px}.studio-user-turn{max-width:88%}.studio-analysis{padding:12px 16px 0}.studio-source{padding:12px 16px 0}
}
@media(max-width:600px){
 #view-studio{padding:20px 14px 32px}.studio-subtitle{font-size:12px}.studio-page-head h1{font-size:24px}.studio-previous{font-size:11px}.studio-toolbar{flex-wrap:wrap}.studio-toolbar .studio-tabs{gap:18px}.studio-toolbar #studio-new{font-size:11px;padding:0 6px}.ai-usage-details>summary{font-size:10px;gap:5px}.studio-usage .ai-usage-details>summary>span:not(.usage-dot){display:none}.studio-empty{padding:36px 6px 25px}.studio-empty h2{font-size:25px;letter-spacing:-.7px}.studio-empty p{font-size:13px}.studio-task-suggestions{gap:7px}.studio-task-suggestions button{font-size:11px;padding:8px 10px;min-height:40px}.studio-task-line{gap:8px}#view-studio .studio-task-line .input{font-size:13px;min-width:0;width:100%}#view-studio .studio-prompt,#view-studio #chat-input,#view-studio #product-facts{font-size:16px}.studio-run{padding:4px 10px 10px;gap:4px}.studio-attach{gap:3px;flex:1}.studio-attach #upload-help{display:none}.studio-run-note{display:none}.studio-compose-note{font-size:11px!important;text-align:left!important;line-height:1.6!important}#run-summary{flex:0 0 auto}#run-summary .studio-compose-note{flex-basis:100%;width:100%}.studio-run:has(.studio-compose-note){align-items:flex-start}#run-summary:has(.studio-compose-note){flex:1}.studio-source summary .muted{max-width:88px}.studio-source summary{font-size:11px;gap:5px}.studio-source summary .pill{font-size:10px}.studio-source-controls .studio-change-source{margin-left:0}.studio-user-turn{max-width:92%;font-size:13px;margin:22px 0 28px;padding:13px 15px}#view-studio #output-card>.ai-result-head{padding:0 2px 18px}#view-studio #output{padding:0 2px 20px}#output .result-text{font-size:14px}#output .result-section>h3{font-size:14px}#chat-log .bubble.me{max-width:92%}#view-studio #chat-card>.card-body{padding:0 0 20px}#view-studio #chat-send{min-width:58px;padding:0 12px}#view-studio .chat-form{gap:4px;padding:7px}#view-studio #chat-input{padding:7px;min-height:62px;height:62px}.studio-upload{width:68px;height:68px}.upload-remove{width:30px;height:30px}.ai-usage-popover{width:min(278px,calc(100vw - 32px))}
}
@media(prefers-reduced-motion:reduce){#view-studio *,#view-studio *:before,#view-studio *:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(max-width:600px){
 #view-studio .studio-page-head{flex-direction:row;align-items:flex-start;gap:12px;margin-bottom:14px}
 .studio-page-head .studio-subtitle{display:none}
 .studio-page-head .studio-previous{margin-left:auto;white-space:nowrap;padding-top:5px}
 .studio-empty{padding:24px 6px 20px}.studio-empty-icon{width:32px;height:32px;margin-bottom:10px}.studio-empty-icon .ic{width:29px;height:29px}.studio-empty h2{font-size:24px;margin-bottom:10px}.studio-empty p{margin-bottom:14px}
 .studio-task-suggestions{display:none}
}
@media(max-width:600px){
 #view-studio .studio-task-line .input,#studio-attach,#view-studio #chat-send,#run-summary>.btn,#output .image-prompt-result .btn,.studio-source summary{min-height:44px}
 .upload-remove{width:44px;height:44px;right:-12px;top:-12px;background:transparent;border:0;box-shadow:none;isolation:isolate}
 .upload-remove:before{content:'';position:absolute;inset:8px;background:var(--white);border:1px solid var(--line-strong);border-radius:50%;box-shadow:var(--shadow);z-index:-1}
}

/* Compact Studio: the conversation owns scrolling; the composer stays in the viewport. */
html,body{overflow-x:clip}
body.studio-active{height:100dvh;overflow-y:hidden}
body.studio-active .shell{height:100dvh;min-height:0}
body.studio-active .main{height:100dvh;min-height:0}
body.studio-active .page-footer{display:none}
#view-studio{height:100%;max-width:1180px;padding:12px 24px 16px;min-height:0;display:flex;flex-direction:column;overflow:visible}
#view-studio .studio-page-head{flex-direction:row;align-items:center;flex:0 0 44px;min-height:44px;margin:0 0 4px;gap:12px}
#view-studio .studio-page-head h1{font-size:20px;font-weight:600;letter-spacing:-.4px;line-height:1.3;min-width:0;overflow-wrap:break-word}
.studio-head-actions{display:flex;align-items:center;gap:4px;margin-left:auto}
.studio-head-actions .icon-btn{width:44px;height:44px;border-radius:var(--r);color:var(--muted)}
.studio-head-actions .icon-btn:hover{background:var(--hover);color:var(--ink)}
#studio-create{display:flex;flex:1;min-height:0;max-width:900px;width:100%;margin:0 auto}
#studio-workflow,#studio-workflow:has(#studio-compose[hidden]){display:flex;flex-direction:column;flex:1;min-height:0;width:100%;height:100%;gap:12px;overflow:visible}
#view-studio #studio-conversation{flex:1;min-height:0;height:auto;max-height:none;overflow-y:auto;overflow-x:clip;overscroll-behavior:contain;padding:4px 12px 12px;scrollbar-gutter:stable}
#view-studio .studio-empty{padding:12px 0;margin:0;max-width:none;text-align:left}
#view-studio .studio-empty p{font-size:15px;line-height:1.6;color:var(--muted);margin:0;max-width:none}
#view-studio #studio-compose,#studio-workflow.has-conversation #studio-compose{display:block;flex:0 0 auto;max-height:none;margin:0;background:var(--white);border:1px solid var(--line-strong);border-radius:var(--r-xl);box-shadow:none;position:relative;overflow:visible}
#view-studio .studio-analysis{padding:8px 12px 0}
#view-studio .studio-prompt{display:block;min-height:42px;height:42px;max-height:120px;padding:4px 0;resize:none;overflow-y:auto;font-size:15px;line-height:1.5;margin:0;width:100%}
#view-studio .studio-analysis:has(.studio-prompt:focus-visible){outline:0}
#view-studio #studio-compose:focus-within{border-color:var(--green)}
#view-studio .studio-prompt:focus-visible{outline:2px solid var(--green);outline-offset:3px;border-radius:var(--r-sm)}
#view-studio #analysis-availability{font-size:12px;line-height:1.4;margin:0 0 4px;color:var(--red)}
#view-studio .studio-run{display:flex;align-items:center;flex-wrap:nowrap;gap:4px;padding:4px 8px 8px;min-width:0}
#view-studio .studio-attach{display:flex;flex:0 0 auto;gap:0}
#view-studio #studio-attach{height:44px;min-height:44px;padding:0 8px;color:var(--muted);font-size:12px;gap:8px}
#view-studio .studio-source{height:44px;flex:0 1 auto;padding:0;min-width:0;position:relative}
#view-studio .studio-source details{max-width:100%}
#view-studio .studio-source summary{height:44px;min-height:44px;border:0;border-radius:var(--r);background:transparent;padding:0 8px;gap:4px;white-space:nowrap;font-size:12px}
#view-studio .studio-source summary:hover{background:var(--hover)}
#view-studio .studio-source summary .pill{font-size:10px;min-width:18px;padding:1px 4px}
#view-studio .studio-source details[open]{position:absolute;bottom:0;left:0;width:360px;max-width:calc(100dvw - 44px);max-height:min(420px,65dvh);overflow-y:auto;padding:8px;background:var(--white);border:1px solid var(--line-strong);border-radius:var(--r-lg);box-shadow:var(--shadow-pop);z-index:100}
#view-studio .studio-source-controls{padding:4px 4px 8px;gap:8px}
#view-studio .studio-source #cohort:not(:empty){max-height:250px;padding:0 4px;overflow:auto}
#view-studio .studio-source-controls .input{font-size:12px;min-height:40px}
#view-studio .studio-source-controls .studio-change-source{margin-left:0;min-height:36px;display:inline-flex;align-items:center}
#view-studio .studio-task-line{flex:0 1 165px;min-width:0;gap:0}
#view-studio .studio-task-line .input{width:100%;min-width:0;max-width:100%;height:44px;min-height:44px;padding:0 24px 0 8px;background:transparent;border-color:transparent;font-size:12px;font-weight:500}
#view-studio #run-summary{flex:0 0 auto;margin-left:auto;gap:0}
#view-studio #run-summary>.btn{height:44px;min-height:44px;min-width:80px;width:auto;padding:0 12px;border-radius:var(--r);font-size:13px;gap:4px}
#view-studio .studio-uploads{display:flex;flex-wrap:nowrap;gap:4px;overflow-x:auto;overflow-y:clip;max-height:56px;padding:0;margin:0;min-width:0}
#view-studio .studio-uploads:not(:empty){padding:4px 0 4px}
#view-studio .studio-upload{position:relative;display:flex;align-items:center;gap:4px;flex:0 0 auto;width:auto;max-width:190px;height:40px;padding:0 0 0 8px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r)}
#view-studio .studio-upload img{width:26px;height:26px;object-fit:cover;border-radius:var(--r-sm);border:0;flex-shrink:0}
#view-studio .studio-upload>span{position:static;background:transparent;color:var(--ink);font-size:11px;line-height:1.3;min-width:0;max-width:130px;white-space:nowrap;text-overflow:ellipsis;overflow:clip;text-align:left;border-radius:0}
#view-studio .studio-upload .upload-remove{position:static;flex:0 0 36px;width:36px;height:40px;border:0;background:transparent;border-radius:var(--r-sm);color:var(--muted);box-shadow:none;font-size:20px}
#view-studio .studio-upload .upload-remove:before{display:none}
#view-studio #upload-error{font-size:12px;line-height:1.4;margin:0;padding:0 0 4px}
#view-studio .studio-user-turn{max-width:88%;margin:8px 0 16px auto;padding:8px 12px;font-size:14px;line-height:1.65;border-radius:var(--r-lg)}
#view-studio .studio-user-turn>p:not(.studio-turn-context){margin-top:4px}
#view-studio #output-card{flex:none;height:auto;max-height:none;overflow:visible;min-height:0}
#view-studio #output-card>.ai-result-head{padding:0 0 8px;gap:8px}
#view-studio #output-title{font-size:16px;letter-spacing:-.2px}
#view-studio #output-status{display:none}
#view-studio #output-meta:empty{display:none}
#view-studio #output{padding:0 0 12px;height:auto;max-height:none;overflow:visible}
#view-studio #output .result-section{padding:12px 0}
#view-studio #output .result-text{font-size:14px;line-height:1.8}
#view-studio #output .result-section>h3{font-size:14px;margin-bottom:8px}
#view-studio #chat-card{border:0;flex:none}
#view-studio #chat-card>.card-body{padding:0}
#view-studio #chat-log{padding:0;overflow:visible;max-height:none}
#view-studio #chat-log .bubble{padding:12px 0;line-height:1.8}
#view-studio #chat-log .bubble.me{padding:8px 12px;margin:8px 0 16px auto;max-width:88%;border-radius:var(--r-lg)}
#view-studio #chat-form{display:none!important}
#view-studio #chat-help{margin:0;padding:0;font-size:12px}
#studio-history{position:fixed;inset:0 0 0 auto;width:min(430px,100%);max-width:100%;height:100dvh;max-height:100dvh;margin:0;padding:0;border:0;border-left:1px solid var(--line-strong);border-radius:0;background:var(--bg);color:var(--ink);overflow:clip}
#studio-history::backdrop{background:var(--studio-scrim)}
#studio-history>.card{display:flex;flex-direction:column;height:100%;margin:0;border:0;border-radius:0;background:var(--bg);color:var(--ink)}
#studio-history .card-head{display:flex;align-items:center;padding:12px 16px;gap:4px;border-bottom:1px solid var(--line);flex-shrink:0}
#studio-history h2{font-size:17px;margin-right:auto}
#studio-history .icon-btn{width:44px;height:44px}
#studio-history #ai-history{flex:1;min-height:0;overflow-y:auto;padding:4px 16px}
#studio-history .ai-history-list li{padding:12px 0}
.ai-usage-summary{display:flex;align-items:center;gap:12px;font-size:14px}
.ai-usage-summary strong{font-weight:600}
@media(max-width:900px){
 body.studio-active .mobile-bar{position:relative;flex-shrink:0;height:56px}
 body.studio-active .main{height:calc(100dvh - 56px)}
 #view-studio{padding:4px 12px 12px}
 #view-studio .studio-page-head{margin-bottom:2px}
}
@media(max-width:600px){
 #view-studio{padding:4px 8px 8px}
 #view-studio #studio-conversation{padding:2px 4px 8px}
 #view-studio #studio-workflow{gap:8px}
 #view-studio .studio-analysis{padding:8px 12px 0}
 #view-studio .studio-prompt{font-size:16px}
 #view-studio .studio-run{gap:2px;padding:4px 4px 4px}
 #view-studio #studio-attach{width:44px;padding:0;justify-content:center}
 #view-studio #studio-attach>span{display:none}
 #view-studio .studio-source summary{padding:0 4px;font-size:11px}
 #view-studio .studio-source summary>.ic{display:none}
 #view-studio .studio-task-line{flex:1 1 110px;max-width:145px}
 #view-studio .studio-task-line .input{font-size:11px;padding-left:4px;padding-right:16px}
 #view-studio #run-summary>.btn{min-width:68px;font-size:12px;padding:0 8px}
 #view-studio #run-summary>.btn .ic{display:none}
 #view-studio .studio-user-turn{max-width:94%;font-size:14px}
 #view-studio #chat-log .bubble.me{max-width:94%}
}
body.studio-active .shell{overflow:clip}
body.studio-active .main{overflow:clip}
#view-studio #studio-conversation{contain:layout}

#view-studio .studio-analysis #studio-instruction{font-size:15px;background:transparent}
#studio-sources:not([open])>:not(summary){display:none}
@media(max-width:600px){#view-studio .studio-analysis #studio-instruction{font-size:16px}}

/* Reference workbench: the supplied seller workflow, within Trovia's theme and navigation. */
:root{--font-studio-display:var(--font-body);--studio-composer-shadow:0 12px 32px -12px rgba(24,29,26,.07),0 2px 6px -1px rgba(24,29,26,.04);--studio-workbench-width:48rem;--studio-workbench-radius:16px}
:root[data-theme=dark]{--studio-composer-shadow:0 16px 36px -12px rgba(0,0,0,.35)}
#view-studio{max-width:1280px;padding:18px 32px 24px}
#view-studio .studio-page-head{flex:0 0 44px;padding-bottom:16px;margin-bottom:0;border-bottom:1px solid var(--line)}
#view-studio .studio-page-head h1{font-size:17px;letter-spacing:-.2px}
#view-studio .studio-head-actions{gap:8px}
#view-studio .studio-head-actions .icon-btn{width:36px;height:36px;background:var(--white);border:1px solid var(--line);border-radius:var(--r)}
#studio-create{max-width:var(--studio-workbench-width)}
#view-studio #studio-workflow{gap:24px;justify-content:center;padding:24px 0}
#view-studio #studio-conversation{flex:0 1 auto;padding:0;scrollbar-gutter:auto;contain:none}
#view-studio .studio-empty{padding:0;text-align:left;max-width:none}
#view-studio .studio-empty h2{display:block;font:400 44px/1.12 var(--font-studio-display);letter-spacing:0;margin:0 0 8px;overflow-wrap:break-word;min-width:0}
#view-studio .studio-empty p{font-size:15px;line-height:1.6;max-width:40rem}
#view-studio #studio-compose{border-radius:var(--studio-workbench-radius);box-shadow:var(--studio-composer-shadow);border-color:var(--line-strong)}
#view-studio .studio-analysis{padding:16px 18px 10px;display:flex;flex-direction:column}
#view-studio .studio-analysis #studio-instruction{min-height:84px;font-size:15px;line-height:1.55;padding:0;margin:0;border:0;box-shadow:none;outline-offset:4px}
#view-studio .studio-run{padding:10px 14px 12px;gap:6px;flex-wrap:wrap;border-top:1px solid var(--line)}
#view-studio #studio-attach,#view-studio .studio-source summary,#view-studio #studio-shortcuts-toggle{height:34px;min-height:34px;background:var(--hover);border:1px solid var(--line);border-radius:var(--r);color:var(--muted);padding:0 11px;gap:6px;font-size:13px;font-weight:500}
#view-studio #studio-attach:hover,#view-studio .studio-source summary:hover,#view-studio #studio-shortcuts-toggle:hover{background:var(--selected);border-color:var(--line-strong);color:var(--ink)}
#view-studio .studio-source{height:34px;flex:0 1 auto;position:relative}
#view-studio .studio-source details[open]{position:static;width:auto;max-width:none;max-height:none;overflow:visible;padding:0;border:0;background:transparent;box-shadow:none}
#view-studio .studio-source summary{display:flex;list-style:none}
#view-studio .studio-source summary::-webkit-details-marker{display:none}
#view-studio .studio-source .source-chevron{width:12px;height:12px}
#view-studio .studio-source-panel{position:absolute;bottom:calc(100% + 18px);left:0;width:440px;max-width:calc(100dvw - 48px);max-height:min(500px,65dvh);display:flex;flex-direction:column;padding:14px;background:var(--white);border:1px solid var(--line-strong);border-radius:12px;box-shadow:var(--shadow-pop);z-index:100}
#view-studio .studio-source-controls{padding:0;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
#view-studio .studio-source-controls label{font-size:13px;font-weight:600;color:var(--ink);flex:1}
#view-studio .studio-source-controls .input{min-height:36px;width:100%;font-size:13px;order:2}
#view-studio .studio-source-controls .studio-change-source{font-size:12px;min-height:32px}
#view-studio #studio-listing-filter{margin-top:10px;min-height:36px;font-size:13px;flex-shrink:0}
#view-studio #studio-source-status{font-size:12px;margin:8px 0;line-height:1.5;color:var(--muted)}
#view-studio .studio-source #cohort:not(:empty){max-height:none;overflow-y:auto;min-height:0;padding:0;flex:1}
.studio-listing-options{display:flex;flex-direction:column;gap:2px}
.studio-listing-option{display:flex;align-items:center;gap:10px;padding:8px 4px;cursor:pointer;border-bottom:1px solid var(--line)}
.studio-listing-option:hover{background:var(--hover)}
.studio-listing-option input{width:16px;height:16px;flex-shrink:0;accent-color:var(--green)}
.studio-listing-option img{width:42px;height:42px;object-fit:cover;border-radius:var(--r-sm);flex-shrink:0}
.studio-listing-option>span{display:flex;flex-direction:column;gap:3px;min-width:0}
.studio-listing-option strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:clip;font-size:12px;line-height:1.4;font-weight:500;overflow-wrap:anywhere}
.studio-listing-option small{font-size:11px;color:var(--muted)}
.studio-source-actions{display:flex;justify-content:space-between;align-items:center;gap:8px;padding-top:12px;flex-shrink:0}
#view-studio .studio-shortcuts{position:relative;flex:0 0 auto}
#view-studio #studio-shortcuts-toggle>span:first-child{font-size:16px;font-weight:400}
.studio-shortcut-menu{position:absolute;bottom:calc(100% + 18px);left:0;width:300px;max-width:calc(100dvw - 44px);padding:8px;border:1px solid var(--line-strong);border-radius:10px;box-shadow:var(--shadow-pop);background:var(--white);z-index:101}
.studio-shortcut-menu>p{padding:4px 8px 8px;font-size:12px;color:var(--muted)}
.studio-shortcut-menu>button{display:flex;flex-direction:column;gap:2px;align-items:flex-start;text-align:left;width:100%;padding:8px;border-radius:var(--r)}
.studio-shortcut-menu>button:hover{background:var(--hover)}
.studio-shortcut-menu strong{font-size:13px;font-weight:600}
.studio-shortcut-menu span{font-size:12px;color:var(--muted)}
#view-studio #run-summary>.btn{height:36px;min-height:36px;padding:0 16px;font-size:13px;min-width:90px}
#view-studio .studio-starters{display:flex;flex-direction:column;gap:10px}
#view-studio .studio-starters>h2{font-size:13px;line-height:1.5;font-weight:500;color:var(--muted);letter-spacing:0}
.studio-workflow-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.studio-workflow-card{display:flex;flex-direction:column;align-items:flex-start;text-align:left;justify-content:space-between;gap:10px;padding:14px 16px;border:1px solid var(--line);border-radius:10px;background:var(--white);transition:background-color .14s,border-color .14s,transform .12s}
.studio-workflow-card:hover{background:var(--hover);border-color:var(--line-strong);transform:translateY(-1px)}
.studio-workflow-card strong{font-size:14px;font-weight:600;line-height:1.45}
.studio-workflow-card>span{font-size:13px;color:var(--muted);line-height:1.45}
.studio-workflow-card small{font-size:12px;color:var(--faint);font-weight:500}
#view-studio .studio-composer-hint{font-size:12px;color:var(--faint);text-align:center;margin-top:-8px}
#view-studio .has-conversation#studio-workflow{padding:16px 0 0;gap:12px;justify-content:flex-start}
#view-studio .has-conversation #studio-conversation{flex:1;min-height:0;padding:0 8px 8px;scrollbar-gutter:stable}
#view-studio .has-conversation .studio-analysis{padding:12px 18px 8px}
#view-studio .has-conversation .studio-analysis #studio-instruction{min-height:42px}
#view-studio .studio-uploads:not(:empty){padding-top:8px}
@media(max-height:700px){
 #view-studio #studio-workflow{gap:16px;padding:20px 0}
 #view-studio .studio-empty h2{font-size:36px}
 #view-studio .studio-workflow-card{padding:12px;gap:6px}
 #view-studio .studio-composer-hint{display:none}
}
@media(max-width:900px){#view-studio{padding:12px 20px 16px}}
@media(max-width:600px){
 #view-studio{padding:4px 16px 12px}
 #view-studio .studio-page-head{padding-bottom:8px;flex-basis:44px}
 #view-studio #studio-workflow{gap:20px;padding:24px 0 12px;justify-content:center}
 #view-studio .studio-empty h2{font-size:36px;max-width:320px}
 #view-studio .studio-empty p{font-size:14px}
 #view-studio .studio-analysis{padding:14px 16px 8px}
 #view-studio .studio-analysis #studio-instruction{font-size:16px}
 #view-studio .studio-run{padding:8px;gap:6px}
 #view-studio #studio-attach{width:34px;min-width:34px;padding:0;justify-content:center}
 #view-studio #studio-attach>span{display:none}
 #view-studio .studio-source summary{font-size:12px;padding:0 8px;gap:4px}
 #view-studio .studio-source summary>.ic{display:inline-block}
 #view-studio .studio-source summary>.source-chevron{display:none}
 #view-studio #studio-shortcuts-toggle{width:34px;padding:0;justify-content:center}
 #view-studio #studio-shortcuts-toggle>span:last-child{display:none}
 #view-studio #run-summary>.btn{min-width:68px;padding:0 10px}
 #view-studio #run-summary>.btn .ic{display:none}
 .studio-workflow-grid{grid-template-columns:minmax(0,1fr);gap:8px}
 .studio-workflow-card{padding:10px 12px;gap:4px}
 .studio-workflow-card>span{display:none}
 .studio-workflow-card small{font-size:11px}
 #view-studio .studio-composer-hint{display:none}
 #view-studio .studio-source-panel{position:fixed;left:16px;right:16px;bottom:156px;width:auto;max-width:none;max-height:55dvh}
 .studio-shortcut-menu{position:fixed;left:16px;right:16px;bottom:156px;width:auto;max-width:none}
 #view-studio .has-conversation#studio-workflow{padding-top:12px;gap:8px}
}
@media(max-height:540px){
 #view-studio{padding-top:4px;padding-bottom:8px}
 #view-studio #studio-workflow{padding:12px 0 0;gap:12px}
 #view-studio .studio-empty h2{font-size:30px}
 #view-studio .studio-empty p{font-size:13px;line-height:1.4}
 #view-studio .studio-analysis{padding:10px 14px 6px}
 #view-studio .studio-analysis #studio-instruction{min-height:42px}
 #view-studio .studio-starters{gap:6px}
 .studio-workflow-card{padding:8px 10px;gap:4px}
 .studio-workflow-card>span{display:none}
}
@media(prefers-reduced-motion:reduce){.studio-workflow-card{transition:none}.studio-workflow-card:hover{transform:none}}
#view-studio #studio-conversation{contain:layout}
#view-studio #studio-workflow{align-items:stretch}
#view-studio .studio-source summary::after{display:none}
#view-studio .studio-source-panel,.studio-workflow-card{color:var(--ink)}

@media(min-width:601px){#view-studio .studio-source-panel{max-height:min(500px,var(--studio-picker-space,65dvh))}}

.studio-shortcut-menu{max-height:var(--studio-shortcut-space,60dvh);overflow-y:auto;overscroll-behavior:contain}
@media(max-width:600px){.studio-shortcut-menu{bottom:var(--studio-shortcut-bottom,156px);max-height:var(--studio-shortcut-space,60dvh)}}

/* Compact saved search and Studio session history */
#view-history .history{gap:0;margin-top:16px;border-top:1px solid var(--line)}
#view-history .h-row{gap:12px;padding:10px 8px;background:transparent;border:0;border-bottom:1px solid var(--line);border-radius:0}
#view-history .h-row:hover,#view-history .h-row:focus-within{background:var(--surface)}
#view-history .h-open{gap:12px;min-height:48px}
#view-history .h-row .h-ic{width:30px;height:30px;border-radius:6px}
#view-history .h-row .h-copy{gap:5px}
#view-history .h-row strong{font-size:13px;font-weight:500}
#view-history .h-row .h-meta{gap:5px 8px;font-size:11px}
#view-history .history-actions{gap:4px;margin:0;padding:0;border:0}
#view-history .history-export-wrap{display:inline-flex}
#view-history .history-export{min-width:64px;height:44px;padding:0 9px;gap:6px;border:1px solid var(--line);background:var(--hover)}
#view-history .history-export:disabled{cursor:not-allowed}
#studio-history h2{font-size:14px;font-weight:500;letter-spacing:0}
#studio-history #ai-history{padding:4px 8px}
#studio-history .ai-history-list{gap:0}
#studio-history .ai-history-list li{padding:0;border:0}
#studio-history .ai-history-open{display:flex;align-items:center;gap:10px;width:100%;min-height:66px;padding:10px 8px;border-radius:7px;text-align:left;color:var(--ink)}
#studio-history .ai-history-open:hover,#studio-history .ai-history-open:focus-visible{background:var(--surface)}
#studio-history .ai-history-open:disabled{opacity:.5;cursor:not-allowed}
#studio-history .ai-history-symbol{display:flex;align-items:center;color:var(--muted)}
#studio-history .ai-history-copy{flex:1;min-width:0}
#studio-history .ai-history-copy strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;font-size:13px;font-weight:500;line-height:1.4}
#studio-history .ai-history-copy small{margin-top:3px;font-size:11px;line-height:1.4}
#studio-history .ai-history-open>.ic{flex-shrink:0;color:var(--muted)}
@media(max-width:600px){
 #view-history .h-row{gap:2px 8px;padding:10px 4px}
 #view-history .h-open{flex-basis:100%}
 #view-history .history-actions{margin-left:auto}
}

/* Studio conversation cleanup. Keep the conversation flexible and the composer visible. */
:root{--font-studio-display:"DM Sans",sans-serif}
#view-studio #studio-workflow,#view-studio .has-conversation#studio-workflow{justify-content:flex-start;gap:10px;padding:16px 0 0}
#view-studio #studio-conversation{flex:1 1 0;min-height:0;overflow-y:auto;padding:0 6px 8px}
#view-studio .studio-empty{padding:18px 0}
#view-studio .studio-empty h2{font:600 28px/1.25 "DM Sans",sans-serif;letter-spacing:-.6px;max-width:none}
#view-studio .studio-empty p{font-size:14px}
#view-studio .studio-task-buttons{display:flex;flex:0 0 auto;gap:6px;flex-wrap:wrap}
#view-studio .studio-task-buttons button{min-height:32px;padding:5px 10px;border:1px solid var(--line);border-radius:8px;background:var(--white);color:var(--muted);font-size:12px;font-weight:500;line-height:1.4}
#view-studio .studio-task-buttons button:hover{background:var(--hover);color:var(--ink);border-color:var(--line-strong)}
#view-studio #studio-compose{flex:0 0 auto}
#view-studio #studio-compose:focus-within{border-color:var(--green);box-shadow:0 0 0 1px var(--green);outline:0}
#view-studio .studio-analysis #studio-instruction:focus,#view-studio .studio-analysis #studio-instruction:focus-visible{outline:0;box-shadow:none;border:0}
#view-studio #studio-attach,#view-studio #run-summary>.btn{width:36px;min-width:36px;height:36px;min-height:36px;padding:0;justify-content:center}
#view-studio #studio-attach .ic,#view-studio #run-summary>.btn .ic{display:inline-block;width:18px;height:18px}
#view-studio .studio-composer-hint{display:block;flex:0 0 auto;font-size:11px;line-height:1.4;color:var(--faint);text-align:center;margin:0}
#view-studio #output-card>.ai-result-head{display:none}
#view-studio #output-card,#view-studio #output{border:0;background:transparent;box-shadow:none;padding:0;margin:0}
#view-studio #output{min-height:0}
#view-studio .answer-copy{display:flex;width:30px;height:30px;margin:8px 0 12px;color:var(--muted);padding:5px}
#view-studio .answer-copy:hover{background:var(--hover);color:var(--ink)}
#view-studio .answer-evidence{margin-top:12px;font-size:12px;color:var(--muted)}
#view-studio .answer-evidence summary{cursor:pointer}
#view-studio #chat-log .bubble:not(.me){display:block}
#view-studio #chat-log .bubble>.who{display:none}
#view-studio #chat-log .bubble>span:not(.who){display:block}
#view-studio .trovia-loading{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;color:var(--green);margin:8px 0;animation:trovia-think 1.4s ease-in-out infinite}
#view-studio .trovia-loading svg{width:26px;height:26px}
@keyframes trovia-think{0%,100%{opacity:.45;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)}}
@media(max-width:600px){#view-studio #studio-workflow{gap:8px;padding-top:12px}#view-studio .studio-empty h2{font-size:25px}#view-studio .studio-task-buttons{gap:5px}#view-studio .studio-task-buttons button{font-size:11px;padding:5px 8px}#view-studio .studio-analysis #studio-instruction{min-height:60px}}
@media(prefers-reduced-motion:reduce){#view-studio .trovia-loading{animation:none;opacity:.75}}

/* Compact shared navigation and page chrome. */
#side-balance{padding:10px 12px}
#side-balance .meter{height:4px;margin:8px 0 0}
#side-balance [data-bind=plan-line][hidden]{display:none}
#view-history>.page-head{margin-bottom:12px}
#view-studio .studio-page-head h1.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:clip;clip:rect(0,0,0,0);white-space:nowrap}

/* Studio selection refinements. */
#view-studio .studio-empty h2{font:600 28px/1.25 "DM Sans",sans-serif;letter-spacing:-.6px}
#view-studio .studio-user-turn>.who{display:none}
#view-studio #copy-result,#view-studio .bubble .answer-copy{width:28px;height:28px;min-height:28px;padding:5px;border:0;background:transparent;box-shadow:none;color:var(--muted)}
#view-studio #copy-result .ic,#view-studio .bubble .answer-copy .ic{width:15px;height:15px}
#view-studio .studio-research-links{display:flex;gap:14px;font-size:12px;width:100%}
#view-studio #studio-search-choice{max-width:none}
#view-studio #studio-selection-count{font-size:12px;color:var(--muted);margin-right:auto}
#view-studio .studio-source-actions{flex-wrap:wrap}
@media(max-width:600px){#view-studio .studio-empty h2{font-size:24px}}

/* Studio source browser shares the listing detail dialog's generous viewport. */
#studio-source-dialog{width:calc(100vw - 64px);max-width:1440px;height:calc(100dvh - 64px);max-height:calc(100dvh - 64px);padding:0;border:1px solid var(--line-strong);border-radius:16px;background:var(--white);color:var(--ink);font-family:var(--font-body);overflow:hidden}
#studio-source-dialog[open]{display:flex;flex-direction:column}
#studio-source-dialog::backdrop{background:var(--studio-scrim)}
.studio-source-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 24px;border-bottom:1px solid var(--line);flex-shrink:0}
.studio-source-heading h2{font:600 20px/1.3 var(--font-body);margin:0}
#studio-source-dialog .studio-source-panel{display:flex;flex-direction:column;min-height:0;flex:1;padding:16px 24px;gap:12px}
#studio-source-dialog .studio-source-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
#studio-source-dialog .studio-research-links{display:flex;gap:16px;font-size:13px}
#studio-source-dialog #studio-source-status{margin:0;color:var(--muted);font-size:13px;line-height:1.5}
#studio-source-dialog #studio-listing-filter{max-width:520px;flex-shrink:0}
#studio-source-dialog #cohort,#studio-search-history{overflow-y:auto;min-height:0;flex:1;overscroll-behavior:contain}
#studio-source-dialog .studio-source-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;padding-top:14px;border-top:1px solid var(--line);flex-shrink:0}
#studio-selection-count{margin-right:auto;font-size:13px;color:var(--muted)}
.studio-history-choice{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;padding:16px 12px;text-align:left;background:transparent;border:0;border-bottom:1px solid var(--line);color:var(--ink);cursor:pointer;font:inherit;min-height:60px}
.studio-history-choice:hover{background:var(--hover)}
.studio-history-choice strong{font-size:14px;font-weight:500;overflow-wrap:anywhere}
.studio-history-choice span{font-size:12px;color:var(--muted);flex-shrink:0}
#studio-source-dialog .studio-listing-option{width:100%;text-align:left;color:var(--ink);background:transparent;border:0;border-bottom:1px solid var(--line);padding:12px 8px;min-height:82px;font:inherit;gap:16px}
#studio-source-dialog .studio-listing-option:hover{background:var(--hover)}
#studio-source-dialog .studio-listing-option input{width:20px;height:20px}
#studio-source-dialog .studio-listing-option img{width:64px;height:64px}
#studio-source-dialog .studio-listing-option>span{flex:1}
#studio-source-dialog .studio-listing-option strong{font-size:14px;line-height:1.5}
#studio-source-dialog .studio-listing-option small{font-size:12px;color:var(--muted)}
.studio-listing-rank{width:24px;flex-shrink:0;text-align:center}
.studio-photo-options{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:16px;padding:4px}
#studio-source-dialog .image-choice{background:var(--hover);border:1px solid var(--line);border-radius:8px;overflow:hidden;cursor:pointer}
#studio-source-dialog .image-choice:has(input:checked){outline:2px solid var(--green);outline-offset:-2px}
#studio-source-dialog .image-choice img{width:100%;aspect-ratio:1;object-fit:contain}
#studio-source-dialog .image-choice span{display:flex;align-items:center;gap:8px;padding:12px}
#studio-source-dialog :focus-visible{outline:2px solid var(--green);outline-offset:3px}
#view-studio #studio-add-images{width:34px;height:34px;border:1px solid var(--line);border-radius:var(--r);background:var(--hover);color:var(--muted);flex-shrink:0}
@media(max-width:600px){
 #studio-source-dialog{width:calc(100vw - 24px);height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);border-radius:12px}
 .studio-source-heading{padding:14px 16px}.studio-source-heading h2{font-size:18px}
 #studio-source-dialog .studio-source-panel{padding:12px;gap:10px}
 .studio-history-choice{align-items:flex-start;flex-direction:column;gap:5px;padding:12px 8px}.studio-history-choice span{flex-shrink:1}
 #studio-source-dialog .studio-listing-option{gap:8px;padding:10px 2px}#studio-source-dialog .studio-listing-option img{width:48px;height:56px}
 #studio-source-dialog .studio-listing-option strong{font-size:13px}.studio-listing-rank{width:18px}
 #studio-source-dialog .studio-source-actions{gap:6px}#studio-selection-count{width:100%;margin:0}
 .studio-photo-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
}
#studio-source-dialog #cohort,#studio-source-dialog #studio-search-history{max-height:none}
#studio-source-dialog .image-choice input{width:20px;height:20px;accent-color:var(--green)}

.studio-photo-listing-title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-weight:500;color:var(--ink);margin-bottom:4px}

/* Compact source browser and prompt starters. */
:root{--studio-image-label-bg:rgba(20,33,25,.86);--studio-image-label-ink:#fff}
#view-studio .studio-empty{text-align:center;padding:32px 0 22px;max-width:720px;margin:0 auto}
#view-studio .studio-empty p{margin:0 auto;max-width:40rem}
#view-studio #studio-starters{justify-content:center;gap:8px;margin:22px auto 0}
#view-studio #studio-starters button{font-family:var(--font-body);min-height:36px;padding:7px 14px;border-radius:18px;background:var(--white);color:var(--ink);border-color:var(--line-strong);transition:background .15s,border-color .15s}
#view-studio #studio-starters button:hover,#view-studio #studio-starters button[aria-pressed=true]{background:var(--green-50);border-color:var(--green);color:var(--green)}
#view-studio .studio-uploads{flex-wrap:wrap;overflow:visible;max-height:none;gap:8px}
#view-studio .studio-uploads:not(:empty){padding:0 0 12px}
#view-studio .studio-upload-image{width:64px;height:64px;padding:0;border-radius:8px;overflow:hidden}
#view-studio .studio-upload-image img{width:100%;height:100%;border-radius:0}
#view-studio .studio-upload-image>span{font-family:var(--font-body);position:absolute;left:0;bottom:0;width:100%;max-width:none;padding:3px 0;background:var(--studio-image-label-bg);color:var(--studio-image-label-ink);text-align:center;font-size:10px;line-height:14px}
#view-studio .studio-upload-image .upload-remove{position:absolute;right:2px;top:2px;width:22px;height:22px;min-height:22px;background:var(--studio-image-label-bg);color:var(--studio-image-label-ink);border-radius:50%;font-size:16px}
#studio-source-dialog::backdrop{backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px)}
#studio-source-dialog .studio-source-heading{min-height:56px;padding:9px 18px;gap:12px;justify-content:flex-start;flex-wrap:wrap}
#studio-source-dialog .studio-source-heading h2{font-size:16px;white-space:nowrap}
#studio-source-dialog .studio-source-heading>.icon-btn{width:30px;height:30px;min-height:30px;flex-shrink:0}
#studio-source-close{margin-left:auto}
.studio-history-filters{display:flex;align-items:center;gap:2px;padding:3px;background:var(--hover);border:1px solid var(--line);border-radius:8px}
.studio-history-filters button{padding:5px 10px;min-height:28px;border:0;border-radius:5px;background:transparent;color:var(--muted);font:500 12px/1.4 var(--font-body);cursor:pointer}
.studio-history-filters button:hover,.studio-history-filters button[aria-pressed=true]{background:var(--selected);color:var(--ink)}
#studio-source-dialog #studio-listing-filter{width:min(360px,38vw);min-height:32px;height:32px;font-size:12px;margin:0}
#studio-source-dialog .studio-source-panel{padding:10px 18px 14px;gap:8px}
#studio-source-dialog .studio-history-choice{min-height:62px;padding:10px 8px;gap:14px;flex-direction:row;align-items:center}
#studio-source-dialog .studio-history-copy{min-width:0;display:flex;flex-direction:column;gap:5px;flex:1}
#studio-source-dialog .studio-history-copy strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}
#studio-source-dialog .studio-history-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11px}
#studio-source-dialog .studio-history-meta .pill,#studio-source-dialog .studio-history-meta .badge{font-size:10px;padding:2px 6px;line-height:16px}
#studio-source-dialog .studio-history-meta .ic{width:12px;height:12px}
#studio-source-dialog .studio-history-choice time{font-size:11px;color:var(--muted);flex-shrink:0;white-space:nowrap}
#studio-source-dialog .studio-listing-option{min-height:62px;padding:8px 4px;gap:12px}
#studio-source-dialog .studio-listing-option img{width:44px;height:44px}
#studio-source-dialog .studio-listing-option strong{font-size:13px;line-height:1.35}
#studio-source-dialog .studio-listing-option small{font-size:11px}
#studio-source-dialog .studio-listing-option input{width:18px;height:18px}
#studio-source-dialog .studio-source-actions{padding-top:10px;gap:8px}
.studio-selection-summary{margin-right:auto;display:flex;align-items:center;gap:12px;min-width:0;flex-wrap:wrap}
#studio-selection-count{white-space:nowrap;margin:0;width:auto;font-size:12px}
#studio-source-meta{font-size:11px;color:var(--muted);overflow-wrap:anywhere}
#studio-source-dialog .image-choice span{padding:8px;font-size:12px}
@media(max-width:600px){
 #view-studio .studio-empty{padding-top:24px}
 #view-studio #studio-starters{gap:6px;margin-top:18px}
 #view-studio #studio-starters button{padding:6px 11px;font-size:12px}
 #studio-source-dialog .studio-source-heading{gap:8px;padding:9px 12px}
 #studio-source-dialog .studio-source-heading h2{font-size:15px}
 #studio-source-dialog .studio-history-filters{order:4;width:100%}
 #studio-source-dialog .studio-history-filters button{flex:1}
 #studio-source-dialog #studio-listing-filter{order:4;width:100%;max-width:none;font-size:16px}
 #studio-source-dialog .studio-source-panel{padding:8px 12px 12px}
 #studio-source-dialog .studio-history-choice{flex-wrap:wrap;gap:5px;padding:9px 4px}
 #studio-source-dialog .studio-history-copy{flex-basis:100%}
 #studio-source-dialog .studio-history-choice time{font-size:10px}
 #studio-source-dialog .studio-listing-option{gap:8px}
 #studio-source-dialog .studio-selection-summary{width:100%;gap:6px 12px}
 #studio-source-dialog .studio-source-actions>.btn{font-size:11px;padding:0 10px;min-height:34px}
}

/* Saved listing evidence and unboxed attachment control. */
#studio-source-dialog .studio-listing-meta{display:flex;align-items:center;flex-wrap:wrap;gap:4px 7px}
#studio-source-dialog .studio-listing-meta>small{overflow-wrap:anywhere}
#studio-source-dialog .studio-listing-metric{display:inline-flex;align-items:center;gap:4px;padding:2px 5px;background:var(--hover);border-radius:5px;font-size:11px;line-height:16px;white-space:nowrap;color:var(--muted)}
#studio-source-dialog .studio-listing-metric .ic{width:13px;height:13px}
#view-studio #studio-attach,#view-studio #studio-attach:hover{width:34px;min-width:34px;padding:0;justify-content:center;border:0;background:transparent;box-shadow:none}
#view-studio #studio-attach:focus-visible{outline:2px solid var(--green);outline-offset:2px}
@media(pointer:coarse){#view-studio #studio-attach{width:44px;min-width:44px;height:44px;min-height:44px}}

/* Account cards share content and footer rows so their dividers align. */
.balance-card,.billing-card{display:grid;grid-template-rows:48px 1fr}
.balance-card .card-body{display:flex}
.account-ai-usage,.billing-body{width:100%;display:grid;grid-template-columns:1fr;grid-template-rows:minmax(102px,1fr) auto;gap:16px}
.account-ai-main{align-self:start}
.balance-card .ai-usage-summary{min-height:20px;line-height:20px}
.balance-card .account-ai-remaining{margin-bottom:0}
.account-ai-footer,#billing-note{border-top:1px solid var(--line);padding-top:14px;min-height:62px;margin:0}
.balance-card .account-ai-reset{border:0;padding-top:0}
.billing-main{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px 24px;align-items:center;align-self:start}
.billing-main .kv{margin:0;grid-template-rows:minmax(20px,auto) minmax(20px,auto);row-gap:8px;align-items:center}
.account-profile{margin-top:16px}
.account-profile>.card-body{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.account-profile .avatar{width:48px;height:48px;font-size:16px;border-radius:10px;flex-shrink:0}
.account-profile .account-profile-copy{flex:1;min-width:0;overflow-wrap:anywhere}
.account-profile [data-act=signout]{margin-left:auto;min-height:44px;flex-shrink:0}
.trovia-tooltip{position:fixed;z-index:10000;width:max-content;max-width:min(320px,calc(100vw - 16px));padding:8px 11px;border:1px solid var(--line-strong);border-radius:7px;background:var(--white);color:var(--ink);box-shadow:var(--shadow-hover);font:500 12px/1.5 var(--font-body);overflow-wrap:anywhere;pointer-events:none}
.trovia-tooltip[hidden]{display:none}
@media(max-width:600px){.billing-main{grid-template-columns:1fr;gap:12px}.account-ai-usage,.billing-body{grid-template-rows:auto auto}.balance-card,.billing-card{grid-template-rows:auto 1fr}}

/* Search filters use the full desktop width while keeping every field visible. */
@media(min-width:901px){
 #view-research .advanced-filters{margin-top:10px;padding-top:10px}
 #view-research .advanced-filters .options-row{margin:0 0 10px;gap:8px 16px}
 #view-research .advanced-filters .switch{min-height:32px;font-size:12px;gap:8px}
 #view-research .advanced-filters .inline-field{font-size:11px}
 #view-research .advanced-filters .inline-field .input{min-height:32px;height:32px;font-size:12px}
 #view-research .advanced-filters .filter-group{margin-bottom:10px!important}
 #view-research .advanced-filters .filter-group>.label{font-size:11px;margin-bottom:6px}
 #view-research .advanced-filters .filter-chips{gap:6px}
 #view-research .advanced-filters .fchip{min-height:32px;padding:0 10px;font-size:12px;gap:6px}
 #view-research .filter-section{margin-bottom:10px}
 #view-research .filter-section legend{font-size:11px;margin-bottom:6px}
 #view-research .advanced-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px 12px}
 #view-research .advanced-grid .field{gap:3px}
 #view-research .advanced-grid .input{min-height:32px;height:32px;font-size:12px;padding:0 8px}
 #view-research .advanced-grid label{font-size:11px;line-height:1.4}
 #view-research .advanced-filters .check-options{gap:6px 18px;font-size:11px}
 #view-research .advanced-filters .check-options label{min-height:28px;gap:6px}
 #view-research .advanced-filters .filter-actions{padding-top:10px;margin-top:8px;gap:8px}
 #view-research .advanced-filters .filter-actions .btn{min-height:34px;font-size:12px;padding:0 12px}
}
@media(min-width:901px) and (max-width:1100px){#view-research .advanced-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:900px){
 #view-research .advanced-filters .input{min-height:44px;font-size:16px}
 #view-research .advanced-filters .check-options label{min-height:44px}
}

.listing-options-note{font-size:12px;line-height:1.5;margin-top:6px}

/* Completion alerts share the dashboard's theme and remain out of the work area. */
.completion-center{position:fixed;right:20px;top:10px;z-index:40}
.completion-bell{position:relative;background:var(--bg);box-shadow:var(--shadow);color:var(--green)}
.completion-count{position:absolute;right:-3px;top:-3px;min-width:17px;height:17px;padding:0 4px;border-radius:20px;background:var(--primary);color:var(--bg);font-size:10px;line-height:17px}
.completion-panel{position:absolute;right:0;top:48px;width:min(340px,calc(100vw - 24px));padding:12px;background:var(--surface);border:1px solid var(--line-strong);border-radius:var(--r-lg);box-shadow:var(--shadow-pop)}
.completion-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
.completion-list{list-style:none;margin:8px 0;padding:0;max-height:min(440px,60dvh);overflow:auto}
.completion-list>li{border-top:1px solid var(--line);padding:4px 0}
.completion-item{display:grid;gap:3px;text-align:left;width:100%;padding:9px 6px;border-radius:var(--r-sm);overflow-wrap:anywhere}
.completion-item:hover{background:var(--hover)}
.completion-item span,.completion-item small{font-size:12px;color:var(--muted)}
#main>.view{padding-top:58px}
.special-search-wait{min-height:clamp(340px,calc(100dvh - 240px),760px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;padding:32px 20px}
.special-search-wait p{color:var(--muted);font-size:13px}
.special-search-mark .trovia-loading{display:flex;color:var(--green);animation:trovia-think 1.4s ease-in-out infinite}
.special-search-mark svg{width:48px;height:48px}
@media(max-width:900px){.completion-center{right:12px;top:9px}.mobile-bar .side-credit{margin-right:46px}#main>.view{padding-top:20px}}
@media(prefers-reduced-motion:reduce){.special-search-mark .trovia-loading{animation:none}}

/* Compact account and Studio controls. */
.account-ai-usage,.billing-body{grid-template-rows:auto auto;gap:12px;align-content:start}
.balance-card .account-ai-main,.billing-main{min-height:74px}
.billing-main .kv{row-gap:9px}
.account-ai-footer,#billing-note{min-height:62px}
.limit-switch{display:flex;gap:4px;margin-left:auto;border:1px solid var(--line);border-radius:7px;padding:3px}
.limit-switch button{font-size:12px;padding:5px 9px;border-radius:5px;white-space:nowrap}
.limit-switch button[aria-pressed=true]{background:var(--hover);color:var(--green)}
.plan-features{padding-left:18px;margin:12px 0 18px;display:grid;gap:7px;font-size:12px;color:var(--muted);line-height:1.5}
.plan-price{margin-top:6px}.current-plan{border-color:var(--green)}
.ai-window-card{margin-top:16px}.plan-options{grid-template-columns:repeat(3,minmax(0,1fr))}
.plan-options .plan-card{display:flex;min-width:0}
.plan-options .plan-card>.card-body{display:flex;flex-direction:column;align-items:flex-start;min-width:0;width:100%}
.plan-options .plan-card h3{font-size:16px;line-height:1.4}
.plan-options .plan-price{font-size:24px;font-weight:600;line-height:1.35;margin:8px 0 0;color:var(--ink)}
.plan-options .plan-price span{font-size:12px;font-weight:400;color:var(--muted)}
.plan-options .plan-features{margin:18px 0 24px;padding-left:17px;gap:9px}
.plan-options .plan-card .btn{margin-top:auto;width:100%;min-height:44px;white-space:normal}
#main>#view-studio{padding-top:14px}
#view-studio .studio-page-head{padding-bottom:8px;flex-basis:44px}
#view-studio .studio-head-actions .completion-center{position:relative;right:auto;top:auto;z-index:40}
#view-studio .studio-analysis{padding:12px 14px 8px}
#view-studio .studio-analysis #studio-instruction{font-size:14px;min-height:96px}
#view-studio .studio-run{padding:7px 12px 8px;gap:5px}
#view-studio .studio-source summary,#view-studio #studio-shortcuts-toggle{font-size:12px;height:31px;min-height:31px;padding:0 9px}
#view-studio .studio-source{height:31px}
#cohort-count,.selection-badge{flex-shrink:0;min-width:20px;overflow:visible}
#view-studio .studio-source summary{overflow:visible;flex-shrink:0}
@media(max-width:800px){.plan-options{grid-template-columns:1fr}.limit-switch{margin-left:0}.card-head:has(.limit-switch){flex-wrap:wrap}}
@media(max-width:600px){#view-studio .studio-analysis #studio-instruction{font-size:16px}.billing-main,.balance-card .account-ai-main{min-height:0}}
.billing-main{align-items:start}.billing-actions{align-self:center}
.billing-main .kv{row-gap:7.5px}
.nav-item .badge-dot{flex-shrink:0;overflow:visible;line-height:20px}
#cohort-count{display:inline-flex;align-items:center;justify-content:center;min-width:20px;min-height:20px;line-height:20px;white-space:nowrap}
#cohort-count[hidden]{display:none}
#view-studio #cohort-count{min-width:22px;min-height:20px;flex:0 0 auto;padding:0 5px;line-height:20px}

/* Window meters use allowance consumption, without exposing allocation ratios. */
.account-ai-windows{display:grid;gap:12px;margin-top:16px}
.account-ai-windows .ai-usage-summary{font-size:12px}
.account-ai-windows .meter{height:6px;margin-top:6px}
.account-ai-usage,.billing-body{grid-template-rows:1fr auto;align-content:stretch}
.side-ai-windows{display:grid;gap:10px;margin-top:12px}
.side-ai-windows .ai-usage-summary{display:flex;justify-content:space-between;gap:6px;font-size:11px;color:var(--nav-muted)}
.side-ai-windows strong{color:var(--nav-text);font-size:10px;white-space:nowrap}
.side-ai-windows .meter{height:4px;margin:5px 0 0}
body.nav-compact .side-ai-windows{display:none}


.toast.error{background:var(--ink);color:var(--bg);border:1px solid var(--line-strong)}

.side-monthly-label{font-size:11px;color:var(--nav-muted);margin-right:auto}.balance-top{gap:6px}body.nav-compact .side-monthly-label{display:none}

/* Keep navigation controls inside short and zoomed viewports. */
.sidebar,body.has-banner .sidebar{max-height:calc(100dvh - 56px);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}
.sidebar-brand,.sidebar .nav,.sidebar .side-foot{flex-shrink:0}
@media(min-width:901px) and (max-height:850px){
 .sidebar,body.has-banner .sidebar{inset:12px auto 12px 12px;max-height:calc(100dvh - 24px);padding-top:14px;padding-bottom:10px}
 .sidebar-brand{margin-bottom:12px}.sidebar .nav{gap:3px}.sidebar .nav-item{min-height:38px}
 .sidebar .side-foot{gap:6px;padding-top:8px}.sidebar .side-foot .nav-item,.sidebar .side-foot .theme-control{min-height:36px}
 .side-ai-windows{gap:7px;margin-top:8px}
}
#main>#view-studio{padding-top:8px;padding-bottom:4px}
#view-studio .studio-page-head{min-height:34px;flex-basis:34px;padding-bottom:5px}
#view-studio .studio-head-actions .icon-btn,#view-studio #studio-tab-skills{width:30px;height:30px;min-height:30px}
#view-studio #studio-tab-skills{width:auto;padding:0 7px;font-size:12px}
#view-studio #studio-workflow{padding:10px 0 0;gap:8px}
#view-studio .studio-composer-hint{margin:0;font-size:11px;line-height:16px;padding-bottom:0}
#view-studio .has-conversation #studio-instruction{min-height:42px}
.answer-rich{white-space:normal;overflow-wrap:anywhere;font-size:14px;line-height:1.7}
.answer-rich p{margin:0 0 12px}.answer-rich p:last-child{margin-bottom:0}
.answer-rich h4{font-size:15px;margin:18px 0 8px}.answer-rich h4:first-child{margin-top:0}
.answer-rich ul,.answer-rich ol{padding-left:22px;margin:8px 0 14px}.answer-rich li{margin:5px 0}
.answer-rich pre{white-space:pre-wrap;padding:10px;background:var(--hover);border-radius:6px;overflow:auto}
.answer-rich code{font-size:.9em}.answer-rich blockquote{border-left:2px solid var(--green);padding-left:12px;color:var(--muted)}
.submitted-media{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.submitted-media figure{margin:0;max-width:100px}.submitted-media img{width:80px;height:80px;object-fit:cover;border-radius:8px}
.submitted-media figcaption{font-size:11px;overflow-wrap:anywhere;color:var(--muted)}
@media(pointer:coarse){#view-studio .studio-head-actions .icon-btn,#view-studio #studio-tab-skills{min-width:40px;min-height:40px}}

/* Navigation is one content-sized stack; no footer control absorbs spare height. */
.sidebar,body.has-banner .sidebar{top:50%;bottom:auto;height:auto;max-height:calc(100dvh - 24px);translate:0 -50%}
.sidebar .nav>.nav-item>.ic,.sidebar .side-foot>.nav-item>.ic{width:22px;height:22px;flex-basis:22px}
.sidebar .side-foot{display:flex;flex-direction:column;flex:0 0 auto;margin-top:18px;gap:8px;padding-top:12px}
.sidebar .side-foot>*{flex-shrink:0}
.sidebar .side-foot .theme-control{margin-top:0}
body.nav-compact .rail-toggle svg{transform:none}
.sidebar .balance{position:relative}
.sidebar .balance-top{padding-right:23px}
.side-ai-limits:not([open]){position:absolute;inset:0;pointer-events:none}
.side-ai-limits>summary{pointer-events:auto}
.side-ai-limits>summary{position:absolute;right:5px;top:6px;display:grid;place-items:center;width:25px;height:25px;border-radius:6px;cursor:pointer;list-style:none;color:var(--nav-muted)}
.side-ai-limits>summary::-webkit-details-marker{display:none}
.side-ai-limits>summary:hover{background:var(--nav-active);color:var(--nav-text)}
.side-ai-limits>summary .ic{width:15px;height:15px;transition:transform .15s ease}
.side-ai-limits[open]>summary .ic{transform:rotate(180deg)}
.side-ai-limits .side-ai-windows{margin-top:6px}
@media(min-width:901px){
 .sidebar .nav>.nav-item{min-height:46px}
 .sidebar .nav{gap:5px}
}
@media(min-width:901px) and (max-height:720px){
 .sidebar .nav>.nav-item{min-height:38px}
 .sidebar .side-foot{margin-top:14px;gap:6px;padding-top:10px}
 .sidebar .nav{gap:3px}
}
.research-start{max-width:660px;margin:clamp(36px,9vh,100px) auto 48px;text-align:center;padding:0 20px}
.research-start-icon{display:grid;place-items:center;width:64px;height:64px;margin:0 auto 20px;border-radius:20px;background:var(--green-50);color:var(--green)}
.research-start-icon>.ic{width:30px;height:30px;stroke-width:1.5}
.research-start .eyebrow{margin-bottom:10px}
.research-start h2{font-size:27px;line-height:1.25;letter-spacing:-.6px;text-wrap:balance}
.research-start>p:not(.eyebrow){max-width:49ch;margin:14px auto 0;color:var(--muted);font-size:14px;line-height:1.8}
.research-start ol{display:flex;justify-content:center;flex-wrap:wrap;gap:12px 22px;list-style:none;margin:28px 0 0;padding:22px 0 0;border-top:1px solid var(--line);color:var(--muted);font-size:12px}
.research-start li{display:flex;align-items:center;gap:8px}
.research-start li span{display:grid;place-items:center;width:23px;height:23px;border:1px solid var(--line-strong);border-radius:50%;font-size:11px;color:var(--green)}
@media(max-width:600px){.research-start{margin-top:42px;padding:0 8px}.research-start h2{font-size:23px}.research-start ol{flex-direction:column;align-items:center;gap:12px}}
