:root {
  color-scheme: dark; --bg:#101412; --panel:#171d19; --line:#313a34;
  --text:#edf1ed; --muted:#a9b5ac; --accent:#a9dfa4;
  --surface:#141915; --control:#202722; --input:#111713;
  font:15px "Geist","Microsoft YaHei",system-ui,sans-serif;
}
* { box-sizing:border-box }
body { margin:0; background:var(--bg); color:var(--text); display:grid; grid-template-columns:188px minmax(0,1fr); min-height:100dvh }
.workspace { min-width:0 }
a { color:inherit; text-decoration:none }
.sidebar { background:var(--surface); border-right:1px solid var(--line); padding:22px 12px; display:flex; flex-direction:column; gap:24px }
.brand { display:flex; align-items:center; gap:8px; font-size:18px; font-weight:740; padding:8px 7px; white-space:nowrap }
.brand span { display:grid; place-items:center; flex:0 0 32px; height:32px; border-radius:9px; background:#263b2b; color:var(--accent) }
nav { display:grid; gap:7px }
nav a { display:flex; gap:9px; align-items:center; padding:10px; border-radius:10px; color:var(--muted) }
nav a span { display:grid; place-items:center; font-size:16px; flex:0 0 24px; height:24px; border-radius:6px; background:#ffffff08 }
nav a[aria-current] { background:#24342a; color:var(--accent) }
.version { margin-top:auto; padding:8px 10px; color:var(--muted) }
header { min-height:62px; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; padding:12px clamp(16px,3vw,40px); border-bottom:1px solid var(--line); background:var(--surface) }
#breadcrumbs { display:flex; gap:8px; flex-wrap:wrap; align-items:center }
#breadcrumbs a,.connection { color:var(--muted) }
main { width:min(100%,1160px); margin:auto; padding:36px clamp(16px,4vw,56px) }
.site-filing { padding:0 16px max(12px,env(safe-area-inset-bottom)); text-align:center; font-size:12px; color:var(--muted) }
.site-filing a { display:inline-block; padding:6px; text-decoration:underline; text-underline-offset:3px }
h1 { font-size:clamp(28px,3.4vw,44px); line-height:1.2; letter-spacing:-.022em; margin:0 0 12px }
h2,h3 { margin:0 0 10px }
p,small { color:var(--muted); line-height:1.7 }
p { margin:6px 0 14px }
.hero { background:#1b241e; border:1px solid var(--line); padding:clamp(20px,3.5vw,36px); border-radius:18px; margin:8px 0 20px }
.hero p { margin-bottom:0 }
.tabs,.actions { display:flex; flex-wrap:wrap; gap:9px; align-items:center }
button,.button,select,input,textarea { color:inherit; font:inherit; background:var(--control); border:1px solid var(--line); padding:10px 13px; border-radius:9px }
input,textarea { background:var(--input) }
button,.button { cursor:pointer; display:inline-block }
button.primary,.button.primary,.tabs a[aria-current] { background:var(--accent); color:#152715; border-color:var(--accent); font-weight:720 }
button:disabled { opacity:.54; cursor:wait }
a,button,.card,select,input,textarea { transition:background .18s,border-color .18s,box-shadow .18s,color .18s,transform .18s }
button:not(:disabled):hover,.button:hover,a.card:hover { border-color:#729579; background-color:#29362c; transform:translateY(-1px) }
button.primary:not(:disabled):hover,.button.primary:hover { background-color:#bee9b9 }
a:hover,nav a:hover { color:var(--accent) }
.button.primary:hover,.tabs a[aria-current]:hover { color:#152715 }
a span,button span { display:inline-block; transition:transform .18s }
a:hover > span[aria-hidden=true] { transform:translateY(-1px) }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px }
input:hover,select:hover,textarea:hover { border-color:#648264 }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr)); gap:14px; margin:16px 0 }
.card,.panel { display:block; padding:18px; border:1px solid var(--line); background:var(--panel); border-radius:14px }
.card strong { display:block; margin:5px 0 }
.panel { margin-top:16px }
label { display:grid; gap:7px; color:var(--muted); min-width:0 }
label input,label select,textarea { width:100%; min-width:0 }
textarea { min-height:128px; resize:vertical }
.status { white-space:pre-wrap; overflow-wrap:anywhere }
.status:empty { display:none }
.workspace > .job-storage-notice { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; padding:10px 16px; margin:12px 16px; font-size:14px }
.output { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.7 }
video,img,audio { display:block; max-width:100%; margin-top:15px; border-radius:10px }
dialog { width:min(530px,calc(100% - 26px)); background:var(--panel); color:var(--text); border:1px solid var(--line); border-radius:16px; padding:25px }
dialog::backdrop { background:#000a }
.price { font-size:32px; font-weight:750; color:var(--accent) }
@media(max-width:720px) {
  body { display:block }
  .sidebar { padding:10px 14px; gap:8px }
  nav { display:flex; flex-wrap:wrap }
  nav a { padding:8px }
  .version { display:none }
  main { padding-top:20px }
}
@media(prefers-reduced-motion:reduce) { * { transition:none!important } }
[hidden] { display:none!important }
.table-scroll { overflow-x:auto }
table { border-collapse:collapse; width:100%; text-align:left }
th,td { padding:10px 12px; border-bottom:1px solid var(--line); white-space:nowrap }
th { color:var(--muted); font-size:.9rem }
tbody tr:hover { background:#253829 }
#admin-main form + form { margin-top:20px; padding-top:8px; border-top:1px solid var(--line) }
body:has(.studio-layout) {
  grid-template-columns:168px minmax(0,1fr);
  background:radial-gradient(ellipse at 53% 0%,#1a281f 0%,var(--bg) 58%);
}
main:has(.studio-layout) {
  width:100%;
  max-width:none;
  padding:16px clamp(14px,2vw,30px) 22px;
}
.studio-layout {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(180px,230px);
  gap:18px;
  margin-top:12px;
  min-height:calc(100dvh - 155px);
}
.studio-layout.history-closed { grid-template-columns:minmax(0,1fr) }
.studio-body {
  display:grid;
  min-width:0;
  grid-template-rows:auto minmax(250px,1fr) auto;
}
.studio-toolbar { display:flex; align-items:flex-end; gap:8px; flex-wrap:wrap }
.studio-model { display:flex; gap:8px; flex-wrap:wrap; margin-right:auto; min-width:0 }
.studio-model label { max-width:min(345px,82vw); font-size:.88rem }
.studio-stage {
  display:grid;
  align-content:center;
  padding:22px 0;
  min-width:0;
}
.studio-stage:has(.studio-result) { align-content:start }
.studio-intro,.studio-result,.studio-composer { width:min(100%,860px); margin-inline:auto; min-width:0 }
.studio-intro .hero {
  background:radial-gradient(ellipse at right,#2c4631,transparent 70%),#152019;
  margin-top:0;
}
.studio-examples { display:flex; flex-wrap:wrap; gap:8px }
.studio-examples button { flex:1 1 155px; padding:11px; text-align:left }
.studio-result .panel { overflow-wrap:anywhere }
.studio-result .panel > button { margin:8px 8px 0 0 }
.studio-composer {
  position:sticky;
  z-index:1;
  bottom:12px;
  padding:13px;
  background:#1a231d;
  border:1px solid #425147;
  border-radius:16px;
  box-shadow:0 10px 30px #080d096b;
}
.studio-composer textarea { min-height:82px; background:var(--input) }
.composer-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:8px }
.composer-actions > small { margin-left:auto }
.composer-settings { display:contents }
.composer-settings summary {
  cursor:pointer; color:var(--text); padding:8px 10px; border:1px solid var(--line); border-radius:8px;
}
.composer-settings summary:hover { border-color:var(--accent); color:var(--accent) }
.composer-settings[open]::details-content {
  display:block; order:5; width:100%; max-height:34dvh; overflow:auto;
}
.composer-settings .grid { margin:8px 0 }
.composer-settings .grid:empty { display:none }
.studio-history {
  background:#111a15;
  border:1px solid var(--line);
  padding:12px;
  border-radius:13px;
  min-width:0;
  align-self:start;
}
.studio-history h2 { font-size:1rem }
.history-entry { display:block; width:100%; text-align:left; margin-top:8px; overflow-wrap:anywhere }
.history-entry strong,.history-entry small { display:block }
.history-entry strong { font-size:.88rem }
.history-entry[aria-pressed=true] { border-color:var(--accent) }
@media(max-width:1050px) {
  .studio-layout { grid-template-columns:minmax(0,1fr) 178px }
}
@media(max-width:820px) {
  body:has(.studio-layout) { display:block }
  .studio-layout { grid-template-columns:minmax(0,1fr) }
  .studio-history { grid-row:2 }
  .studio-body { min-height:65dvh }
}
@media(max-height:580px) {
  .studio-composer { position:static }
}
.quote-approval { display:flex; align-items:center; flex-direction:row-reverse; justify-content:flex-end; gap:9px; margin:16px 0 } .quote-approval input { width:auto }
.work-tile { min-width:0; overflow-wrap:anywhere }
.work-tile img,.work-tile video { margin:0 0 12px; width:100%; aspect-ratio:16/10; object-fit:contain; background:#0a120d }
.work-tile audio { width:100%; margin:0 0 12px }
.work-title { display:block; font-weight:700; margin-bottom:5px }
.studio-top { display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; gap:12px; position:relative; z-index:3 }
.studio-top .tabs { padding:4px; border:1px solid var(--line); border-radius:12px; background:#101a14 }
.studio-top .tabs .button { border:0 }
.studio-top .tabs .button:not([aria-current]) { background:transparent }
.model-picker { position:relative; width:min(100%,365px) }
.model-trigger,.model-choice { display:flex; align-items:center; gap:10px; text-align:left; min-width:0 }
.model-trigger { width:100%; background:#122219; border-color:#47704b; box-shadow:0 0 0 2px #25463155 }
.model-arrow { margin-left:auto; color:var(--accent); font-size:18px }
.model-info { display:grid!important; gap:1px; flex:1; min-width:0 }
.model-info strong,.model-info small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block }
.model-info small { font-size:.75rem }
.model-icon {
  display:grid!important; place-items:center; flex:0 0 29px; height:29px;
  border-radius:8px; background:#20352b; color:var(--accent);
}
.model-menu {
  position:absolute; right:0; top:calc(100% + 7px); width:100%; z-index:4;
  padding:8px; border-radius:12px; border:1px solid #37563d; background:#0e1812;
  box-shadow:0 15px 30px #0009;
}
.model-menu > input { width:100%; margin-bottom:6px }
.model-list { max-height:min(330px,48dvh); overflow:auto; overscroll-behavior:contain }
.model-row { display:flex; gap:3px; align-items:center }
.model-row:has([aria-pressed=true]) { background:#1b3926; border-radius:8px }
.model-choice { flex:1; border:0; padding:8px; background:transparent }
.model-choice:hover,.model-pin:hover { transform:none!important; box-shadow:none!important; background:#244432 }
.model-pin { padding:6px 8px; background:transparent; border:0; color:var(--accent); margin-right:3px }
@media(max-width:650px) { .model-picker { width:100% } }
.studio-top { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,440px) minmax(0,1fr); align-items:start }
.studio-top .tabs { justify-self:start }
.studio-top .model-picker { width:100%; grid-column:2; min-width:0 }
@media(max-width:1040px) {
  .studio-top { grid-template-columns:auto minmax(0,1fr) }
  .studio-top .model-picker { width:min(100%,440px); justify-self:center }
}
@media(max-width:610px) {
  .studio-top { grid-template-columns:minmax(0,1fr) }
  .studio-top .model-picker { grid-column:1; width:100% }
}
#admin-main details { margin-top:14px }
#admin-main details summary { cursor:pointer; color:var(--accent) }
.studio-top-actions { display:flex; gap:7px; flex-wrap:wrap; justify-content:flex-end; align-items:center }
.studio-top-actions button { white-space:nowrap }
.studio-top .tabs a::before { margin-right:6px; color:currentColor }
.studio-top .tabs a[data-mode=chat]::before { content:"◈" }
.studio-top .tabs a[data-mode=image]::before { content:"▧" }
.studio-top .tabs a[data-mode=video]::before { content:"▷" }
.studio-top .tabs a[data-mode=audio]::before { content:"≋" }
.studio-toolbar:has(.studio-model > label[hidden]:last-child) { display:none }
.studio-intro .hero { position:relative; isolation:isolate; overflow:hidden; padding:clamp(23px,4vw,44px) }
.studio-intro .hero::after {
  content:""; position:absolute; z-index:-1; inset:0;
  background-image:linear-gradient(#acd4a60c 1px,transparent 1px),linear-gradient(90deg,#acd4a60c 1px,transparent 1px);
  background-size:28px 28px; mask-image:linear-gradient(90deg,transparent 18%,black);
}
.studio-intro .studio-hero-image { background:radial-gradient(ellipse at right,#284e3b,transparent 74%),#152219 }
.studio-intro .studio-hero-video { background:radial-gradient(ellipse at right,#26494c,transparent 74%),#15221f }
.studio-intro .studio-hero-audio,.studio-intro .studio-hero-music { background:radial-gradient(ellipse at right,#424540,transparent 74%),#1b251b }
.studio-examples button { color:var(--text); min-height:45px }
.studio-examples button::after { content:"↗"; float:right; color:var(--muted); margin-left:6px }
.studio-examples button:hover::after { color:var(--accent) }
.studio-history-heading { display:flex; gap:6px; align-items:baseline; justify-content:space-between }
.studio-history-heading a { white-space:nowrap; font-size:.78rem; color:var(--muted) }
.studio-history-heading a:hover { color:var(--accent) }
.studio-history-filters { display:flex; gap:6px; flex-wrap:wrap }
.studio-history-filters button { font-size:.78rem; padding:5px 8px }
.studio-history-filters button[aria-pressed=true] { color:var(--accent); border-color:#4f7751; background:#243923 }
.history-empty { font-size:.85rem; margin:12px 0 2px }
.history-entry { display:flex; gap:8px; align-items:center; padding:8px }
.history-entry img { width:38px; height:38px; margin:0; border-radius:6px; object-fit:cover }
.history-entry-text { min-width:0; overflow-wrap:anywhere }
.history-entry:hover span { transform:none }
.studio-composer button:disabled { cursor:not-allowed }
@media(max-width:1040px) {
  .studio-top-actions { grid-column:2; justify-content:center }
}
@media(max-width:610px) {
  .studio-top-actions { grid-column:1; justify-content:flex-end }
  .studio-top .tabs { justify-self:stretch; justify-content:space-between; gap:3px }
  .studio-top .tabs .button { padding:8px 9px }
  .studio-layout { min-height:0 }
  .studio-body { grid-template-rows:auto minmax(235px,1fr) auto }
  .studio-composer { bottom:6px }
}
.studio-toolbar { grid-row:1 }
.studio-stage { grid-row:2 }
.studio-composer { grid-row:3; align-self:end }
.tabs .button[aria-current]:hover { background:var(--accent); color:#152715 }
nav a:hover { background:#ffffff08 }
nav a[aria-current]:hover { background:#2b4030 }
.connection { display:inline-block; padding:6px 10px; border:1px solid var(--line); border-radius:8px; font-size:.85rem }
.connection:hover { border-color:#6b8d72 }
.catalog-filters { grid-template-columns:minmax(0,2fr) minmax(140px,1fr); margin-bottom:12px }
.catalog-grid > .panel { display:flex; flex-direction:column; align-items:flex-start; margin:0 }
.catalog-grid > .panel > a.card { flex:1; width:100%; padding:0 0 13px; border:0; background:transparent }
.catalog-grid > .panel > a.card:hover { background:transparent; transform:none }
.catalog-grid > .panel button { padding:6px 9px; font-size:.82rem }
.account-grid > .panel { margin-top:0 }
.account-grid h2 { font-size:1.05rem }
.account-total { display:inline-block; margin:0 0 14px; color:var(--text); font-size:2rem; font-weight:730; font-variant-numeric:tabular-nums }
.account-balance .status { margin-bottom:0 }
.studio-intro .hero { border-color:#39463c }
.model-trigger { background:#1a251e; border-color:#55715a; box-shadow:none }
.model-menu { background:#18211b; border-color:#405849; box-shadow:0 10px 28px #0007 }
.studio-history { background:var(--surface) }
.work-tile { padding:12px }
.work-title { padding:1px 2px }
#admin-main > .panel { padding:clamp(14px,2.5vw,24px) }
#admin-main details { padding:11px 13px; border:1px solid var(--line); border-radius:9px; background:var(--surface) }
#admin-main details[open] summary { margin-bottom:8px }
@media(max-width:820px) {
  body { display:block }
  .sidebar { border-right:0; border-bottom:1px solid var(--line); padding:7px 12px; gap:6px }
  .sidebar nav { display:flex; flex-wrap:wrap; gap:4px }
  .sidebar nav a { padding:7px 8px }
  .sidebar .version { display:none }
  main { padding-top:22px }
}
@media(max-width:450px) {
  .catalog-filters { grid-template-columns:minmax(0,1fr) }
  .studio-top .tabs a::before { display:none }
  header { min-height:52px }
}
/* The public workbench uses the approved blue preview. */
.tech-theme {
  --bg:#060c17;
  --surface:#0a1220;
  --panel:#101b2d;
  --control:#142033;
  --input:#090f1c;
  --line:#40536c;
  --text:#e5eef6;
  --muted:#a1b1c4;
  --accent:#84dff4;
  background:var(--bg);
}
.tech-theme:has(.studio-layout) { background:var(--bg) }
.tech-theme .workspace {
  position:relative;
  isolation:isolate;
  background:radial-gradient(ellipse at 54% 9%,#173859 0%,#10283e 19%,transparent 55%),
    linear-gradient(145deg,#081321,#060c17 65%,#11192d);
}
.tech-theme .workspace::before {
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  background-image:linear-gradient(#92bbec19 1px,transparent 1px),
    linear-gradient(90deg,#92bbec19 1px,transparent 1px);
  background-size:38px 38px;
  mask-image:radial-gradient(ellipse at 54% 20%,black 2%,transparent 77%);
  pointer-events:none;
}
.tech-theme header { background:#091220ab }
.tech-theme .brand span,.tech-theme .model-icon { background:#15334a }
.tech-theme nav a[aria-current],.tech-theme nav a[aria-current]:hover { background:#173147 }
.tech-theme .studio-top .tabs { background:#0a1422c9 }
.tech-theme .model-trigger { background:#0b1c31e8; border-color:#77cee854 }
.tech-theme .model-menu { background:#101b2d; border-color:#427088 }
.tech-theme .model-row:has([aria-pressed=true]),.tech-theme .model-choice:hover,
.tech-theme .model-pin:hover { background:#17364a }
.tech-theme .hero,.tech-theme .studio-intro .hero {
  position:relative;
  border-color:#83aad34f;
  background:linear-gradient(112deg,#12223bf0,#112942d9 75%,#18374bd9);
  box-shadow:0 13px 30px #04091026;
}
.tech-theme .hero::before {
  content:"";
  position:absolute;
  top:0;
  left:24px;
  right:24px;
  height:1px;
  background:linear-gradient(90deg,transparent,#86dcf6a3,transparent);
  pointer-events:none;
}
.tech-theme .studio-intro .hero::after { content:none }
.tech-theme .studio-composer { background:#101b2df0; border-color:#7b9bbb5c }
.tech-theme .studio-history { background:#0a1423da }
.tech-theme .studio-history-filters button[aria-pressed=true] { background:#173147; border-color:#508da4 }
.tech-theme .work-tile img,.tech-theme .work-tile video { background:#080e1a }
.tech-theme button:not(:disabled):hover,.tech-theme .button:hover,.tech-theme a.card:hover,
.tech-theme input:hover,.tech-theme select:hover,.tech-theme textarea:hover {
  border-color:#6ca5bd;
}
.tech-theme button:not(:disabled):hover,.tech-theme .button:hover,.tech-theme a.card:hover { background-color:#1c3448 }
.tech-theme button.primary,.tech-theme .button.primary,.tech-theme .tabs a[aria-current],
.tech-theme .tabs a[aria-current]:hover { color:#072536; background:var(--accent) }
.tech-theme button.primary:not(:disabled):hover,.tech-theme .button.primary:hover { background:#a3ecfb }
.tool-detail { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:16px; align-items:start }
.tool-detail .panel { margin-top:0; min-width:0 }
.tool-brief { display:grid; gap:14px }
.tool-brief textarea { min-height:105px }
.tool-output h2 { font-size:1.05rem }
.tool-back { display:block; margin-top:20px; color:var(--accent) }
@media(max-width:650px) { .tool-detail { grid-template-columns:minmax(0,1fr) } }
/* Shared agent and tool directories derive category counts from their entries. */
main:has(.directory-layout) { width:min(100%,1600px); padding:24px clamp(16px,2.4vw,36px) 40px }
.directory-hero { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:28px }
.directory-hero > div { min-width:0 }
.directory-hero h1 { font-size:clamp(24px,2.3vw,34px); line-height:1.4 }
.directory-hero > label { flex:0 0 260px; font-size:.85rem }
.directory-eyebrow { display:block; margin-bottom:8px; font-size:.72rem; letter-spacing:.14em; color:var(--accent); font-weight:700 }
.directory-source { flex-shrink:0; font-size:.85rem }
.directory-search { margin:0 0 18px; font-size:.8rem }
.directory-search input { padding:10px 9px; font-size:.82rem }
.directory-layout { display:grid; grid-template-columns:208px minmax(0,1fr); gap:24px; align-items:start }
.directory-categories { position:sticky; top:20px; max-height:calc(100dvh - 40px); overflow-y:auto; scrollbar-width:thin; margin:0; padding:16px 12px; background:#0b1728e8 }
.directory-category-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:2px 4px 18px }
.directory-category-heading h2 { margin:0; font-size:1.05rem }
.directory-count { min-width:25px; padding:2px 6px; border-radius:6px; background:#a6c9f010; color:var(--muted); font-size:.8rem; text-align:center; font-variant-numeric:tabular-nums }
.directory-category-list { display:grid; gap:7px }
.directory-category { display:flex; align-items:center; gap:10px; width:100%; padding:10px; text-align:left; background:transparent; border-color:transparent; font-size:.88rem }
.directory-category-label { flex:1 }
.directory-category-dot { flex:0 0 7px; height:7px; border-radius:50%; background:var(--category-color) }
.directory-star { color:var(--accent) }
.directory-category[aria-pressed=true] { background:#173147; border-color:#639ebc; color:var(--text); box-shadow:inset 3px 0 0 var(--accent) }
.directory-category[aria-pressed=true] .directory-count { color:var(--accent); background:#84dff415 }
.directory-favorites { margin-top:9px; border-top-color:var(--line) }
.directory-results { min-width:0 }
.directory-results-heading { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:8px; margin:4px 0 18px }
.directory-results-heading h2 { margin:0; font-size:1.2rem }
.directory-results-heading small { font-size:.82rem }
.directory-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,220px),1fr)); gap:16px }
.directory-card { display:flex; flex-direction:column; min-width:0; min-height:265px; margin:0; padding:20px; background:linear-gradient(145deg,#15263aeb,#0e1a2bf5); transition:border-color .18s,box-shadow .18s,transform .18s }
.directory-card:hover { border-color:var(--category-color); transform:translateY(-3px); box-shadow:0 12px 28px #02071166 }
.directory-card-top { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:20px }
.directory-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; border:1px solid #8db6d42e; background:#aad9ff09; color:var(--category-color); font-size:24px; transition:transform .18s,background .18s }
.directory-card:hover .directory-icon { transform:translateY(-2px); background:#aad9ff14 }
.directory-category-tag { color:var(--category-color); font-size:.76rem; padding:4px 7px; border-radius:6px; background:#b3d8ff08 }
.directory-card h3 { margin:0 0 8px; font-size:1.1rem; overflow-wrap:anywhere }
.directory-card p { font-size:.88rem; margin:0 0 18px }
.directory-mode { margin-top:auto; padding-bottom:12px; font-size:.78rem }
.directory-mode.mode-local { color:#7fe0cf }
.directory-mode.mode-external { color:#f0d49d }
.agent-brief { margin-bottom:18px }
.agent-brief h3 { margin-top:18px }
.agent-brief a { display:block; margin-top:14px; color:var(--accent); font-size:.85rem }
.local-tool-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px; align-items:start }
.local-tool-form fieldset { min-width:0; border:0; padding:0; margin:0; display:grid; gap:14px }
.local-tool-form legend { font-size:1.05rem; font-weight:700; margin-bottom:16px }
.local-tool-form fieldset > button { justify-self:start }
.local-tool-note { color:#7fe0cf; font-size:.85rem; margin:0 }
.local-tool-form textarea { min-height:190px }
.local-file-list { display:grid; gap:8px }
.local-file-row { display:flex; flex-wrap:wrap; gap:6px; align-items:center; border-bottom:1px solid var(--line); padding-bottom:8px }
.local-file-row span { flex:1 1 100%; overflow-wrap:anywhere; font-size:.85rem; color:var(--muted) }
.local-file-row button { font-size:.76rem; padding:5px 8px }
.local-tool-output { min-width:0 }
.local-tool-output h2 { font-size:1.05rem }
.local-tool-output p { overflow-wrap:anywhere }
.local-tool-preview textarea { width:100%; min-height:260px; font:13px/1.6 Consolas,monospace; margin-bottom:12px }
.local-tool-preview img { max-height:380px; object-fit:contain; margin:0 auto 16px; background:#fff }
@media(max-width:760px) { .local-tool-layout { grid-template-columns:minmax(0,1fr) } }
.directory-card-actions { display:flex; justify-content:space-between; gap:8px; align-items:center; padding-top:13px; border-top:1px solid #86a7ca2a }
.directory-card-actions .button,.directory-card-actions button { padding:7px 9px; font-size:.8rem }
.directory-favorite { background:transparent; color:var(--muted) }
.directory-favorite[aria-pressed=true] { color:var(--accent); border-color:#528598 }
.directory-open { background:#153148; color:var(--accent); border-color:#3d758d }
.directory-empty { grid-column:1 / -1; margin:0; padding:40px 20px; text-align:center }
@media(max-width:1100px) {
  .directory-hero { align-items:flex-start; flex-direction:column; gap:18px }
  .directory-hero > label { flex-basis:auto; width:min(100%,360px) }
  .directory-layout { grid-template-columns:190px minmax(0,1fr); gap:18px }
}
@media(max-width:760px) {
  .directory-layout { grid-template-columns:minmax(0,1fr) }
  .directory-categories { position:static; max-height:none; overflow:visible }
  .directory-category-heading { margin-bottom:12px }
  .directory-category-list { grid-template-columns:repeat(2,minmax(0,1fr)) }
  .directory-favorites { margin-top:0; border-top-color:transparent }
  .directory-hero { padding:22px }
  .directory-hero > label { width:100% }
}
:root { --server-tool-accent:#73b6ff; }
.mode-server { color:var(--server-tool-accent); }
.server-tool-preview { white-space:pre-wrap; overflow-wrap:anywhere; max-height:480px; overflow:auto; }

/* Keep the current turn and the creation controls within the same reading column. */
.galaxy-theme .studio-stage .studio-work-result {
  display:grid; gap:16px; padding:clamp(16px,2.2vw,30px); border:1px solid var(--line);
  background:var(--glass-strong); border-radius:22px; box-shadow:0 10px 30px var(--shadow);
  scroll-margin:16px; overflow-wrap:anywhere;
}
.studio-result-heading,.studio-result-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px }
.studio-result-heading { justify-content:space-between; padding-bottom:12px; border-bottom:1px solid var(--line) }
.studio-result-heading h2 { margin:0; font-size:19px }
.studio-result-heading small,.studio-user-turn small,.studio-assistant-turn small { font-size:12px; color:var(--muted) }
.studio-user-turn { justify-self:end; max-width:92%; border-radius:15px 15px 4px 15px; background:var(--accent-soft); padding:10px 15px }
.studio-assistant-turn { min-width:0 }
.studio-work-result .output { line-height:1.85 }
.studio-result-actions button,.studio-result-actions a,.studio-earlier summary { font-size:12px }
.studio-result-actions a { margin-inline-start:auto; color:var(--accent) }
.galaxy-theme :is(.studio-composer,.tw-model-settings,.agent-model) .generation-parameter-panel {
  display:block; min-width:0; margin:4px 0 8px; padding:0; border:1px solid var(--line); border-radius:14px;
  background:var(--control); overflow:clip;
}
.galaxy-theme .generation-parameter-panel > summary.generation-parameter-heading {
  display:flex; align-items:center; gap:9px; min-height:42px; padding:8px 12px; list-style:none;
  color:var(--text); border:0; border-radius:13px; background:transparent; cursor:pointer; font-size:13px;
}
.generation-parameter-heading::-webkit-details-marker { display:none }
.galaxy-theme .generation-parameter-heading:hover { background:var(--accent-soft) }
.galaxy-theme .generation-parameter-heading:focus-visible { outline:2px solid var(--accent); outline-offset:-3px }
.generation-parameter-heading strong { flex:none; font-size:13px }
.generation-parameter-values { display:flex; min-width:0; flex-wrap:wrap; align-items:center; gap:4px 6px }
.generation-parameter-chip { max-width:100%; padding:3px 7px; border-radius:7px; background:var(--accent-soft); color:var(--accent); font-size:11px; overflow-wrap:anywhere }
.generation-parameter-arrow { flex:none; margin-left:auto; font-size:18px; line-height:1; color:var(--muted) }
.generation-parameter-panel[open] .generation-parameter-arrow { transform:rotate(180deg) }
.galaxy-theme .generation-parameter-grid {
  display:block; min-width:0; margin:0; padding:0; container-type:inline-size;
}
.generation-parameter-panel .generation-parameter-grid { border-top:1px solid var(--line) }
.parameter-tabs { display:flex; align-items:center; gap:6px; padding:6px 14px 0; border-bottom:1px solid var(--line) }
.galaxy-theme .parameter-tabs > button {
  position:relative; margin:0; padding:7px 10px 9px; border:0; border-radius:6px 6px 0 0;
  color:var(--muted); background:transparent; font:inherit; font-size:12px; line-height:18px;
  white-space:nowrap; box-shadow:none; transform:none;
}
.galaxy-theme .parameter-tabs > button:hover { background:var(--accent-soft); color:var(--text) }
.galaxy-theme .parameter-tabs > button[aria-selected=true] { color:var(--accent); font-weight:650 }
.parameter-tabs > button[aria-selected=true]::after {
  content:""; position:absolute; inset:auto 10px -1px; height:2px; border-radius:2px; background:var(--accent);
}
.galaxy-theme .parameter-tabs > button:focus-visible { outline:2px solid var(--focus); outline-offset:-2px }
.parameter-pane {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:end; align-content:start;
  gap:12px 16px; min-width:0; padding:12px 16px 14px;
  max-block-size:min(40dvh,340px); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin;
}
.parameter-pane:only-child { padding-block:12px }
.parameter-pane[data-section=references] { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start }
.parameter-pane[data-section=references] > :only-of-type:is(fieldset) { grid-column:1/-1 }
.parameter-pane :is(label,input,select,textarea) { min-width:0 }
.parameter-pane > label,.parameter-chat-role > label { display:flex; flex-direction:column; align-items:stretch; gap:5px; font-size:12px; line-height:1.45; overflow-wrap:anywhere }
.galaxy-theme .parameter-pane label > :is(select,input:not([type=file])) {
  box-sizing:border-box; width:100%; height:36px; min-height:36px; flex:none; margin:0;
  padding:0 10px; border:1px solid var(--line); border-radius:8px; background-color:var(--control); color:var(--text);
  font-size:13px; line-height:normal; text-overflow:ellipsis;
}
.galaxy-theme .parameter-pane label > :is(select,input):disabled { color:var(--muted); background-color:var(--accent-soft); opacity:.7 }
.parameter-pane > :is(small,output,.parameter-chat-role),.parameter-pane > label:has(textarea,input[type=url]) { grid-column:1/-1 }
.parameter-pane small,.parameter-pane .reference-help { line-height:1.45; margin:0 }
.galaxy-theme .parameter-pane label > textarea,.galaxy-theme .studio-composer .parameter-pane label > textarea {
  box-sizing:border-box; width:100%; height:58px; min-height:58px; max-height:160px; resize:vertical;
  margin:0; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:var(--control); font-size:13px; line-height:1.5;
}
.galaxy-theme .parameter-pane :is(textarea,select,input):focus-visible { outline:2px solid var(--focus); outline-offset:1px }
@container (max-width:640px) {
  .parameter-pane { grid-template-columns:repeat(2,minmax(0,1fr)); padding-inline:12px; column-gap:12px }
  .parameter-pane[data-section=references] { grid-template-columns:minmax(0,1fr) }
}
@container (max-width:280px) {
  .parameter-pane { grid-template-columns:minmax(0,1fr) }
  .parameter-tabs { padding-inline:5px; gap:0 }
  .galaxy-theme .parameter-tabs > button { padding-inline:5px }
}
.parameter-pixel-size { grid-column:1/-1; color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums }
@media(max-width:820px) {
  .generation-parameter-panel { scroll-margin-block:12px }
  .galaxy-theme .generation-parameter-panel[open]::details-content { max-height:none; overflow:visible }
  .parameter-pane { max-block-size:min(38dvh,300px) }
}
@media(max-width:600px) {
  .galaxy-theme .generation-parameter-panel > summary.generation-parameter-heading { padding:8px; gap:6px }
  .parameter-tabs { padding-inline:8px; gap:2px }
}
.studio-earlier summary { cursor:pointer; color:var(--accent) }
.studio-earlier[open] > :last-child { margin-top:10px; max-height:38dvh; overflow:auto; padding:12px; background:var(--input); border-radius:12px }
.studio-turns strong { display:block; margin-block:12px 4px; color:var(--muted); font-size:12px }
.studio-turns strong:first-child { margin-top:0 }
.studio-work-result .tw-job-result { display:flex; flex-wrap:wrap; gap:10px; align-items:center; min-width:0 }
.studio-work-result .tw-job-result :is(img,video,audio) { flex-basis:100%; object-fit:contain; max-height:60dvh; max-width:100%; margin:0 }
.studio-work-result .tw-job-result p { flex-basis:100%; margin:0 }
.studio-work-result .tw-job-result .tw-detail-link { margin-inline-start:auto }
.galaxy-theme .studio-body .studio-composer:has(.composer-settings[open]) { position:relative; bottom:auto }
.galaxy-theme .studio-composer .composer-settings textarea { border:1px solid var(--line); background:var(--input); min-height:68px; padding:9px 12px }
@media (max-width:820px) {
  .galaxy-theme .studio-layout > .studio-history { grid-column:1; grid-row:auto; max-height:52dvh; overflow:auto }
  .galaxy-theme .studio-layout .studio-body { grid-template-rows:auto minmax(0,1fr) auto }
  .galaxy-theme .studio-layout .studio-stage { padding:12px 0 18px }
  .galaxy-theme .studio-layout .studio-stage:has(.studio-work-result) { padding-top:0 }
  .studio-work-result .tw-job-result :is(img,video) { max-height:45dvh }
}
