:root{color-scheme:light;--bg:#eaf3f1;--panel:#fff;--soft:#dcece8;--strong:#cfe4df;--ink:#073d47;--text:#1d5660;--muted:#4e7078;--line:#bfd8d4;--line2:#a9cbc5;--gold:#b57a14;--gold2:#f5d184;--teal:#117b86;--catalog-price:#aa7010;--navigation-accent:#b57a14;--primary-end:#d39b3d;--danger:#bd554b;--success:#2d8168;--shadow:0 16px 40px rgba(21,61,69,.1);--radius:8px}
[data-theme=dark]{color-scheme:dark;--bg:#031419;--panel:#103943;--soft:#1a4a54;--strong:#245e67;--ink:#fff8e8;--text:#edf6f4;--muted:#bfd2d2;--line:#37616a;--line2:#47747b;--gold:#f0c66f;--gold2:#ffe2a5;--teal:#8edbd0;--catalog-price:#f0c66f;--navigation-accent:#f0c66f;--primary-end:#d5a64f;--danger:#ff8b80;--success:#77d6ad;--shadow:0 18px 52px rgba(0,8,12,.38)}
[data-palette=blue]{--bg:#f4f7fc;--panel:#fff;--soft:#edf3fc;--strong:#dfeafb;--ink:#172b4d;--text:#38506f;--muted:#7185a1;--line:#d6e1f0;--line2:#b7c9e4;--gold:#356dd4;--gold2:#8bbbf7;--teal:#2876c7;--catalog-price:#38506f;--navigation-accent:#2876c7;--primary-end:#356dd4;--danger:#c35662;--success:#2b8a78;--shadow:0 16px 40px rgba(31,76,143,.1)}
/* The approved jade palette keeps its storage key; surfaces share the same color interpolation. */
:root{
  --page-heading:#073d47;--brand-accent:#b57a14;--workflow-icon:#b57a14;
  --header-surface:#e6f1ee;--navigation-surface:#e6f1ee;--mobile-navigation-surface:#f5fbf9;--field-surface:#f5f8f7;
  --catalog-highlight:#fbfdfc;--catalog-rim:#fff;--catalog-sheen:#ffffffaa;
  --catalog-icon-surface:#e1eeeb;--catalog-icon-highlight:#f0f5f0;--chrome-art-opacity:.07;
}
[data-theme=dark]{
  --page-heading:#f0dab0;--brand-accent:#dfbd7f;--workflow-icon:#dfbd7f;
  --header-surface:#061f26;--navigation-surface:#0a2d35;--mobile-navigation-surface:#0a2d35;--field-surface:#0d3038;
  --catalog-highlight:#1b4b55;--catalog-rim:#648990;--catalog-sheen:#eaffff1f;
  --catalog-icon-surface:#20525b;--catalog-icon-highlight:#2e646b;--chrome-art-opacity:.3;
}
[data-palette=blue]{
  --page-heading:#172b4d;--brand-accent:#2876c7;--workflow-icon:#2876c7;
  --header-surface:#f4f7fc;--navigation-surface:#edf3fc;--mobile-navigation-surface:#fff;--field-surface:#edf3fc;
  --catalog-highlight:transparent;--catalog-rim:transparent;--catalog-sheen:transparent;
  --catalog-icon-surface:color-mix(in srgb,#2876c7 8%,#fff);--catalog-icon-highlight:transparent;--chrome-art-opacity:.13;
}
[data-palette=blue][data-theme=dark]{
  --page-heading:#edf4ff;--brand-accent:#88c1f5;--workflow-icon:#88c1f5;
  --header-surface:#101b2d;--navigation-surface:#20344f;--mobile-navigation-surface:#18273e;--field-surface:#20344f;
  --catalog-icon-surface:color-mix(in srgb,#88c1f5 8%,#18273e);
}
*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;background:var(--bg);color:var(--text);font:14px/1.5 "Segoe UI","Microsoft YaHei",sans-serif;letter-spacing:0}body:before{content:"";position:fixed;inset:0;pointer-events:none;background-image:linear-gradient(rgba(16,91,99,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(16,91,99,.035) 1px,transparent 1px);background-size:48px 48px;mask-image:linear-gradient(#000,transparent 86%)}button,input,textarea,select{font:inherit;letter-spacing:0}button{cursor:pointer}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--gold);outline-offset:2px}.hidden{display:none!important}
.app-shell{width:min(100%,1480px);margin:auto;padding:0 30px 42px}.topbar{height:76px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:8;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(18px)}.brand{display:flex;align-items:center;gap:11px}.brand b{color:var(--ink)}.brand small{display:block;color:var(--muted);font-size:9px;margin-top:3px}.brand-mark{display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--gold);border-radius:8px;color:var(--gold);font:700 17px Georgia;background:var(--panel);box-shadow:0 5px 18px rgba(183,124,53,.12)}.brand-button{border:0;background:none;padding:0}.top-actions{display:flex;align-items:center;gap:9px}.icon-button,.profile-button,.credit-pill,.theme-switch{height:38px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--text)}.icon-button{width:38px;font-size:20px}.profile-button,.credit-pill{display:flex;align-items:center;gap:8px;padding:0 12px}.credit-pill span{color:var(--muted);font-size:12px}.credit-pill b{color:var(--gold)}.avatar{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:var(--teal);color:var(--panel);font-size:11px}.theme-switch{padding:3px;display:flex}.theme-switch button{width:30px;border:0;border-radius:4px;background:none;color:var(--muted)}.theme-switch button.selected{background:var(--soft);color:var(--gold)}
.app-layout{display:grid;grid-template-columns:224px minmax(0,1fr);gap:34px;padding-top:28px}.sidebar{min-height:calc(100vh - 105px);border-right:1px solid var(--line);padding-right:20px;display:flex;flex-direction:column}.eyebrow{margin:0 0 13px;color:var(--gold);font-size:10px;font-weight:700;letter-spacing:.16em}.nav{display:grid;gap:4px}.nav button{height:43px;border:0;border-radius:6px;background:none;color:var(--muted);display:flex;align-items:center;gap:11px;text-align:left;padding:0 13px}.nav button span{width:18px;color:var(--gold);font-size:16px}.nav button:hover,.nav button.active{background:var(--soft);color:var(--ink)}.nav button.active{box-shadow:inset 2px 0 var(--gold);font-weight:600}.side-status{margin-top:auto;display:flex;gap:10px;align-items:center;border-top:1px solid var(--line);padding:17px 6px}.side-status b,.side-status small{display:block}.side-status b{font-size:12px;color:var(--ink)}.side-status small{font-size:10px;color:var(--muted)}.status-dot{width:8px;height:8px;border-radius:50%;background:var(--gold);box-shadow:0 0 0 4px color-mix(in srgb,var(--gold) 14%,transparent)}.main{width:min(100%,1180px);min-width:0}
.page-head{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:24px}.page-head h1{margin:0;color:var(--ink);font-size:30px;line-height:1.2}.page-head p{margin:8px 0 0;color:var(--muted)}.head-actions{display:flex;gap:9px}.button{min-height:40px;padding:0 15px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--text);display:inline-flex;align-items:center;justify-content:center;gap:7px}.button:hover{border-color:var(--gold)}.button.primary{border-color:transparent;background:linear-gradient(135deg,var(--gold2),var(--gold));color:#173039;font-weight:700;box-shadow:0 8px 18px rgba(183,124,53,.2)}.button:disabled{opacity:.58;cursor:wait}.wide{width:100%}.text-button{border:0;background:none;color:var(--teal);padding:13px}.panel{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);box-shadow:var(--shadow)}
.hero{min-height:240px;padding:30px;display:grid;grid-template-columns:1.25fr .75fr;gap:34px;align-items:center;overflow:hidden;background:linear-gradient(120deg,var(--panel),var(--soft))}.hero h1{max-width:680px;font-size:38px;margin:0;color:var(--ink);line-height:1.18}.hero p{max-width:620px;color:var(--muted);line-height:1.75;margin:14px 0 22px}.hero-actions{display:flex;gap:10px}.signal{height:170px;position:relative;border-left:1px solid var(--line)}.signal:before,.signal:after{content:"";position:absolute;border:1px solid var(--gold);border-radius:50%;width:190px;height:190px;right:12px;top:-13px;box-shadow:0 0 0 24px color-mix(in srgb,var(--teal) 8%,transparent),0 0 38px color-mix(in srgb,var(--gold) 24%,transparent)}.signal:after{width:90px;height:90px;right:62px;top:37px;border-color:var(--teal);box-shadow:none}.signal-label{position:absolute;right:57px;top:73px;color:var(--ink);font-size:11px;font-weight:700;z-index:1}.section-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:30px 0 14px}.section-head h2{font-size:17px;margin:0;color:var(--ink)}.filters,.choice-row{display:flex;gap:6px;flex-wrap:wrap}.filter,.choice{min-height:32px;padding:0 11px;border:1px solid var(--line);border-radius:5px;background:var(--panel);color:var(--muted)}.filter.active,.choice.selected{border-color:var(--gold);background:color-mix(in srgb,var(--gold) 10%,var(--panel));color:var(--ink)}.agent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}.agent-card{min-height:158px;padding:17px;border:1px solid var(--line);border-radius:8px;background:var(--panel);display:flex;flex-direction:column;transition:.18s}.agent-card:hover{transform:translateY(-2px);border-color:var(--gold);box-shadow:var(--shadow)}.agent-top{display:flex;justify-content:space-between}.agent-icon{width:40px;height:40px;border-radius:7px;border:1px solid color-mix(in srgb,var(--gold) 45%,var(--line));display:grid;place-items:center;color:var(--gold);background:color-mix(in srgb,var(--gold) 9%,var(--panel));font-size:17px}.point-badge,.category{font-size:11px;color:var(--muted)}.agent-card h3{font-size:15px;color:var(--ink);margin:14px 0 6px}.agent-card p{font-size:12px;color:var(--muted);margin:0}.agent-foot{display:flex;justify-content:space-between;margin-top:auto;padding-top:12px;color:var(--gold);font-size:11px}
.home-hero{height:430px;position:relative;overflow:hidden;border:1px solid var(--line);border-radius:8px;background:#071a20;color:#fff;box-shadow:var(--shadow)}.home-hero-media{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center}.home-hero-shade{position:absolute;inset:0;background:linear-gradient(90deg,rgba(3,20,25,.93) 0%,rgba(3,24,29,.75) 43%,rgba(3,24,29,.12) 76%),linear-gradient(0deg,rgba(3,20,25,.56),transparent 46%)}.home-hero-copy{position:absolute;left:42px;top:50%;width:min(560px,58%);transform:translateY(-54%)}.home-hero-copy h1{margin:0;font:600 46px/1.14 Georgia,"Microsoft YaHei",serif;color:#fff}.home-hero-copy>p:not(.eyebrow){max-width:520px;margin:17px 0 24px;color:#c6d7d4;line-height:1.75}.hero-secondary{border-color:rgba(255,255,255,.26);background:rgba(3,24,29,.36);color:#fff;backdrop-filter:blur(10px)}.home-hero-meta{position:absolute;left:42px;right:42px;bottom:25px;display:flex;gap:0;border-top:1px solid rgba(255,255,255,.18);padding-top:15px}.home-hero-meta span{min-width:126px;display:grid;grid-template-columns:auto 1fr;align-items:baseline;gap:7px}.home-hero-meta b{font:600 19px Georgia;color:var(--gold2)}.home-hero-meta small{color:#9fb5b5;font-size:10px}.home-featured,.home-catalog{margin-top:38px}.home-section-title{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:15px}.home-section-title h2{margin:0;color:var(--ink);font-size:21px}.home-section-title>p{margin:0;color:var(--muted);font-size:11px}.featured-grid{display:grid;grid-template-columns:1.15fr 1fr 1fr;gap:12px}.featured-card{min-height:208px;position:relative;overflow:hidden;padding:20px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);text-align:left;display:flex;flex-direction:column;justify-content:space-between;transition:.2s}.featured-card:before{content:"";position:absolute;left:0;right:0;top:0;height:3px;background:var(--gold)}.featured-card:hover{transform:translateY(-3px);border-color:var(--gold);box-shadow:var(--shadow)}.featured-index{color:var(--gold);font:600 12px Georgia}.featured-card h3{margin:7px 0 7px;color:var(--ink);font-size:17px}.featured-card p{max-width:90%;margin:0;color:var(--muted);font-size:11px;line-height:1.65}.featured-price{display:block;margin-top:12px;color:var(--gold);font-size:11px}.featured-arrow{position:absolute;right:18px;bottom:17px;color:var(--gold);font-size:19px}.featured-1{background:linear-gradient(145deg,color-mix(in srgb,var(--gold) 10%,var(--panel)),var(--panel) 62%)}.featured-2:before{background:var(--teal)}.featured-3:before{background:var(--line2)}.catalog-title{margin-bottom:13px}.catalog-bar{padding:11px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.catalog-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:24px}.catalog-item{min-height:88px;padding:14px 4px;border:0;border-bottom:1px solid var(--line);background:none;color:var(--text);display:grid;grid-template-columns:42px minmax(0,1fr) auto 18px;align-items:center;gap:12px;text-align:left}.catalog-item:hover .catalog-copy b,.catalog-item:hover .catalog-arrow{color:var(--gold)}.catalog-copy{min-width:0;display:grid;gap:3px}.catalog-copy b{color:var(--ink);font-size:13px}.catalog-copy small{overflow:hidden;color:var(--muted);font-size:10px;text-overflow:ellipsis;white-space:nowrap}.catalog-meta{display:grid;gap:2px;text-align:right;white-space:nowrap}.catalog-meta small{color:var(--muted);font-size:9px}.catalog-meta b{color:var(--gold);font-size:10px}.catalog-arrow{color:var(--muted);font-size:15px;transition:.18s}.catalog-item:hover .catalog-arrow{transform:translateX(3px)}
.workspace{display:grid;grid-template-columns:minmax(310px,420px) minmax(0,1fr);gap:16px;align-items:start}.workspace-form,.workspace-result,.settings-card,.credit-card{padding:20px}.workflow-steps{display:flex;gap:5px;margin-bottom:20px}.workflow-step{height:4px;flex:1;background:var(--strong);border-radius:2px}.workflow-step.active{background:var(--gold)}.form-grid{display:grid;gap:15px}.field{display:grid;gap:7px}.field>span{font-size:12px;color:var(--text);font-weight:600}.field small{color:var(--muted);font-size:11px}.input,.select,.textarea,.field input{width:100%;border:1px solid var(--line);border-radius:6px;background:var(--soft);color:var(--text)}.input,.select,.field input{height:41px;padding:0 12px}.textarea{min-height:120px;padding:12px 13px;resize:vertical;line-height:1.65}.upload-zone{border:1px dashed var(--line2);border-radius:7px;padding:20px;text-align:center;color:var(--muted);background:var(--soft)}.upload-zone input{display:none}.advanced{border-top:1px solid var(--line);padding-top:13px}.advanced summary{cursor:pointer;color:var(--teal);font-size:12px;font-weight:600}.advanced-fields{display:grid;gap:12px;margin-top:13px}.form-actions{display:flex;justify-content:space-between;align-items:center;gap:12px}.cost{font-size:12px;color:var(--muted)}.cost b{color:var(--gold)}.result-empty,.loading{min-height:440px;display:grid;place-items:center;text-align:center;color:var(--muted)}.empty-symbol{width:58px;height:58px;margin:0 auto 14px;border:1px solid var(--line);border-radius:50%;display:grid;place-items:center;color:var(--gold);font-size:22px}.result-content{line-height:1.75;white-space:pre-wrap}.result-image{max-width:100%;max-height:620px;display:block;margin:auto;border-radius:6px}.result-toolbar{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:14px;margin-bottom:16px}.spinner{width:34px;height:34px;border:2px solid var(--line);border-top-color:var(--gold);border-radius:50%;animation:spin .8s linear infinite;margin:0 auto 13px}@keyframes spin{to{transform:rotate(360deg)}}
.table-panel{overflow:auto}.table{width:100%;border-collapse:collapse;min-width:620px}.table th,.table td{text-align:left;padding:13px 15px;border-bottom:1px solid var(--line);font-size:12px}.table th{color:var(--muted);background:var(--soft)}.status{padding:3px 7px;border-radius:4px;background:var(--soft);font-size:10px}.status.done{color:var(--success)}.status.failed,.status.cancelled,.status.interrupted{color:var(--danger)}.task-actions{display:flex;align-items:center;gap:2px}.text-button.danger{color:var(--danger)}.empty{padding:72px 20px;text-align:center;color:var(--muted)}.settings-grid,.credit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.settings-card h3,.credit-card h3{margin:0 0 7px;color:var(--ink);font-size:15px}.settings-card p,.credit-card p{margin:0 0 17px;color:var(--muted);font-size:12px}.credit-number{font-size:36px;color:var(--gold);font-weight:700}.transaction{display:flex;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line)}.transaction small{color:var(--muted)}.hidden-payment{display:none}.toast-region{position:fixed;right:22px;bottom:22px;z-index:30;display:grid;gap:8px}.toast{max-width:340px;padding:12px 14px;border:1px solid var(--line);border-radius:6px;background:var(--panel);box-shadow:var(--shadow)}
.task-toolbar{margin-bottom:12px;padding:12px;display:grid;grid-template-columns:minmax(220px,1fr) 180px auto auto;align-items:end;gap:9px}.task-toolbar label{display:grid;gap:5px}.task-toolbar label>span{color:var(--muted);font-size:10px}.task-toolbar input,.task-toolbar select{height:38px;padding:0 10px;border:1px solid var(--line);border-radius:6px;background:var(--soft);color:var(--text)}.task-toolbar>b{padding:0 5px 10px;color:var(--muted);font-size:11px;text-align:right}
.auth-screen{position:fixed;inset:0;z-index:50;display:grid;place-items:center;background:var(--bg)}.auth-card{width:min(410px,calc(100% - 32px));padding:30px;border:1px solid var(--line);border-radius:9px;background:var(--panel);box-shadow:var(--shadow);max-height:calc(100vh - 32px);overflow:auto}.auth-heading{margin:28px 0 22px}.auth-heading h1{margin:0;color:var(--ink);font-size:26px}.auth-heading p{margin:7px 0 0;color:var(--muted)}.auth-register-field{margin-top:14px}.auth-error{margin:14px 0 0;padding:10px 12px;border:1px solid color-mix(in srgb,var(--danger) 35%,var(--line));border-radius:6px;background:color-mix(in srgb,var(--danger) 8%,var(--panel));color:var(--danger);font-size:12px;line-height:1.55}.auth-card>.button{margin-top:18px}.auth-card>.text-button{display:block;margin:14px auto 0}.auth-card [hidden]{display:none}
@media(max-width:1050px){.agent-grid{grid-template-columns:repeat(2,1fr)}.workspace{grid-template-columns:360px 1fr}}@media(max-width:850px){.app-shell{padding:0 20px}.app-layout{grid-template-columns:1fr}.sidebar{min-height:auto;border-right:0;border-bottom:1px solid var(--line);padding:0 0 14px}.sidebar>.eyebrow,.side-status{display:none}.nav{display:flex;overflow:auto}.nav button{white-space:nowrap}.workspace{grid-template-columns:1fr}.hero{grid-template-columns:1fr}.signal{display:none}}@media(max-width:600px){.app-shell{padding:0 14px}.topbar{height:66px}.brand small,.profile-button span:last-child,.credit-pill span,.icon-button{display:none}.page-head{align-items:flex-start;flex-direction:column}.page-head h1{font-size:25px}.hero{padding:22px}.hero h1{font-size:29px}.agent-grid,.settings-grid,.credit-grid{grid-template-columns:1fr}.workspace-form,.workspace-result{padding:16px}}
@media(max-width:1050px){.featured-grid{grid-template-columns:1fr 1fr}.featured-card:first-child{grid-column:1/-1;min-height:180px}.catalog-grid{grid-template-columns:1fr}.home-hero-copy{width:64%}}@media(max-width:700px){.home-hero{height:470px}.home-hero-copy{left:24px;right:24px;top:42%;width:auto}.home-hero-copy h1{font-size:36px}.home-hero-shade{background:linear-gradient(90deg,rgba(3,20,25,.9),rgba(3,24,29,.48)),linear-gradient(0deg,rgba(3,20,25,.78),transparent 60%)}.home-hero-meta{left:24px;right:24px;bottom:19px}.home-hero-meta span{min-width:0;flex:1;grid-template-columns:1fr;gap:2px}.home-section-title{align-items:flex-start;gap:8px;flex-direction:column}.featured-grid{grid-template-columns:1fr}.featured-card:first-child{grid-column:auto}.featured-card{min-height:172px}.catalog-item{grid-template-columns:42px minmax(0,1fr) auto 18px;gap:9px}}@media(max-width:440px){.home-hero{height:500px}.home-hero-copy h1{font-size:32px}.home-hero-copy>p:not(.eyebrow){font-size:12px}.hero-actions{align-items:stretch;flex-direction:column}.home-hero-meta small{font-size:9px}.catalog-copy small{display:none}.catalog-meta small{display:none}}

/* Motion and scrolling remain native, with restrained theme-aware surfaces. */
html{scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--line2) var(--bg)}
*{scrollbar-width:thin;scrollbar-color:var(--line2) transparent}
::-webkit-scrollbar{width:7px;height:7px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--line2);border:2px solid var(--bg);border-radius:8px}
::-webkit-scrollbar-button{display:none;width:0;height:0}
.nav{scrollbar-width:none;overscroll-behavior-x:contain;scroll-padding:12px}
.nav::-webkit-scrollbar{display:none}
.nav .nav-icon{width:20px;height:20px;display:grid;place-items:center;flex:0 0 20px;color:color-mix(in srgb,var(--teal) 70%,var(--muted))}.nav .nav-icon svg{width:19px;height:19px;display:block;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.nav button.active .nav-icon{color:var(--navigation-accent)}
.button,.nav button,.filter,.choice,.mode-option,.theme-switch button,.catalog-item,.icon-button,.profile-button,.credit-pill{transition:background-color 180ms ease,color 180ms ease,border-color 180ms ease,box-shadow 180ms ease,transform 180ms ease}
.button:active:not(:disabled),.featured-card:active,.agent-card:active{transform:translateY(1px)}
.input,.textarea,.select,.field input,.plan-editor textarea{transition:border-color 180ms ease,box-shadow 180ms ease,background-color 180ms ease}
.input:focus,.textarea:focus,.field input:focus,.plan-editor textarea:focus{border-color:var(--teal);box-shadow:0 0 0 3px color-mix(in srgb,var(--teal) 10%,transparent)}
.panel{box-shadow:0 3px 14px rgba(0,20,25,.035)}
.button.primary{background:linear-gradient(135deg,var(--gold2),var(--primary-end))}
.advanced[open] .advanced-fields,.image-tuning[open] textarea{animation:surface-enter 200ms ease both}
.toast{animation:surface-enter 220ms ease both}
@keyframes surface-enter{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:850px){.nav{gap:5px;padding:2px 0 4px}.nav button.active{box-shadow:inset 0 -2px var(--gold)}.sidebar{padding-bottom:10px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* Homepage visual hierarchy: compact brand masthead, tangible workflow previews. */
.home-hero{height:330px;box-shadow:none}
.home-hero-copy{left:32px;top:24px;transform:none;width:60%}
.home-hero-copy h1{font:600 36px/1.15 "Segoe UI","Microsoft YaHei",sans-serif}
.home-hero-copy h1 span{display:block;margin-top:8px;font-size:23px;font-weight:500;color:#e5eeeb}
.home-hero-copy>p:not(.eyebrow){margin:12px 0 18px;font-size:13px}
.home-hero-meta{left:32px;right:32px;bottom:17px;padding-top:12px}
.home-featured,.home-catalog{margin-top:26px}
.home-section-title .eyebrow{margin-bottom:5px;font-size:9px}
.home-section-title h2{font-size:20px}
.featured-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.featured-card,.featured-card:first-child{padding:0;min-height:0;grid-column:auto;display:block;background:var(--panel);box-shadow:0 4px 14px rgba(5,38,42,.04)}
.featured-card:before{display:none}
.featured-scene{display:block;width:100%;aspect-ratio:1.8;position:relative;overflow:hidden;background-image:url('./assets/workflow-scenes.png');background-size:300% auto;background-repeat:no-repeat;background-position-y:50%;border-bottom:1px solid var(--line)}
.featured-scene.scene-video{background-image:url('./assets/video-generation-scene.png');background-size:cover;background-position:center}
.scene-0{background-position-x:0%}.scene-1{background-position-x:50%}.scene-2{background-position-x:100%}
.scene-label{position:absolute;left:12px;top:12px;padding:4px 7px;border:1px solid rgba(255,255,255,.4);border-radius:3px;background:rgba(5,31,36,.76);color:#fff;font-size:8px;font-weight:600}
.featured-body{display:block;padding:15px 17px}
.featured-card h3{font-size:17px;margin:4px 0 6px}
.featured-description{display:block;color:var(--muted);font-size:11px;line-height:1.6}
.featured-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:15px;padding-top:11px;border-top:1px solid var(--line)}
.featured-price{margin:0;font-size:11px}
.featured-entry{color:var(--teal);font-size:11px;font-weight:600}
.featured-entry>span{display:inline-block;margin-left:5px;transition:transform 180ms ease}
.featured-card:hover .featured-entry>span{transform:translate(2px,-2px)}
.catalog-item{padding:17px 9px;min-height:90px}
.catalog-item:hover{background:var(--soft)}
.catalog-item:nth-child(3n+2) .agent-icon{color:var(--teal);background:color-mix(in srgb,var(--teal) 9%,var(--panel));border-color:color-mix(in srgb,var(--teal) 25%,var(--line))}
.catalog-item:nth-child(3n) .agent-icon{color:var(--ink);background:var(--soft);border-color:var(--line2)}
.catalog-copy b{font-size:14px}.catalog-meta b{font-size:12px}
@media(max-width:1050px){.featured-grid{gap:10px}.featured-body{padding:12px}.featured-card h3{font-size:15px}.featured-description{font-size:10px}.featured-footer{flex-wrap:wrap}}
@media(max-width:700px){.home-hero{height:330px}.home-hero-copy{left:22px;right:22px;width:auto;top:24px}.home-hero-copy h1{font-size:32px}.home-hero-copy h1 span{font-size:21px}.home-hero-meta{left:22px;right:22px}.home-hero .hero-actions{flex-direction:row}.home-hero .button{font-size:12px;padding:0 12px}.featured-grid{grid-template-columns:1fr}.featured-card,.featured-card:first-child{display:grid;grid-template-columns:38% minmax(0,1fr)}.featured-scene{height:100%;aspect-ratio:auto;background-size:auto 100%;border-bottom:0}.featured-body{padding:14px}.featured-footer{margin-top:10px;padding-top:8px}.featured-description{font-size:11px}.scene-label{font-size:7px;left:7px;top:7px}}

@media(max-width:700px){.featured-scene{background-size:300% auto}}
@media(max-width:440px){.featured-card,.featured-card:first-child{grid-template-columns:1fr}.featured-scene{height:auto;aspect-ratio:2.1}.featured-body{padding:14px 16px}}

/* Generated identity atlas is shared by catalog and sidebar shortcuts. */
.workflow-logo{display:block;width:60px;height:60px;flex:0 0 auto;background-image:url('./assets/workflow-icons.png');background-size:400% 400%;background-repeat:no-repeat}
.catalog-item{grid-template-columns:60px minmax(0,1fr) auto 18px;gap:15px;min-height:105px}
.catalog-grid{column-gap:28px}
.catalog-item .workflow-logo{transition:transform 200ms ease;filter:drop-shadow(0 3px 3px rgba(0,45,46,.08))}
.catalog-item:hover .workflow-logo{transform:translateY(-2px)}
.sidebar{position:sticky;top:98px;align-self:start;min-height:calc(100vh - 126px);padding-right:18px}
.side-brand{display:flex;align-items:center;gap:10px;margin-bottom:22px;padding:0 4px 18px;border-bottom:1px solid var(--line)}
.side-brand b{display:block;color:var(--ink);font-size:17px}.side-brand small{display:block;margin-top:3px;color:var(--muted);font-size:8px}
.brand-emblem{width:53px;height:53px;background-position:33.333333% 100%}
.sidebar>.eyebrow{font-size:9px;margin-bottom:10px;padding-left:12px}
.side-shortcuts{margin-top:25px;padding-top:19px;border-top:1px solid var(--line)}
.side-shortcuts>.eyebrow{padding-left:12px;margin-bottom:8px}
.side-shortcuts button{width:100%;display:flex;align-items:center;gap:8px;padding:6px 8px;border:0;background:none;color:var(--text);text-align:left;border-radius:6px;font-size:11px;transition:background 180ms ease}
.side-shortcuts button:hover{background:var(--soft)}.side-shortcuts .workflow-logo{width:32px;height:32px}.shortcut-arrow{margin-left:auto;color:var(--muted)}
.side-library{display:flex;flex-direction:column;align-items:flex-start;margin:24px 0 18px;padding:15px 12px;border:0;border-top:1px solid var(--line);background:none;text-align:left;color:var(--ink)}
.library-emblem{width:66px;height:66px;background-position:100% 100%;margin-bottom:9px}.side-library b{font-size:13px}.side-library small{font-size:10px;color:var(--muted);margin-top:5px}.side-library>span:last-child{color:var(--teal);font-size:11px;margin-top:13px}.side-status{margin-top:8px}
@media(max-width:850px){.sidebar{position:static;min-height:0;padding-right:0}.side-brand,.side-shortcuts,.side-library{display:none}}
@media(max-width:600px){.catalog-item{grid-template-columns:48px minmax(0,1fr) auto 14px;gap:8px;padding:13px 0}.catalog-item .workflow-logo{width:48px;height:48px}.catalog-copy b{font-size:13px}.catalog-meta b{font-size:11px}}

@media(min-width:851px){.sidebar{max-height:none;overflow:visible}}
.video-channel-note{display:flex;align-items:center;gap:12px;margin:18px 0;padding:12px 16px;border:1px solid color-mix(in srgb,var(--teal) 18%,var(--line));border-radius:8px;background:color-mix(in srgb,var(--teal) 5%,var(--panel));color:var(--ink)}
.video-channel-note .channel-mark{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:var(--teal);color:#fff;font-weight:700}
.video-channel-note b,.video-channel-note small{display:block}.video-channel-note small{margin-top:3px;color:var(--muted);font-size:11px}

/* Shared neutral imagery: accent comes from CSS, never baked-in gold icon pixels. */
.featured-scene{isolation:isolate}
.featured-scene:after{content:"";position:absolute;inset:0;pointer-events:none;background:var(--art-wash);mix-blend-mode:color;opacity:var(--art-wash-opacity)}
:root{--art-saturation:.82;--art-wash:transparent;--art-wash-opacity:0;--icon-accent:var(--teal)}
[data-theme=dark]{--art-saturation:.72;--art-wash:rgba(12,95,101,.20);--art-wash-opacity:.55}
[data-palette=blue]{--art-saturation:.78;--art-wash:rgba(49,109,211,.33);--art-wash-opacity:.62}
.workflow-logo,.brand-emblem,.library-emblem{background-image:none!important;background-color:color-mix(in srgb,var(--icon-accent) 7%,var(--panel));border:1px solid color-mix(in srgb,var(--icon-accent) 18%,var(--line));border-radius:8px;color:var(--icon-accent);display:grid;place-items:center;filter:none!important}
.workflow-logo svg{width:27px;height:27px;display:block}
.side-shortcuts .workflow-logo svg{width:19px;height:19px}
.brand-emblem svg{width:31px;height:31px}.library-emblem svg{width:29px;height:29px}
.home-hero-media{filter:saturate(.88) contrast(1.04);opacity:.92}
.home-hero{background:var(--text)}
.home-hero-shade{background:linear-gradient(90deg,rgba(9,18,24,.92),rgba(9,18,24,.55) 48%,rgba(9,18,24,.08))}
.featured-scene{filter:saturate(var(--art-saturation)) contrast(1.02)}
[data-palette=blue] .home-hero-media{filter:saturate(.74) contrast(1.06)}
[data-palette=blue]{--hero-shade-a:rgba(9,22,46,.91);--hero-shade-b:rgba(11,37,71,.58);--hero-shade-c:rgba(12,42,81,.09)}
.scene-label{background:rgba(25,31,35,.8)}

/* Mobile containment and button normalization. */
.sidebar,.nav,.agent-card{min-width:0}.agent-card{width:100%;text-align:left}
.mode-switch{width:min(100%,300px);min-height:62px;margin:0 0 14px auto;padding:4px;display:grid;grid-template-columns:1fr 1fr;gap:4px;border:1px solid var(--line);border-radius:8px;background:var(--soft)}.mode-option{min-height:52px;padding:7px 11px;border:1px solid transparent;border-radius:6px;background:var(--panel);color:var(--text);display:flex;flex-direction:column;align-items:flex-start;justify-content:center}.mode-option b{font-size:13px;color:inherit}.mode-option small{font-size:11px;color:var(--muted)}.mode-option.active{border-color:var(--gold);background:var(--teal);color:#fff}.mode-option.active small{color:#d8f1ed}.config-notice{margin:-4px 0 14px;padding:10px 13px;border:1px solid color-mix(in srgb,var(--gold) 40%,var(--line));border-radius:6px;background:color-mix(in srgb,var(--gold) 8%,var(--panel));color:var(--muted);font-size:12px}.provider-card{grid-row:span 2}.provider-card .button{margin-top:2px}.setting-facts{display:grid;gap:8px}.setting-facts span{display:flex;align-items:center;justify-content:space-between;padding:11px;border:1px solid var(--line);border-radius:6px;background:var(--soft)}.setting-facts b{font-size:12px}.setting-facts small{color:var(--muted)}
.settings-actions{display:flex;justify-content:flex-end;gap:8px}.provider-test-result{min-height:18px;color:var(--muted);font-size:11px}.provider-test-result.success{color:var(--success)}.provider-test-result.failed{color:var(--danger)}
.detail-assist{grid-column:1/-1;padding:14px;display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;border:1px solid color-mix(in srgb,var(--teal) 34%,var(--line));border-radius:7px;background:color-mix(in srgb,var(--teal) 6%,var(--panel))}.detail-assist b{color:var(--ink)}.detail-assist p{margin:4px 0 0;color:var(--muted);font-size:11px;line-height:1.55}.detail-assist-feedback{grid-column:1/-1;padding-top:10px;border-top:1px solid var(--line);color:var(--teal);font-size:11px}.detail-assist-feedback .text-button{margin-left:8px}
.workflow-map{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;margin-bottom:14px;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--line)}.workflow-map span{min-height:55px;padding:9px 11px;display:flex;align-items:center;gap:8px;background:var(--panel);color:var(--muted);font-size:11px}.workflow-map span.active{background:color-mix(in srgb,var(--gold) 9%,var(--panel));color:var(--ink)}.workflow-map span.complete{background:var(--soft);color:var(--teal)}.workflow-map i{font-style:normal;color:var(--gold);font-size:10px;font-weight:700}.result-toolbar>div{display:grid;gap:2px}.result-toolbar small{color:var(--muted);font-size:10px}.result-actions{display:flex;gap:8px}.status.waiting_confirmation{color:var(--gold)}.plan-editor{display:grid;gap:8px}.plan-editor>span{color:var(--ink);font-weight:700}.plan-editor textarea{width:100%;min-height:390px;padding:14px;border:1px solid var(--line);border-radius:6px;background:var(--soft);color:var(--text);resize:vertical;line-height:1.7}.plan-editor small{color:var(--muted);font-size:11px}
.result-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:18px;padding-top:18px;border-top:1px solid var(--line)}.result-gallery figure{margin:0;border:1px solid var(--line);border-radius:7px;overflow:hidden;background:var(--soft)}.result-gallery img{width:100%;aspect-ratio:1/1;display:block;object-fit:cover}.result-gallery figcaption{min-height:38px;padding:8px 10px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--muted);font-size:10px}.gallery-actions{display:flex;align-items:center;gap:8px}.result-gallery a,.result-gallery button{border:0;padding:0;background:none;color:var(--teal);font-size:10px;font-weight:700;line-height:1.2;text-decoration:none}.result-gallery button:disabled{color:var(--muted)}
.result-gallery.is-sortable figure[draggable="true"]{cursor:grab;transition:opacity .16s ease,transform .16s ease,border-color .16s ease}.result-gallery.is-sortable figure[draggable="true"]:active{cursor:grabbing}.result-gallery figure.dragging{opacity:.5;transform:scale(.985);border-color:var(--accent)}.gallery-actions button[aria-label^="上移"],.gallery-actions button[aria-label^="下移"]{width:24px;height:24px;border:1px solid var(--line);border-radius:4px;font-size:13px}
.image-tuning{border-top:1px solid var(--line);padding:8px 10px}.image-tuning summary{cursor:pointer;color:var(--muted);font-size:10px}.image-tuning textarea{width:100%;min-height:68px;margin-top:8px;padding:8px;border:1px solid var(--line);border-radius:5px;background:var(--panel);color:var(--text);font-size:11px;line-height:1.5;resize:vertical}
.file-delivery{margin-bottom:16px;padding:14px;display:grid;grid-template-columns:40px 1fr auto;align-items:center;gap:11px;border:1px solid color-mix(in srgb,var(--gold) 45%,var(--line));border-radius:7px;background:color-mix(in srgb,var(--gold) 7%,var(--panel));color:var(--text);text-decoration:none}.file-delivery>span{width:40px;height:40px;display:grid;place-items:center;border-radius:6px;background:var(--gold);color:#fff;font-size:18px}.file-delivery b,.file-delivery small{display:block}.file-delivery b{color:var(--ink);font-size:12px}.file-delivery small{margin-top:3px;color:var(--muted);font-size:10px}.file-delivery strong{color:var(--teal);font-size:11px}
.video-delivery{margin-bottom:16px;border:1px solid var(--line);border-radius:7px;overflow:hidden;background:#071a20}.video-delivery video{width:100%;max-height:540px;display:block;background:#000}.video-delivery a{min-height:42px;padding:0 13px;display:flex;align-items:center;justify-content:flex-end;color:var(--gold2);font-size:11px;font-weight:700;text-decoration:none}
.upload-disabled{opacity:.72;cursor:not-allowed;text-align:left}.upload-disabled small{display:block;margin-top:6px}.video-task-state{display:grid;gap:10px;padding:18px;border:1px solid var(--line);border-radius:7px;background:var(--soft)}.video-task-state progress{width:100%;accent-color:var(--gold)}
.structured-panel{margin-bottom:16px;padding:16px;border:1px solid var(--line);border-radius:8px;background:color-mix(in srgb,var(--soft) 72%,var(--panel))}.structured-title{display:flex;justify-content:space-between;gap:12px;margin-bottom:12px}.structured-title small{color:var(--muted)}.candidate-grid,.screen-plan-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.candidate-card,.chapter-row{border:1px solid var(--line);border-radius:7px;background:var(--panel);color:var(--text);text-align:left}.candidate-card{min-height:128px;padding:13px;display:grid;align-content:start;gap:5px}.candidate-card small,.candidate-card p,.chapter-row small{color:var(--muted)}.candidate-card p{margin:3px 0 0;font-size:10px;line-height:1.5}.candidate-card.selected,.chapter-row.selected{border-color:var(--gold);box-shadow:inset 3px 0 var(--gold)}.interview-list{margin:0;padding-left:22px;display:grid;gap:9px;line-height:1.55}.chapter-list{display:grid;gap:7px}.chapter-row{padding:11px;display:grid;grid-template-columns:30px minmax(120px,.7fr) 1fr;align-items:center;gap:8px}.chapter-row>span{color:var(--gold);font:600 12px Georgia}.screen-plan-grid article{min-height:105px;padding:12px;border-left:2px solid var(--teal);background:var(--panel)}.screen-plan-grid article>span{color:var(--gold);font-size:9px}.screen-plan-grid article b{display:block;margin:6px 0}.screen-plan-grid article p{margin:0;color:var(--muted);font-size:10px;line-height:1.5}.screen-plan-grid article small{display:block;margin-top:7px;color:var(--teal)}
.interview-panel{display:grid;gap:14px}.interview-panel .structured-title{margin:0}.interview-panel .structured-title>div{display:flex;align-items:baseline;gap:10px}.interview-current{color:var(--gold)!important;font-weight:700}.interview-progress{height:4px;overflow:hidden;border-radius:2px;background:var(--line)}.interview-progress span{height:100%;display:block;background:var(--gold);transition:width .24s ease}.interview-panel h3{margin:2px 0 0;color:var(--ink);font-size:17px;line-height:1.55}.interview-panel textarea{min-height:190px}.interview-count{justify-self:end;color:var(--muted)}.interview-actions{display:flex;justify-content:space-between;gap:9px}
@media(max-width:600px){.candidate-grid,.screen-plan-grid{grid-template-columns:1fr}.chapter-row{grid-template-columns:26px 1fr}.chapter-row small{grid-column:2}}
@media(max-width:600px){.detail-assist{grid-template-columns:1fr}.detail-assist .button{width:100%}}
.recharge-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.recharge-panel{padding:22px}.recharge-panel h2{margin:0 0 7px;color:var(--ink);font-size:18px}.recharge-panel>p{margin:0 0 20px;color:var(--muted)}.code-input{text-transform:uppercase;letter-spacing:.08em}.redeem-note{padding:11px;border-radius:6px;background:var(--soft);color:var(--muted);font-size:11px}.package-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:16px}.package{min-height:72px;padding:11px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--text);display:grid;text-align:left;position:relative}.package b{color:var(--ink)}.package span{color:var(--gold);font-weight:700}.package small{position:absolute;right:8px;top:8px;color:var(--gold)}.package.selected{border-color:var(--gold);background:color-mix(in srgb,var(--gold) 8%,var(--panel))}.payment-method{display:flex;align-items:center;gap:11px;padding:13px;margin-bottom:14px;border:1px solid var(--line);border-radius:6px;background:var(--soft)}.payment-method span b,.payment-method span small{display:block}.payment-method span small{color:var(--muted);font-size:10px}.payment-method i{margin-left:auto;color:var(--muted);font-size:11px;font-style:normal}.payment-icon{width:34px;height:34px;border-radius:6px;background:#20a96b;color:white;display:grid!important;place-items:center}.order-preview{margin-top:14px;padding:18px 22px;display:flex;align-items:center;justify-content:space-between}.order-preview h3{margin:0;color:var(--ink)}.order-preview p{margin:4px 0 0;color:var(--muted);font-size:11px}.order-preview>span{color:var(--gold);font-size:10px;font-weight:700;letter-spacing:.12em}
@media(max-width:850px){.app-layout{display:block}.nav{width:100%;max-width:calc(100vw - 40px);overflow-x:auto}.nav button{flex:0 0 auto}.main{padding-top:18px}}
@media(max-width:700px){.recharge-grid{grid-template-columns:1fr}.order-preview{align-items:flex-start;gap:14px;flex-direction:column}.workflow-map{grid-template-columns:repeat(2,minmax(0,1fr))}.task-toolbar{grid-template-columns:1fr 1fr}.task-toolbar>b{text-align:left}}@media(max-width:600px){.nav{max-width:calc(100vw - 28px)}.mode-switch{width:100%;margin-left:0}.workflow-map span{min-height:48px;padding:8px;font-size:10px}.result-gallery{grid-template-columns:1fr}.task-toolbar{grid-template-columns:1fr}.task-toolbar>b{padding-bottom:0}}
@media(max-width:440px){.auth-screen{place-items:start center;padding-top:max(48px,env(safe-area-inset-top))}.auth-card{width:calc(100vw - 28px);max-width:none;margin:0;padding:24px 20px}.auth-heading{margin:22px 0 18px}.auth-heading h1{font-size:24px}.auth-card .field,.auth-card .input,.auth-card input{min-width:0;width:100%}.auth-card .button{width:100%}}

/* Phone layout: compact chrome, touch-friendly navigation and readable data rows. */
@media(max-width:600px){
  .app-shell{padding:0 14px 30px}
  .topbar{height:66px;gap:8px}
  .topbar .brand{gap:8px;min-width:0}
  .topbar .brand-mark{width:36px;height:36px;flex:0 0 36px}
  .topbar .brand b{font-size:13px;white-space:nowrap}
  .topbar .brand small,.topbar .icon-button,.topbar .profile-button>span:last-child,.topbar .credit-pill span{display:none}
  .top-actions{gap:7px;min-width:0}
  .theme-switch{height:36px;padding:2px}
  .theme-switch button{width:27px;min-height:30px}
  .credit-pill{height:36px;padding:0 10px}
  .profile-button{width:36px;height:36px;padding:0;justify-content:center}
  .app-layout{padding-top:18px}
  .sidebar{padding-bottom:0;border-right:0;border-bottom:1px solid var(--line)}
  .sidebar>.eyebrow,.side-status{display:none}
  .nav{max-width:none;width:100%;gap:4px;padding:0 0 8px;scrollbar-width:none;scroll-snap-type:x proximity;overscroll-behavior-inline:contain}
  .nav::-webkit-scrollbar{display:none}
  .nav button{height:42px;padding:0 12px;scroll-snap-align:center;white-space:nowrap}
  .nav button span{width:16px;font-size:14px}
  .main{padding-top:18px}
  .page-head{margin-bottom:20px;align-items:flex-start}
  .page-head h1{font-size:25px}
  .page-head>div:first-child>p:last-child{font-size:12px;line-height:1.7}
  .head-actions{width:100%}
  .head-actions .button{width:100%}
  .panel{border-radius:8px}
  .table-panel{padding:0;border:0;background:transparent;box-shadow:none;overflow:visible}
  .table,.table tbody,.table tr,.table td{display:block;width:100%;min-width:0}
  .table thead{display:none}
  .table tr{margin-bottom:10px;padding:14px;border:1px solid var(--line);border-radius:8px;background:var(--panel);box-shadow:var(--shadow)}
  .table td{padding:5px 0;border:0;color:var(--muted)}
  .table td:first-child{padding-top:0;color:var(--ink);font-size:14px}
  .table td:last-child{padding-bottom:0}
  .task-actions{justify-content:flex-start}
  .settings-actions,.result-actions{flex-wrap:wrap}
  .settings-actions .button,.result-actions .button{flex:1 1 120px}
  .file-delivery{grid-template-columns:36px minmax(0,1fr);padding:12px}
  .file-delivery>span{width:36px;height:36px}
  .file-delivery strong{grid-column:2}
}

/* Mobile chrome uses the same brighter jade-and-gold contrast as the cards. */
@media(max-width:820px){
  .topbar .brand-mark{color:var(--brand-accent);filter:drop-shadow(0 3px 5px color-mix(in srgb,var(--gold) 28%,transparent))}
  .topbar .credit-pill b{color:var(--gold);font-weight:800}
  .topbar .appearance-menu summary,.topbar .icon-button{color:var(--teal)}
  .sidebar .nav button .nav-icon{color:var(--teal)}
  .sidebar .nav button.active{background:color-mix(in srgb,var(--gold) 13%,var(--mobile-navigation-surface));color:var(--ink)}
  .sidebar .nav button.active .nav-icon{color:var(--gold)}
  .sidebar .nav button.active:after{background:var(--gold);box-shadow:0 0 8px color-mix(in srgb,var(--gold) 55%,transparent)}
  .catalog-view-switch{border-color:color-mix(in srgb,var(--teal) 35%,var(--line));box-shadow:0 3px 12px color-mix(in srgb,var(--teal) 10%,transparent)}
  .catalog-view-switch button.active{background:color-mix(in srgb,var(--teal) 14%,var(--panel));color:var(--teal)}
}
@media(max-width:350px){
  .app-shell{padding-inline:10px}
  .topbar .brand b{font-size:12px}
  .theme-switch button{width:24px}
  .credit-pill{padding:0 8px}
  .nav button{padding-inline:10px}
}

.catalog-title-actions{display:flex;align-items:center;gap:12px}.catalog-title-actions>p{margin:0;color:var(--muted);font-size:11px}.catalog-view-switch{height:34px;padding:3px;display:flex;border:1px solid var(--line);border-radius:6px;background:var(--panel)}.catalog-view-switch button{width:32px;border:0;border-radius:4px;background:transparent;color:var(--muted)}.catalog-view-switch button.active{background:var(--soft);color:var(--teal)}.catalog-view-switch svg{width:17px;height:17px;display:block;margin:auto}
.catalog-grid.compact-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:14px}.compact-grid .catalog-item{min-height:178px;padding:18px;border:1px solid var(--line);border-radius:8px;background:var(--panel);display:flex;align-items:flex-start;flex-direction:column}.compact-grid .catalog-copy{margin-top:12px}.compact-grid .catalog-copy small{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.compact-grid .catalog-meta{margin-top:auto;text-align:left}.compact-grid .catalog-arrow{position:absolute;right:16px;bottom:16px}.compact-grid .catalog-item{position:relative}
@media(max-width:850px){.catalog-grid.compact-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){
  body{padding-bottom:calc(72px + env(safe-area-inset-bottom))}
  .app-shell{padding-bottom:22px}
  .sidebar{position:fixed;top:auto;left:0;right:0;bottom:0;z-index:30;padding:0 6px env(safe-area-inset-bottom);border:0;border-top:1px solid var(--line);background:color-mix(in srgb,var(--bg) 92%,transparent);box-shadow:0 -10px 28px color-mix(in srgb,var(--ink) 8%,transparent);backdrop-filter:blur(18px)}
  .sidebar .nav{height:64px;max-width:none;padding:5px 0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;overflow:visible;scroll-snap-type:none}
  .sidebar .nav button{height:54px;min-width:0;padding:4px 2px;display:flex;flex-direction:column;justify-content:center;gap:3px;border-radius:6px;text-align:center;font-size:10px;line-height:1.15;white-space:nowrap}
  .sidebar .nav button .nav-icon{width:28px;height:28px;flex:0 0 28px;color:color-mix(in srgb,var(--teal) 54%,var(--muted))}
  .sidebar .nav button .nav-icon svg{width:24px;height:24px;stroke-width:1.7}
  .sidebar .nav button.active{box-shadow:none;background:color-mix(in srgb,var(--teal) 8%,var(--panel));color:var(--ink)}
  .sidebar .nav button.active .nav-icon{color:var(--navigation-accent)}
  .sidebar .nav button.active:after{content:"";position:absolute;top:0;width:22px;height:2px;border-radius:2px;background:var(--gold)}
  .sidebar .nav button{position:relative}
  .catalog-title{width:100%;flex-direction:row;align-items:flex-end}
  .catalog-title-actions{margin-left:auto;flex-direction:column;align-items:flex-end;gap:7px}
  .catalog-grid.compact-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .compact-grid .catalog-item{min-height:142px;padding:14px;gap:8px}
  .compact-grid .catalog-item .workflow-logo{width:44px;height:44px}
  .compact-grid .catalog-copy{margin-top:0}
  .compact-grid .catalog-copy b{font-size:13px;line-height:1.45}
  .compact-grid .catalog-copy small{display:none}
  .compact-grid .catalog-meta{padding-right:16px}
  .compact-grid .catalog-meta small{display:none}
  .compact-grid .catalog-arrow{right:14px;bottom:14px}
}

/* Shared finishing rules for readable controls and stable theme states. */
html{scroll-padding-top:90px}
.home-catalog{scroll-margin-top:90px}
.catalog-item:focus-visible,.featured-card:focus-visible{outline:2px solid var(--teal);outline-offset:3px}
.catalog-view-switch{height:42px}
.catalog-view-switch button{width:38px}
.catalog-grid.compact-grid .catalog-item:hover{border-color:var(--line2);background:var(--soft)}
.catalog-copy b,.result-toolbar b,.table td,.setting-facts span{overflow-wrap:anywhere}
.result-toolbar{flex-wrap:wrap;gap:12px}
.result-toolbar>div{min-width:0}
.result-content{overflow-wrap:anywhere}
.field,.form-grid>*{min-width:0}
[data-theme=dark] .mode-option.active{color:var(--bg)}
[data-theme=dark] .mode-option.active small{color:var(--bg)}
@media(max-width:850px) and (min-width:601px){
  .nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));max-width:none;overflow:visible}
  .nav button{justify-content:center;padding:0 5px;gap:5px;font-size:12px}
}
@media(max-width:600px){
  .app-layout .main{padding-top:0}
  .filter,.choice{min-height:40px}
  input,textarea,select,.input,.textarea,.select,.image-tuning textarea{font-size:16px}
  .toast-region{bottom:calc(84px + env(safe-area-inset-bottom))}
  .table td:before{display:inline-block;min-width:66px;color:var(--muted);font-size:11px}
  .table td:nth-child(2):before{content:'智能体'}
  .table td:nth-child(3):before{content:'阶段'}
  .table td:nth-child(4):before{content:'时间'}
  .table td:nth-child(5):before{content:'积分'}
  .table td:nth-child(6):before{content:'状态'}
}
.tool-search{width:min(560px,calc(100vw - 28px));max-height:80dvh;padding:22px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);box-shadow:var(--shadow)}
.tool-search::backdrop{background:rgba(5,17,25,.5);backdrop-filter:blur(7px)}
.search-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;color:var(--ink);font-weight:600}
.search-heading button{width:36px;height:36px;border:0;background:none;color:var(--muted);font-size:25px}
.tool-search input{width:100%;height:46px;padding:0 12px;border:1px solid var(--line);border-radius:6px;background:var(--soft);color:var(--text);font-size:16px}
.search-results{margin-top:12px;max-height:50dvh;overflow:auto}
.search-results>button{display:flex;align-items:center;gap:12px;width:100%;padding:12px 6px;border:0;border-bottom:1px solid var(--line);background:none;color:var(--text);text-align:left}
.search-results>button:hover,.search-results>button:focus-visible{background:var(--soft)}
.search-results .workflow-logo{width:36px;height:36px}.search-results .workflow-logo svg{width:23px;height:23px}
.search-results small{display:block;color:var(--muted);font-size:11px}.search-results strong{margin-left:auto;white-space:nowrap;color:var(--gold);font-size:11px}.search-empty{padding:30px 0;text-align:center;color:var(--muted)}
@media(max-width:600px){.topbar #searchButton{display:block;width:32px;font-size:22px}.tool-search{padding:16px}.search-results b{font-size:13px}.top-actions{gap:3px!important}}
/* Raster brand identity and uncluttered header controls. */
.brand-mark,.brand-image{position:relative;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important;color:var(--ink)}
.brand-mark:before,.brand-image:before{content:"";display:block;width:100%;height:100%;background:currentColor;mask:url('./assets/miaoxiang-mark.png') center/contain no-repeat;-webkit-mask:url('./assets/miaoxiang-mark.png') center/contain no-repeat}
.topbar .brand-mark{width:40px;height:40px;flex-basis:40px}.brand small{letter-spacing:0}
.topbar .icon-button,.topbar .credit-pill,.topbar .profile-button{border:0;background:transparent;box-shadow:none}
.topbar .credit-pill b{color:var(--ink)}
.topbar .icon-button:hover,.topbar .credit-pill:hover,.topbar .profile-button:hover{background:var(--soft)}
.appearance-menu{position:relative}
.appearance-menu>summary{list-style:none;width:38px;height:38px;display:grid;place-items:center;cursor:pointer;border-radius:6px;color:var(--muted)}
.appearance-menu>summary::-webkit-details-marker{display:none}
.appearance-menu>summary:hover,.appearance-menu[open]>summary{background:var(--soft);color:var(--teal)}
.appearance-glyph{font-size:23px;line-height:1}
.appearance-popover{position:absolute;right:0;top:calc(100% + 12px);width:236px;padding:18px;background:var(--panel);border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow);z-index:40}
.appearance-title{display:block;color:var(--ink);font-weight:600;margin-bottom:18px}
.appearance-popover .appearance-controls{display:grid;grid-template-columns:1fr auto;align-items:center;gap:16px 12px}
.appearance-label{font-size:12px;color:var(--muted)}
.appearance-popover .palette-switch,.appearance-popover .theme-switch{border:0;background:var(--soft);height:40px}
.appearance-popover .theme-switch button{width:34px}
.appearance-popover .palette-swatch{width:30px;height:30px}
.appearance-popover .theme-switch button.selected{background:var(--panel);box-shadow:0 1px 4px #00000010}
@media(max-width:600px){.topbar .brand-button>span:last-child{display:block}.topbar .brand b{font-size:12px}.topbar .brand-mark{width:32px;height:36px;flex-basis:32px}.topbar .brand{gap:8px}.topbar .appearance-menu>summary{width:36px;height:40px}.appearance-popover{right:-70px}.topbar .credit-pill{padding:0 7px}}

/* Palette and luminance are independent; all combinations share one transition. */
:root{--hero-shade-a:rgba(9,18,24,.92);--hero-shade-b:rgba(9,18,24,.55);--hero-shade-c:rgba(9,18,24,.08)}
[data-palette=blue][data-theme=dark]{color-scheme:dark;--bg:#101b2d;--panel:#18273e;--soft:#20344f;--strong:#294561;--ink:#edf4ff;--text:#dae6f5;--muted:#a4b7d0;--line:#344b69;--line2:#4b6687;--gold:#89b8ff;--gold2:#b4d5ff;--teal:#88c1f5;--catalog-price:#dae6f5;--navigation-accent:#88c1f5;--primary-end:#89b8ff;--danger:#ef97a3;--success:#7cd7ba;--shadow:0 18px 50px rgba(0,0,0,.26)}
.home-hero-shade{background:linear-gradient(90deg,var(--hero-shade-a),var(--hero-shade-b) 48%,var(--hero-shade-c))}
.appearance-controls{display:flex;gap:6px;align-items:center}
.palette-switch{display:flex;align-items:center;gap:3px;padding:3px;border:1px solid var(--line);border-radius:6px;background:var(--panel);height:38px}
.palette-swatch{position:relative;width:28px;height:28px;border:2px solid transparent;border-radius:50%;background:transparent}
.palette-swatch:after{content:"";position:absolute;inset:5px;border-radius:50%;background:var(--swatch)}
.palette-swatch.jade{--swatch:linear-gradient(135deg,#164b54 58%,#dfbd7f 58%)}.palette-swatch.blue{--swatch:#4888e4}
.palette-swatch.selected{border-color:var(--teal)}
.theme-switch svg{width:18px;height:18px;display:block;margin:auto;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:600px){.palette-switch{height:36px;padding:2px}.palette-swatch{width:25px;height:28px}.topbar .brand b{font-size:12px}.topbar .brand{gap:6px}.top-actions{gap:5px}}
@media(max-width:380px){.topbar .brand-button>span:last-child{display:block}.topbar .brand b{font-size:11px}}
@property --bg{syntax:"<color>";inherits:true;initial-value:#f1f5f5}
@property --panel{syntax:"<color>";inherits:true;initial-value:#fff}
@property --soft{syntax:"<color>";inherits:true;initial-value:#e1eeeb}
@property --strong{syntax:"<color>";inherits:true;initial-value:#d8e9e5}
@property --ink{syntax:"<color>";inherits:true;initial-value:#123e47}
@property --text{syntax:"<color>";inherits:true;initial-value:#264f58}
@property --muted{syntax:"<color>";inherits:true;initial-value:#526f77}
@property --line{syntax:"<color>";inherits:true;initial-value:#d1dddd}
@property --line2{syntax:"<color>";inherits:true;initial-value:#c7d8d8}
@property --gold{syntax:"<color>";inherits:true;initial-value:#866327}
@property --gold2{syntax:"<color>";inherits:true;initial-value:#ead0a0}
@property --teal{syntax:"<color>";inherits:true;initial-value:#1c626a}
@property --danger{syntax:"<color>";inherits:true;initial-value:#bd554b}
@property --success{syntax:"<color>";inherits:true;initial-value:#2d8168}
@property --art-wash{syntax:"<color>";inherits:true;initial-value:transparent}
@property --hero-shade-a{syntax:"<color>";inherits:true;initial-value:rgba(9,18,24,.92)}
@property --hero-shade-b{syntax:"<color>";inherits:true;initial-value:rgba(9,18,24,.55)}
@property --hero-shade-c{syntax:"<color>";inherits:true;initial-value:rgba(9,18,24,.08)}
@property --catalog-price{syntax:"<color>";inherits:true;initial-value:#866327}
@property --navigation-accent{syntax:"<color>";inherits:true;initial-value:#866327}
@property --primary-end{syntax:"<color>";inherits:true;initial-value:#bc9759}
@property --page-heading{syntax:"<color>";inherits:true;initial-value:#0a3a45}
@property --brand-accent{syntax:"<color>";inherits:true;initial-value:#866327}
@property --workflow-icon{syntax:"<color>";inherits:true;initial-value:#866327}
@property --header-surface{syntax:"<color>";inherits:true;initial-value:#e8f0ef}
@property --navigation-surface{syntax:"<color>";inherits:true;initial-value:#e8f0ef}
@property --mobile-navigation-surface{syntax:"<color>";inherits:true;initial-value:#e8f0ef}
@property --field-surface{syntax:"<color>";inherits:true;initial-value:#f5f8f7}
@property --catalog-highlight{syntax:"<color>";inherits:true;initial-value:#fbfdfc}
@property --catalog-rim{syntax:"<color>";inherits:true;initial-value:#fff}
@property --catalog-sheen{syntax:"<color>";inherits:true;initial-value:#ffffffaa}
@property --catalog-icon-surface{syntax:"<color>";inherits:true;initial-value:#e1eeeb}
@property --catalog-icon-highlight{syntax:"<color>";inherits:true;initial-value:#f0f5f0}
@property --chrome-art-opacity{syntax:"<number>";inherits:true;initial-value:.07}
@media(prefers-reduced-motion:no-preference){:root.appearance-ready{transition:--bg 480ms ease-in-out,--panel 480ms ease-in-out,--soft 480ms ease-in-out,--strong 480ms ease-in-out,--ink 480ms ease-in-out,--text 480ms ease-in-out,--muted 480ms ease-in-out,--line 480ms ease-in-out,--line2 480ms ease-in-out,--gold 480ms ease-in-out,--gold2 480ms ease-in-out,--teal 480ms ease-in-out,--catalog-price 480ms ease-in-out,--navigation-accent 480ms ease-in-out,--primary-end 480ms ease-in-out,--page-heading 480ms ease-in-out,--brand-accent 480ms ease-in-out,--workflow-icon 480ms ease-in-out,--header-surface 480ms ease-in-out,--navigation-surface 480ms ease-in-out,--mobile-navigation-surface 480ms ease-in-out,--field-surface 480ms ease-in-out,--catalog-highlight 480ms ease-in-out,--catalog-rim 480ms ease-in-out,--catalog-sheen 480ms ease-in-out,--catalog-icon-surface 480ms ease-in-out,--catalog-icon-highlight 480ms ease-in-out,--chrome-art-opacity 480ms ease-in-out,--danger 480ms ease-in-out,--success 480ms ease-in-out,--art-wash 480ms ease-in-out,--hero-shade-a 480ms ease-in-out,--hero-shade-b 480ms ease-in-out,--hero-shade-c 480ms ease-in-out}.home-hero-media,.featured-scene,.featured-scene:after{transition:filter 480ms ease-in-out,opacity 480ms ease-in-out}}
.resume-notice{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 0;margin-bottom:20px;border-block:1px solid currentColor}
.resume-notice p{margin:6px 0 0;font-size:14px}
.resume-actions{display:flex;flex-wrap:wrap;gap:8px;flex-shrink:0}
@media(max-width:600px){.resume-notice{align-items:flex-start;flex-direction:column}.resume-actions{width:100%}.resume-actions .button{flex:1}}
.flow-steps{list-style:none;display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1px;margin:20px 0;padding:0;border:1px solid var(--line);border-radius:6px;overflow:hidden}
.flow-steps li{display:grid;grid-template-columns:24px 1fr;gap:6px;padding:14px;min-width:0;background:var(--panel)}
.flow-steps li small{grid-column:2;font-size:12px}.flow-steps li.active{box-shadow:inset 0 -3px currentColor}.flow-steps li.complete>span{font-weight:bold}
.chat-history{display:grid;gap:16px;margin-bottom:20px}.chat-message{padding:14px 0;border-bottom:1px solid var(--line)}.chat-message div{white-space:pre-wrap;overflow-wrap:anywhere;margin-top:8px;line-height:1.75}.chat-message.user{padding-left:12px;border-left:2px solid currentColor}
.asset-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}.project-dialog{width:min(480px,calc(100% - 32px));padding:24px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:8px;opacity:0;transform:translateY(10px) scale(.98);transition:opacity 180ms ease,transform 220ms cubic-bezier(.22,1,.36,1)}.project-dialog[open]{opacity:1;transform:none}.project-dialog::backdrop{background:#0008;opacity:0;transition:opacity 180ms ease}.project-dialog[open]::backdrop{opacity:1}
.task-actions{justify-content:flex-end}.task-actions .text-button{transition:color 160ms ease,transform 160ms ease}.task-actions .text-button:hover{transform:translateX(-2px)}.workflow-logo svg{transition:transform 220ms cubic-bezier(.22,1,.36,1)}.workflow-logo:hover svg{transform:scale(1.08) rotate(-3deg)}
.table tr.removing,.agent-card.removing{opacity:0;transform:translateX(14px);transition:opacity 220ms ease,transform 220ms ease}
#chatFollowup{display:grid;gap:12px;margin-top:20px}#chatFollowup .button{justify-self:end}
@media(max-width:600px){.flow-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.flow-steps li{padding:10px;font-size:13px}.asset-actions .button{flex:1}.result-toolbar{flex-wrap:wrap}.project-dialog h2{font-size:20px}}
.detail-field-actions{display:flex;flex-wrap:wrap;gap:12px;flex-basis:100%}
.task-elapsed{display:block;color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums;margin-top:4px}
.task-error{padding:12px;border-left:2px solid var(--danger);background:var(--soft);overflow-wrap:anywhere;line-height:1.6}
.image-tuning{padding:12px;border-top:1px solid var(--line)}.image-tuning summary{cursor:pointer;color:var(--teal);font-size:12px}.image-tuning .field{margin-top:12px}.image-tuning textarea{min-height:90px;resize:vertical}
.result-gallery figure.is-regenerating img{opacity:.6;transition:opacity 180ms ease}.result-gallery figure.is-regenerating{cursor:progress}
.archived-project{padding:22px}
.upload-zone>span,.upload-zone>small{display:block}
.result-actions>[data-delete-project],.asset-actions>[data-delete-project]{margin-left:auto;flex:0 0 auto}
@media(prefers-reduced-motion:reduce){.result-gallery figure.is-regenerating img{transition:none}}

/* Customer homepage: half-width brand image, working entries in the first viewport. */
.home-overview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;align-items:stretch}
.home-overview .home-hero{height:272px;min-width:0;border:0;border-radius:8px;box-shadow:none}
.home-overview .home-hero-media{object-position:65% center}
.home-overview .home-hero-copy{left:24px;right:24px;top:22px;width:auto;transform:none}
.home-overview .home-hero-copy .eyebrow{margin:0 0 10px;color:#cce2df;font-size:9px;letter-spacing:0}
.home-overview .home-hero-copy h1{font-size:30px;line-height:1.14}
.home-overview .home-hero-copy h1 span{margin-top:7px;font-size:20px}
.home-overview .home-hero-copy>p:not(.eyebrow){margin:12px 0 15px;font-size:12px;line-height:1.5;color:#d5e3df}
.home-overview .hero-actions{flex-direction:row}
.home-overview .hero-actions .button{min-height:34px;padding:0 12px;font-size:12px}
.home-overview .hero-actions svg{width:15px;height:15px}
.home-overview .home-hero-meta{left:24px;right:24px;bottom:15px;padding-top:11px;gap:14px}
.home-overview .home-hero-meta span{min-width:0;flex:1;display:flex;flex-wrap:wrap;gap:3px 6px}
.home-overview .home-hero-meta b{font:600 16px/1.3 "Segoe UI","Microsoft YaHei",sans-serif;color:#f2e5bd}
.home-overview .home-hero-meta small{font-size:10px;color:#d0e2df}
.home-workbench{min-width:0;display:flex;flex-direction:column}
.workbench-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.workbench-heading .eyebrow{margin:0 0 4px;font-size:9px;letter-spacing:0;color:var(--muted)}
.workbench-heading h2{margin:0;font-size:20px;line-height:1.3;color:var(--ink)}
.home-workbench .text-button{min-height:40px;display:inline-flex;gap:6px;align-items:center;justify-content:center;flex-shrink:0;padding:0 2px;font-size:12px}
.home-workbench .text-button svg{width:15px;height:15px}
.quick-start-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px;margin:10px 0 0}
.quick-workflow{min-width:0;min-height:82px;display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:11px;padding:10px 4px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;color:var(--text);text-align:left;transition:background-color 180ms ease}
.quick-workflow:hover{background:var(--soft)}
.quick-workflow .workflow-logo{width:38px;height:38px;border-radius:7px}
.quick-workflow .workflow-logo svg{width:24px;height:24px}
.quick-workflow-copy{display:grid;gap:3px;min-width:0}
.quick-workflow-copy b{font-size:14px;line-height:1.4;font-weight:600;color:var(--ink);overflow-wrap:anywhere}
.quick-workflow-copy small{font-size:10px;line-height:1.4;color:var(--muted)}
.quick-workflow-copy>span{color:var(--teal);font-size:10px;font-weight:600}
.workbench-resume{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:auto;padding-top:10px}
.workbench-resume>div{display:flex;align-items:center;gap:10px;min-width:0}
.workbench-resume>div>span:last-child{display:grid;min-width:0}
.workbench-resume b{font-size:12px;line-height:1.5;color:var(--text);font-weight:500;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.workbench-resume small{font-size:10px;color:var(--muted)}
.workbench-folder,.resume-count{width:30px;height:30px;flex:0 0 30px;display:grid;place-items:center;color:var(--teal)}
.workbench-folder svg{width:22px;height:22px}.resume-count{font-size:15px;font-variant-numeric:tabular-nums;background:var(--soft);border-radius:5px}
.home-featured{margin-top:24px}
.home-featured .home-section-title{flex-direction:row;align-items:center;gap:8px;margin-bottom:12px}
.home-featured .home-section-title h2{font-size:17px}
.home-featured .featured-grid{gap:12px}
.home-featured .featured-card{display:grid;grid-template-columns:32% minmax(0,1fr);min-height:136px;box-shadow:none}
.home-featured .featured-scene{height:100%;aspect-ratio:auto;background-size:auto 100%;border:0;border-right:1px solid var(--line)}
.home-featured .featured-scene.scene-video{background-size:auto 140%}
.home-featured .scene-video:before{content:"";position:absolute;left:50%;top:43.6%;transform:translate(-35%,-50%);border-top:6px solid transparent;border-bottom:6px solid transparent;border-left:9px solid #08242b;z-index:1}
.home-featured .scene-label{display:none}
.home-featured .featured-body{display:flex;flex-direction:column;min-width:0;padding:13px}
.home-featured .category{font-size:10px}
.home-featured .featured-card h3{margin:3px 0 5px;font-size:15px;line-height:1.4}
.home-featured .featured-description{font-size:11px;line-height:1.5}
.home-featured .featured-footer{flex-wrap:wrap;gap:4px;margin-top:auto;padding-top:9px;border:0}
.home-featured .featured-price,.home-featured .featured-entry{font-size:10px}
.home-catalog{margin-top:24px}
@media(min-width:851px) and (max-width:1150px){
  .home-overview{gap:18px}
  .home-overview .home-hero-copy{left:18px;right:18px}
  .home-overview .home-hero-copy h1{font-size:27px}
  .home-overview .home-hero-meta{left:18px;right:18px;gap:6px}
  .home-overview .home-hero-meta span{display:grid}
  .quick-start-grid{gap:0 10px}
  .quick-workflow{grid-template-columns:28px minmax(0,1fr);gap:7px;padding-inline:0}
  .quick-workflow .workflow-logo{width:28px;height:30px}
  .quick-workflow .workflow-logo svg{width:20px;height:20px}
  .quick-workflow-copy b{font-size:12px}
  .quick-workflow-copy small{display:none}
  .home-featured .featured-card{grid-template-columns:26% minmax(0,1fr)}
  .home-featured .featured-body{padding:10px}
  .home-featured .featured-description{font-size:10px}
  .home-featured .featured-entry{display:none}
}
@media(max-width:700px){
  .home-overview{grid-template-columns:minmax(0,1fr);gap:20px}
  .home-overview .home-hero{height:216px}
  .home-overview .home-hero-copy{left:20px;right:20px;top:18px}
  .home-overview .home-hero-copy h1{font-size:26px}
  .home-overview .home-hero-copy h1 span{font-size:18px;margin-top:5px}
  .home-overview .home-hero-copy>p:not(.eyebrow){margin:8px 0 10px;font-size:11px}
  .home-overview .home-hero-copy .eyebrow{margin-bottom:6px;font-size:8px}
  .home-overview .hero-actions .button{min-height:30px;font-size:11px}
  .home-overview .home-hero-meta{left:20px;right:20px;bottom:12px;padding-top:9px}
  .home-overview .home-hero-meta b{font-size:14px}
  .home-overview .home-hero-meta small{font-size:9px}
  .workbench-heading h2{font-size:18px}
  .quick-start-grid{margin-top:5px;gap:0 12px}
  .quick-workflow{min-height:76px;gap:9px;grid-template-columns:34px minmax(0,1fr);padding:9px 0}
  .quick-workflow .workflow-logo{width:34px;height:34px}
  .quick-workflow-copy b{font-size:13px}
  .quick-workflow-copy small{font-size:9px}
  .workbench-resume{padding-top:8px}
  .home-featured .featured-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .home-featured .featured-card{display:flex;flex-direction:column;min-height:0}
  .home-featured .featured-scene{height:auto;aspect-ratio:1.9;border-right:0;border-bottom:1px solid var(--line);background-size:300% auto}
  .home-featured .featured-body{padding:10px 8px;flex:1}
  .home-featured .featured-card h3{min-height:36px;margin:0;font-size:12px;line-height:1.5}
  .home-featured .featured-description,.home-featured .category,.home-featured .featured-entry{display:none}
  .home-featured .featured-footer{padding-top:5px}
  .home-featured .home-section-title p{font-size:10px}
}
@media(max-width:360px){
  .quick-workflow-copy b{font-size:12px}
  .quick-workflow-copy small{display:none}
  .quick-workflow{min-height:70px}
  .home-featured .featured-body{padding:8px 6px}
  .home-featured .featured-card h3{font-size:11px;min-height:34px}
}

/* Miaoxiang Chengpian: direct-access directory and source-aligned navigation. */
body{font-size:16px;padding-bottom:0}
.eyebrow{letter-spacing:0;font-size:12px}
.app-shell{max-width:1600px;padding-inline:24px}
.topbar{height:76px;background:var(--header-surface);isolation:isolate}
.topbar:before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,var(--bg) 18%,transparent 60%,var(--bg)),url('./assets/arclight-hero.png') 55% 44%/cover no-repeat;opacity:var(--chrome-art-opacity);pointer-events:none}
.topbar-identity{display:flex;align-items:center;gap:12px;min-width:0}
.brand{gap:10px;text-align:left}.brand b,.side-brand b{font-size:21px;line-height:1.3}
.brand small,.side-brand small{font-size:11px;letter-spacing:0}
.brand-mark{width:40px;height:40px;flex:0 0 40px;color:var(--brand-accent)}
.brand b,.side-brand b,.page-head h1{color:var(--page-heading)}
.brand-mark:before,.brand-image:before{mask-image:url('./assets/miaoxiang-mark.png');-webkit-mask-image:url('./assets/miaoxiang-mark.png')}
.icon-button svg{display:block;width:21px;height:21px;margin:auto;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.mobile-menu-button,#closeNavigation{display:none}
.app-layout{display:grid;grid-template-columns:200px minmax(0,1fr);gap:28px;padding-top:22px}
.main{width:100%;max-width:none;padding-top:0}
.sidebar{position:sticky;top:98px;height:calc(100dvh - 122px);min-height:510px;border:0;border-radius:8px;padding:18px 12px;isolation:isolate;background:var(--navigation-surface);overflow:hidden}
.sidebar:before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(0deg,transparent,var(--soft) 73%),url('./assets/arclight-hero.png') 64% bottom/auto 65% no-repeat;opacity:.16;pointer-events:none}
.side-brand{display:flex;gap:9px;align-items:center;padding:0 2px 18px;margin:0 0 18px;border-bottom:1px solid var(--line)}
.side-brand b{font-size:19px}.side-brand>div{min-width:0}.side-brand small{display:block;margin-top:4px;color:var(--muted)}
.sidebar>.eyebrow{margin:0 12px 8px;color:var(--muted)}
.sidebar .nav{display:grid;grid-template-columns:1fr;gap:6px;height:auto;padding:0;max-width:none;overflow:visible}
.sidebar .nav button{width:100%;height:46px;display:flex;flex-direction:row;justify-content:flex-start;gap:10px;padding:0 12px;font-size:15px;white-space:nowrap;line-height:1.4;text-align:left}
.sidebar .nav button .nav-icon{width:21px;height:21px;flex:0 0 21px}
.sidebar .nav button.active{box-shadow:inset 2px 0 var(--navigation-accent);background:color-mix(in srgb,var(--teal) 11%,var(--panel));color:var(--ink)}
.side-status{display:flex;margin-top:auto;padding:18px 6px 0;background:none}
.side-status b{font-size:13px}.side-status small{font-size:12px}.service-ready .status-dot{background:var(--success)}
.nav-backdrop[hidden]{display:none}
.home-catalog.function-directory{margin-top:0}
.directory-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.directory-heading>div:first-child{display:flex;align-items:baseline;gap:14px}
.directory-heading h1{font-size:26px;line-height:1.3;margin:0;color:var(--page-heading)}
.directory-heading>div>span{font-size:14px;color:var(--muted)}
.function-directory .catalog-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;margin-bottom:14px;border-top:0}
.function-directory .filters{gap:7px}
.function-directory .filter{min-height:38px;padding:0 12px;font-size:14px;border:0;background:transparent}
.function-directory .filter.active{background:var(--strong);color:var(--navigation-accent);box-shadow:inset 0 -2px var(--navigation-accent)}
.directory-search.icon-button{display:block;width:38px;flex:0 0 38px}
.function-directory .catalog-grid{gap:0 22px;margin-top:0}
.function-directory .catalog-item{position:relative;min-height:100px;gap:12px;padding:16px 8px;grid-template-columns:40px minmax(0,1fr) auto 20px}
.function-directory .catalog-item .workflow-logo{width:38px;height:38px;border-radius:7px}
.function-directory .workflow-logo svg{width:26px;height:26px}
.function-directory .catalog-copy{margin:0;gap:7px}
.function-directory .catalog-copy b{font-size:17px;font-weight:600;line-height:1.4}
.function-directory .catalog-copy small{display:block;color:var(--muted);font-size:14px;line-height:1.6;white-space:normal;overflow:visible}
.function-directory .catalog-meta{display:flex;gap:8px;flex-direction:column;text-align:right}
.function-directory .catalog-meta small{font-size:12px;display:block}
.function-directory .catalog-meta b{font-size:13px;font-weight:500;color:var(--catalog-price)}
.catalog-arrow svg{display:block;width:19px;height:19px}
.function-directory .catalog-grid.compact-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
/* Direction A: quiet raised surfaces, with icon, title and price on separate rows. */
.function-directory .compact-grid .catalog-item{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:50px auto 1fr auto;align-items:start;align-content:start;gap:9px 12px;min-height:214px;padding:18px;border:1px solid color-mix(in srgb,var(--line) 55%,var(--panel));border-radius:8px;background:var(--panel);box-shadow:0 1px 2px rgba(10,28,34,.025),0 5px 14px rgba(10,28,34,.045)}
.function-directory .compact-grid .catalog-item,.function-directory .compact-grid .workflow-logo{isolation:isolate}
.function-directory .compact-grid .catalog-item::before{content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;background:linear-gradient(155deg,var(--catalog-highlight),transparent 66%);box-shadow:inset 0 1px var(--catalog-rim),inset 0 2px var(--catalog-sheen);pointer-events:none}
.function-directory .compact-grid .workflow-logo{position:relative;width:50px;height:50px;grid-column:1;grid-row:1;border:0;border-radius:10px;background:var(--catalog-icon-surface)}
.function-directory .compact-grid .workflow-logo::before{content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;background:linear-gradient(145deg,var(--catalog-icon-highlight),transparent);box-shadow:inset 0 1px var(--catalog-sheen);pointer-events:none}
.function-directory .compact-grid .workflow-logo svg{width:29px;height:29px;stroke-width:1.75}
.function-directory .compact-grid .catalog-copy{display:contents}
.function-directory .compact-grid .catalog-copy b{grid-column:1/-1;grid-row:2;align-self:start;font-size:16px;font-weight:600;line-height:1.5}
.function-directory .compact-grid .catalog-copy small{grid-column:1/-1;grid-row:3;font-size:14px;line-height:1.65;display:block;min-width:0;overflow-wrap:anywhere}
.function-directory .compact-grid .catalog-meta{display:contents;white-space:normal}
.function-directory .compact-grid .catalog-meta small{grid-column:2;grid-row:1;align-self:center;justify-self:end;font-size:12px;line-height:1.5;text-align:right}
.function-directory .compact-grid .catalog-meta b{grid-column:1;grid-row:4;align-self:end;padding-top:8px;white-space:nowrap;text-align:left}
.function-directory .compact-grid .catalog-arrow{position:static;grid-column:2;grid-row:4;align-self:end;justify-self:end;width:19px;height:19px;color:var(--navigation-accent)}
.workflow-logo{--icon-accent:var(--workflow-icon)}
.function-directory .catalog-item[data-tone]{--tool-tone:var(--workflow-icon);--tool-soft:color-mix(in srgb,var(--tool-tone) 11%,var(--panel));--tool-glow:color-mix(in srgb,var(--tool-tone) 7%,transparent)}
.function-directory .catalog-item[data-tone="violet"]{--tool-tone:#7654f6}
.function-directory .catalog-item[data-tone="coral"]{--tool-tone:#ed6255}
.function-directory .catalog-item[data-tone="lime"]{--tool-tone:#2da75e}
.function-directory .catalog-item[data-tone="amber"]{--tool-tone:#d58a17}
.function-directory .catalog-item[data-tone="cyan"]{--tool-tone:#00a0b6}
.function-directory .catalog-item[data-tone="purple"]{--tool-tone:#a54cbd}
.function-directory .catalog-item[data-tone="emerald"]{--tool-tone:#159174}
.function-directory .catalog-item[data-tone="blue"]{--tool-tone:#397fe0}
.function-directory .catalog-item[data-tone="rose"]{--tool-tone:#e54878}
.function-directory .catalog-item[data-tone="orange"]{--tool-tone:#ef741f}
.function-directory .catalog-item[data-tone="indigo"]{--tool-tone:#596be0}
[data-theme=dark] .function-directory .catalog-item[data-tone="violet"]{--tool-tone:#8b6cff}
[data-theme=dark] .function-directory .catalog-item[data-tone="coral"]{--tool-tone:#ff7164}
[data-theme=dark] .function-directory .catalog-item[data-tone="lime"]{--tool-tone:#3bc66f}
[data-theme=dark] .function-directory .catalog-item[data-tone="amber"]{--tool-tone:#f0a125}
[data-theme=dark] .function-directory .catalog-item[data-tone="cyan"]{--tool-tone:#14bed1}
[data-theme=dark] .function-directory .catalog-item[data-tone="purple"]{--tool-tone:#c05ed7}
[data-theme=dark] .function-directory .catalog-item[data-tone="emerald"]{--tool-tone:#22b08e}
[data-theme=dark] .function-directory .catalog-item[data-tone="blue"]{--tool-tone:#5598f4}
[data-theme=dark] .function-directory .catalog-item[data-tone="rose"]{--tool-tone:#f45c8c}
[data-theme=dark] .function-directory .catalog-item[data-tone="orange"]{--tool-tone:#ff8c32}
[data-theme=dark] .function-directory .catalog-item[data-tone="indigo"]{--tool-tone:#7b8cff}
.function-directory .catalog-item[data-tone] .workflow-logo{--icon-accent:#fff;color:#fff;background-color:var(--tool-tone)!important;background-image:linear-gradient(145deg,color-mix(in srgb,var(--tool-tone) 78%,#fff),var(--tool-tone))!important;box-shadow:inset 0 1px rgba(255,255,255,.38),0 8px 20px color-mix(in srgb,var(--tool-tone) 24%,transparent)}
.function-directory .catalog-item[data-tone] .workflow-logo::before{background:linear-gradient(145deg,rgba(255,255,255,.18),transparent 58%);box-shadow:inset 0 1px rgba(255,255,255,.24)}
.function-directory .compact-grid .catalog-item[data-tone]::before{background:linear-gradient(180deg,color-mix(in srgb,var(--tool-tone) 9%,var(--panel)),transparent 42%);box-shadow:inset 0 3px var(--tool-tone),inset 0 1px var(--catalog-rim)}
.function-directory .compact-grid .catalog-item[data-tone] .catalog-meta small{padding:4px 8px;border-radius:999px;color:var(--tool-tone);background:color-mix(in srgb,var(--tool-tone) 10%,var(--panel));font-weight:700}
.function-directory .compact-grid .catalog-item[data-tone]{background:var(--panel)}
/* Light mode keeps the global jade-gold material unified; category color stays on the icon, rim and label. */
.function-directory .compact-grid .catalog-item[data-tone]:hover{border-color:color-mix(in srgb,var(--tool-tone) 34%,var(--line));box-shadow:0 8px 22px color-mix(in srgb,var(--tool-tone) 10%,transparent)}
.function-directory .compact-grid .catalog-item[data-tone]:hover .catalog-arrow{color:var(--tool-tone)}
.settings-hub{display:grid;gap:12px}.settings-hub-card,.advanced-entry{border:1px solid var(--line);border-radius:8px;background:var(--panel)}
.settings-hub-card{display:flex;gap:15px;align-items:center;padding:20px}.settings-hub-card h3{margin:0 0 4px;color:var(--ink);font-size:16px}.settings-hub-card p{margin:0;color:var(--muted);font-size:14px}
.settings-hub-icon{width:42px;height:42px;flex:0 0 42px;display:grid;place-items:center;border-radius:8px;color:var(--teal);background:color-mix(in srgb,var(--teal) 9%,var(--panel))}.settings-hub-icon svg{width:23px;height:23px}
.advanced-entry summary{min-height:68px;display:flex;align-items:center;gap:14px;padding:14px 18px;cursor:pointer;list-style:none}.advanced-entry summary::-webkit-details-marker{display:none}.advanced-entry summary>span:first-child{width:38px;height:38px;display:grid;place-items:center;border-radius:8px;color:var(--muted);background:var(--soft)}.advanced-entry summary svg{width:21px;height:21px}.advanced-entry summary>span:nth-child(2){display:grid;gap:2px}.advanced-entry summary b{color:var(--ink);font-size:15px}.advanced-entry summary small{color:var(--muted);font-size:12px}.advanced-entry[open] .account-chevron{transform:rotate(90deg)}.advanced-entry-body{padding:0 18px 18px 70px;border-top:1px solid var(--line)}.advanced-entry-body p{margin:14px 0 2px;color:var(--muted);font-size:13px}
@media(max-width:600px){.function-directory .compact-grid .catalog-item{grid-template-rows:46px auto 1fr auto;min-height:216px}.function-directory .compact-grid .workflow-logo{width:46px;height:46px}.function-directory .compact-grid .workflow-logo svg{width:27px;height:27px}.settings-hub-card{padding:16px}.advanced-entry-body{padding-left:18px}}
.function-directory .catalog-item:hover{transform:translateY(-2px);border-color:color-mix(in srgb,var(--teal) 38%,var(--line));box-shadow:0 5px 16px rgba(10,28,34,.08)}
.function-directory .catalog-item:hover .catalog-copy b{color:var(--ink)}
.function-directory .catalog-item:hover .catalog-arrow{color:var(--navigation-accent)}
.directory-resume{display:flex;gap:12px;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding:0 0 10px;margin-bottom:14px}
.directory-resume>span{display:flex;gap:10px;align-items:center;min-width:0}
.directory-resume b{max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:500}
.directory-resume small{font-size:13px;color:var(--muted);white-space:nowrap}
.directory-resume svg{width:18px;height:18px;flex-shrink:0;color:var(--teal)}
.directory-resume .text-button{display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:14px;padding:8px 0}
.field>span,.advanced summary,.upload-zone small,.mode-option small,.flow-steps small,.cost,.setting-facts small{font-size:14px}
.button,.text-button,.choice,.select,.input,.textarea,.field input{font-size:15px}
.flow-steps b,.plan-editor>label,.settings-card h3,.credit-card h3,.agent-card h3{font-size:16px}
.result-content,.chat-message,.plan-editor textarea,.book-editor textarea{font-size:16px;line-height:1.8}
.table th,.table td,.task-toolbar label>span,.settings-card p,.credit-card p,.agent-card p{font-size:14px}
.status,.point-badge,.task-toolbar>b,.table td:before,.file-delivery small{font-size:13px}
.page-head>div:first-child>p:last-child{font-size:15px;line-height:1.7}
.tutorial-empty{min-height:360px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;border-block:1px solid var(--line)}
.tutorial-mark{width:60px;height:60px;color:var(--teal)}.tutorial-mark svg{width:100%;height:100%}
.tutorial-empty h2{font-size:21px;margin:20px 0 0}.tutorial-empty p{color:var(--muted);font-size:15px}
.membership-summary{display:flex;gap:20px;align-items:center;padding:26px 0;border-block:1px solid var(--line)}
.member-avatar{display:grid;place-items:center;width:64px;height:64px;background:var(--soft);color:var(--teal);border-radius:8px;font-size:26px}
.membership-summary h2{font-size:22px;margin:0}.membership-summary p{font-size:15px;color:var(--muted);margin:6px 0 0}
.membership-summary>strong{margin-left:auto;color:var(--gold);font-size:14px}
.member-actions{display:flex;flex-wrap:wrap;gap:12px;padding-top:24px}
@media(min-width:821px) and (max-width:1200px){
  .app-shell{padding-inline:20px}.app-layout{grid-template-columns:184px minmax(0,1fr);gap:20px}
  .sidebar{padding-inline:8px}.side-brand b{font-size:18px}
  .function-directory .filter{padding-inline:8px}
  .function-directory .catalog-grid.compact-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .function-directory .catalog-grid:not(.compact-grid){grid-template-columns:1fr}
}
@media(min-width:821px) and (max-height:670px){
  .sidebar{position:static;height:auto;min-height:510px}
}
.nav .nav-label-mobile{display:none}
.nav button .nav-label-desktop,.nav button .nav-label-mobile{width:auto;color:inherit;font-size:inherit}
.account-menu{display:grid;margin-top:24px;border-top:1px solid var(--line)}
.account-menu button{display:flex;align-items:center;gap:14px;min-height:62px;padding:14px 4px;background:transparent;border:0;border-bottom:1px solid var(--line);color:var(--ink);text-align:left;font-size:16px}
.account-menu button:hover{background:var(--soft)}
.account-menu .nav-icon{display:flex;width:24px;height:24px;color:var(--teal)}
.account-menu .nav-icon svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7}
.account-chevron{margin-left:auto;color:var(--muted);font-size:24px}
@media(max-width:820px){
  :root{--mobile-nav-height:72px}
  html{scroll-padding-bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 20px)}
  .app-shell{padding-inline:18px;padding-bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 24px)}.app-layout{grid-template-columns:minmax(0,1fr);gap:0;padding-top:20px}
  .topbar{height:68px}.topbar .mobile-menu-button,#closeNavigation{display:grid;place-items:center;border:0;box-shadow:none}
  .mobile-menu-button{width:36px;height:40px}.topbar-identity{gap:6px}
  .topbar .brand-mark{width:33px;height:33px;flex-basis:33px}.topbar .brand b{font-size:20px}
  .sidebar{position:fixed;top:auto;bottom:0;left:0;right:0;width:100%;height:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));min-height:0;padding:8px 12px calc(8px + env(safe-area-inset-bottom));z-index:35;border:0;border-top:1px solid var(--line);border-radius:0;background:var(--mobile-navigation-surface);overflow:visible;box-shadow:0 -4px 20px color-mix(in srgb,var(--ink) 6%,transparent);transform:none;visibility:visible}
  .sidebar:before,.sidebar .side-brand,.sidebar>.eyebrow,.sidebar .side-status{display:none}
  .sidebar .nav{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;height:100%;padding:0}
  .sidebar .nav [data-route="tutorial"],.sidebar .nav [data-route="credits"],.sidebar .nav [data-route="settings"],.nav .nav-label-desktop{display:none}
  .nav .nav-label-mobile{display:block}
  .sidebar .nav button{height:100%;padding:5px 1px;display:flex;flex-direction:column;justify-content:center;gap:5px;font-size:12px;line-height:1.25;text-align:center;white-space:normal;box-shadow:none}
  .sidebar .nav button .nav-icon{width:22px;height:22px;flex:0 0 22px}
  .sidebar .nav button.active{box-shadow:none;color:var(--navigation-accent)}
  .sidebar .nav button.active:after{content:none}
  .sidebar .side-brand b{font-size:20px}.sidebar .brand-mark{width:34px;height:34px;flex-basis:34px}
  .function-directory .catalog-grid.compact-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
  .function-directory .catalog-grid:not(.compact-grid){grid-template-columns:1fr}
  .toast-region{bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 12px)}
}
@media(max-width:600px){
  .sidebar .nav button{font-size:12px;gap:3px}
  body{padding-bottom:0}.app-shell{padding-inline:14px}.topbar{height:64px}
  .topbar .brand small{display:none}.topbar .brand{gap:6px}.topbar .brand b{font-size:19px}
  .top-actions{gap:2px}.top-actions .profile-button{display:none}
  .top-actions .icon-button{display:grid;width:32px}.credit-pill{padding:0 5px;font-size:13px}
  .appearance-popover{right:-40px}
  .appearance-menu summary{width:32px}.directory-heading{margin-bottom:10px}
  .directory-heading h1{font-size:23px}.directory-heading>div:first-child{display:block}.directory-heading>div>span{font-size:13px;margin-top:5px;display:block}
  .function-directory .catalog-bar{gap:4px;margin-bottom:12px;padding:0 0 10px;align-items:flex-end}
  .function-directory .filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;width:100%}
  .function-directory .filter{font-size:14px;min-height:36px;padding:0 4px}
  .directory-search.icon-button{display:none}
  .function-directory .catalog-grid.compact-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .function-directory .compact-grid .catalog-item{gap:8px;min-height:214px;padding:14px}
  .function-directory .compact-grid .workflow-logo{width:46px;height:46px}
  .function-directory .compact-grid .workflow-logo svg{width:27px;height:27px}
  .function-directory .compact-grid .catalog-copy b{font-size:16px;line-height:1.5}
  .function-directory .compact-grid .catalog-copy small{font-size:13px;line-height:1.65}
  .function-directory .compact-grid .catalog-meta b{font-size:13px}
  .function-directory .compact-grid .catalog-meta small{display:none}
  .function-directory .compact-grid [data-open-tool="personal-ip-talking-head"] .catalog-meta small{display:block;font-size:11px;white-space:nowrap}
  .function-directory .catalog-grid:not(.compact-grid) .catalog-item{grid-template-columns:34px minmax(0,1fr) 20px;gap:10px;padding:16px 4px}
  .function-directory .catalog-grid:not(.compact-grid) .catalog-copy{grid-column:2}
  .function-directory .catalog-grid:not(.compact-grid) .catalog-meta{grid-row:2;grid-column:2;flex-direction:row;justify-content:space-between;align-items:center}
  .function-directory .catalog-grid:not(.compact-grid) .catalog-arrow{grid-column:3;grid-row:1}
  .directory-resume small{display:none}.directory-resume b{max-width:160px;font-size:13px}
  .directory-resume .text-button{font-size:13px}.directory-resume>span{gap:6px}
  .field>span,.flow-steps small,.table td,.settings-card p,.credit-card p{font-size:14px}
  input,textarea,select,.input,.textarea,.select,.field input{font-size:16px}
  .page-head h1{font-size:26px}
}
@media(max-width:360px){
  .app-shell{padding-inline:10px}.topbar .brand-mark{width:28px;height:28px;flex-basis:28px}.topbar .brand b{font-size:17px}
  .topbar-identity{gap:3px}.mobile-menu-button{width:30px}.top-actions .credit-pill{font-size:12px}
  .function-directory .compact-grid .catalog-item{padding:12px;column-gap:6px}
  .function-directory .compact-grid .catalog-copy b{font-size:15px}
}
@media(prefers-reduced-motion:reduce){
  .sidebar,.function-directory .catalog-item{transition:none}
  .function-directory .catalog-item:hover{transform:none}
}

/* Source-aligned confirmation screens share the global type and theme tokens. */
.source-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.source-section-heading h3{margin:0;font-size:19px}
.source-section-heading>span{color:var(--muted);font-size:14px}
.source-talking-editor .source-talking-script{min-height:300px;line-height:1.9}
.source-talking-actions{display:flex;flex-wrap:wrap;gap:10px}
.source-ppt-editor{--ppt-gap:18px}
.source-ppt-pages{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--ppt-gap)}
.source-ppt-page{min-width:0;padding:16px;border:1px solid var(--line);border-radius:8px;display:grid;gap:12px;background:var(--panel)}
.source-ppt-page>header{display:flex;justify-content:space-between;align-items:center;gap:12px}
.source-ppt-page>header>b{font-size:15px;color:var(--teal)}
.source-ppt-page-actions{display:flex;gap:4px}
.source-ppt-icon{display:inline-grid;place-items:center;width:36px;height:36px;border:0;background:transparent;border-radius:5px;color:var(--text);font-size:21px;flex:none}
.source-ppt-icon:hover:not(:disabled){background:var(--soft)}
.source-ppt-icon:disabled{opacity:.3;cursor:default}
.source-ppt-page .field{gap:6px}
.source-ppt-page .textarea{min-height:82px}
.source-ppt-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.source-ppt-modes .mode-option{padding:16px;min-width:0;text-align:left}
.source-ppt-modes .mode-option b,.source-ppt-modes .mode-option small{display:block}
.source-ppt-modes .mode-option small{margin-top:6px;color:var(--muted)}
.source-ppt-modes .mode-option.active small{color:inherit;opacity:.85}
.source-ppt-templates{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.source-ppt-template{padding:0 0 14px;overflow:hidden;min-width:0;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);text-align:left}
.source-ppt-template.selected{border-color:var(--teal);box-shadow:0 0 0 1px var(--teal)}
.source-ppt-template img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover}
.source-ppt-template b,.source-ppt-template span,.source-ppt-template small{display:block;padding:0 12px;overflow-wrap:anywhere}
.source-ppt-template b{font-size:16px;margin-top:12px}
.source-ppt-template span{font-size:14px;line-height:1.65;margin-top:6px;color:var(--muted)}
.source-ppt-template small{font-size:13px;margin-top:8px;color:var(--teal)}
.source-ppt-strategy{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.source-ppt-strategy>.field:last-child{grid-column:1/-1}
.source-ppt-image-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.source-ppt-slide{margin:0;min-width:0;overflow:hidden}
.source-ppt-slide>img{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:contain;background:var(--soft);border-radius:6px}
.source-ppt-slide figcaption{padding-block:12px;display:flex;align-items:flex-start;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:14px}
.source-ppt-slide .gallery-actions{display:flex;gap:10px;flex-wrap:wrap}
.source-ppt-placeholder{aspect-ratio:16/9;background:var(--soft);border:1px dashed var(--line);border-radius:6px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;gap:12px;text-align:center;overflow-wrap:anywhere}
.source-ppt-placeholder>b{color:var(--teal);font-size:18px}
.source-ppt-placeholder>small{color:var(--muted)}
.source-ppt-viewer{min-width:0}
.source-ppt-viewer-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-bottom:16px}
.source-ppt-viewer-toolbar>b{font-size:17px;overflow-wrap:anywhere}
.source-ppt-viewer-toolbar>div{display:flex;align-items:center;gap:8px;flex:none;font-size:14px}
.source-ppt-thumbnails{display:flex;gap:10px;overflow:auto;padding:6px 2px 10px}
.source-ppt-thumbnails>button{position:relative;width:112px;flex:0 0 112px;aspect-ratio:16/9;border:2px solid transparent;background:var(--soft);padding:0;border-radius:5px;overflow:hidden;color:var(--text)}
.source-ppt-thumbnails>button.selected{border-color:var(--teal)}
.source-ppt-thumbnails img{display:block;width:100%;height:100%;object-fit:contain}
.source-ppt-thumbnails b{position:absolute;left:4px;bottom:3px;font-size:11px;background:rgba(0,0,0,.7);color:white;padding:1px 4px;border-radius:3px}
.source-ppt-archives{margin-block:20px}
.source-ppt-history-images{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-block:12px}
.source-ppt-history-images a{min-width:0;font-size:13px}
.source-ppt-history-images img{display:block;width:100%;aspect-ratio:16/9;object-fit:contain;margin-bottom:6px}
@media(max-width:700px){
  .source-ppt-pages,.source-ppt-strategy,.source-ppt-image-grid{grid-template-columns:1fr}
  .source-ppt-templates{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .source-ppt-template b{font-size:15px}
  .source-ppt-template span{font-size:13px}
  .source-ppt-template b,.source-ppt-template span,.source-ppt-template small{padding-inline:9px}
  .source-ppt-modes{gap:8px}
  .source-ppt-modes .mode-option{padding:12px}
  .source-ppt-modes .mode-option b{font-size:15px}
  .source-ppt-modes .mode-option small{font-size:13px}
  .source-ppt-viewer-toolbar{flex-wrap:wrap}
  .source-ppt-history-images{grid-template-columns:repeat(2,minmax(0,1fr))}
}
.source-plan-editor{min-width:0;margin:18px 0;padding:0;border:0;display:grid;gap:16px}
.source-plan-editor legend{font-size:17px;font-weight:600;color:var(--ink);margin-bottom:14px}
.source-plan-editor textarea{min-height:90px}
.source-field-row{display:grid;grid-template-columns:minmax(0,1fr) 130px;gap:14px}
.source-cover-editor h3{font-size:20px;margin:0 0 18px;color:var(--ink)}
.source-cover-editor .candidate-grid{grid-template-columns:1fr;gap:10px}
.source-cover-editor .candidate-card{padding:14px;min-height:0}
.source-cover-editor .candidate-card b{font-size:17px}
.source-cover-editor .candidate-card p,.source-cover-editor .candidate-card span{font-size:14px}
.source-cover-editor .candidate-card small{font-size:13px}
.source-poster-steps{grid-template-columns:repeat(3,minmax(0,1fr))}
.source-poster-tabs{display:none}
.source-poster-workspace{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:28px;align-items:start}
.source-poster-workspace>section,.source-poster-preview{min-width:0}
.source-poster-preview{position:sticky;top:96px;padding-left:24px;border-left:1px solid var(--line)}
.source-poster-preview h3,.source-poster-source h3{font-size:20px;color:var(--ink);margin:0 0 18px}
.source-poster-empty{display:grid;place-content:center;min-height:300px;padding:24px;text-align:center;background:var(--soft);border-radius:6px}
.source-poster-empty b{font-size:18px;color:var(--ink)}
.source-poster-empty p{font-size:15px;color:var(--muted);line-height:1.7;overflow-wrap:anywhere}
.source-poster-delivery figure{margin:0 0 16px}
.source-poster-delivery img{display:block;width:100%;height:auto;max-height:610px;object-fit:contain;background:var(--soft);border-radius:4px}
.source-poster-delivery figcaption{font-size:14px;color:var(--muted);line-height:1.6;overflow-wrap:anywhere;margin-top:10px}
.source-poster-delivery>a{text-decoration:none}
.source-poster-prompt,.source-poster-archives{margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}
.source-poster-prompt>summary,.source-poster-archives>summary{font-size:15px;cursor:pointer}
.source-poster-prompt pre{font:14px/1.7 Consolas,"Microsoft YaHei",monospace;white-space:pre-wrap;overflow-wrap:anywhere;max-height:320px;overflow:auto;padding:12px;background:var(--soft);border-radius:4px}
.source-poster-prompt .text-button{padding:8px 0}
.source-poster-legacy{font-size:13px;color:var(--muted)}
.source-poster-archives .source-poster-delivery{margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}
.workspace-result:has(.source-poster-workspace,.source-poster-source)>.result-actions{margin-top:24px;padding-top:16px;border-top:1px solid var(--line)}
[data-poster-source] .source-input-summary{margin:0;padding:0;border:0}
[data-poster-source] .source-input-summary>summary{display:none}
[data-poster-source] .workspace-form{padding:0!important;border:0;box-shadow:none;background:transparent}
@media(max-width:900px){
  .source-poster-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-bottom:1px solid var(--line);margin-bottom:20px}
  .source-poster-tabs button{min-height:44px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);font-size:16px}
  .source-poster-tabs button[aria-selected=true]{color:var(--teal);border-bottom-color:var(--teal);font-weight:600}
  .source-poster-workspace{grid-template-columns:minmax(0,1fr);gap:24px}
  .source-poster-workspace[data-poster-mobile-view=plan]>.source-poster-preview,.source-poster-workspace[data-poster-mobile-view=preview]>section{display:none}
  .source-poster-preview{position:static;padding:0;border-left:0}
  .source-poster-delivery img{max-height:520px}
  .source-poster-workspace>section,.source-poster-workspace>.source-poster-preview{animation:surface-enter 180ms ease both}
}
@media(max-width:600px){
  .source-poster-steps li{display:flex;flex-direction:column;text-align:center;gap:6px;padding:10px 5px}
  .source-poster-steps li b{font-size:15px}
  .source-poster-steps li small{font-size:12px}
}
.source-cover-editor #sourceCoverSettings>fieldset{min-width:0;padding:0;border:0;margin:0;display:grid;gap:20px}
.source-cover-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.source-cover-modes button{min-height:44px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--text);font-size:16px}
.source-cover-modes button[aria-pressed=true]{background:var(--soft);border-color:var(--teal);color:var(--teal)}
.source-cover-material{min-width:0;border-top:1px solid var(--line);padding-top:18px}
.source-cover-material>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;font-size:16px}
.source-cover-material>header small{font-size:13px;color:var(--muted)}
.source-cover-library{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:10px;margin-bottom:12px}
.source-cover-library:empty{display:none}
.source-cover-library button{min-width:0;text-align:left;position:relative;padding:7px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--text);transition:border-color 160ms ease,background-color 160ms ease}
.source-cover-library button[aria-pressed=true]{border-color:var(--teal);background:var(--soft)}
.source-cover-library img{width:100%;height:110px;object-fit:contain;display:block}
.source-cover-library span{display:block;font-size:13px;line-height:1.5;overflow-wrap:anywhere;margin-top:6px}
.source-cover-library small{display:block;color:var(--teal);font-size:12px;margin-top:3px}
.source-cover-selected{margin:0 0 12px;max-width:180px}
.source-cover-selected img{display:block;width:100%;height:140px;object-fit:contain}
.source-cover-selected figcaption{overflow-wrap:anywhere;font-size:14px}
.source-cover-delivery h3{font-size:20px;color:var(--ink);margin:0 0 6px}
.source-cover-delivered-title{margin:0 0 20px;font-size:16px;overflow-wrap:anywhere}
.source-cover-previews{display:grid;grid-template-columns:minmax(0,1fr);gap:24px;max-width:840px;margin-inline:auto}
.source-cover-previews.dual{grid-template-columns:repeat(2,minmax(0,1fr));max-width:720px;align-items:start}
.source-cover-previews figure{min-width:0;margin:0}
.source-cover-previews figcaption{font-size:15px;font-weight:600;color:var(--ink);margin-bottom:12px}
.source-cover-original{background:var(--soft);display:flex;justify-content:center;overflow:hidden;border-radius:4px}
.source-cover-original img{display:block;width:100%;height:auto;max-height:640px;object-fit:contain}
.source-cover-previews.dual .source-cover-original{aspect-ratio:9/16}
.source-cover-previews.dual .source-cover-original img{width:100%;height:100%;max-height:none}
.source-cover-crop{aspect-ratio:3/4;overflow:hidden;background:var(--soft);border-radius:4px}
.source-cover-crop img{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
.source-cover-download{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px;margin-top:22px;padding-top:18px;border-top:1px solid var(--line)}
.source-cover-download>span{font-size:14px;color:var(--muted)}
.source-cover-download a{text-decoration:none}
.source-cover-archives{border-top:1px solid var(--line);margin-top:24px;padding-top:16px}
.source-cover-archives>summary{font-size:15px;cursor:pointer}
.source-cover-archives .source-cover-delivery{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}
.source-cover-steps li>button>b>span{display:inline-block;white-space:nowrap}
.workspace-result:has(.source-cover-editor,.source-cover-delivery)>.result-actions{margin-top:24px;padding-top:16px;border-top:1px solid var(--line)}
[data-cover-source] .source-input-summary{margin:0;padding:0;border:0}
[data-cover-source] .source-input-summary>summary{display:none}
[data-cover-source] .workspace-form{padding:0!important}
@media(max-width:600px){
  .source-cover-previews.dual{gap:12px}
  .source-cover-previews figcaption{min-height:42px;font-size:14px}
  .source-flow-steps.source-cover-steps{grid-template-columns:repeat(5,minmax(0,1fr))}
  .source-flow-steps.source-cover-steps li>button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:76px;padding:7px 3px;text-align:center}
  .source-cover-steps li>button>b{font-size:14px;line-height:1.4;overflow-wrap:anywhere}
  .source-cover-steps li>button>small{display:none}
}
.source-step-actions{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;margin-top:18px}
.source-confirmation{margin:0;display:grid;gap:16px}
.source-confirmation>div{padding-bottom:14px;border-bottom:1px solid var(--line)}
.source-confirmation dt{font-size:13px;color:var(--muted);margin-bottom:5px}
.source-confirmation dd{margin:0;font-size:16px;overflow-wrap:anywhere}
.source-chat-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:28px;align-items:start}
.source-chat-history{min-width:0;border-right:1px solid var(--line);padding-right:20px}
.source-chat-history>summary{font-size:15px;font-weight:600;color:var(--ink);padding:12px 0;cursor:pointer}
.source-chat-history>summary span{color:var(--muted);font-size:13px;font-weight:400;margin-left:8px}
.source-chat-new{width:100%;margin:8px 0 16px}
.source-chat-history-list{max-height:590px;overflow:auto;overscroll-behavior:contain;padding-right:4px}
.source-chat-history-row{border-left:2px solid transparent;margin-bottom:6px;transition:background-color 180ms ease,opacity 220ms ease,transform 220ms ease}
.source-chat-history-row.selected{background:var(--soft);border-left-color:var(--teal)}
.source-chat-history-row:hover{background:var(--soft)}
.source-chat-history-row.removing{opacity:0;transform:translateX(10px);pointer-events:none}
.source-chat-open{display:grid;gap:6px;width:100%;padding:12px 10px 0;border:0;text-align:left;background:transparent;color:var(--text)}
.source-chat-open b{font-size:15px;font-weight:500;overflow-wrap:anywhere}
.source-chat-open small{font-size:12px;color:var(--muted)}
.source-chat-history-actions{display:flex;justify-content:flex-end;gap:10px;padding:0 10px}
.source-chat-history-actions .text-button{font-size:12px;padding:10px 0}
.source-chat-history-empty{color:var(--muted);font-size:14px;padding:12px 0}
.source-chat-main{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;min-width:0;height:clamp(580px,calc(100dvh - 250px),800px);border-block:1px solid var(--line)}
.source-chat-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--line)}
.source-chat-header>div:first-child{min-width:0}
.source-chat-header b{font-size:15px;color:var(--ink);overflow-wrap:anywhere}
.source-chat-header small{display:block;color:var(--muted);font-size:12px;margin-top:4px}
.source-chat-header .mode-switch{flex:none;margin:0;gap:4px}
.source-chat-header .mode-option{min-width:0;padding:7px 10px}
.source-chat-header .mode-option b{font-size:13px;color:inherit}
.source-chat-header .mode-option small{font-size:11px}
.source-chat-header .mode-option.active small{color:inherit}
.source-chat-scroll{min-height:0;overflow:auto;overscroll-behavior:contain;padding:24px 12px 24px 0}
.source-chat-welcome{max-width:600px;margin:18px auto;padding:0 6px}
.source-chat-welcome>svg{width:40px;height:40px;color:var(--teal)}
.source-chat-welcome h2{font-size:22px;color:var(--ink);margin:16px 0 10px}
.source-chat-welcome p{font-size:16px;line-height:1.85;white-space:pre-wrap;color:var(--muted)}
.source-chat-examples{display:grid;margin-top:24px}
.source-chat-examples button{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:15px 0;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--text);text-align:left;font-size:15px;line-height:1.65;overflow-wrap:anywhere}
.source-chat-examples button:hover{color:var(--teal)}
.source-chat-examples button span{color:var(--teal);flex:none}
.source-chat-message{padding:0 4px;margin-bottom:28px;animation:surface-enter 180ms ease both}
.source-chat-message header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
.source-chat-message header b{font-size:14px;color:var(--teal)}
.source-chat-message header small{font-size:12px;color:var(--muted)}
.source-chat-message header .text-button{font-size:12px;padding:6px 0}
.source-chat-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:17px;line-height:1.85}
.source-chat-message.user{background:var(--soft);padding:14px 18px;border-radius:6px;margin-left:32px}
.source-chat-message.user header b{color:var(--muted)}
.source-chat-typing{display:flex;gap:6px;padding:12px 0}
.source-chat-typing span{width:5px;height:5px;border-radius:50%;background:var(--teal);animation:source-chat-pulse 1.1s ease-in-out infinite}
.source-chat-typing span:nth-child(2){animation-delay:120ms}.source-chat-typing span:nth-child(3){animation-delay:240ms}
@keyframes source-chat-pulse{0%,80%,100%{opacity:.3}40%{opacity:1}}
.source-chat-error{display:flex;align-items:center;justify-content:space-between;gap:16px;border-left:3px solid var(--danger);padding:12px 16px;background:var(--soft);font-size:14px;overflow-wrap:anywhere}
.source-chat-error b{color:var(--danger)}.source-chat-error p{margin:6px 0 0}
.source-chat-error .button{flex:none}
#workflowForm.source-chat-composer,#chatFollowup.source-chat-composer{display:block;margin:0;padding:12px 14px;background:var(--panel);border:1px solid var(--line2);border-radius:6px}
.source-chat-composer textarea{display:block;resize:none;width:100%;min-height:74px;max-height:200px;padding:0;border:0;outline:0;background:transparent;color:var(--text);font-size:17px;line-height:1.75}
.source-chat-composer:focus-within{border-color:var(--teal);box-shadow:0 0 0 2px color-mix(in srgb,var(--teal) 10%,transparent)}
.source-chat-compose-footer{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-top:8px}
.source-chat-compose-footer>small{font-size:12px;color:var(--muted);line-height:1.7}
.source-chat-compose-footer>div{display:flex;gap:8px;align-items:center}
.source-chat-send{display:grid;place-items:center;width:38px;height:38px;flex:none;border:0;border-radius:6px;background:var(--teal);color:var(--panel);font-size:25px;transition:opacity 180ms ease,transform 180ms ease}
.source-chat-send:hover:not(:disabled){transform:translateY(-1px)}
.source-chat-send:disabled{opacity:.45;cursor:default}
.source-chat-footer{display:flex;gap:12px;flex-wrap:wrap;align-items:center;padding:4px 0}
.source-chat-footer .text-button{font-size:13px;padding:10px 0}
.source-chat-footer .danger{margin-left:auto}
@media(max-width:1100px){
  .source-chat-layout{grid-template-columns:180px minmax(0,1fr);gap:20px}
  .source-chat-header{flex-wrap:wrap}
}
@media(max-width:900px){
  .source-chat-layout{grid-template-columns:minmax(0,1fr);gap:14px}
  .source-chat-history{padding:0;border-right:0;border-bottom:1px solid var(--line)}
  .source-chat-history-list{max-height:250px}
  .source-chat-history-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}
  .source-chat-open{padding:12px 10px}
  .source-chat-main{height:clamp(520px,calc(100dvh - 210px),740px)}
}
@media(max-width:480px){
  .source-chat-header{gap:10px}
  .source-chat-header .mode-switch{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .source-chat-header .mode-option{display:flex;justify-content:center;gap:8px;align-items:center}
  .source-chat-header .mode-option small{margin:0}
  .source-chat-scroll{padding-top:16px}
  .source-chat-welcome{margin-top:4px}
  .source-chat-welcome h2{font-size:20px}
  .source-chat-message.user{margin-left:14px;padding:12px}
  .source-chat-error{flex-wrap:wrap}
  .source-chat-compose-footer .cost{display:block}
  .source-chat-footer{gap:10px}
}
.source-material-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.source-material-preview:empty{display:none}
.source-material-preview figure{min-width:0;margin:0}
.source-material-preview img{display:block;width:100%;height:110px;object-fit:contain;background:var(--soft);border-radius:6px}
.source-material-preview figcaption{font-size:13px;margin-top:6px;color:var(--muted)}
.source-material-preview .text-button{font-size:13px;padding:6px 0}
.source-upload-field{min-width:0;display:grid;gap:10px}
.source-upload-field>.upload-zone{position:relative;display:grid;gap:6px;margin:0;cursor:pointer}
.source-upload-field input[type="file"]{display:block;position:absolute;width:1px;height:1px;padding:0;opacity:0;clip-path:inset(50%)}
.source-upload-field>.upload-zone:focus-within{outline:2px solid var(--teal);outline-offset:3px}
.source-file-previews{display:grid;gap:10px}
.source-file-previews:empty{display:none}
.source-file-preview{min-width:0;display:grid;grid-template-columns:56px minmax(0,1fr) 34px;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);animation:surface-enter 180ms ease both}
.source-file-preview>img,.source-file-invalid{width:56px;height:56px;border-radius:4px;object-fit:contain;background:var(--soft)}
.source-file-invalid{display:grid;place-items:center;color:var(--danger);font-size:24px}
.source-file-preview b{display:block;overflow-wrap:anywhere;font-size:14px;font-weight:500}
.source-file-preview small{display:block;margin-top:5px;color:var(--muted);font-size:12px;overflow-wrap:anywhere}
.source-file-preview small.source-file-error{color:var(--danger)}
.source-file-preview .text-button{width:34px;height:38px;padding:0;font-size:22px}
.source-flow-steps li{display:block;padding:0}
.source-flow-steps li>button{display:grid;grid-template-columns:24px minmax(0,1fr);gap:4px 8px;width:100%;min-height:78px;padding:12px;border:0;background:transparent;color:inherit;text-align:left}
.source-flow-steps li>button>span{grid-row:1/3;align-self:center;font-size:15px}
.source-flow-steps li>button>b{font-size:15px}
.source-flow-steps li>button>small{grid-column:2;font-size:13px}
.source-flow-steps li>button:disabled{cursor:default}
.source-active-workspace{display:block;max-width:1080px;margin-inline:auto}
.source-input-summary{margin-bottom:16px;border-bottom:1px solid var(--line)}
.source-input-summary>summary{padding:12px 4px;color:var(--muted);font-size:14px;cursor:pointer}
.source-input-summary .workspace-form{margin-block:8px 16px;max-width:none;position:static}
.source-active-workspace .workspace-result{width:100%}
.source-active-workspace .result-gallery:has(>figure:only-child){grid-template-columns:minmax(0,640px);justify-content:center}
.source-active-workspace .result-gallery:has(>figure:only-child) img{height:auto;max-height:80vh;object-fit:contain}
.source-active-workspace .source-cover-editor .candidate-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.field[hidden]{display:none!important}
.source-writing-editor h3{font-size:20px;margin:2px 0 10px}
.source-section-list{display:grid;gap:22px}
.source-section-list>section{min-width:0;display:grid;gap:12px;border-top:1px solid var(--line);padding-top:18px}
.source-section-list header,.source-publish-copy header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.source-section-list h4{margin:0;font-size:16px}
.source-section-list h4 small,.source-item-reason{font-size:13px;color:var(--muted);margin:0}
.source-section-list textarea{min-height:130px}
.source-checks{margin:10px 0;padding-left:20px;color:var(--muted);font-size:14px;line-height:1.7}
.source-image-count input{width:110px}
.source-title-choices,.source-publish-actions{display:flex;flex-wrap:wrap;gap:8px}
.source-title-choices .selected{color:var(--accent);border-color:currentColor}
.source-article-preview{font-size:17px;line-height:1.9;overflow-wrap:anywhere;color:var(--ink)}
.source-article-preview h1{font-size:26px;line-height:1.45}
.source-article-preview h2{font-size:21px;line-height:1.5;margin-top:24px}
.source-article-preview p{margin:14px 0}
.source-article-preview figure{margin:20px 0}
.source-article-preview img{display:block;width:100%;height:auto;border-radius:4px}
.source-article-preview figcaption,.source-article-preview .article-digest{color:var(--muted);font-size:14px}
.source-publish-copy>section{padding-block:16px;border-bottom:1px solid var(--line)}
.source-publish-copy h3{font-size:17px;margin:0}
.source-publish-checks{display:grid;gap:12px}
.source-publish-checks label{display:flex;align-items:flex-start;gap:8px;font-size:14px;line-height:1.7}
.source-book-workspace h3{font-size:20px;margin:0;color:var(--ink)}
.source-book-workspace h4{font-size:17px;margin:8px 0 14px}
.source-book-workspace p{line-height:1.85;overflow-wrap:anywhere}
.source-book-fields,.source-book-outline-list{display:grid;gap:16px}
.source-book-interview-layout,.source-book-outline-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px;align-items:start}
.source-book-interview-layout>aside{padding-left:24px;border-left:1px solid var(--line)}
.source-book-interview-layout>section,.source-book-outline-layout>section{min-width:0}
.source-book-interview-layout textarea{min-height:240px}
.source-book-question-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.source-book-question-tabs button,.source-book-toolbar button{width:40px;height:40px;border:1px solid var(--line);border-radius:5px;background:var(--panel);color:var(--text)}
.source-book-question-tabs button.selected{background:var(--teal);color:var(--panel);border-color:var(--teal)}
.source-book-materials{display:grid;gap:0;min-width:0}
.source-book-materials details{padding-block:12px;border-bottom:1px solid var(--line)}
.source-book-materials summary{display:grid;gap:6px;cursor:pointer;overflow-wrap:anywhere;font-size:14px}
.source-book-materials small{font-size:12px;color:var(--muted)}
.source-book-material-content{font-size:14px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;max-height:280px;overflow:auto;padding-block:12px}
.source-book-add-material{margin-top:18px;font-size:14px}
.source-book-add-material summary{padding-block:10px;color:var(--teal);cursor:pointer}
.source-book-check{display:flex;align-items:center;gap:8px;font-size:14px}
.source-book-check input{accent-color:var(--teal)}
.source-book-outline-row{padding:16px;border:1px solid var(--line);border-radius:6px;display:grid;gap:14px;min-width:0}
.source-book-outline-row>header{display:flex;justify-content:space-between;align-items:center}
.source-book-outline-row>header>div{display:flex}
.source-book-outline-list+button{margin-top:16px}
.source-book-writing-layout{display:grid;grid-template-columns:170px minmax(0,1fr) 190px;gap:22px}
.source-book-writing-layout>aside,.source-book-editor{min-width:0}
.source-book-writing-layout>aside h3,.source-book-writing-layout>aside h4{font-size:16px}
.source-book-writing-layout .source-section-heading>span{font-size:12px}
.source-book-writing-materials{border-left:1px solid var(--line);padding-left:18px}
.source-book-writing-materials p{font-size:14px}
.source-book-chapters{display:grid;gap:4px;margin-block:14px}
.source-book-chapters>button{display:grid;gap:7px;text-align:left;width:100%;background:transparent;color:var(--text);border:0;border-left:3px solid transparent;border-radius:0;padding:12px 10px;overflow-wrap:anywhere}
.source-book-chapters>button:hover{background:var(--soft)}
.source-book-chapters>button.selected{background:var(--soft);border-left-color:var(--teal)}
.source-book-chapters b{font-size:15px;font-weight:600}
.source-book-chapters span,.source-book-chapters small{font-size:12px;color:var(--muted)}
.source-book-objective{font-size:14px;color:var(--muted);margin:10px 0 18px}
.source-book-toolbar{display:flex;gap:6px;align-items:center;flex-wrap:wrap;padding:8px 0;border-top:1px solid var(--line)}
.source-book-toolbar button{border:0;font-size:16px;font-weight:600}
.source-book-toolbar button:hover:not(:disabled){background:var(--soft)}
.source-book-toolbar span{margin-left:auto;font-size:12px;color:var(--muted)}
.source-book-workspace .source-book-manuscript{min-height:440px;font-size:17px;line-height:1.9;resize:vertical}
.source-book-manuscript:read-only{color:var(--muted);background:var(--soft)}
.source-book-ai-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;padding-top:14px}
.source-book-ai-actions .text-button{font-size:13px}
.source-book-versions{margin-top:18px;font-size:14px}
.source-book-versions button{display:block;margin-top:10px;text-align:left}
.source-book-issues article{padding-block:20px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.source-book-issues small{font-size:13px;color:var(--gold)}
.source-book-issues h4{margin:10px 0}
.source-book-issues p{font-size:15px;margin-block:8px}
.source-book-export-options{display:flex;flex-wrap:wrap;gap:14px;padding-block:24px;border-block:1px solid var(--line)}
.source-book-mobile-tabs{display:none}
@media(max-width:1120px){
  .source-book-writing-layout{grid-template-columns:160px minmax(0,1fr)}
  .source-book-writing-materials{grid-column:1/-1;border-left:0;border-top:1px solid var(--line);padding:18px 0 0}
}
@media(max-width:600px){
  .source-book-interview-layout,.source-book-outline-layout,.source-book-writing-layout{display:block}
  .source-book-interview-layout>aside{padding:20px 0 0;border-left:0;border-top:1px solid var(--line);margin-top:20px}
  .source-book-outline-list{margin-top:24px}
  .source-book-outline-row{padding:12px}
  .source-book-writing-materials{border:0;padding:0}
  .source-book-mobile-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;border-bottom:1px solid var(--line);padding-bottom:8px}
  .source-book-mobile-tabs button{border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--muted);padding:12px 4px;font-size:15px}
  .source-book-mobile-tabs button.selected{border-bottom-color:var(--teal);color:var(--teal)}
  .source-book-writing-layout:not([data-book-panel-view="outline"])>.source-book-directory,.source-book-writing-layout:not([data-book-panel-view="editor"])>.source-book-editor,.source-book-writing-layout:not([data-book-panel-view="materials"])>.source-book-writing-materials{display:none}
  .source-book-workspace .source-book-manuscript{min-height:340px}
  .source-book-export-options>.button{flex:1;min-width:140px}
}
.task-warning{padding:12px 14px;border-left:3px solid var(--accent);background:var(--soft);font-size:14px;line-height:1.7;color:var(--ink)}
.source-detail-editor h3{font-size:20px;margin:8px 0;color:var(--ink)}
.workspace:not(.source-active-workspace):has(.source-detail-input-layout){grid-template-columns:minmax(0,1fr)}
.workspace:not(.source-active-workspace):has(.source-detail-input-layout) #resultPanel:has(.result-empty){display:none}
.source-detail-input-layout{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(260px,.7fr);gap:30px;align-items:start}
.source-detail-source-fields,.source-detail-material-fields{display:grid;gap:18px;min-width:0}
.source-detail-material-fields{padding-left:24px;border-left:1px solid var(--line)}
.source-detail-material-fields h3{font-size:18px;margin:0}
.source-detail-input-layout .detail-assist{margin:0}
.source-detail-input-layout .upload-zone{margin:0}
.source-detail-editor h4{font-size:16px;margin:0 0 10px}
.source-detail-understanding{display:grid;grid-template-columns:1.2fr 1fr;gap:30px;padding-block:12px 24px;border-bottom:1px solid var(--line)}
.source-detail-understanding>section,.source-detail-fact{min-width:0}
.source-detail-promise{font-size:19px;line-height:1.7;color:var(--ink);margin:0 0 20px}
.source-detail-facts,.source-detail-strategy{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}
.source-detail-fact ul{padding-left:20px;margin:0;font-size:15px;line-height:1.85;overflow-wrap:anywhere}
.source-detail-fact p{color:var(--muted);font-size:14px}
.source-detail-plan-grid{display:grid;gap:18px}
.source-detail-plan-grid.main{grid-template-columns:repeat(3,minmax(0,1fr))}
.source-detail-plan-grid.screens{grid-template-columns:repeat(2,minmax(0,1fr))}
.source-detail-plan-item{min-width:0;border:1px solid var(--line);border-radius:6px;padding:16px;display:grid;align-content:start;gap:14px;background:var(--panel)}
.source-detail-plan-item>header{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.source-detail-plan-item>header b{font-size:16px}
.source-detail-plan-item small{font-size:12px;font-weight:400;color:var(--muted);margin-left:6px}
.source-detail-plan-item textarea{min-height:110px}
.source-detail-plan-item .advanced{margin:0}
.source-detail-cost{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-block:20px;border-block:1px solid var(--line);flex-wrap:wrap}
.source-detail-cost>b{font-size:22px;color:var(--accent)}
.source-detail-cost small{display:block;font-size:13px;color:var(--muted);font-weight:400;margin-top:5px}
.source-detail-reference-strip{display:flex;gap:12px;flex-wrap:wrap;margin-block:12px}
.source-detail-reference-strip:empty{display:none}
.source-detail-reference-strip figure{width:110px;margin:0;overflow-wrap:anywhere;font-size:12px;color:var(--muted)}
.source-detail-reference-strip img{width:100%;height:100px;object-fit:contain;background:var(--soft);border-radius:4px}
.source-detail-material{min-width:0}
.source-detail-delivery-grid{display:grid;gap:18px;grid-template-columns:repeat(3,minmax(0,1fr))}
.source-detail-delivery-grid.screens{grid-template-columns:repeat(2,minmax(0,1fr))}
.source-detail-image{min-width:0;margin:0}
.source-detail-image>a{display:block}
.source-detail-image img,.source-detail-placeholder{display:block;width:100%;aspect-ratio:3/4;object-fit:contain;border-radius:4px;background:var(--soft)}
.source-detail-image.main img,.source-detail-image.main .source-detail-placeholder{aspect-ratio:1}
.source-detail-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;border:1px dashed var(--line);padding:16px;text-align:center;overflow-wrap:anywhere}
.source-detail-placeholder b{color:var(--accent)}
.source-detail-placeholder small{color:var(--muted)}
.source-detail-image figcaption{display:grid;gap:10px;padding-block:12px;font-size:14px;overflow-wrap:anywhere}
.source-detail-image .gallery-actions{display:flex;flex-wrap:wrap;gap:14px}
.source-detail-long{width:min(100%,540px);margin-inline:auto}
.source-detail-long img{display:block;width:100%;height:auto}
.source-detail-archives{margin-block:20px}
.source-detail-archives section{margin-block:20px}
.source-detail-archives img{display:block;width:100%;height:150px;object-fit:contain;background:var(--soft)}
.source-detail-archives a{font-size:13px;min-width:0}
.source-writing-format{display:flex;gap:6px;padding:8px;border:1px solid var(--line);border-bottom:0;border-radius:6px 6px 0 0;background:var(--soft)}
.source-writing-format button{display:grid;place-items:center;width:40px;height:36px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--ink);font-size:17px;font-weight:700}
.source-writing-format button:hover,.source-writing-format button:focus-visible{background:var(--panel);outline:2px solid var(--teal);outline-offset:-2px}
.source-writing-rich{min-height:340px;max-height:680px;overflow:auto;border:1px solid var(--line);border-radius:0 0 6px 6px;padding:24px;background:var(--panel);color:var(--text);font-size:17px;line-height:1.9;overflow-wrap:anywhere}
.source-writing-rich:focus{outline:2px solid var(--teal);outline-offset:2px}
.source-writing-rich p{margin:0 0 18px}.source-writing-rich h2{font-size:22px;line-height:1.5;margin:26px 0 14px}
.source-writing-rich blockquote,.source-article-preview blockquote{margin:16px 0;padding:12px 16px;border-left:3px solid var(--teal);background:var(--soft)}
.source-writing-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin:16px 0 28px}
.source-writing-gallery figure{min-width:0;margin:0}
.source-writing-gallery img{display:block;width:100%;aspect-ratio:3/4;object-fit:contain;background:var(--soft);border-radius:6px}
.source-writing-gallery figcaption{display:grid;gap:10px;padding-block:12px;font-size:14px;overflow-wrap:anywhere}
.source-writing-gallery .gallery-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.source-writing-gallery .gallery-actions button:not(.text-button){width:30px;height:30px;padding:0;border:1px solid var(--line);border-radius:4px;background:var(--panel);color:var(--text)}
.source-writing-gallery .task-error{font-size:13px}.source-writing-gallery .image-tuning textarea{min-height:90px}
.source-writing-actions{margin-top:22px}
[data-writing-source] .source-input-summary{border:0;padding:0;margin:0}
[data-writing-source] .source-input-summary>summary{display:none}
[data-writing-source] .workspace-form{padding:0!important}
@media(max-width:700px){.source-writing-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.source-writing-rich{padding:16px}}
@media(max-width:600px){
  .source-flow-steps.source-writing-steps{grid-template-columns:repeat(3,minmax(0,1fr))}
  .source-flow-steps.source-writing-steps li>button{display:flex;align-items:center;justify-content:center;gap:6px;padding:9px 4px;min-height:48px}
  .source-writing-steps li>button>b{font-size:14px}.source-writing-steps li>button>small{display:none}
  .source-writing-rich{max-height:520px}
}
@media(max-width:1000px){
  .source-detail-plan-grid.main{grid-template-columns:1fr}
}
@media(max-width:700px){
  .source-detail-input-layout{grid-template-columns:minmax(0,1fr);gap:24px}
  .source-detail-material-fields{padding-left:0;border-left:0;border-top:1px solid var(--line);padding-top:20px}
  .source-detail-understanding,.source-detail-facts,.source-detail-strategy,.source-detail-plan-grid.screens,.source-detail-delivery-grid,.source-detail-delivery-grid.screens{grid-template-columns:1fr}
  .source-detail-understanding{gap:20px}
  .source-detail-editor .source-section-heading{flex-wrap:wrap}
  .source-detail-plan-item{padding:12px}
  .source-detail-archives .source-detail-delivery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
  .source-active-workspace .source-cover-editor .candidate-grid{grid-template-columns:1fr}
  .source-flow-steps{grid-template-columns:repeat(2,minmax(0,1fr))}
  .source-flow-steps li>button{min-height:70px;padding:10px;gap:4px 6px}
  .source-field-row{grid-template-columns:minmax(0,1fr) 110px}
  .source-step-actions .button{flex:1;min-width:120px}
  .source-detail-steps{grid-template-columns:repeat(5,minmax(0,1fr))}
  .source-detail-steps li>button{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:78px;padding:7px 4px;gap:5px;text-align:center}
  .source-detail-steps li>button>b{font-size:14px;line-height:1.4;overflow-wrap:anywhere}
  .source-detail-steps li>button>small{display:none}
  .source-book-steps{grid-template-columns:repeat(3,minmax(0,1fr))}
  .source-book-steps li>button{display:flex;align-items:center;justify-content:center;gap:6px;padding:9px 4px;min-height:48px}
  .source-book-steps li>button>b{font-size:14px}
  .source-book-steps li>button>small{display:none}
}

/* Product library: finished work and reusable inputs remain distinct. */
.library-tabs{display:flex;gap:24px;border-bottom:1px solid var(--line);margin-bottom:18px}
.library-tabs button{border:0;border-bottom:2px solid transparent;background:none;color:var(--muted);min-height:46px;font-size:16px;padding:0 2px}
.library-tabs button.active{border-color:var(--teal);color:var(--ink);font-weight:700}
.library-toolbar{display:grid;grid-template-columns:minmax(0,1fr) 140px;gap:12px;max-width:680px}
.library-search{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:6px;background:var(--panel);padding:0 12px;min-width:0}
.library-search svg{width:20px;height:20px;flex-shrink:0;color:var(--muted)}
.library-search input{width:100%;min-width:0;border:0;background:transparent;color:var(--text);height:44px;font-size:16px;outline-offset:3px}
.library-toolbar .select{height:46px;font-size:16px}
.library-count{font-size:13px;color:var(--muted);margin:16px 0 12px}
.library-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.library-card.agent-card{padding:0;overflow:hidden;gap:0;min-height:0;box-shadow:none}
.library-preview{display:block;position:relative;aspect-ratio:4/3;width:100%;border:0;border-bottom:1px solid var(--line);background:var(--soft);padding:0;overflow:hidden;text-align:left;color:var(--text)}
.library-preview img,.library-preview video{display:block;width:100%;height:100%;object-fit:contain}
.library-media-label{position:absolute;bottom:8px;left:8px;padding:4px 8px;border-radius:4px;background:var(--panel);color:var(--text);font-size:12px}
.library-text-preview{display:block;padding:18px;font-size:15px;line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere}
.library-card-body{padding:14px;display:flex;flex-direction:column;flex:1;min-width:0}
.library-card-body>p{font-size:12px;color:var(--muted);display:flex;flex-direction:column;gap:4px}
.library-card-body h3{font-size:16px;line-height:1.55;margin:8px 0 0;overflow-wrap:anywhere}
.library-partial{font-size:12px;color:var(--teal);margin-top:6px}
.library-card .asset-actions{margin-top:auto;padding-top:10px;gap:8px}
.library-card .asset-actions .text-button{min-height:44px;padding-inline:0;font-size:14px;display:inline-flex;align-items:center}
.library-card .asset-actions .danger{margin-left:auto}
.library-empty{padding:48px 16px;text-align:center;color:var(--muted)}
.library-empty h3{font-size:17px;font-weight:500}
.list-pagination{display:flex;align-items:center;justify-content:center;gap:14px;padding:24px 0;color:var(--muted);font-size:13px}
.list-pagination .button{min-height:44px}
.library-dialog{max-height:85dvh;overflow:auto}
.library-dialog>header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}
.library-dialog>header h2{font-size:20px;margin:0}
.library-dialog .icon-button{display:grid;place-items:center;min-width:44px;min-height:44px}
.library-dialog form{display:grid;gap:18px}
.reference-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px;max-height:48dvh;overflow:auto}
.reference-picker button{padding:0;min-width:0;border:1px solid var(--line);border-radius:6px;overflow:hidden;background:var(--panel);color:var(--text);text-align:left}
.reference-picker img{width:100%;aspect-ratio:4/3;display:block;object-fit:contain;background:var(--soft)}
.reference-picker b{display:block;padding:10px;font-size:14px;overflow-wrap:anywhere}
.reference-picker-status{font-size:14px;color:var(--danger)}
.source-upload-field .library-pick{display:block;width:100%;min-height:44px;text-align:center;font-size:13px}
.source-upload-field{min-width:0}
.projects-page .task-toolbar{padding:0 0 16px;border-bottom:1px solid var(--line);border-radius:0;background:none}
.projects-page .task-toolbar input,.projects-page .task-toolbar select{height:44px}
.projects-page .task-toolbar .icon-button{display:grid;place-items:center;width:44px;height:44px}
.projects-page .task-toolbar .icon-button svg{width:20px;height:20px}
.projects-page .task-actions .text-button{min-height:44px;white-space:normal}
@media(max-width:1050px){.library-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:820px){
  .function-directory .filter{min-height:44px}
  .catalog-view-switch{height:48px;padding:1px}
  .catalog-view-switch button{width:44px;min-height:44px}
  .directory-resume .text-button{min-height:44px}
  input,textarea,select,.input,.textarea,.select,.field input{font-size:16px}
  .choice-row .choice,.gallery-actions button,.source-ppt-icon,.source-writing-format button{min-height:44px;min-width:44px}
  .workspace:not(.source-active-workspace) #resultPanel:has(>.result-empty){display:none}
  .projects-page .task-toolbar{grid-template-columns:minmax(0,1fr) 44px auto;gap:10px}
  .projects-page .task-toolbar label:first-child{grid-column:1/-1}
  .projects-page .task-toolbar>b{align-self:end;padding-bottom:12px;font-weight:400}
  .projects-page .table-panel{border:0;background:transparent;box-shadow:none;overflow:visible;padding:0}
  .projects-page .table,.projects-page .table tbody{display:block;width:100%;min-width:0}
  .projects-page .table thead{display:none}
  .projects-page .table tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 10px;box-shadow:none;padding:14px;margin-bottom:10px;border:1px solid var(--line);border-radius:8px;background:var(--panel)}
  .projects-page .table td{display:block;width:100%;min-width:0;padding:0;border:0;font-size:13px;line-height:1.6;color:var(--muted)}
  .projects-page .table td::before{display:none}
  .projects-page .table td:nth-child(1){grid-column:1;grid-row:1;font-size:16px;color:var(--ink)}
  .projects-page .table td:nth-child(6){grid-column:2;grid-row:1;text-align:right}
  .projects-page .table td:nth-child(2){grid-column:1;grid-row:2}
  .projects-page .table td:nth-child(4){grid-column:2;grid-row:2;text-align:right;font-size:12px}
  .projects-page .table td:nth-child(3){grid-column:1;grid-row:3}
  .projects-page .table td:nth-child(5){grid-column:2;grid-row:3;text-align:right}
  .projects-page .table td:nth-child(7){grid-column:1/-1;grid-row:4;margin-top:6px;border-top:1px solid var(--line)}
  .projects-page .task-actions{justify-content:flex-start;gap:12px}
  .projects-page .task-actions .text-button{font-size:14px;padding:6px 0}
  .projects-page .task-actions .danger{margin-left:auto}
  .projects-page .status{display:inline-block;white-space:nowrap}
  .projects-page .page-head{flex-direction:row;align-items:center;gap:10px}
  .projects-page .head-actions{width:auto;flex-shrink:0}
  .projects-page .head-actions .button{width:auto;font-size:14px;padding-inline:12px}
  .projects-page .page-head .eyebrow{display:none}
  .projects-page .page-head h1{font-size:23px}
  #view:has(#workflowForm)>.page-head{flex-direction:row;align-items:flex-start;gap:12px}
  #view:has(#workflowForm)>.page-head>div:first-child{min-width:0}
  #view:has(#workflowForm)>.page-head>.head-actions{width:auto;flex-shrink:0}
  #view:has(#workflowForm)>.page-head>.head-actions .button{width:auto;padding:0 10px;min-height:44px;font-size:13px}
  #view:has(#workflowForm)>.page-head h1{font-size:24px;line-height:1.4;overflow-wrap:anywhere}
  .workspace-form>.form-grid:has(>.source-upload-field){grid-template-columns:repeat(2,minmax(0,1fr))}
  .workspace-form>.form-grid:has(>.source-upload-field)>*{grid-column:1/-1}
  .workspace-form>.form-grid>.source-upload-field{grid-column:auto!important}
}
@media(max-width:600px){
  .library-grid{gap:12px}
  .library-card-body{padding:10px}
  .library-card .asset-actions{gap:6px;display:grid;grid-template-columns:1fr 1fr}
  .library-card .asset-actions .danger{grid-column:2;justify-self:end}
  .library-card .asset-actions .text-button{font-size:13px}
  .library-card-body>p>span{display:none}
  .library-card-body h3{font-size:15px}
  .library-toolbar{grid-template-columns:minmax(0,1fr) 110px;gap:8px}
  .library-toolbar:not(:has(select)){grid-template-columns:1fr}
  .workspace-form .source-upload-field .upload-zone{min-height:120px;display:flex;flex-direction:column;justify-content:center;padding:12px 8px;gap:6px}
  .workspace-form .source-upload-field .upload-zone span{font-size:14px}
  .workspace-form .source-upload-field .upload-zone small{font-size:12px;line-height:1.65}
  .workspace-form .source-upload-field .source-file-preview{grid-template-columns:32px minmax(0,1fr)}
  .workspace-form .source-upload-field .source-file-preview img{width:32px;height:40px}
  .workspace-form .source-upload-field .source-file-preview>button{grid-column:2;justify-self:end;min-height:40px}
  .source-section-heading,.source-step-actions{scroll-margin-bottom:100px}
}

/* Shared spacing and feedback for input, confirmation and delivery screens. */
:root{--ui-field-gap:16px;--ui-action-gap:12px;--ui-section-gap:24px;--ui-control-height:44px;--ui-motion:180ms;--ui-ease:cubic-bezier(.22,1,.36,1)}
.settings-card>.field+.field{margin-top:var(--ui-field-gap)}
.settings-card>.advanced,.settings-card>.settings-actions{margin-top:20px}
.form-grid,.source-plan-editor{gap:var(--ui-field-gap)}
.field{align-content:start}
.field>span{font-size:14px;line-height:1.5}
.field small{font-size:12px;line-height:1.65}
.page-head>div>p:empty{display:none}
.result-toolbar small{font-size:12px;line-height:1.65}
.result-toolbar>div{gap:6px}
.source-step-actions{gap:var(--ui-action-gap);align-items:center}
.source-step-actions .button,.result-actions .button{white-space:normal;line-height:1.5;padding-block:9px;min-width:0}
.workspace-result>.result-actions{margin-top:var(--ui-section-gap);padding-top:16px;border-top:1px solid var(--line);flex-wrap:wrap;align-items:center}
.workspace-result>.result-actions>.button{flex:0 1 auto}
.workspace-result>.loading{min-height:152px;display:flex;justify-content:center;align-items:center;gap:14px}
.workspace-result>.loading .spinner{width:26px;height:26px;flex-shrink:0;margin:0}
.loading>b{font-size:15px;font-weight:500}
.button:disabled{cursor:not-allowed}
.button,.text-button,.source-ppt-icon,.source-book-toolbar button,.source-book-question-tabs button,
.candidate-card,.source-ppt-template,.source-ppt-thumbnails>button,.source-cover-modes button,
.source-book-mobile-tabs button,.source-poster-tabs button,.library-tabs button,.source-chat-send,
.source-flow-steps li,.source-flow-steps button,summary{transition:background-color var(--ui-motion) ease,color var(--ui-motion) ease,border-color var(--ui-motion) ease,box-shadow var(--ui-motion) ease,transform 140ms var(--ui-ease)}
.text-button:hover:not(:disabled){color:var(--ink)}
.text-button.danger:hover:not(:disabled){color:var(--danger);background:color-mix(in srgb,var(--danger) 8%,transparent)}
:is(.text-button,.choice,.filter,.source-ppt-icon,.source-book-toolbar button,.source-book-question-tabs button,.candidate-card,.source-ppt-template,.source-ppt-thumbnails>button,.source-cover-modes button,.source-book-mobile-tabs button,.source-poster-tabs button,.library-tabs button,.source-chat-send):active:not(:disabled){transform:translateY(1px)}
summary:focus-visible,a:focus-visible{outline:2px solid var(--teal);outline-offset:3px}
#resultPanel:focus,#view:focus{outline:none}
.source-file-preview{grid-template-columns:56px minmax(0,1fr) 44px}
.source-file-preview>.text-button{padding:0;min-width:44px;min-height:44px}
.source-ppt-page-actions,.source-book-outline-row>header>div{gap:8px}
.source-ppt-editor h3{margin:0;color:var(--ink);font-size:20px}
.source-ppt-editor>[data-ppt-director]{justify-self:start;min-height:44px}
.source-ppt-editor .source-step-actions{margin-top:8px}
.source-flow-steps button:hover:not(:disabled){background:var(--soft)}
.source-chat-message{animation:none}
.project-dialog,.tool-search{max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain}
.project-dialog h2{margin:0 0 16px;font-size:20px;line-height:1.4}
.project-dialog>p{line-height:1.75;margin:0 0 24px}
.project-dialog form>.result-actions{margin-top:20px}
dialog[open]::backdrop{animation:ui-backdrop-in 180ms ease both}
dialog[open].is-closing::backdrop{animation:ui-backdrop-out 140ms ease both}
@keyframes ui-backdrop-in{from{opacity:0}to{opacity:1}}
@keyframes ui-backdrop-out{from{opacity:1}to{opacity:0}}
@media(max-width:820px){
  #view .button,dialog .button{min-height:var(--ui-control-height)}
  #view .text-button{min-height:44px;display:inline-flex;align-items:center;justify-content:center}
  #view summary{min-height:44px;padding-block:11px;line-height:1.6}
  #view .gallery-actions{gap:8px 12px;align-items:center}
  #view .gallery-actions a{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center}
  #view .source-book-toolbar button,#view .source-book-question-tabs button{width:44px;height:44px}
  #view .source-chat-send,.tool-search .search-heading button{width:44px;height:44px;min-width:44px}
  #view .directory-search{width:44px;height:44px;min-width:44px}
  .input,.select,.field input{height:44px}
  #view .field input[type=checkbox]{height:auto;width:auto}
  .workspace-result>.result-actions{gap:10px}
  .workspace-result>.result-actions>.button{flex:1 1 125px;font-size:14px}
  .source-step-actions>.button{flex:1 1 140px;min-height:44px}
  .source-step-actions>.button.primary{flex-grow:2}
  .source-file-preview>button{min-height:44px!important}
}
@media(max-width:600px){
  .source-flow-steps{grid-template-columns:repeat(5,minmax(0,1fr))}
  .source-flow-steps li>button{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:84px;padding:8px 4px;gap:6px;text-align:center}
  .source-flow-steps li>button>b{font-size:13px;line-height:1.5;max-width:4em;text-wrap:balance;overflow-wrap:anywhere}
  .source-flow-steps li>button>small{display:none}
  .source-flow-steps.source-writing-steps,.source-flow-steps.source-book-steps{grid-template-columns:repeat(3,minmax(0,1fr))}
  .source-flow-steps.source-writing-steps li>button,.source-flow-steps.source-book-steps li>button{flex-direction:row;min-height:48px}
  .source-step-actions>.button:only-child{flex-basis:100%}
  .workspace-result>.loading{min-height:112px}
  .project-dialog{padding:20px}
  .project-dialog .result-actions>.button{flex:1}
}
@media(prefers-reduced-motion:reduce){
  dialog[open]::backdrop,dialog[open].is-closing::backdrop{animation:none}
  .spinner,.source-chat-typing span{animation:none!important}
}

/* Reference inputs expose both acquisition paths inside one labeled surface. */
.source-upload-field{container:reference-slot / inline-size}
.source-upload-field>.upload-zone,.workspace-form .source-upload-field>.upload-zone{
  display:grid;align-content:start;min-height:0;padding:14px;gap:14px;cursor:default;text-align:left
}
.source-upload-actions{display:flex;flex-wrap:wrap;gap:8px}
.source-upload-actions .button{
  display:inline-flex;flex:1 1 136px;width:auto;min-width:0;min-height:44px;gap:6px;
  padding:8px;font-size:14px;line-height:1.5;white-space:normal;box-shadow:none
}
.source-upload-actions .button>span{min-width:0;overflow-wrap:anywhere}
.source-upload-actions .button svg{display:block;width:17px;height:17px;flex:none}
.source-upload-actions .button.upload-pick{
  color:var(--teal);font-weight:600;
  background:color-mix(in srgb,var(--teal) 9%,var(--panel));
  border-color:color-mix(in srgb,var(--teal) 48%,var(--line))
}
.source-upload-actions .button.library-pick{display:inline-flex;width:auto;border-color:var(--line2);color:var(--text);font-size:14px}
.source-upload-actions .button:hover:not(:disabled){background:var(--strong);border-color:var(--teal)}
.source-upload-caption{display:grid;gap:6px;text-align:center;overflow-wrap:anywhere}
.source-upload-caption b{font-size:14px;font-weight:600;line-height:1.6;color:var(--ink);text-wrap:balance}
.source-upload-role{display:inline-block;max-width:100%}
.source-upload-requirement{display:inline-block;white-space:nowrap}
.source-upload-caption small{font-size:12px;line-height:1.7;color:var(--muted)}
.upload-zone>.source-file-previews:not(:empty){border-top:1px solid var(--line);padding-top:10px}
.upload-zone .source-file-preview:last-child{border-bottom:0}
.upload-disabled{cursor:default;border-style:solid;box-shadow:none}
.upload-disabled b{display:block;font-size:14px;font-weight:500;color:var(--muted)}
.upload-disabled small{display:block;margin-top:6px;font-size:12px;line-height:1.7}
@container reference-slot (max-width:190px){
  .source-upload-field>.upload-zone,.workspace-form .source-upload-field>.upload-zone{padding:10px;gap:12px}
  .source-upload-actions .button{flex-basis:100%;padding-inline:6px}
  .source-file-preview,.workspace-form .source-upload-field .source-file-preview{grid-template-columns:minmax(0,1fr) 44px}
  .source-file-preview>img,.workspace-form .source-upload-field .source-file-preview>img{grid-column:1/-1;width:100%;height:72px}
  .source-file-preview>div{grid-column:1}
  .source-file-preview>button{grid-column:2;grid-row:2}
}
@container reference-slot (max-width:150px){
  .source-upload-actions .button svg{display:none}
}

/* Shared select surface and top-layer options, including deep workflow editors. */
.ui-select,.field>.ui-select,.task-toolbar label>.ui-select{display:block;position:relative;width:100%;min-width:0;font-size:15px;font-weight:400;color:var(--text)}
.ui-select[hidden]{display:none}
.ui-select>select.ui-select-native{
  position:absolute!important;inset:0 auto auto 0!important;width:1px!important;height:1px!important;
  padding:0!important;margin:0!important;border:0!important;opacity:0;pointer-events:none;clip-path:inset(50%)
}
.ui-select-trigger{
  display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-width:0;min-height:44px;
  padding:10px 12px;border:1px solid var(--line);border-radius:6px;background:var(--field-surface);
  color:var(--text);font:inherit;line-height:1.5;text-align:left;
  transition:border-color 180ms ease,box-shadow 180ms ease,background-color 180ms ease
}
.ui-select-value{min-width:0;overflow-wrap:anywhere}
.ui-select-trigger>svg{width:17px;height:17px;flex:none;color:var(--muted);transition:transform 180ms ease,color 180ms ease}
.ui-select-trigger:hover:not(:disabled){border-color:var(--line2);background:color-mix(in srgb,var(--field-surface) 75%,var(--panel))}
.ui-select-trigger[aria-expanded=true]{border-color:var(--teal);box-shadow:0 0 0 3px color-mix(in srgb,var(--teal) 10%,transparent)}
.ui-select-trigger[aria-expanded=true]>svg{transform:rotate(180deg);color:var(--teal)}
.ui-select-trigger:focus-visible{outline:2px solid var(--teal);outline-offset:3px}
.ui-select-trigger:disabled{opacity:.55;cursor:not-allowed}
.ui-select-trigger[aria-invalid=true]{border-color:var(--danger)}
.ui-select-menu{
  position:fixed;inset:auto;margin:0;padding:6px;box-sizing:border-box;max-height:320px;overflow-y:auto;overflow-x:hidden;
  border:1px solid var(--line2);border-radius:8px;background:var(--panel);color:var(--text);
  box-shadow:0 12px 32px #0000001c,0 2px 8px #0000000a;z-index:100;
  font:15px/1.5 "Segoe UI","Microsoft YaHei",sans-serif;letter-spacing:0;overscroll-behavior:contain;
  scrollbar-width:thin;scrollbar-color:var(--line2) transparent;transition:none
}
.ui-select-menu::backdrop{background:transparent}
.ui-select-menu::-webkit-scrollbar{width:5px}
.ui-select-menu::-webkit-scrollbar-thumb{border-radius:4px;background:var(--line2)}
.ui-select-option{
  display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:10px 12px;
  border-radius:4px;cursor:pointer;transition:background-color 120ms ease,color 120ms ease
}
.ui-select-option>span:first-child{min-width:0;overflow-wrap:anywhere}
.ui-select-option.is-active{background:var(--soft)}
.ui-select-option[aria-selected=true]{background:color-mix(in srgb,var(--teal) 10%,var(--panel));color:var(--teal);font-weight:600}
.ui-select-option[aria-selected=true].is-active{background:color-mix(in srgb,var(--teal) 16%,var(--panel))}
.ui-select-option[aria-disabled=true]{opacity:.45;cursor:not-allowed}
.ui-select-check{width:16px;height:16px;flex:none;position:relative}
.ui-select-option[aria-selected=true] .ui-select-check:after{
  content:"";position:absolute;left:5px;top:2px;width:6px;height:10px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg)
}
.ui-select-group{padding:8px 12px 4px;color:var(--muted);font-size:12px;font-weight:600}
@media(max-width:820px){
  .ui-select,.field>.ui-select,.task-toolbar label>.ui-select,.ui-select-menu{font-size:16px}
  .ui-select-option{min-height:46px}
}
@media(prefers-reduced-motion:reduce){
  .ui-select-trigger,.ui-select-trigger>svg,.ui-select-option{transition:none}
}

.workspace-form .form-actions{flex-wrap:wrap}
.workspace-form .form-actions>.cost{white-space:nowrap}
.workspace-form .form-actions>.button{margin-left:auto;max-width:100%;min-height:44px;height:auto;white-space:normal;line-height:1.5}
.input,.select,.textarea,.field input,.plan-editor textarea{background-color:var(--field-surface)}
