:root{--bg:#fff;--paper:#fff;--ink:#000;--muted:#000;--line:#dedede;--action:#000;--accent:#fff;--serif:Georgia,'Songti SC',serif}*{box-sizing:border-box}body{margin:0;color:var(--ink);background:#fff;font:14px/1.6 -apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer;border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:10px;padding:10px 15px;transition:.18s}button:hover{background:#fff;border-color:#dedede}button:disabled{opacity:.5;cursor:wait}button.primary{background:#fff;color:#000;border-color:var(--action)}input,select,textarea{border:1px solid var(--line);background:#fff;border-radius:9px;color:var(--ink);padding:11px 12px;width:100%;outline:none}input:focus,select:focus,textarea:focus{border-color:var(--action);box-shadow:0 0 0 3px #0000000a}label{display:block;font-size:12px;color:#000;margin:16px 0 6px}h1,h2,h3,p{margin-top:0}small,.muted{color:var(--muted)}.boot{padding:15vh;text-align:center}.auth{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}.auth-art{background:#fff;padding:70px;color:#000;display:flex;flex-direction:column;justify-content:space-between}.wordmark{font-weight:700;letter-spacing:2px;display:flex;align-items:center;gap:10px}.logo{background:#fff;color:#000;border-radius:12px;display:inline-grid;place-items:center;width:36px;height:36px;font-size:25px}.auth-art h1{font:56px/1.4 var(--serif);margin:50px 0 24px}.auth-art p{max-width:380px;color:#000}.art-lines{border-top:1px solid #dedede;padding-top:25px;letter-spacing:3px;font-size:11px}.auth-form{align-self:center;max-width:410px;width:100%;padding:32px;margin:auto}.auth-form h2{font-size:28px}.auth-form button{width:100%;margin-top:25px}.shell{display:grid;grid-template-columns:244px 1fr;min-height:100vh}.sidebar{position:fixed;inset:0 auto 0 0;width:244px;border-right:1px solid var(--line);padding:28px 20px;display:flex;flex-direction:column;background:#fff}.sidebar .wordmark{margin-bottom:34px;font-size:19px}.nav{display:flex;flex-direction:column;gap:7px}.nav button{text-align:left;background:#fff;border-color:transparent}.nav button.active{background:#fff;color:#000;font-weight:600}.nav-icon{display:inline-block;width:27px}.caption{font-size:10px;letter-spacing:2px;color:var(--muted);margin:27px 12px 12px}.recent{overflow:auto;flex:1;min-height:70px;max-height:35vh}.recent button{display:block;text-align:left;width:100%;border:0;background:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;padding:9px 12px}.profile{border-top:1px solid #dedede;padding-top:18px;margin-top:auto}.profile-row{display:flex;align-items:center;gap:10px}.avatar{width:32px;height:32px;background:#fff;border-radius:50%;display:grid;place-items:center;font-weight:600}.profile button{font-size:11px;padding:4px 8px;background:#fff;margin-top:12px}.main{grid-column:2;min-width:0}.topbar{height:82px;border-bottom:1px solid var(--line);padding:0 40px;display:flex;align-items:center;justify-content:space-between;gap:15px}.topbar small{font-size:11px;letter-spacing:2px}.badge{display:inline-flex;align-items:center;gap:7px;font-size:11px;border:1px solid #dedede;background:#fff;padding:5px 12px;border-radius:20px}.badge::before{content:'';width:6px;height:6px;border-radius:50%;background:#fff}.badge.warn{background:#fff;border-color:#dedede;color:#000}.workspace{max-width:1120px;margin:auto;padding:36px 46px}.welcome{padding:42px 0 30px}.eyebrow{font-size:10px;letter-spacing:3px;color:#000;margin-bottom:17px}.welcome h1{font:38px/1.4 var(--serif);font-weight:400}.welcome p{color:var(--muted);font-size:13px}.chips{display:flex;flex-wrap:wrap;gap:9px;margin-top:25px}.chips button{font-size:12px;background:#fff;padding:8px 14px}.chatbox{background:#fff;border:1px solid var(--line);border-radius:18px;padding:18px 20px;box-shadow:0 10px 28px #00000005}.chatbox textarea{min-height:115px;border:0;resize:vertical;padding:0;box-shadow:none;font-size:14px}.composer-footer{display:flex;align-items:center;gap:10px;padding-top:13px;border-top:1px solid #dedede}.composer-footer select{width:auto;max-width:230px;padding:7px 10px;border:0;background:#fff;font-size:12px}.composer-footer button{margin-left:auto}.composer-note{text-align:center;font-size:11px;color:#000;margin-top:12px}.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:36px}.card{background:#fff;border:1px solid var(--line);border-radius:13px;padding:22px}.card .num{font:28px var(--serif);margin:11px 0}.card small{font-size:11px}.card-icon{color:#000;font-size:18px}.section-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:8px 0 26px}.section-head h2{margin:0;font-size:23px;font-weight:500}.notice{background:#fff;border:1px solid #dedede;border-radius:10px;padding:12px 16px;font-size:12px;margin-bottom:23px}.notice.warning{background:#fff;border-color:#dedede}.messages{margin:10px 0 25px;display:flex;flex-direction:column;gap:18px}.message{padding:18px 22px;background:#fff;border:1px solid var(--line);border-radius:14px;white-space:pre-wrap;overflow-wrap:anywhere;max-width:95%}.message.user{background:#fff;align-self:flex-end;border-color:#dedede}.message .role{font-size:10px;color:#000;margin-bottom:9px;letter-spacing:1px}.pending{border:1px dashed #dedede;background:#fff;padding:15px;border-radius:10px;margin:14px 0}.image-result{display:block;max-width:100%;max-height:580px;border-radius:12px;margin:18px 0;object-fit:contain}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:20px}.panel{padding:25px;background:#fff;border:1px solid var(--line);border-radius:14px;margin-bottom:20px}.panel h3{font-size:16px;font-weight:600;margin-bottom:6px}.panel button[type=submit]{margin-top:20px}.inline{display:flex;gap:12px;align-items:end}.inline>div{flex:1}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;text-align:left;font-size:12px}th{font-weight:500;color:#000;padding:12px 8px;border-bottom:1px solid var(--line);white-space:nowrap}td{padding:14px 8px;border-bottom:1px solid #dedede;max-width:300px;overflow:hidden;text-overflow:ellipsis}td button{font-size:11px;padding:4px 10px}.state{font-size:11px;background:#fff;border-radius:5px;padding:3px 7px;white-space:nowrap}.error{color:#000}.auth-error{color:#000;margin-top:12px}.bar{height:5px;background:#fff;border-radius:4px;overflow:hidden;margin-top:15px}.bar progress{width:100%;height:5px;accent-color:var(--action)}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);padding:12px 22px;border-radius:10px;background:#fff;color:#000;box-shadow:0 6px 25px #00000012;display:none;z-index:20;max-width:90vw}.preview-ref{max-height:100px;border-radius:8px;display:block;margin:10px 0}.heading-sub{font-size:12px;color:var(--muted);margin-top:8px}.settings-actions{display:flex;gap:10px;align-items:center}.image-prompt{min-height:130px}.subtle-link{color:var(--action)}@media(max-width:900px){.shell{grid-template-columns:190px 1fr}.sidebar{width:190px;padding:22px 12px}.workspace{padding:25px}.topbar{padding:0 25px}.two-col{grid-template-columns:1fr}.cards{gap:8px}.card{padding:15px}.auth-art{padding:40px}.auth-art h1{font-size:42px}}@media(max-width:620px){.auth{display:block}.auth-art{padding:25px}.auth-art h1,.auth-art p,.art-lines{display:none}.auth-form{padding:35px 25px}.shell{display:block}.sidebar{position:static;width:auto;padding:14px 18px;border-right:0;border-bottom:1px solid var(--line)}.sidebar .wordmark{margin:0 0 10px}.nav{flex-direction:row;overflow:auto}.nav button{white-space:nowrap;padding:7px}.caption,.recent,.profile{display:none}.topbar{height:64px;padding:0 20px}.workspace{padding:22px 18px}.welcome{padding:20px 0}.welcome h1{font-size:30px}.cards{grid-template-columns:1fr}.card{display:flex;align-items:center;justify-content:space-between}.card .num{font-size:22px}.composer-footer{flex-wrap:wrap}.composer-footer select{max-width:150px}.inline{flex-wrap:wrap}.inline>div{min-width:130px}.panel{padding:18px}}

input[type=checkbox]{width:auto;vertical-align:middle;margin-right:7px}

/* SPARK IDEA: original red/white brand artwork, monochrome interface. */
:root{color-scheme:light}
body,button,input,select,textarea{color:#000;background:#fff}
input::placeholder,textarea::placeholder{color:#000;opacity:1}
button.primary{background:#fff;color:#000;border:1px solid #000;font-weight:600}
button:hover{background:#fff;border-color:#000}
button:disabled{opacity:.45}
.nav button.active{background:#fff;color:#000;border:1px solid #000}
.badge::before{background:#000}
.auth-art{border-right:1px solid #dedede}
.avatar{border:1px solid #dedede}
#toast{background:#fff;color:#000;border:1px solid #000}
.wordmark{width:100%}
.brand-logo{display:block;position:relative;overflow:hidden;width:100%;max-width:200px;aspect-ratio:1774 / 438;flex-shrink:0}
.brand-logo img{position:absolute;width:105.637%;max-width:none;height:auto;left:-2.818%;top:-73.973%;display:block}
.auth-art .brand-logo{max-width:310px}
@media(max-width:900px){.sidebar .brand-logo{max-width:166px}}
@media(max-width:620px){.sidebar .brand-logo{max-width:180px}.auth-art .brand-logo{max-width:230px}.auth-art{border-right:0;border-bottom:1px solid #dedede}}

/* Reference layout: white canvas, black typography, SPARK red accents. */
:root{--brand:#d50020;--line:#ececee;--serif:-apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif}
.ui-icon{width:21px;height:21px;flex-shrink:0;vertical-align:middle}
button.primary{background:var(--brand);border-color:var(--brand);color:#fff;border-radius:10px}
button.primary:hover{background:#b9001b;border-color:#b9001b}
button:focus-visible,a:focus-visible{outline:2px solid var(--brand);outline-offset:3px}
.reference-auth{grid-template-columns:minmax(0,60%) minmax(0,40%);min-height:100vh;background:#fff}
.reference-auth .auth-art{position:relative;overflow:hidden;display:flex;justify-content:flex-start;padding:52px 54px 32px;min-height:850px;border-right:1px solid var(--line)}
.reference-auth .auth-art .wordmark{position:relative;z-index:2}
.reference-auth .auth-art .brand-logo{max-width:252px}
.auth-tagline{position:relative;z-index:2;font-size:10px;letter-spacing:4px;line-height:1.6;margin-top:40px}
.auth-copy{position:relative;z-index:2;margin-top:78px}
.reference-auth .auth-copy h1{font-family:var(--serif);font-size:clamp(46px,5.7vw,88px);font-weight:850;line-height:1.23;letter-spacing:-3px;margin:0 0 30px}
.reference-auth .auth-copy p{font-size:19px;line-height:1.8;max-width:510px;margin:0}
.auth-features{position:relative;z-index:2;display:flex;gap:28px;margin-top:58px}
.auth-features>div{display:flex;gap:14px;align-items:center}
.auth-features .ui-icon{width:30px;height:36px;stroke-width:1.4}
.auth-features strong,.auth-features small{display:block;white-space:nowrap}
.auth-features strong{font-size:14px}.auth-features small{font-size:11px;margin-top:3px}
.auth-footer{position:relative;z-index:2;font-size:9px;letter-spacing:3px;margin-top:auto;padding-top:65px}
.glass-art{position:absolute;right:-70px;top:175px;width:330px;height:650px;pointer-events:none;opacity:.85}
.glass-plane{position:absolute;display:block;transform:skewY(29deg);border:1px solid #ffffffc7;box-shadow:inset 1px 0 0 #fff}
.glass-plane.front{width:230px;height:350px;top:158px;right:10px;background:linear-gradient(125deg,#f00023,#d40017 50%,#68000f);box-shadow:14px 20px 55px #a7001424;opacity:.94}
.glass-plane.middle{width:218px;height:460px;top:80px;right:38px;transform:skewY(-29deg);background:linear-gradient(150deg,#d700201a,#ff001840 48%,#65000c0f)}
.glass-plane.back{width:90px;height:385px;top:5px;left:0;background:linear-gradient(#d5002010,#d5002000)}
.glass-plane.floor{width:300px;height:140px;bottom:9px;right:0;transform:skewY(-29deg);background:linear-gradient(60deg,#f4f4f450,#fff0)}
.art-cross{position:absolute;bottom:3px;left:135px;color:var(--brand);font-size:27px;font-weight:200}
.auth-entry{display:flex;flex-direction:column;padding:36px 34px 24px;min-width:0}
.locale-label{text-align:right;font-size:12px;margin-bottom:55px}
.reference-auth .auth-form{max-width:460px;border:1px solid var(--line);border-radius:13px;padding:38px 32px;background:#fffffffa;margin:auto 0;align-self:center;box-shadow:0 8px 40px #00000002}
.reference-auth .auth-form h2{font-size:40px;letter-spacing:-1px;font-weight:800;margin-bottom:8px;line-height:1.25}
.reference-auth .auth-form>p{font-size:15px;margin:0 0 30px}
.reference-auth .auth-form label{font-size:13px;font-weight:600;margin:21px 0 7px}
.field-with-icon{position:relative;display:flex;align-items:center}
.field-with-icon>.ui-icon{position:absolute;left:14px;width:18px;height:18px;pointer-events:none}
.field-with-icon input{padding:13px 42px;font-size:14px;min-height:48px;border-color:#e3e3e8}
.field-with-icon input::placeholder{color:#000;opacity:.6}
.reference-auth .auth-form button.password-toggle{position:absolute;right:7px;top:5px;width:36px;height:38px;padding:8px;border:0;margin:0;background:transparent;color:#000}
.auth-options{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:18px 0 22px;font-size:11px}
.reference-auth .auth-form .text-button{width:auto;margin:0;padding:0;background:transparent;border:0;font-size:12px;color:#000}
.reference-auth .auth-form .auth-submit{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:0;font-size:16px;min-height:52px}
.auth-bottom{border-top:1px solid var(--line);padding-top:25px;margin-top:28px;font-size:12px;text-align:center}
.auth-help{font-size:12px;border:1px solid var(--line);border-radius:8px;margin-top:20px;padding:13px}
.auth-entry-footer{text-align:center;font-size:10px;margin-top:36px;letter-spacing:2px}
.reference-shell{grid-template-columns:244px minmax(0,1fr)}
.reference-shell .sidebar{padding:25px 18px 20px}
.reference-shell .sidebar .brand-logo{max-width:208px}
.reference-shell .sidebar .wordmark{margin-bottom:23px}
.reference-shell .nav button{display:flex;align-items:center;gap:10px;font-size:13px;padding:11px 12px;border:1px solid transparent;border-radius:10px}
.reference-shell .nav button.active{background:#fff;border-color:#f0c7cc;color:#000;box-shadow:inset 3px 0 0 var(--brand)}
.nav-icon{width:22px;display:flex}.nav-plus{margin-left:auto;color:var(--brand)}
.reference-shell .caption{display:flex;justify-content:space-between;font-size:11px;letter-spacing:0;margin:35px 10px 16px}
.reference-shell .recent{max-height:none;min-height:50px}
.reference-shell .recent button{display:flex;gap:12px;align-items:center;padding:10px;font-size:11px}
.recent .ui-icon{width:15px;height:15px}.recent button span{overflow:hidden;text-overflow:ellipsis}
.reference-shell .profile{padding-top:15px}.reference-shell .profile-row{padding:0;border:0;display:flex;width:100%;text-align:left;gap:12px;font-size:12px;margin:0}
.profile-row>span:last-child{margin-left:auto}.profile-row small{display:block;font-size:10px}
.reference-shell .avatar{background:#fff;border-color:#ececec;width:35px;height:35px}
.reference-shell .topbar{height:82px;padding:0 28px;border-bottom:1px solid var(--line)}
.topbar>strong{font-size:14px;font-weight:600}.topbar-actions{display:flex;gap:20px;align-items:center}.top-profile{display:flex;gap:10px;align-items:center;border:0;padding:0;font-size:12px}
.reference-shell .badge{font-size:10px;padding:5px 10px}.reference-shell .badge::before{background:var(--brand)}
.workspace-layout{display:block}.workspace-layout.with-rail{display:grid;grid-template-columns:minmax(0,1fr) 270px;min-height:calc(100vh - 82px)}
.reference-shell .workspace{width:100%;max-width:1140px;padding:30px;margin:0 auto}
.with-rail .workspace{padding:45px 30px 25px;max-width:900px}
.dashboard-welcome{text-align:center;padding:46px 0 35px}
.dashboard-welcome h1{font-size:clamp(30px,3.4vw,52px);font-family:var(--serif);font-weight:800;letter-spacing:-1.6px;line-height:1.35;margin-bottom:23px}
.dashboard-welcome p{font-size:14px;line-height:1.85;margin-bottom:0}
.template-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin:8px 0 32px}
.template-card{display:flex;text-align:left;align-items:center;gap:12px;min-height:90px;padding:16px 13px;border-color:#e9e9ed;border-radius:12px;box-shadow:0 3px 9px #00000002}
.template-card:hover{border-color:#d5002055;box-shadow:0 5px 20px #d5002007}
.template-card>span:nth-child(2){min-width:0}.template-card strong{display:block;font-size:13px;font-weight:700;white-space:nowrap}.template-card small{display:block;font-size:10px;margin-top:4px;white-space:nowrap}
.template-icon{display:grid;place-items:center;border:1px solid #f1dbdf;border-radius:11px;width:37px;height:43px;flex-shrink:0;color:var(--brand)}
.template-icon .ui-icon{width:24px;height:24px}.template-arrow{margin-left:auto;font-size:17px}
.reference-shell .chatbox{padding:18px;border-radius:14px;box-shadow:0 8px 22px #00000005}.reference-shell .chatbox textarea{min-height:85px}
.reference-shell .composer-footer{border-top:0;padding-top:5px;gap:9px}.composer-spark{padding:7px;border:1px solid var(--line);border-radius:9px;display:flex}
.reference-shell .composer-footer select{border:1px solid var(--line);padding:9px;max-width:190px}.reference-shell .composer-footer small{font-size:10px}
.reference-shell .send-button{width:42px;height:42px;font-size:25px;padding:0;font-weight:400}.reference-shell .composer-note{font-size:10px;margin:12px 0 18px}
.reference-shell .notice{font-size:10px;padding:10px 12px;border-color:#eee;margin-bottom:10px;line-height:1.8}
.right-rail{border-left:1px solid var(--line);padding:20px 16px;display:flex;flex-direction:column;gap:14px;min-width:0}
.rail-card,.rail-promo{padding:18px 15px;border:1px solid var(--line);border-radius:12px;background:#fff;overflow:hidden}
.rail-promo{position:relative;min-height:180px}.rail-promo>small,.rail-promo h3,.rail-promo p,.rail-promo button{position:relative;z-index:1}
.rail-promo>small{font-size:10px}.rail-promo h3{font-size:19px;font-weight:800;margin:13px 0 3px}.rail-promo p{font-size:11px;margin-bottom:20px}.rail-promo button{font-size:11px;padding:8px 12px;display:flex;align-items:center;gap:10px}.rail-promo button .ui-icon{width:15px;height:15px}
.promo-fold{position:absolute;width:90px;height:160px;right:-27px;bottom:-58px;background:linear-gradient(125deg,#fff 0,#fce3e7 50%,#d50020 51%,#a70019 100%);transform:rotate(38deg);box-shadow:-8px 0 15px #d500200b}
.rail-card h3{font-size:12px;margin-bottom:16px}.rail-card>button{display:flex;align-items:center;gap:13px;border:0;padding:9px 3px;font-size:11px;width:100%;text-align:left}.rail-card>button .ui-icon{width:16px;height:16px}.rail-card>button>span:last-child,.rail-card>button>.ui-icon:last-child{margin-left:auto}.rail-card>button>.ui-icon:first-child{margin-left:0}
.quota-ring{display:flex;align-items:center;gap:10px}.quota-ring>svg{width:90px;flex-shrink:0}.quota-ring p{font-size:11px;margin:5px 0}.quota-ring small{font-size:10px}.text-button{border:0;background:transparent;padding:0;font-size:11px}.quota-ring .text-button{color:var(--brand)}
.rail-info{display:flex;gap:13px;margin:18px 0;font-size:11px;align-items:center}.rail-info small{display:block;font-size:9px;margin-top:2px}.rail-info .ui-icon{width:20px;height:20px}.rail-help{font-size:11px;padding-top:12px;line-height:1.8}
.inspiration-tip{margin-top:30px;font-size:13px}
@media(min-width:1600px){.reference-auth .auth-art{padding:65px 70px 40px}.auth-copy{margin-top:100px}.glass-art{right:0;width:370px}.reference-auth .auth-copy h1{font-size:94px}.reference-auth .auth-entry{padding:40px 65px}.with-rail .workspace{padding-top:65px}.dashboard-welcome{padding-top:70px}}
@media(max-width:1250px){.workspace-layout.with-rail{grid-template-columns:minmax(0,1fr) 235px}.right-rail{padding:16px 12px}.reference-shell{grid-template-columns:210px minmax(0,1fr)}.reference-shell .sidebar{width:210px;padding:22px 14px}.with-rail .workspace{padding:35px 22px 20px}.template-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-welcome{padding-top:20px}.dashboard-welcome h1{font-size:37px}.reference-auth .auth-art{padding:44px 38px 28px}.reference-auth .auth-copy h1{font-size:63px}.reference-auth .auth-copy p{font-size:16px}.auth-features{gap:20px}.auth-features .ui-icon{width:23px}.auth-features strong{font-size:12px}.auth-features small{font-size:10px}.auth-features>div{gap:8px}.reference-auth .auth-form{padding:32px 25px}.auth-entry{padding:30px 24px}.glass-art{right:-135px;opacity:.65}.reference-auth .auth-form h2{font-size:34px}}
@media(max-width:1000px){.workspace-layout.with-rail{grid-template-columns:minmax(0,1fr)}.right-rail{display:none}.reference-auth{grid-template-columns:1fr 1fr}.reference-auth .auth-copy h1{font-size:50px}.auth-features{flex-wrap:wrap;gap:20px}.glass-art{opacity:.18}.reference-auth .auth-art{min-height:780px}.reference-auth .auth-copy p{font-size:15px}.auth-copy{margin-top:85px}.reference-auth .auth-art .brand-logo{max-width:220px}.reference-auth .auth-form h2{font-size:30px}.auth-entry{padding:28px 22px}.auth-footer{font-size:8px;letter-spacing:2px}.template-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.template-card{gap:8px;padding:12px 10px}.template-icon{width:29px}.template-arrow{display:none}}
@media(max-width:760px){.reference-auth{display:block}.reference-auth .auth-art{min-height:auto;padding:25px;border-right:0;border-bottom:1px solid var(--line)}.reference-auth .auth-art .brand-logo{max-width:205px}.auth-tagline,.auth-copy,.auth-features,.auth-footer,.glass-art{display:none}.auth-entry{padding:20px 24px 30px}.locale-label{margin-bottom:25px}.reference-auth .auth-form{max-width:480px;width:100%;margin:0 auto;padding:28px}.auth-entry-footer{margin-top:25px}.reference-shell{grid-template-columns:180px minmax(0,1fr)}.reference-shell .sidebar{width:180px}.reference-shell .sidebar .brand-logo{max-width:152px}.template-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.top-profile{display:none}.dashboard-welcome h1{font-size:32px}.dashboard-welcome p{font-size:12px}.dashboard-welcome p br{display:none}.reference-shell .workspace{padding:25px 20px}.reference-shell .topbar{padding:0 20px;height:70px}.workspace-layout.with-rail{min-height:calc(100vh - 70px)}}
@media(max-width:620px){.reference-shell{display:block}.reference-shell .sidebar{width:100%;padding:16px 18px 10px}.reference-shell .sidebar .brand-logo{max-width:180px}.reference-shell .sidebar .wordmark{margin-bottom:14px}.reference-shell .nav{gap:4px}.reference-shell .nav button{font-size:12px;padding:8px 10px;gap:7px;flex-shrink:0}.nav-icon .ui-icon{width:17px;height:17px}.nav-icon{width:17px}.nav-plus{display:none}.reference-shell .caption,.reference-shell .recent{display:none}.reference-shell .profile{display:none}.reference-shell .topbar{height:58px;padding:0 18px}.reference-shell .topbar>strong{font-size:12px}.reference-shell .workspace{padding:24px 18px}.dashboard-welcome{padding:15px 0 24px}.dashboard-welcome h1{font-size:29px;letter-spacing:-1px;line-height:1.45}.dashboard-welcome p{font-size:12px}.template-grid{gap:9px;margin-bottom:24px}.template-card{min-height:77px;gap:9px;padding:11px 10px}.template-card strong{font-size:12px}.template-card small{font-size:9px}.template-icon{width:31px;height:38px}.template-icon .ui-icon{width:21px}.reference-shell .chatbox textarea{min-height:95px}.reference-shell .composer-footer select{max-width:137px;font-size:11px}.reference-shell .composer-footer{gap:6px}.composer-spark{padding:7px}.composer-spark .ui-icon{width:16px;height:16px}.reference-auth .auth-form{padding:26px 22px}.reference-auth .auth-form h2{font-size:32px}}

/* Interaction and optical refinements, preserving the approved layout. */
:root{--line:#e8e8ec}
body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
button{transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease,background-color .16s ease}
button:disabled{cursor:not-allowed;opacity:.45}
button:active:not(:disabled){transform:translateY(1px)}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #d50020;outline-offset:3px}
.template-card{min-height:96px;padding:18px 14px;gap:13px}
.template-card strong{font-size:14px;line-height:1.5}
.template-card small{font-size:11px;line-height:1.5;margin-top:4px;white-space:normal}
.template-arrow{transition:transform .16s ease}
.template-card:hover .template-arrow{transform:translateX(3px)}
.reference-shell .nav button:hover:not(.active){border-color:#dedee3}
.reference-shell .recent button{font-size:12px;border-radius:8px;min-height:38px}
.reference-shell .recent button:hover,.reference-shell .recent button[aria-current=page]{box-shadow:inset 2px 0 #d50020}
.reference-shell .recent{scrollbar-width:thin;scrollbar-color:#ddd #fff}
.reference-shell .profile-row small{font-size:11px;margin-top:3px}
.rail-card h3{font-size:13px;margin-bottom:17px}
.rail-card>button{font-size:12px;min-height:40px;padding:10px 3px}
.rail-card>button:hover{box-shadow:inset 0 -1px #dedee3}
.rail-info{font-size:12px;line-height:1.6}.rail-info small{font-size:10px}
.rail-promo>small,.rail-promo p,.quota-ring small{font-size:11px}
.quota-ring p{font-size:12px;line-height:1.8;font-variant-numeric:tabular-nums}
.reference-shell .composer-note{font-size:11px;line-height:1.7}
.reference-shell .notice{font-size:11px;line-height:1.8;padding:11px 13px}
.reference-shell .chatbox:focus-within{border-color:#c9c9cf;box-shadow:0 6px 24px #00000008}
.reference-shell .chatbox textarea{line-height:1.8;max-height:320px}
.message{line-height:1.9}.message .role{font-size:11px;margin-bottom:12px}
.pending{display:flex;align-items:center;gap:11px;line-height:1.7;font-size:12px}
.pending::before{content:'';width:14px;height:14px;flex-shrink:0;border:2px solid #e6e6e6;border-top-color:#d50020;border-radius:50%;animation:working-spin .85s linear infinite}
@keyframes working-spin{to{transform:rotate(360deg)}}
[aria-busy=true] textarea:disabled{opacity:1;-webkit-text-fill-color:#000}
#toast{font-size:13px;line-height:1.7;border-color:#e2e2e7;padding:12px 18px;box-shadow:0 6px 28px #00000012}
.auth-options{font-size:12px}.auth-bottom{line-height:1.8}.auth-error:not(:empty){border-left:2px solid #d50020;padding:8px 12px;font-size:13px}
.reference-auth .field-with-icon input{transition:border-color .16s ease,box-shadow .16s ease}
.reference-auth .field-with-icon input:focus{border-color:#d50020;box-shadow:0 0 0 3px #d5002008}
@media(max-width:1250px){.template-card{padding:14px 12px;gap:10px}.template-card strong{font-size:13px}.template-card small{font-size:11px}}
@media(max-width:620px){.template-card{min-height:88px;padding:12px 10px;gap:9px}.template-card strong{font-size:12px}.template-card small{font-size:10px}.reference-shell .nav{scrollbar-width:thin;scrollbar-color:#ddd #fff;padding-bottom:5px}.reference-shell .notice{font-size:11px}.reference-shell .composer-footer small{font-size:10px}.reference-shell .topbar-actions{gap:8px}.auth-options{font-size:11px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

.cpa-panel .section-head{margin-bottom:15px}.cpa-actions{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0}.cpa-info{font-size:13px;line-height:1.8}.cpa-wait{display:flex;align-items:center;flex-wrap:wrap;gap:12px}.cpa-wait a{color:#d50020}.cpa-wait button{font-size:12px}.cpa-panel .heading-sub{line-height:1.8}.cpa-panel .badge{white-space:nowrap}@media(max-width:620px){.cpa-actions{flex-direction:column}.cpa-actions button{width:100%}.cpa-panel .section-head{align-items:flex-start;flex-direction:column}}

.section-head a{color:#111;text-underline-offset:4px}.section-head a:hover{color:#ce0024}
/* Management sections */
[data-admin-panel][hidden]{display:none!important}
.admin-tabs{display:flex;gap:28px;border-bottom:1px solid #e5e5e5;margin:24px 0 28px;overflow-x:auto}
.admin-tabs button{flex-shrink:0;border:0;border-radius:0;background:#fff;padding:14px 3px;color:#111;position:relative}
.admin-tabs button[aria-selected=true]{font-weight:700;box-shadow:inset 0 -2px #ce0024}
.admin-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:24px}
.admin-metrics article{border:1px solid #e5e5e5;border-radius:14px;padding:24px;background:#fff;display:flex;flex-direction:column;gap:12px}
.admin-metrics strong{font-size:28px;line-height:1.3}.admin-metrics strong small{font-size:13px;font-weight:400}.admin-metrics span,.admin-metrics small{font-size:13px;color:#111}
.admin-status-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 0;border-top:1px solid #eee}.admin-status-row p{font-size:13px;margin:7px 0 0}.admin-status-row>span{font-size:13px;text-align:right}
.admin-shortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.admin-shortcuts button{text-align:left;padding:24px;background:#fff;border:1px solid #e5e5e5;border-radius:14px;white-space:normal}.admin-shortcuts strong{display:flex;justify-content:space-between;font-size:16px;margin-bottom:12px}.admin-shortcuts small{font-size:13px;line-height:1.7;color:#111}
.admin-details{border-top:1px solid #eee;margin:22px 0;padding-top:18px}.admin-details summary{cursor:pointer;font-size:14px;color:#111;padding:5px 0}.admin-details p{font-size:13px;line-height:1.8}.admin-costs{margin:24px 0}
@media(max-width:1000px){.admin-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-shortcuts{grid-template-columns:1fr}}
@media(max-width:520px){.admin-tabs{gap:20px;margin:18px 0}.admin-metrics{gap:10px}.admin-metrics article{padding:16px}.admin-metrics strong{font-size:23px}.admin-status-row{gap:12px}.admin-shortcuts button{padding:18px}}

/* ===== 最近对话：删除入口 ===== */
.recent-item{display:flex;align-items:center;gap:2px}
.recent-item>button[data-conversation]{flex:1;min-width:0}
.recent-item .recent-del{flex-shrink:0;width:26px;height:26px;padding:0;border:0;background:transparent;color:#b0b0b6;border-radius:6px;font-size:12px;line-height:1;opacity:0;transition:opacity .14s ease,color .14s ease,background-color .14s ease}
.recent-item:hover .recent-del,.recent-del:focus-visible{opacity:1}
.recent-del:hover{color:#d50020;background:#f4f4f5}
.recent-del:active:not(:disabled){transform:translateY(1px)}

/* ===== 顶栏主题选择器 ===== */
.theme-select{width:auto;padding:6px 9px;font-size:11px;border:1px solid #e3e3e8;border-radius:8px;background:#fff;color:#111}
@media(max-width:620px){.theme-select{font-size:11px;padding:5px 6px}}

/* ===== 三主题：白 / 黑 / 跟随系统（默认浅色=现有设计） ===== */
html[data-theme=dark]{color-scheme:dark}
html[data-theme=dark] body{background:#0b0b0d;color:#f2f2f2}
html[data-theme=dark] button,html[data-theme=dark] input,html[data-theme=dark] select,html[data-theme=dark] textarea{background:#151518;color:#f2f2f2;border-color:#2a2a30}
html[data-theme=dark] button:hover{background:#1c1c20;border-color:#d50020}
html[data-theme=dark] button.primary{background:var(--brand);border-color:var(--brand);color:#fff}
html[data-theme=dark] button.primary:hover{background:#ff1f3d;border-color:#ff1f3d}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#8a8a92;opacity:1}
html[data-theme=dark] label,html[data-theme=dark] .muted{color:#b9b9c0}
html[data-theme=dark] .sidebar{background:#0b0b0d;border-color:#22222a}
html[data-theme=dark] .nav button{background:transparent;color:#d6d6dc}
html[data-theme=dark] .nav button:hover{background:#151518}
html[data-theme=dark] .nav button.active{background:#151518;color:#fff;border-color:#4a0f16}
html[data-theme=dark] .recent button{background:transparent;color:#c8c8cf}
html[data-theme=dark] .recent button:hover,html[data-theme=dark] .recent button[aria-current=page]{background:#151518}
html[data-theme=dark] .recent{scrollbar-color:#33333b #0b0b0d}
html[data-theme=dark] .recent-del{color:#6a6a72}
html[data-theme=dark] .recent-del:hover{color:#ff4058;background:#1c1c20}
html[data-theme=dark] .profile{border-color:#22222a}
html[data-theme=dark] .avatar{background:#151518;color:#fff;border-color:#33333b}
html[data-theme=dark] .profile-row small{color:#b9b9c0}
html[data-theme=dark] .topbar{background:#0b0b0d;border-color:#22222a}
html[data-theme=dark] .topbar>strong{color:#fff}
html[data-theme=dark] .topbar small{color:#b9b9c0}
html[data-theme=dark] .theme-select{background:#151518;color:#e6e6ea;border-color:#33333b}
html[data-theme=dark] .badge{background:#151518;color:#e6e6ea;border-color:#33333b}
html[data-theme=dark] .badge.warn{background:#151518;color:#ffcf6b;border-color:#5a4422}
html[data-theme=dark] .workspace h1,html[data-theme=dark] .workspace h2,html[data-theme=dark] .workspace h3,html[data-theme=dark] .admin-metrics strong{color:#fff}
html[data-theme=dark] .eyebrow,html[data-theme=dark] .composer-note,html[data-theme=dark] .card small,html[data-theme=dark] .heading-sub{color:#b9b9c0}
html[data-theme=dark] .chatbox,html[data-theme=dark] .card,html[data-theme=dark] .panel,html[data-theme=dark] .message,html[data-theme=dark] .pending,html[data-theme=dark] .notice,html[data-theme=dark] .template-card,html[data-theme=dark] .rail-card,html[data-theme=dark] .rail-promo,html[data-theme=dark] .admin-metrics article,html[data-theme=dark] .admin-shortcuts button{background:#111114;border-color:#26262e}
html[data-theme=dark] .chatbox textarea{background:#111114;color:#f2f2f2}
html[data-theme=dark] .chatbox:focus-within{border-color:#3a3a42}
html[data-theme=dark] .composer-footer{border-color:#26262e}
html[data-theme=dark] .composer-footer select{border-color:#33333b;background:#151518;color:#e6e6ea}
html[data-theme=dark] .message.user{background:#17171b;border-color:#26262e}
html[data-theme=dark] .message .role,html[data-theme=dark] .card small{color:#b9b9c0}
html[data-theme=dark] .template-card:hover{border-color:#d50020}
html[data-theme=dark] .template-icon{border-color:#4a1a22;color:#ff4058}
html[data-theme=dark] .rail-card h3,html[data-theme=dark] .rail-promo h3{color:#fff}
html[data-theme=dark] .rail-promo p,html[data-theme=dark] .rail-info small,html[data-theme=dark] .rail-card small,html[data-theme=dark] .quota-ring small{color:#b9b9c0}
html[data-theme=dark] .right-rail{border-color:#22222a}
html[data-theme=dark] .admin-tabs{border-color:#26262e}
html[data-theme=dark] .admin-tabs button{background:transparent;color:#c8c8cf}
html[data-theme=dark] .admin-tabs button[aria-selected=true]{color:#fff}
html[data-theme=dark] .admin-metrics span,html[data-theme=dark] .admin-metrics small,html[data-theme=dark] .admin-shortcuts small,html[data-theme=dark] .admin-status-row p,html[data-theme=dark] .admin-details p,html[data-theme=dark] .admin-details summary,html[data-theme=dark] .section-head a{color:#c8c8cf}
html[data-theme=dark] .admin-status-row{border-color:#22222a}
html[data-theme=dark] .admin-details{border-color:#26262e}
html[data-theme=dark] .admin-status-row>span{color:#f2f2f2}
html[data-theme=dark] table th{color:#e6e6ea;border-color:#26262e}
html[data-theme=dark] td{border-color:#22222a}
html[data-theme=dark] .state{background:#151518;color:#d6d6dc}
html[data-theme=dark] .bar{background:#22222a}
html[data-theme=dark] #toast{background:#151518;color:#f2f2f2;border-color:#33333b;box-shadow:0 6px 28px #00000055}
html[data-theme=dark] .pending::before{border-color:#3a3a42;border-top-color:#ff4058}
html[data-theme=dark] [aria-busy=true] textarea:disabled{-webkit-text-fill-color:#f2f2f2}
html[data-theme=dark] .auth-art{background:#0b0b0d;color:#f2f2f2;border-color:#22222a}
html[data-theme=dark] .auth-art h1,html[data-theme=dark] .auth-art p,html[data-theme=dark] .auth-art .wordmark{color:#f2f2f2}
html[data-theme=dark] .art-lines{border-color:#26262e}
html[data-theme=dark] .auth-form h2{color:#fff}
html[data-theme=dark] .reference-auth .auth-form{background:#111114;border-color:#26262e;box-shadow:none}
html[data-theme=dark] .field-with-icon input{background:#151518;color:#f2f2f2;border-color:#33333b}
html[data-theme=dark] .reference-auth .auth-form .text-button{color:#d6d6dc}
html[data-theme=dark] .auth-bottom,html[data-theme=dark] .auth-help{border-color:#26262e}
html[data-theme=dark] .auth-error{color:#ff8093}
html[data-theme=dark] .error{color:#ff8093}
html[data-theme=dark] .glass-plane.front{opacity:.55}
html[data-theme=dark] .glass-plane.middle{opacity:.35}
html[data-theme=dark] .promo-fold{opacity:.8}
html[data-theme=dark] .profile button{background:#151518}
html[data-theme=dark] .chips button{background:#151518;color:#e6e6ea}
html[data-theme=dark] .cpa-wait a{color:#ff4058}
@media(max-width:900px){html[data-theme=dark] .nav button{border-color:transparent}}

/* ===== 统一对话创作页（对话 + 生图，ChatGPT 式排版） ===== */
.with-rail .chat-workspace{max-width:960px;padding:18px 30px 34px;margin:0 auto;width:100%;display:flex;flex-direction:column;min-height:calc(100vh - 82px)}
.chat-workspace .messages{max-width:760px;width:100%;margin:8px auto 26px;flex:1}
.chat-workspace .message{max-width:88%}
.chat-workspace .message.user{align-self:flex-end;background:#f4f4f5;border-color:transparent;border-radius:20px 20px 6px 20px}
.chat-workspace .message.user .role{color:#6b6b72}
.chat-workspace .message .role{font-size:11px;margin-bottom:10px}
.chat-workspace .message .image-result{margin:6px 0 4px;border-radius:12px;border:1px solid var(--line)}.chat-workspace .message .msg-ref{max-width:150px;max-height:150px;width:auto;border-radius:10px;margin:0 0 8px;border:1px solid var(--line);object-fit:cover;display:block}
.image-actions{display:flex;gap:8px;margin-top:8px}
.img-btn{display:inline-flex;align-items:center;gap:6px;font-size:12px;padding:7px 12px;border:1px solid var(--line);border-radius:8px;background:#fff;color:#333;text-decoration:none;transition:.16s}
.img-btn .ui-icon{width:15px;height:15px}
.img-btn:hover{border-color:#d50020;color:#d50020}
.img-btn.img-download{background:#fff0f1;border-color:#f0c7cc;color:#d50020}
.img-btn.img-download:hover{background:#d50020;color:#fff;border-color:#d50020}
html[data-theme=dark] .img-btn{background:#151518;border-color:#33333b;color:#d6d6dc}
html[data-theme=dark] .img-btn:hover{color:#ff4058;border-color:#ff4058}
html[data-theme=dark] .img-btn.img-download{background:#2a1015;border-color:#4a1a22;color:#ff8093}
html[data-theme=dark] .img-btn.img-download:hover{background:#d50020;color:#fff;border-color:#d50020}
.lightbox{position:fixed;inset:0;background:#000000cc;z-index:60;display:grid;place-items:center;padding:40px;cursor:zoom-out}
.lightbox[hidden]{display:none}
.lightbox img{max-width:100%;max-height:88vh;border-radius:10px;box-shadow:0 20px 60px #00000066}
.lightbox-close{position:fixed;top:18px;right:22px;width:42px;height:42px;border-radius:50%;background:#ffffff2b;color:#fff;font-size:18px;border:0;cursor:pointer;z-index:61}
.lightbox-close:hover{background:#ffffff4d}
.chatbox.composer{max-width:960px;width:100%;margin:0;border-radius:22px;padding:14px 14px 10px;box-shadow:0 10px 30px #00000008}
.chatbox.composer textarea{min-height:30px;max-height:200px;font-size:15px;line-height:1.7}
.chatbox.composer .composer-footer{padding-top:10px;border-top:1px solid var(--line);margin-top:4px}
.composer-icon{width:38px;height:38px;padding:0;border:1px solid var(--line);border-radius:10px;background:#fff;color:#444;display:grid;place-items:center;flex-shrink:0}
.composer-icon:hover{border-color:#d50020;color:#d50020}
.composer-icon.active{color:#fff;background:var(--brand);border-color:var(--brand)}
.ref-preview{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:12px;padding:4px 6px 4px 4px;background:#fff;flex-shrink:0;max-width:220px}
.ref-preview[hidden]{display:none}
.ref-preview img{width:34px;height:34px;object-fit:cover;border-radius:8px;flex-shrink:0}
.ref-preview span{font-size:11px;color:#555;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:120px}
.ref-remove{width:22px;height:22px;padding:0;border:none;background:transparent;color:#999;cursor:pointer;font-size:13px;line-height:1;border-radius:6px;flex-shrink:0}
.ref-preview .ref-item{display:inline-flex;align-items:center;gap:4px;max-width:none;overflow:visible;white-space:nowrap;padding:2px}
.ref-preview .ref-item img{width:34px;height:34px;object-fit:cover;border-radius:8px;flex-shrink:0}
.ref-preview .ref-item img.preview-ref{width:auto;height:auto;max-height:100px}
.ref-remove:hover{color:#d50020;background:#fff0f1}
.composer-icon:disabled{opacity:.38;cursor:not-allowed}
.composer-icon:disabled:hover{color:#444;border-color:var(--line)}
.chatbox.composer .composer-footer select{max-width:230px}
.chat-workspace .composer-note{margin:12px auto 0;max-width:760px;text-align:center}
.chat-workspace .notice{margin:14px auto 0;max-width:760px}
html[data-theme=dark] .chat-workspace .message.user{background:#1c1c20;border-color:transparent}
html[data-theme=dark] .chat-workspace .message.user .role{color:#8a8a92}
html[data-theme=dark] .chatbox.composer .composer-footer{border-color:#26262e}
html[data-theme=dark] .composer-icon{background:#151518;border-color:#33333b;color:#d6d6dc}
html[data-theme=dark] .composer-icon:hover{color:#ff4058;border-color:#ff4058}
html[data-theme=dark] .ref-preview{background:#151518;border-color:#33333b}
html[data-theme=dark] .ref-preview span{color:#b8b8c0}
html[data-theme=dark] .ref-remove:hover{color:#ff4058;background:#2a1015}
@media(max-width:760px){.with-rail .chat-workspace{padding:14px 16px 26px}.chat-workspace .message{max-width:94%}.chatbox.composer .composer-footer select{max-width:150px}}


