/* Keep the cash statement readable inside both legacy theme shells. */
.homeai-management section[aria-label="邀请返现管理"],
.homeai-rewards section[aria-label="我的现金返现"]{box-sizing:border-box;padding:20px;background:#fff;color:#182444;border-radius:12px}
.homeai-management section[aria-label="邀请返现管理"] p,
.homeai-rewards section[aria-label="我的现金返现"] p{color:#54617a}
.homeai-management section[aria-label="邀请返现管理"] p[role="alert"],
.homeai-rewards section[aria-label="我的现金返现"] p[role="alert"]{color:#a32121}
.homeai-management section[aria-label="邀请返现管理"] p[role="status"]{color:#155b40}
.homeai-management section[aria-label="邀请返现管理"] :is(input,select){background:#fff;color:#182444;border-color:#aab4d1;accent-color:#111fbf}
.homeai-management section[aria-label="邀请返现管理"] table{min-width:0}
@media(max-width:640px){.homeai-management section[aria-label="邀请返现管理"],.homeai-rewards section[aria-label="我的现金返现"]{padding:14px}.homeai-management section[aria-label="邀请返现管理"] table{min-width:0;width:100%}}

/* Personal account: align navigation and keep the ledger within a readable measure. */
html:root .account-center-sidebar .homeai-api-entry {
 display:flex;align-items:center;gap:10px;width:100%;box-sizing:border-box;
 min-height:44px;margin:0;padding:10px 12px;border:1px solid var(--homeai-line);border-radius:12px;
 font:inherit;font-size:14px;font-weight:600;text-decoration:none;
 background:var(--homeai-accent);color:var(--ui-primary-bg-color);
}
html:root .homeai-api-entry svg{width:17px;height:17px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7}
html:root .homeai-api-entry:hover{border-color:var(--homeai-accent-hover);background:var(--homeai-accent-hover)}
html:root .homeai-api-entry:focus-visible{outline:2px solid var(--homeai-accent);outline-offset:2px}
html:root .homeai-api-entry small{margin-left:auto;font-size:11px;font-weight:500}
html:root .account-center-main:has(.homeai-ledger) .account-center-topbar{padding:20px 24px 16px;min-height:0;align-items:center}
html:root .account-center-main:has(.homeai-ledger) .account-center-title h2{font-size:26px;line-height:1.3;margin:0 0 4px}
html:root .account-center-main:has(.homeai-ledger) .account-center-title p{font-size:13px;line-height:1.5;margin:0}
html:root .account-center-main:has(.homeai-ledger) .account-center-body{padding:16px 24px;min-width:0;min-height:0;overflow:hidden}
html:root .homeai-ledger{max-width:1040px;min-width:0;width:100%;font-size:13px;line-height:1.4;color:var(--ui-primary-text-color);--ledger-gap:8px}
.homeai-ledger *{box-sizing:border-box}
.homeai-ledger button,.homeai-ledger input{font:inherit;color:inherit;background:var(--ui-secondary-bg-color);border:1px solid var(--homeai-line);border-radius:6px;min-height:36px;padding:6px 12px}
.homeai-ledger button{cursor:pointer}
.homeai-ledger button:hover{border-color:var(--homeai-accent)}
.homeai-ledger button:disabled{opacity:.45;cursor:default}
.homeai-ledger button:focus-visible,.homeai-ledger input:focus-visible{outline:2px solid var(--homeai-accent);outline-offset:2px}
.homeai-ledger .ledger-primary{background:var(--homeai-accent);color:var(--ui-main-text-color);border-color:var(--homeai-accent);font-weight:600}
.homeai-ledger .ledger-filters{display:flex;gap:var(--ledger-gap);align-items:end;flex-wrap:wrap}
.homeai-ledger .ledger-filters label{display:grid;gap:4px;color:var(--homeai-muted);font-size:12px}
.homeai-ledger .ledger-filters input{width:156px;color:var(--ui-primary-text-color)}
.homeai-ledger .ledger-summary{display:flex;gap:16px;justify-content:space-between;margin:12px 0;color:var(--homeai-muted);font-size:12px}
.homeai-ledger .ledger-summary p{margin:0}
.homeai-ledger .ledger-summary [data-total]{white-space:nowrap}
.homeai-ledger .ledger-notice{margin:8px 0;color:var(--ui-primary-text-color)}
.homeai-ledger .ledger-notice:empty{display:none}
.homeai-ledger table{border-collapse:collapse;width:100%;table-layout:fixed}
.homeai-ledger th{text-align:left;font-size:12px;font-weight:500;color:var(--homeai-muted);padding:8px;border-bottom:1px solid var(--homeai-line)}
.homeai-ledger th:nth-child(1){width:17%}.homeai-ledger th:nth-child(2){width:24%}.homeai-ledger th:nth-child(3){width:20%}.homeai-ledger th:nth-child(4){width:19%}.homeai-ledger th:nth-child(5){width:20%}
.homeai-ledger td{padding:6px 8px;vertical-align:middle;border-bottom:1px solid var(--homeai-line);overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.homeai-ledger td strong{display:block;font-weight:500;font-size:13px}
.homeai-ledger td span{display:block;color:var(--homeai-muted);font-size:12px;margin-top:2px}
.homeai-ledger tbody tr:hover{background:var(--homeai-accent-soft)}
.homeai-ledger .ledger-amount{text-align:right}
.homeai-ledger .ledger-amount strong{font-size:15px;font-weight:600}
.homeai-ledger .ledger-amount .is-credit{color:var(--homeai-accent)}
.homeai-ledger .ledger-copy{display:inline-flex;align-items:center;justify-content:flex-start;gap:6px;min-height:20px;padding:0;border:0;background:transparent;max-width:100%}
.homeai-ledger .ledger-copy code{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.homeai-ledger .ledger-copy svg{width:13px;height:13px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.6}
.homeai-ledger .ledger-pagination{display:flex;gap:8px;align-items:center;justify-content:flex-end;margin:16px 0}
.homeai-ledger .ledger-pagination button{min-width:0;padding:6px 8px}
.homeai-ledger .ledger-pagination span{margin-right:auto;color:var(--homeai-muted)}
.homeai-ledger .ledger-empty{padding:32px 0;color:var(--homeai-muted)}
.homeai-ledger .ledger-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:1000px){
 .homeai-ledger table,.homeai-ledger tbody{display:block}.homeai-ledger thead{display:none}
 .homeai-ledger tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 12px;padding:12px 0;border-bottom:1px solid var(--homeai-line)}
 .homeai-ledger td{padding:0;border:0}.homeai-ledger .ledger-activity{grid-column:1;grid-row:1}.homeai-ledger .ledger-amount{grid-column:2;grid-row:1}.homeai-ledger .ledger-model{grid-column:1 / -1;grid-row:2}
 .homeai-ledger .ledger-model strong,.homeai-ledger .ledger-model span{display:inline}.homeai-ledger .ledger-model span{margin-left:8px}
 .homeai-ledger .ledger-task{grid-column:1 / -1;grid-row:3;display:flex;align-items:center;gap:8px}.homeai-ledger .ledger-time{grid-column:1 / -1;grid-row:4;color:var(--homeai-muted);font-size:12px}
 .homeai-ledger .ledger-task:before{content:'任务编号';font-size:12px;color:var(--homeai-muted)}
}
@media(max-width:600px){
 html:root .account-center-main:has(.homeai-ledger) .account-center-topbar{padding:16px}
 html:root .account-center-main:has(.homeai-ledger) .account-center-body{padding:12px 16px}
 html:root .account-center-main:has(.homeai-ledger) .account-center-title h2{font-size:22px}
 .homeai-ledger .ledger-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .homeai-ledger .ledger-filters input{width:100%;min-width:0}.homeai-ledger button,.homeai-ledger input{min-height:44px}
 .homeai-ledger .ledger-summary{flex-direction:column;gap:4px}.homeai-ledger .ledger-copy{min-height:44px}.homeai-ledger .ledger-pagination{flex-wrap:wrap}
}
@media(max-width:360px){.homeai-ledger .ledger-filters label{grid-column:1 / -1}}

/* The account shell has a fixed height: only rows scroll, so paging stays reachable. */
html:root .homeai-ledger{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;height:100%;overflow:hidden}
.homeai-ledger .ledger-filters,.homeai-ledger .ledger-summary,.homeai-ledger .ledger-notice,.homeai-ledger .ledger-pagination{flex-shrink:0}
.homeai-ledger .ledger-results{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--homeai-muted) transparent}
.homeai-ledger .ledger-results:focus-visible{outline:2px solid var(--homeai-accent);outline-offset:-2px}
.homeai-ledger thead{position:sticky;top:0;background:var(--ui-primary-bg-color);z-index:1}
.homeai-ledger .ledger-pagination{margin:0;padding:12px 0 0;border-top:1px solid var(--homeai-line)}
@media(max-height:740px){
 html:root .account-center-main:has(.homeai-ledger) .account-center-body{overflow:auto;display:block}
 html:root .homeai-ledger{height:auto;overflow:visible}
 .homeai-ledger .ledger-results{flex:none;max-height:none;min-height:140px;overflow:visible}
 .homeai-ledger .ledger-pagination{position:sticky;bottom:0;background:var(--ui-primary-bg-color);padding-bottom:4px}
}

/* Keep image preview and editing actions in separate, non-overlapping rows. */
html:root .history-item .image-list:has(>.homeai-legacy-image-frame){
 grid-template-columns:repeat(auto-fill,minmax(min(100%,170px),1fr));
 gap:12px;align-items:start;
}
html:root .history-item .homeai-legacy-image-frame{padding-bottom:0!important;min-width:0}
html:root .history-item .homeai-legacy-image-frame>.tk-ratio-container-content{position:relative;height:auto}
html:root .history-item .homeai-legacy-image-frame .image-wrap{display:flex;flex-direction:column;height:auto;overflow:visible;background:transparent;cursor:default}
html:root .history-item .homeai-legacy-image-frame .image-wrap>.cover{
 width:100%;height:auto;aspect-ratio:1 / var(--homeai-legacy-image-ratio,1);
 border-radius:6px;cursor:zoom-in;background:var(--ui-secondary-bg-color);
}
html:root .history-item .homeai-legacy-image-frame .cover .tk-safe-image__inner{width:100%;height:100%}
html:root .history-item .homeai-legacy-image-frame .cover [role=button]:focus-visible{outline:2px solid var(--ui-primary-color);outline-offset:2px}
html:root .history-item .homeai-legacy-image-frame .image-wrap .action-wrap{position:static;display:block;transform:none;width:100%}
html:root .history-item .image-list .homeai-legacy-image-frame .image-wrap .action-wrap .action-bar{
 display:flex;flex-wrap:wrap;justify-content:center;gap:2px;
 margin:4px 0 0;padding:2px;box-sizing:border-box;max-width:100%;
 background:var(--ui-secondary-bg-color);border-radius:6px;backdrop-filter:none;
}
html:root .homeai-legacy-image-action{
 display:inline-flex;align-items:center;justify-content:center;flex:1 0 28px;
 min-width:28px;min-height:32px;padding:6px;border:0;border-radius:4px;
 color:var(--ui-secondary-text-color);background:transparent;cursor:pointer;touch-action:manipulation;
}
html:root .homeai-legacy-image-action:hover,html:root .homeai-legacy-image-action:focus-visible{background:var(--ui-secondary-border-color);color:var(--ui-primary-color)}
html:root .homeai-legacy-image-action svg{pointer-events:none;flex-shrink:0}
@media(pointer:coarse),(max-width:600px){html:root .homeai-legacy-image-action{min-width:44px;min-height:44px;flex-basis:44px}}

#homeai-upload-notices{position:fixed;right:18px;bottom:20px;z-index:2147483000;width:min(390px,calc(100vw - 32px));max-height:50vh;overflow:auto;display:grid;gap:8px;pointer-events:none}
.homeai-upload-notice{display:flex;align-items:flex-start;gap:12px;padding:13px 14px;background:#fff;color:#17203b;border:1px solid #d8dfef;border-left:4px solid #111fbf;border-radius:12px;box-shadow:0 6px 24px #0002;font:14px/1.6 system-ui,sans-serif;pointer-events:auto;overflow-wrap:anywhere}
.homeai-upload-notice span{flex:1;min-width:0}.homeai-upload-notice button{border:0;background:transparent;color:#59647c;cursor:pointer;font:22px/1 system-ui;padding:2px 4px;flex:none}.homeai-upload-notice button:focus-visible{outline:2px solid #111fbf;outline-offset:2px}
.homeai-upload-notice[data-state=error]{border-left-color:#bd352b}.homeai-upload-notice[data-state=done]{border-left-color:#25814a}
@media(max-width:480px){#homeai-upload-notices{right:12px;bottom:max(14px,env(safe-area-inset-bottom));width:calc(100vw - 24px);max-height:40vh}}

.homeai-legacy-reference-field .label{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px}
.homeai-legacy-reference-field .homeai-reference-actions{display:flex;align-items:center;gap:10px;margin-left:auto}
.homeai-reference-auto-clear{display:inline-flex;align-items:center;gap:6px;min-height:32px;font:inherit;font-size:12px;white-space:nowrap;cursor:pointer;color:inherit}
.homeai-reference-auto-clear input{width:15px;height:15px;margin:0;accent-color:var(--homeai-accent,#9cf5c5);cursor:pointer}
.homeai-reference-auto-clear input:focus-visible,.homeai-legacy-reference-field .image-item:focus-visible{outline:2px solid var(--homeai-accent,#9cf5c5);outline-offset:3px}
.homeai-legacy-reference-field .image-item:not(.upload){cursor:grab;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:none}
.homeai-legacy-reference-field .image-item:not(.upload) img{-webkit-user-drag:none;pointer-events:none}
.homeai-legacy-reference-field .image-item.homeai-reference-dragging{opacity:.5;cursor:grabbing}
.homeai-legacy-reference-field .image-item.homeai-reference-target{outline:2px solid var(--homeai-accent,#9cf5c5);outline-offset:2px}
.homeai-legacy-reference-field.homeai-reference-sorting{cursor:grabbing}
.homeai-reference-announcement{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
[data-homeai-theme="light"] .homeai-reference-auto-clear input{accent-color:#171717}
[data-homeai-theme="light"] .homeai-legacy-reference-field .image-item:focus-visible,[data-homeai-theme="light"] .homeai-legacy-reference-field .image-item.homeai-reference-target{outline-color:#171717}

#homeai-local-acceptance{position:fixed;right:12px;bottom:10px;z-index:2147483000;display:flex;gap:8px;align-items:center;padding:6px 10px;border:1px solid #444;border-radius:8px;background:#19191bea;color:#aaa;font:11px Arial,sans-serif}#homeai-local-acceptance button{background:none;border:0;color:var(--homeai-accent);cursor:pointer;font:inherit}#homeai-local-acceptance.compact>span,#homeai-local-acceptance.compact>button:first-of-type{display:none}

@media(max-width:768px){
 #homeai-local-acceptance{display:none}
 :root .aigc-asset-page.aigc-asset-page{padding:16px 12px;min-width:0}
 :root .aigc-asset-page.aigc-asset-page .header{display:flex;flex-direction:column;gap:12px;flex-shrink:0}
 :root .aigc-asset-page.aigc-asset-page .page-title{margin-bottom:0}
 :root .aigc-asset-page.aigc-asset-page .tab-list{display:flex;flex-wrap:wrap;margin:0;gap:8px}
 :root .aigc-asset-page.aigc-asset-page .tab-list>*{white-space:nowrap;margin:0;padding:8px 10px}
 :root .aigc-asset-page.aigc-asset-page .asset-action-bar,:root .aigc-asset-page.aigc-asset-page .asset-meta-bar{position:static;transform:none;display:flex;flex-wrap:wrap;gap:8px}
 :root .aigc-asset-page.aigc-asset-page .asset-action-bar button{padding:8px;font-size:12px;min-width:0}
 :root .aigc-asset-page.aigc-asset-page .asset-search-input{width:100%;min-width:0}
 :root .aigc-asset-page.aigc-asset-page .asset-storage-usage{font-size:12px}
 :root .aigc-asset-page.aigc-asset-page .history-list-dialog{margin-top:12px}
 :root .aigc-asset-page.aigc-asset-page .history-list-box{grid-template-columns:minmax(0,1fr);gap:12px}
 :root .aigc-asset-page.aigc-asset-page .asset-pagination-bar{flex-wrap:wrap;gap:8px}
 :root .aigc-asset-page.aigc-asset-page .asset-pagination-controls{flex-wrap:wrap;gap:6px}
}
@media(max-width:768px){
 :root .generate-toolbar-right-actions.generate-toolbar-right-actions{top:calc(4px + var(--promo-banner-offset,0px));right:8px;gap:4px}
 :root .generate-toolbar-right-actions .toolbar-action-btn,:root .generate-toolbar-right-actions .toolbar-toolbox-btn{width:32px;min-width:32px;padding:0}
}
@media(max-width:768px){
 :root .home-page .inspiration-showcase__dome-copy,
 :root .home-page .inspiration-showcase__top.is-dome .inspiration-showcase__dome-copy{left:0!important;right:0!important;margin-inline:auto!important;width:calc(100% - 28px)!important;max-width:320px!important;box-sizing:border-box;transform:translateY(-50%)!important;transition:opacity .3s ease!important}
 :root .generate-toolbar-right-actions .toolbar-toolbox-popover.toolbar-toolbox-popover{position:fixed;left:74px;right:12px;width:auto;max-width:none;top:calc(50px + var(--promo-banner-offset,0px));box-sizing:border-box;max-height:calc(100dvh - 70px - var(--promo-banner-offset,0px))}
 :root .generate-toolbar-right-actions .toolbar-toolbox-popover:before{display:none}
 :root .canvas-workspace .agent-floating-btn{top:76px;right:12px}
}

@media(max-width:768px){
 :root .canvas-workspace .panel-toolbar.panel-toolbar{width:calc(100vw - 94px)!important;max-width:calc(100vw - 94px)!important;overflow-x:auto!important;overflow-y:hidden!important;flex-wrap:nowrap!important}
 :root .canvas-workspace .panel-toolbar.panel-toolbar>*{flex-shrink:0}
}

/* HOMEAI source mark; original replica brand accent and icon sizing. */
:root .tike-logo-white-icon.tike-logo-white-icon{background-color:var(--homeai-accent)!important}

/* Estimates remain explicitly labelled and stop below 100 until delivery. */
.homeai-generation-status{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;overflow:hidden;border:0;border-radius:inherit;background:#191b1d;color:#f4f4f5;padding:16px;box-sizing:border-box;text-align:center;container-type:inline-size}
.homeai-generation-status__mark{display:none}
.homeai-generation-status__mark .homeai-generation-trace{stroke:#eeeeef;stroke-dasharray:16 124;animation:homeai-generation-trace 3s linear infinite}
.homeai-generation-status strong{font-size:15px;line-height:1.5;font-weight:500;letter-spacing:.02em}
.homeai-generation-status p{margin:0;color:#a9adb2;font-size:12px;line-height:1.5;max-width:100%;text-wrap:balance}
.homeai-generation-status strong.homeai-generation-status__percent{font-size:36px;font-weight:650;line-height:1.1;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.homeai-generation-status__estimate{font-size:12px;line-height:1.4;color:#b8bcbf}
.homeai-generation-status__track{width:min(180px,80%);height:5px;flex-shrink:0;border-radius:3px;overflow:hidden;background:#3a4140}
.homeai-generation-status__track>span{display:block;height:100%;border-radius:inherit;background:#9cf5c5;transition:width .3s ease}
.homeai-generation-complete{position:absolute;bottom:10px;left:10px;z-index:4;padding:5px 8px;border-radius:6px;background:#171b19;color:#f4f4f5;font-size:12px;font-weight:600;line-height:1.4;pointer-events:none}
html[data-homeai-theme="light"] .homeai-generation-status{background:#f7f7f8;color:#202124}
html[data-homeai-theme="light"] .homeai-generation-status__mark,html[data-homeai-theme="light"] .homeai-generation-status p{color:#65686d}
html[data-homeai-theme="light"] .homeai-generation-status__estimate{color:#5c5c5c}
html[data-homeai-theme="light"] .homeai-generation-status__track{background:#dedede}
html[data-homeai-theme="light"] .homeai-generation-status__track>span{background:#171717}
html[data-homeai-theme="light"] .homeai-generation-status .homeai-generation-trace{stroke:#292b2e}
@keyframes homeai-generation-trace{to{stroke-dashoffset:-140}}
@container(max-width:180px){.homeai-generation-status__mark{width:32px;height:32px;margin:0}.homeai-generation-status p{display:none}.homeai-generation-status strong{font-size:12px}}
@container(max-width:180px){.homeai-generation-status__mark{display:none}.homeai-generation-status strong.homeai-generation-status__percent{font-size:28px}}
@media(prefers-reduced-motion:reduce){.homeai-generation-status .homeai-generation-trace{animation:none;stroke-dasharray:none}.homeai-generation-status__track>span{transition:none}}
/* HOMEAI packages retain the supplied cards; remove the demo's empty strike-through price. */
.upgrade-original-line{display:none!important}.upgrade-plan-grid.flex{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))!important}.upgrade-plan-card h3{font-size:20px!important;line-height:1.35!important}.upgrade-plan-card:first-child .upgrade-validity-note::after{content:' · 首充限一次';color:#bdbdbd}
@media(max-width:760px){.account-center-modal{grid-template-columns:minmax(0,1fr)!important;overflow:auto!important}.account-center-sidebar{display:block!important;width:auto!important;padding:12px!important;border-right:0!important}.account-center-sidebar button{display:inline-flex!important;width:auto!important;min-height:36px;margin:3px;padding:8px 10px!important}.account-center-sidebar .nav-group{display:contents!important}.account-center-main{min-width:0!important;width:100%!important;overflow:visible!important}.account-center-body{width:auto!important;padding:16px!important}.upgrade-plan-grid.flex{grid-template-columns:minmax(0,1fr)!important}.upgrade-plan-card{min-width:0!important}.account-center-sidebar .nav-group-title{display:none!important}}
@media(max-width:760px){.account-center-sidebar{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}.account-sidebar-controls{display:block!important}.account-nav-list{display:flex!important;overflow-x:auto!important;gap:5px!important}.account-nav-group{display:contents!important}.account-nav-group-title{display:none!important}.account-center-sidebar .account-nav-item{flex:0 0 auto!important;margin:0!important}.account-center-sidebar .account-nav-item span{white-space:nowrap}.upgrade-plan-card{min-height:240px!important}.account-center-modal{grid-template-rows:auto minmax(0,1fr)!important}}
@media(max-width:760px){.account-nav-list{flex-direction:row!important;flex-wrap:nowrap!important;height:auto!important;min-height:0!important}.account-sidebar-controls{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}.account-center-sidebar>button{position:static!important;margin-top:6px!important}.account-center-sidebar{align-self:start!important}}
/* Account enhancements follow the accepted black / lime workspace. */
.homeai-custom-recharge { margin: 0 0 24px; padding: 24px; background: #18181b; border: 1px solid #27272a; border-radius: 16px; }
.homeai-custom-recharge h3 { margin: 0 0 8px; font-size: 20px; color: #fff; }
.homeai-custom-recharge p,.homeai-recharge-form output { color: #b9b9bf; font-size: 14px; line-height: 1.6; }
.homeai-recharge-form { margin-top: 20px; }
.homeai-recharge-form label { display: block; margin-bottom: 8px; color: #fff; }
.homeai-recharge-input { display: flex; gap: 12px; max-width: 560px; }
.homeai-recharge-input input { min-width: 0; flex: 1; color: #fff; background: #111; border: 1px solid #666; border-radius: 8px; padding: 12px; font: inherit; font-size: 16px; caret-color: var(--homeai-accent); }
.homeai-recharge-input input::placeholder { color: #a8a8ad; }
.homeai-recharge-input button,.homeai-ps-intro a { min-height: 44px; padding: 12px 18px; border-radius: 8px; background: var(--homeai-accent); color: #101400; font-weight: 600; }
.homeai-recharge-input button:disabled { opacity: .6; cursor: wait; }
.homeai-recharge-input button:hover:not(:disabled),.homeai-ps-intro a:hover { background: var(--homeai-accent-hover); }
.homeai-recharge-form output { display: block; margin-top: 12px; min-height: 24px; overflow-wrap: anywhere; }
.homeai-recharge-input :focus-visible,.homeai-ps-intro a:focus-visible { outline: 2px solid var(--homeai-accent); outline-offset: 3px; }
.homeai-ps-intro { padding: 18px 20px; border-bottom: 1px solid #27272a; background: #18181b; flex-shrink: 0; font-size: 14px; color: #fff; }
.homeai-ps-intro p { color: #b9b9bf; line-height: 1.6; margin: 8px 0 14px; max-width: 70ch; }
.homeai-ps-intro div { display: flex; flex-wrap: wrap; gap: 12px; }
.homeai-ps-intro a { display: inline-flex; align-items: center; text-decoration: none; }
.homeai-ps-intro a+a { background: #333; color: #fff; }
@media(max-width:600px) { .homeai-custom-recharge { padding: 16px; } .homeai-recharge-input { flex-direction: column; } .homeai-recharge-input input { width: 100%; box-sizing: border-box; } .homeai-ps-intro { padding: 14px; } }
.homeai-support-trigger { display: inline-flex; justify-content: center; align-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.homeai-support-trigger:hover { color: var(--homeai-accent); background: #18181b; }
.homeai-support-trigger:focus-visible { outline: 2px solid var(--homeai-accent); outline-offset: 2px; }
.homeai-support-content { width: min(240px, calc(100vw - 100px)); text-align: center; color: #fff; }
.homeai-support-content strong { display: block; margin-bottom: 12px; }
.layout-sidebar-qrcode-popover .homeai-support-content img { display: block; width: 100%; height: auto; max-width: 100%; object-fit: contain; border-radius: 4px; background: #fff; }
.homeai-support-content p { font-size: 14px; line-height: 1.6; color: #b9b9bf; margin: 12px 0 6px; }
.homeai-support-content a { display: inline-flex; align-items: center; min-height: 40px; color: var(--homeai-accent); text-decoration: underline; text-underline-offset: 3px; }
.homeai-support-content a:focus-visible { outline: 2px solid var(--homeai-accent); outline-offset: 3px; }
.el-popover.el-popper.layout-sidebar-qrcode-popover { width: 264px !important; max-width: calc(100vw - 80px); box-sizing: border-box; background: #18181b; border: 1px solid #27272a; }
.layout-sidebar-qrcode-popover .homeai-support-content { width: 100%; }
.homeai-generation-feedback{position:fixed;z-index:1800;left:50%;top:76px;transform:translateX(-50%);width:min(560px,calc(100vw - 28px));box-sizing:border-box;display:flex;align-items:center;gap:16px;padding:12px 16px;border:1px solid var(--ha-border-strong,#52605e);border-radius:12px;background:var(--ha-elevated,#252b2a);color:var(--ha-text,#f5f7f6);box-shadow:0 8px 24px #0002;font-size:14px;line-height:1.65}.homeai-generation-feedback[hidden]{display:none}.homeai-generation-feedback p{margin:0;flex:1;overflow-wrap:anywhere}.homeai-generation-feedback button{min-width:44px;min-height:44px;flex-shrink:0;color:inherit;background:transparent;border:0;text-decoration:underline;cursor:pointer}.homeai-generation-feedback[data-state=error],.homeai-generation-feedback[data-state=unconfirmed]{border-color:var(--ha-text,#ddd)}
[data-homeai-sync=pending]{background:var(--ha-elevated,#252b2a)!important;color:var(--ha-muted,#b7c0be)!important;border-color:var(--ha-border,#454e4b)!important;font-weight:400!important}[data-homeai-sync=pending] button{display:none}

/* Explicit action and estimate, including narrow legacy tool layouts. */
html:root .ai-image-page .tool-layout>.submit .homeai-generate-action,html:root .homeai-mobile-tool-body .gen-control-panel .homeai-generate-action,html:root .homeai-generate-action{width:auto!important;min-width:112px!important;flex:0 0 auto!important;border-radius:12px!important;padding:0 16px!important;gap:8px!important;font-size:14px!important;font-weight:600!important;white-space:nowrap!important}
.homeai-generate-action[aria-busy=true]::before{content:"";display:block;width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:homeai-spin 1s linear infinite}
@keyframes homeai-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.homeai-generate-action[aria-busy=true]::before{animation:none}}

html:root .ai-image-page .tool-layout>.submit:has(.homeai-submit-status){flex-wrap:wrap!important}.homeai-submit-status{width:100%;flex-basis:100%;margin:8px 0 0;color:var(--ha-text,#eef7f1);font-size:13px;line-height:1.5;overflow-wrap:anywhere}.homeai-submit-status[data-state=error],.homeai-submit-status[data-state=unconfirmed]{font-weight:600}

.homeai-submit-status[hidden]{display:none!important}.generate-dock>.homeai-submit-status{box-sizing:border-box;max-width:100%;margin:0;padding:8px 12px;font-size:12px;line-height:1.5;color:var(--ha-muted,#b7c0be);pointer-events:auto}.generate-dock>.homeai-submit-status:is([data-state=error],[data-state=unconfirmed]){color:var(--ha-text,#eef7f1)}

/* Legacy tasks use a full-width state card; no estimated percentage or overlapping retention notice. */
.homeai-legacy-progress{box-sizing:border-box;width:100%;max-width:520px;padding:20px;border:1px solid #343b38;border-radius:12px;background:#151a17;color:#f3f6f4}
.homeai-legacy-progress__heading{display:flex;align-items:center;gap:8px;min-width:0}
.homeai-legacy-progress__heading strong{font-size:14px;line-height:1.5;font-weight:600}
.homeai-legacy-progress__dot{width:6px;height:6px;flex:none;border-radius:50%;background:#a8efc8}
.homeai-legacy-progress__count{margin-left:auto;font-size:12px;line-height:1.5;color:#b3beb7;white-space:nowrap}
.homeai-legacy-progress__track{height:4px;margin:16px 0 12px;border-radius:2px;background:#343b38;overflow:hidden}
.homeai-legacy-progress__track span{display:block;height:100%;width:32%;border-radius:inherit;background:#a8efc8;animation:homeai-legacy-wait 1.8s ease-in-out infinite alternate}
.homeai-legacy-progress p{margin:0;font-size:12px;line-height:1.7;color:#b3beb7;overflow-wrap:anywhere}
@keyframes homeai-legacy-wait{from{transform:translateX(0)}to{transform:translateX(212.5%)}}
html[data-homeai-theme="light"] .homeai-legacy-progress{background:#f6f8f7;border-color:#dce2de;color:#1c2921}
html[data-homeai-theme="light"] .homeai-legacy-progress__count,html[data-homeai-theme="light"] .homeai-legacy-progress p{color:#526158}
html[data-homeai-theme="light"] .homeai-legacy-progress__track{background:#dde6e0}
html[data-homeai-theme="light"] .homeai-legacy-progress__dot,html[data-homeai-theme="light"] .homeai-legacy-progress__track span{background:#267246}
@media(max-width:640px){.homeai-legacy-progress{padding:16px}.homeai-legacy-progress__heading{gap:6px}}
@media(prefers-reduced-motion:reduce){.homeai-legacy-progress__track span{animation:none;transform:translateX(106%)}}

/* Explicitly labelled estimates; completion remains tied to delivered task results. */
.homeai-legacy-progress__estimate{margin-left:auto;display:flex;align-items:baseline;gap:8px;white-space:nowrap;color:#b3beb7;font-size:11px}
.homeai-legacy-progress__estimate strong{font-size:18px;font-weight:600;color:#f3f6f4;font-variant-numeric:tabular-nums;min-width:3ch;text-align:right}
.homeai-legacy-progress__track--estimated span{animation:none;transform:none;transition:width .6s ease}
.homeai-legacy-complete{grid-column:1/-1;margin-bottom:4px;color:#a8efc8;font-size:12px;line-height:1.5;font-variant-numeric:tabular-nums}
html[data-homeai-theme="light"] .homeai-legacy-progress__estimate{color:#526158}
html[data-homeai-theme="light"] .homeai-legacy-progress__estimate strong{color:#1c2921}
html[data-homeai-theme="light"] .homeai-legacy-complete{color:#267246}
@media(max-width:640px){.homeai-legacy-progress__estimate{gap:4px}.homeai-legacy-progress__estimate strong{font-size:16px}.homeai-legacy-progress__heading{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){.homeai-legacy-progress__track--estimated span{transition:none;transform:none}}

.homeai-astra-hero{position:relative;display:flex;align-items:flex-end;min-height:720px;height:calc(100svh - var(--promo-banner-offset,64px));max-height:960px;background:#05090d;color:#edf5ff;isolation:isolate}
.homeai-astra-hero *{box-sizing:border-box}
.homeai-astra-stage{position:absolute;inset:0;user-select:none;-webkit-user-select:none;background:#05090d url('/brand/astra-hero/assets/poster.jpg') center calc(50% - clamp(80px,12svh,128px))/contain no-repeat}
.homeai-astra-frame{display:block;width:100%;height:100%;border:0;pointer-events:none}
.homeai-astra-pause{position:absolute;right:28px;top:16px;min-height:44px;padding:0 12px;border:1px solid #354453;border-radius:8px;background:#0b121c;color:#c3d0df;font:inherit;font-size:12px;cursor:pointer}
.homeai-astra-pause:hover{background:#182532;color:#fff}
.homeai-astra-content{position:relative;z-index:1;display:flex;flex-direction:column;align-items:flex-start;gap:24px;width:100%;margin:0;padding:100px clamp(22px,5vw,80px) 64px;background:linear-gradient(transparent,rgba(5,9,13,.72));pointer-events:auto}
.homeai-astra-content a{pointer-events:auto}
.homeai-astra-content h1{font-size:clamp(28px,3vw,42px);font-weight:600;line-height:1.3;text-wrap:balance;letter-spacing:-.02em;margin:0 0 16px}
.homeai-astra-content p{max-width:44em;margin:0;color:#b8c9da;font-size:15px;line-height:1.8}
.homeai-astra-entry{flex-shrink:0}
.homeai-astra-hero a{text-decoration:none;color:inherit}
.homeai-hero-actions{display:flex;align-items:center;gap:24px;flex-wrap:wrap}
.homeai-hero-actions a{display:inline-flex;align-items:center;justify-content:center;gap:14px;font-size:14px;min-height:48px;font-weight:600;transition:background .18s,color .18s}
.homeai-hero-actions a:first-child{background:var(--homeai-accent);color:#0c2115;padding:0 22px;border-radius:10px}
.homeai-hero-actions a:first-child:hover{background:#bff9d9}
.homeai-hero-actions a:last-child:hover{color:var(--homeai-accent)}
.homeai-hero-actions svg{width:20px;height:20px;stroke:currentColor;stroke-width:1.5;fill:none;stroke-linecap:round;stroke-linejoin:round}
.homeai-astra-mediums{display:flex;justify-content:flex-start;gap:12px;margin-top:12px;flex-wrap:wrap}
.homeai-astra-hero .homeai-astra-mediums a{display:inline-flex;align-items:center;justify-content:center;min-width:108px;min-height:56px;padding:12px 28px;border-radius:999px;background:#b9f4d3;color:#142a20;font-size:18px;font-weight:600;line-height:1.3;transition:background .18s ease}
.homeai-astra-hero .homeai-astra-mediums a:nth-child(2){background:#c7d8ff;color:#192a4a}
.homeai-astra-hero .homeai-astra-mediums a:nth-child(3){background:#f3dfad;color:#3d2c0b}
.homeai-astra-hero .homeai-astra-mediums a:hover{background:#ddfbe9}
.homeai-astra-hero .homeai-astra-mediums a:nth-child(2):hover{background:#e0eaff}
.homeai-astra-hero .homeai-astra-mediums a:nth-child(3):hover{background:#fff0ce}
.homeai-astra-hero :is(a,button):focus-visible{outline:2px solid #9cf5c5;outline-offset:4px}
.homeai-astra-hero ::selection{background:#9cf5c5;color:#05090d}
@media(max-width:900px){.homeai-astra-content{flex-direction:column;align-items:flex-start;gap:24px}.homeai-astra-mediums{justify-content:flex-start}}
@media(max-width:640px){.homeai-astra-hero{height:calc(100svh - var(--promo-banner-offset,64px));min-height:660px;max-height:900px}.homeai-astra-pause{right:14px;top:12px;font-size:11px}.homeai-astra-content{padding:80px 22px 40px;gap:20px}.homeai-astra-content h1{font-size:28px;max-width:9em}.homeai-astra-content p{font-size:13px}.homeai-astra-content br{display:none}.homeai-hero-actions{gap:16px;flex-wrap:wrap}.homeai-hero-actions a{font-size:12px;gap:8px;min-height:44px}.homeai-hero-actions a:first-child{padding:0 14px}.homeai-hero-actions svg{width:16px;height:16px}}
@media(prefers-reduced-motion:reduce){.homeai-astra-pause{display:none}.homeai-astra-hero *{transition:none!important}}

@media(max-width:640px){.homeai-astra-mediums{gap:8px;width:100%}.homeai-astra-hero .homeai-astra-mediums a{min-width:0;min-height:48px;flex:1 1 0;padding:10px 12px;font-size:16px;white-space:nowrap}}

/* HOMEAI-owned theme. Reference layouts remain behind the runtime adapter. */
html:root {
  --homeai-font: "HarmonyOS Sans SC", MiSans, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  --homeai-accent: #9cf5c5;
  --homeai-accent-hover: #bff9d9;
  --homeai-accent-soft: #192c23;
  --homeai-surface: #171b19;
  --homeai-line: #303a35;
  --homeai-muted: #a6b3ac;
  --ui-primary-color: var(--homeai-accent);
  --ui-primary-color-light: var(--homeai-accent-hover);
  --ui-primary-color-lightness: var(--homeai-accent-hover);
  --ui-primary-color-dark: #77dca6;
  --ui-primary-color-darkness: #77dca6;
  --ui-secondary-bg-color: var(--homeai-surface);
  --ui-secondary-border-color: var(--homeai-line);
  color-scheme: dark;
  scrollbar-color: #46534c #0c100e;
}
::selection { background: #9cf5c540; color: #fff; }
input, textarea, [contenteditable] { caret-color: var(--homeai-accent); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--homeai-accent); outline-offset: 3px;
}
/* Keep one 62px rail across every route; distinguish it with spacing and shape. */
html:root .layout-container .layout-sidebar { background: #0b100d; border-right: 1px solid #202a24; --sidebar-nav-top-space: 112px; padding: 18px 0; }
html:root .layout-container .layout-sidebar .nav-list .nav-list-inner { gap: 10px; padding: 0 6px; }
html:root .layout-container .layout-sidebar .nav-list .nav-item { width: 100%; min-height: 52px; border: 0; border-radius: 12px; background: transparent; font: inherit; color: var(--homeai-muted); transition: background .15s ease, color .15s ease; }
html:root .layout-container .layout-sidebar .nav-list .nav-item:hover { color: #eef7f1; background: #19211c; }
html:root .layout-container .layout-sidebar .nav-list .nav-item.active { background: var(--homeai-accent-soft); color: var(--homeai-accent); }
html:root .layout-container .layout-sidebar .nav-label { font-size: 11px; }
html:root .layout-container .layout-sidebar .footer { gap: 13px; }
html:root .layout-container .layout-sidebar .footer .language-trigger { border-color: #3d4a42; background: transparent; }
html:root .layout-container .layout-sidebar .footer .upgrade-btn { border: 0; background: #19211c; }
html:root .layout-container .layout-main .promo-banner { flex-basis: 64px; height: 64px; background: #101a14; color: var(--homeai-accent); border-bottom: 1px solid #24362b; justify-content: flex-start; padding: 0 28px; }
html:root .layout-container .layout-main .promo-banner .promo-banner-text { font-size: 12px; font-weight: 500; letter-spacing: .04em; }
html:root .layout-container .layout-main .promo-banner .promo-banner-close { color: var(--homeai-muted); }
html:root .layout-container .layout-main .promo-banner button:focus-visible { outline-color: var(--homeai-accent); }
/* The existing HOMEAI H composition, with a quieter proportion and shared palette. */
html:root .homeai-hero { grid-template-columns: 1.08fr .92fr; min-height: 570px; padding-top: 48px; padding-bottom: 48px; gap: 40px; }
html:root .homeai-hero h1 { font-size: clamp(44px, 4.4vw, 66px); letter-spacing: -.025em; }
html:root .homeai-hero-copy > p, :root .homeai-hero-mediums a { color: #acbcb2; }
html:root .homeai-hero-signature { margin-top: 48px; }
html:root .homeai-hero-signature-note { color: #a3b2a9; border-color: #354b3e; }
html:root .homeai-hero-actions a:first-child { border-radius: 14px; color: #0c2115; }
html:root .homeai-hero-actions a:last-child { border-bottom: 1px solid #354b3e; }
html:root .homeai-hero-art { max-width: 510px; }
html:root .homeai-art-trace { stroke: #3e6250; }
html:root .homeai-art-axis { stroke: #263c30; }
html:root .homeai-art-link { stroke: #6f9a81; }
html:root .homeai-motion-label { color: #a3b2a9; }
/* Preserve resize, reference images, model controls and the service quote flow. */
html:root .generate-dock .unified-generate-panel { border-radius: 16px; background: var(--homeai-surface); border-color: #3a4940; box-shadow: none; }
html:root .generate-dock .unified-generate-panel:focus-within { border-color: #6b9d81; }
html:root .generate-toolbar .toolbar-action-btn,
html:root .generate-toolbar-right-actions .toolbar-action-btn,
html:root .generate-toolbar-right-actions .toolbar-toolbox-btn { border-radius: 10px; }
html:root .result-list { gap: 42px; }
html:root .homeai-quote-dialog { border-radius: 16px; background: var(--homeai-surface); border-color: var(--homeai-line); box-shadow: none; }
html:root .homeai-quote-dialog button { border-radius: 8px; min-height: 44px; }
html:root .account-center-modal { border-radius: 16px; }
html:root .homeai-custom-recharge { background: var(--homeai-surface); border-color: var(--homeai-line); }
html:root .homeai-recharge-form output { font-variant-numeric: tabular-nums; }
@media (min-width: 1101px) {
  html:root .generate-dock .unified-generate-panel { width: 880px; max-width: 100%; }
}
@media (max-width: 1000px) {
  html:root .homeai-hero { min-height: 500px; padding: 40px 30px; gap: 8px; }
  html:root .homeai-hero h1 { font-size: 46px; }
}
@media (max-width: 640px) {
  html:root .layout-container .layout-main .promo-banner { padding: 0 42px 0 16px; }
  html:root .layout-container .layout-main .promo-banner .promo-banner-text { font-size: 11px; }
  html:root .homeai-hero { grid-template-columns: 1fr; min-height: 0; padding: 34px 22px 24px; gap: 8px; }
  html:root .homeai-hero h1 { font-size: clamp(34px, 9.8vw, 44px); }
  html:root .homeai-hero-signature { margin-top: 26px; }
  html:root .homeai-hero-art { max-width: 330px; }
}
@media (prefers-reduced-motion: reduce) {
  html:root .layout-sidebar .nav-item, :root .generate-dock, :root .generate-toolbar { transition: none; }
}

/* Canvas keeps its full work area; remove decorative chrome from the toolbar. */
html:root .canvas-workspace .panel-toolbar { background: #141a16; border-color: #37483d; border-radius: 12px; box-shadow: none; }
html:root .canvas-workspace textarea::placeholder { color: #a3aea7; }
html:root .creative-gallery__eyebrow { display: none; }

/* Compact controls use three predictable rows instead of fixed-width columns. */
@media (max-width: 600px) {
  html:root .generate-dock .unified-generate-panel { padding-bottom: 154px; }
  html:root .generate-dock .controls-row { left: 12px; right: 12px; bottom: 14px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-rows: repeat(3,36px); gap: 4px 8px; height: 116px; max-height: none; }
  html:root .generate-dock .controls-row .model-anchor { grid-area: 1 / 1; }
  html:root .generate-dock .controls-row .camera-pill,
  html:root .generate-dock .controls-row .gen-mode-anchor { grid-area: 1 / 2; }
  html:root .generate-dock .controls-row .settings-anchor { grid-area: 2 / 1; width: 100%; }
  html:root .generate-dock .controls-row .settings-pill { width: 100%; }
  html:root .generate-dock .controls-row .settings-pill > span { max-width: none; }
  html:root .generate-dock .controls-row .image-preset-anchor { grid-area: 2 / 2; width: 100%; }
  html:root .generate-dock .controls-row .stepper-pill { grid-area: 3 / 1; width: 100%; justify-content: start; }
  html:root .generate-dock .controls-row .control-pill { font-size: 11px; padding-inline: 4px; gap: 4px; }
  html:root .result-scroll-nav { top: 58px; bottom: auto; flex-direction: row; }
}
html:root .result-list-prompt-use, html:root .toolbar-tutorial-btn { color: var(--homeai-accent); }

html:root .generate-dock .generate-btn { background: var(--homeai-accent); color: #0c2115; border-color: transparent; }
html:root .generate-dock .generate-btn:hover:not(:disabled) { background: var(--homeai-accent-hover); }
@media (min-width: 601px) and (max-width: 1100px) {
  html:root .result-scroll-nav { top: 64px; bottom: auto; flex-direction: row; }
}

/* Explicit account and support actions in the compact rail. */
html:root .layout-sidebar .homeai-account-trigger,
html:root .layout-sidebar .homeai-support-trigger { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 52px; min-height: 54px; height: auto; padding: 6px 2px; border: 0; border-radius: 12px; background: transparent; color: #c2d2c8; font: inherit; font-size: 11px; line-height: 1.3; white-space: nowrap; cursor: pointer; }
html:root .layout-sidebar .homeai-account-trigger { background: #192c23; color: #bff9d9; }
html:root .layout-sidebar .homeai-account-trigger img,
html:root .layout-sidebar .homeai-support-trigger img { width: 24px; height: 24px; }
html:root .layout-sidebar .homeai-account-trigger:hover,
html:root .layout-sidebar .homeai-support-trigger:hover { background: #263f31; color: #fff; }
/* Price and admin entry points remain available even after closing the banner. */
.homeai-utility-nav{display:flex;flex-direction:column;gap:4px;width:100%;padding:0 4px}
.homeai-utility-nav a{display:flex;align-items:center;justify-content:center;min-height:36px;padding:5px 2px;border-radius:7px;color:#acbcb2;text-decoration:none;font-size:11px;line-height:1.4}
.homeai-utility-nav a:hover,.homeai-utility-nav a[aria-current]{background:#192c23;color:#9cf5c5}
html:root .layout-container .layout-main .promo-banner{min-height:64px;gap:18px;padding-right:54px;flex-shrink:0}
html:root .layout-container .layout-main .promo-banner .promo-banner-text{font-size:13px;line-height:1.5;white-space:normal;text-align:left;max-height:42px;overflow:hidden;min-width:0}
.homeai-banner-link{flex-shrink:0;color:#9cf5c5;text-decoration:underline;font-size:12px}
@media(max-height:820px){html:root .layout-container .layout-sidebar{--sidebar-nav-top-space:24px}html:root .layout-container .layout-sidebar .footer{gap:8px}.homeai-utility-nav a{min-height:32px}}
@media(max-width:640px){html:root .layout-container .layout-main .promo-banner{padding-left:16px;gap:10px}.homeai-banner-link{max-width:68px;white-space:normal;font-size:11px}}


.homeai-theme-toggle{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:52px;min-height:48px;padding:5px 2px;border:0;border-radius:10px;background:transparent;color:var(--homeai-muted);font:inherit;font-size:11px;cursor:pointer}
.homeai-theme-toggle svg{width:22px;height:22px;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}
.homeai-theme-toggle:hover{background:var(--homeai-accent-soft);color:var(--homeai-accent)}
@media(max-height:760px){html:root .layout-container .layout-sidebar{--sidebar-nav-top-space:12px;padding-block:10px}html:root .layout-container .layout-sidebar .footer{gap:4px}.homeai-theme-toggle{min-height:44px}}

/* Announcement copy and link share the centered content axis. Close stays independent. */
html:root .layout-container .layout-main .promo-banner{justify-content:center;padding-inline:52px}
html:root .layout-container .layout-main .promo-banner .promo-banner-text{text-align:center;flex:0 1 auto}
html:root .layout-container .layout-main .promo-banner .promo-banner-close{position:absolute;right:16px}
@media(max-width:640px){html:root .layout-container .layout-main .promo-banner{padding-inline:44px;gap:8px}}
/* Compact library thumbnails; full-size preview remains available on click. */
html:root .aigc-asset-page.aigc-asset-page{padding:24px 28px;min-width:0}
html:root .aigc-asset-page .history-list-dialog .history-list-box{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px;align-content:start}
html:root .aigc-asset-page .history-list-box .history-result-item{min-width:0;aspect-ratio:1;max-height:220px;border-radius:8px;background:var(--ha-panel)}
html:root .aigc-asset-page .history-list-box .history-result-item .cover{width:100%;height:100%}
html:root .aigc-asset-page .history-list-box .history-result-item img{object-fit:contain}
html:root .aigc-asset-page .header{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:16px}
html:root .aigc-asset-page .page-title{width:100%;margin:0}
html:root .aigc-asset-page .tab-list{margin:0;gap:8px}
html:root .aigc-asset-page .asset-action-bar,html:root .aigc-asset-page .asset-meta-bar{position:static;transform:none;display:flex;flex-wrap:wrap;gap:12px}
html:root .aigc-asset-page .asset-meta-bar{margin-left:auto}
html:root .aigc-asset-page .asset-search-input{width:220px;max-width:100%}
@media(max-width:760px){html:root .aigc-asset-page.aigc-asset-page{padding:16px 12px}html:root .aigc-asset-page .header{align-items:stretch}html:root .aigc-asset-page .asset-meta-bar{margin:0;width:100%}html:root .aigc-asset-page .history-list-dialog .history-list-box{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}html:root .aigc-asset-page .history-list-box .history-result-item .type-wrap{top:6px;left:6px}html:root .aigc-asset-page .history-list-box .history-result-item .asset-detail-btn{top:6px;right:6px}}

@media(max-width:640px){html:root .layout-container .layout-main .promo-banner .promo-banner-close{right:8px;width:28px;height:28px}html:root .layout-container .layout-main .promo-banner .promo-banner-text{font-size:12px;max-height:36px}}

/* Inline SVG paths avoid WebKit SVG-background/mask rendering and extra requests. */
html:root .layout-sidebar .homeai-nav-glyph{display:block;flex-shrink:0;width:24px;height:24px;overflow:visible;background:none;mask:none;-webkit-mask:none;color:inherit}
html:root .layout-sidebar .nav-item>.homeai-nav-glyph{width:22px;height:22px}
html:root .layout-sidebar .homeai-utility-nav a{flex-direction:column;gap:4px;min-height:44px}
html:root .layout-sidebar .homeai-utility-nav svg{display:block;width:20px;height:20px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:640px){html:root .layout-container .layout-sidebar{height:100dvh;max-height:100dvh;overflow-y:auto;overscroll-behavior:contain}html:root .layout-sidebar .homeai-nav-glyph,html:root .layout-sidebar .homeai-theme-toggle svg{visibility:visible;opacity:1}}

/* Canvas tools: labels occupy their own line, with usable space around controls. */
html:root .canvas-workspace :is(.face-swap-panel,.cloth-change-panel) .upload-field-row{margin:0 0 8px;gap:8px;flex-shrink:0}
html:root .canvas-workspace :is(.face-swap-panel,.cloth-change-panel) .upload-field-title{padding:0;line-height:1.5;background:transparent}
html:root .canvas-workspace :is(.face-swap-panel,.cloth-change-panel) .upload-section-row{margin:0 0 4px}
html:root .canvas-workspace :is(.face-swap-panel,.cloth-change-panel) .empty-state-container{padding:16px;gap:12px;flex-wrap:wrap;align-content:center}
html:root .canvas-workspace :is(.face-swap-panel,.cloth-change-panel) .empty-text{line-height:1.5;overflow-wrap:anywhere}
html:root .canvas-workspace .character-split-panel .image-box .label{top:64px;left:24px;right:24px;padding:0;line-height:1.5;background:transparent}
html:root .canvas-workspace .character-split-panel .image-box .empty-state-container{top:92px;left:24px;right:24px;min-height:124px;padding:16px;flex-direction:column;align-items:center;justify-content:center;gap:12px;border-radius:12px}
html:root .canvas-workspace .character-split-panel .image-box .empty-text{text-align:center;line-height:1.5}
html:root .canvas-workspace .character-split-panel .image-box .panel-title-in-box{left:24px;right:56px;top:20px;font-size:16px;line-height:1.5}
html:root .canvas-workspace .empty-label{margin:0 0 8px;padding:0;line-height:1.5;max-width:100%;background:transparent}
html:root .canvas-workspace .batch-images-panel .empty-state-container{padding:44px 16px 20px;gap:12px}
html:root .canvas-workspace :is(.panel-prompt-input,.prompt-input,textarea){box-sizing:border-box;line-height:1.6;padding:12px 16px}
html:root .canvas-workspace .tools-panel .tool-card{padding:12px 8px;gap:8px}
/* Selection is explicit in both themes and never depends on a sprite glyph. */
html:root .aigc-asset-page .history-list-dialog .history-list-box .history-result-item .type-wrap .asset-select-box{width:28px;height:28px;touch-action:manipulation;background:var(--ha-panel,#171b19);border:1px solid var(--ha-border-strong,#a6b3ac);color:var(--ha-text,#edf5ef);box-shadow:none}
html:root .aigc-asset-page .history-list-dialog .history-list-box .history-result-item .type-wrap .asset-select-box.is-checked{background:var(--homeai-accent);border-color:var(--homeai-accent);color:var(--ha-on-accent,#0b100d)}
html:root .aigc-asset-page .history-list-dialog .history-list-box .history-result-item .type-wrap .asset-select-box svg{fill:none;stroke:currentColor;display:block}
html:root .asset-prompt-popover{max-width:calc(100vw - 32px);box-sizing:border-box}
html:root .canvas-workspace .annotation-modify-panel .empty-upload-box{flex-direction:column;padding:16px;gap:12px;border-radius:12px}
html:root .canvas-workspace .annotation-modify-panel .empty-text{line-height:1.5;text-align:center;overflow-wrap:anywhere}

/* Match the reference site’s readable Chinese body stack, using installed fonts. */
html:root, html:root body { font-family: var(--homeai-font); }
html:root :is(button,input,optgroup,select,textarea) { font-family: inherit; }

/* An opt-in light workspace. The accepted starfield and user media keep their colors. */
html:root[data-homeai-theme="light"] {
  color-scheme: light;
  --ha-accent:#171717;--ha-accent-hover:#333333;--ha-on-accent:#fff;
  --ha-text:#181818;--ha-muted:#5c5c5c;--ha-panel:#fff;--ha-input:#fafafa;
  --ha-elevated:#f7f7f7;--ha-selected:#ededed;--ha-hover:#f1f1f1;
  --ha-border:#dedede;--ha-border-strong:#999999;--ha-focus:#171717;
  --ha-scrollbar:#a0a0a0;--ha-danger:#a22f24;--ha-warning:#825b13;
  --homeai-accent:var(--ha-accent);--homeai-accent-hover:var(--ha-accent-hover);
  --homeai-accent-soft:var(--ha-selected);--homeai-surface:var(--ha-panel);
  --homeai-line:var(--ha-border);--homeai-muted:var(--ha-muted);
  --ui-primary-color:var(--ha-accent);--ui-primary-color-light:var(--ha-accent-hover);
  --ui-primary-color-lightness:var(--ha-accent-hover);--ui-primary-color-dark:#333333;--ui-primary-color-darkness:#333333;
  --ui-main-text-color:#fff;--ui-primary-text-color:var(--ha-text);--ui-secondary-text-color:var(--ha-muted);
  --ui-primary-bg-color:#ffffff;--ui-primary-bg-color-light:#f1f1f1;--ui-primary-bg-color-dark:#fff;
  --ui-secondary-bg-color:#fff;--ui-secondary-bg-color-light:#f7f7f7;--ui-secondary-bg-color-dark:#fafafa;
  --ui-primary-border-color:var(--ha-border);--ui-secondary-border-color:var(--ha-border);
  --ui-scrollbar-bg-color:#cccccc;--ui-scrollbar-hover-color:#999999;
  --el-color-primary:#171717;--el-color-primary-light-3:#444444;--el-color-primary-light-5:#777777;
  --el-color-primary-light-7:#d0d0d0;--el-color-primary-light-9:#f1f1f1;
  --el-color-white:#fff;--el-bg-color:#fff;--el-bg-color-overlay:#fff;--el-fill-color-blank:#fff;
  --el-text-color-primary:var(--ha-text);--el-text-color-regular:var(--ha-muted);
  background:#ffffff;color:var(--ha-text);scrollbar-color:#a0a0a0 #f7f7f7;
}
html[data-homeai-theme="light"] ::selection{background:#dedede;color:#181818}
html:root[data-homeai-theme="light"] :is(body,.layout-container,.layout-main,.layout-route-view){background:#ffffff;color:var(--ha-text)}
html:root[data-homeai-theme="light"] .layout-container .layout-sidebar{background:#f7f7f7;border-color:#dedede}
html:root[data-homeai-theme="light"] .layout-sidebar .nav-list .nav-item:hover{background:#eeeeee;color:#171717}
html:root[data-homeai-theme="light"] .layout-sidebar :is(.homeai-support-trigger,.homeai-account-trigger){color:#171717}
html:root[data-homeai-theme="light"] .layout-sidebar .homeai-account-trigger{background:#ededed}
html:root[data-homeai-theme="light"] .layout-sidebar :is(.homeai-support-trigger,.homeai-account-trigger):hover{background:#e3e3e3}
html:root[data-homeai-theme="light"] .layout-sidebar :is(.homeai-support-trigger,.homeai-account-trigger) img{filter:grayscale(1) brightness(.25)}
html:root[data-homeai-theme="light"] .layout-sidebar .footer .upgrade-btn{background:#eeeeee;color:#181818}
html[data-homeai-theme="light"] .homeai-utility-nav a{color:#5c5c5c}
html[data-homeai-theme="light"] .homeai-utility-nav a:is(:hover,[aria-current]){background:#ededed;color:#171717}
html:root[data-homeai-theme="light"] .layout-main .promo-banner{background:#ffffff;color:#171717;border-color:#e0e0e0}
html[data-homeai-theme="light"] .homeai-banner-link{color:#171717}
/* The accepted starfield stays intact; its light-mode controls are monochrome. */
html[data-homeai-theme="light"] .homeai-astra-hero{--homeai-accent:#ffffff;--homeai-accent-hover:#e9e9e9;color:#f5f5f5}
html[data-homeai-theme="light"] .homeai-astra-content{color:#f5f5f5}
html[data-homeai-theme="light"] .homeai-astra-content p{color:#cccccc}
html[data-homeai-theme="light"] #homeai-local-acceptance{background:#fafafaed;color:#5c5c5c;border-color:#b5b5b5}
/* Shared React business surfaces use the same roles as the Vue workspace. */
html[data-homeai-theme="light"] :is(.homeai-management,.homeai-commerce){--ui-primary-bg-color:#ffffff;--ui-main-text-color:#fff;--ui-warning:#825b13;color:#181818}
html[data-homeai-theme="light"] .homeai-management{--bg:#ffffff}
html[data-homeai-theme="light"] :is(.homeai-quote-dialog,.homeai-custom-recharge){background:#fff;color:#181818;border-color:#dedede}
html[data-homeai-theme="light"] .homeai-quote-dialog p{color:#5c5c5c}
html[data-homeai-theme="light"] .homeai-quote-dialog button{background:#f7f7f7;color:#181818}
html[data-homeai-theme="light"] .homeai-quote-dialog button.primary{background:#171717;color:#fff}
html[data-homeai-theme="light"] .homeai-custom-recharge :is(h3,label){color:#181818}
html[data-homeai-theme="light"] .homeai-custom-recharge :is(p,output){color:#5c5c5c}
html[data-homeai-theme="light"] .homeai-recharge-input input{background:#fafafa;color:#181818;border-color:#999999}
html[data-homeai-theme="light"] .homeai-recharge-input button{color:#fff}
html[data-homeai-theme="light"] .homeai-recharge-input input::placeholder{color:#666666}
/* Account and recharge navigation contain scoped legacy colors. */
html[data-homeai-theme="light"] .account-center-modal{
  --account-canvas:#ffffff;--account-sidebar:#f7f7f7;--account-surface:#fff;--account-surface-hover:#f1f1f1;--account-border:#dedede;
  --ui-primary-color:#171717;--ui-primary-text-color:#181818;--el-color-primary:#171717;
  --el-color-primary-light-3:#444444;--el-color-primary-light-5:#777777;--el-color-primary-light-7:#d0d0d0;--el-color-primary-light-9:#f1f1f1;
  --el-input-focus-border-color:#171717;color:#181818;border-color:#dedede;
}
html[data-homeai-theme="light"] .account-center-page{--account-canvas:#ffffff}
html[data-homeai-theme="light"] .account-center-modal :is(h1,h2,h3,h4,p,span,strong,label,small,li,th,td){color:inherit}
html[data-homeai-theme="light"] .account-nav-item{color:#5c5c5c}
html[data-homeai-theme="light"] .account-nav-item:hover{background:#eeeeee;color:#171717}
html[data-homeai-theme="light"] .account-nav-item.active{background:#ededed;color:#171717;border-color:#cccccc}
html[data-homeai-theme="light"] :is(.account-nav-group-title,.account-center-title p,.upgrade-validity-note,.upgrade-plan-card p,.upgrade-benefit-copy,.metric-label){color:#5c5c5c}
html[data-homeai-theme="light"] :is(.account-sidebar-footer button,.account-center-close){color:#5c5c5c;background:transparent}
html[data-homeai-theme="light"] .upgrade-plan-card.featured{background:#fafafa;border-color:#b0b0b0}
html[data-homeai-theme="light"] .upgrade-plan-card .upgrade-validity-note::after{color:#5c5c5c}
html[data-homeai-theme="light"] :is(.upgrade-buy-btn,.upgrade-action-btn){background:#171717;color:#fff;border-color:#171717}
html[data-homeai-theme="light"] :is(.member-center-card,.member-center-hero,.team-card,.record-item){background:#fff;color:#181818;border-color:#dedede}
html[data-homeai-theme="light"] :is(.topbar-team-trigger,.member-center-team-trigger,.member-center-team-dropdown,.team-dropdown-menu){background:#fff;color:#181818;border-color:#dedede}
/* Editor chrome stays light; user images/canvas pixels are never inverted. */
html:root[data-homeai-theme="light"] .generate-dock .unified-generate-panel{background:#fff;border-color:#cccccc}
html:root[data-homeai-theme="light"] .generate-dock .generate-btn{background:#171717;color:#fff}
html:root[data-homeai-theme="light"] .canvas-workspace .panel-toolbar{background:#fff;border-color:#cccccc}
html[data-homeai-theme="light"] :is(.homeai-support-content,.layout-sidebar-qrcode-popover){background:#fff;color:#181818;border-color:#dedede}
html[data-homeai-theme="light"] .account-center-sidebar{background:#f7f7f7;border-color:#dedede}
html[data-homeai-theme="light"] .account-center-modal :is(.upgrade-price-row,.upgrade-price-main,.upgrade-plan-power,.upgrade-features,.upgrade-plan-note){color:#181818}
html[data-homeai-theme="light"] .account-center-modal .upgrade-plan-action{background:#171717;color:#fff;border-color:#171717}
html[data-homeai-theme="light"] .layout-sidebar img[src="/brand/homeai-mark-lime.svg"]{filter:grayscale(1) brightness(.15)}
html:root[data-homeai-theme="light"]{--ha-canvas:#ffffff;--ha-shadow:#222222}
html[data-homeai-theme="light"] .account-center-modal :is(.upgrade-flex-desc,.upgrade-model-price-note,.upgrade-payment-note){color:#5c5c5c}
html[data-homeai-theme="light"] :is(.homeai-commerce,.homeai-management) :is(input,textarea)::placeholder{color:#666666}
html:root[data-homeai-theme="light"]{--ha-shadow:rgba(0,0,0,.12)}
html[data-homeai-theme="light"] .generate-floating-btn{background:#171717;color:#fff;border-color:#171717}
html[data-homeai-theme="light"] .generate-floating-btn:disabled{background:#dedede;color:#666666;border-color:#dedede}

html:root[data-homeai-theme="light"] .homeai-hero-actions a:first-child{color:#181818}
html:root[data-homeai-theme="light"] .homeai-hero-actions a:first-child:hover{background:#e9e9e9}
html:root[data-homeai-theme="light"] .homeai-hero-actions a:last-child{border-color:#777;color:#f5f5f5}

/* Keep editor chrome readable while preserving uploaded artwork colors. */
html:root[data-homeai-theme="light"] .canvas-workspace :is(.character-split-panel .image-box,.face-swap-panel,.cloth-change-panel,.batch-images-panel,.commerce-card-panel,.panel-scaler-wrapper){border:1px solid var(--ha-border);border-radius:16px;color:var(--ha-text)}
html:root[data-homeai-theme="light"] .canvas-workspace :is(.panel-title-in-box,.panel-header,.commerce-card-title,.upload-section-title){color:var(--ha-text)}
html:root[data-homeai-theme="light"] .canvas-workspace :is(.label,.upload-field-title,.empty-label,.empty-text,.panel-prompt-label){color:var(--ha-muted)}
html:root[data-homeai-theme="light"] .canvas-workspace :is(.character-split-panel,.face-swap-panel,.cloth-change-panel) .icon-btn{background:var(--ha-elevated);color:var(--ha-text);border:1px solid var(--ha-border)}
html:root[data-homeai-theme="light"] .canvas-workspace .tool-panel-send-btn.disabled{background:#ededed;color:#666;opacity:1}
html:root[data-homeai-theme="light"] .canvas-workspace :is(.empty-state-container,.image-box){border-color:var(--ha-border-strong)}
html:root[data-homeai-theme="light"] .aigc-asset-page .history-list-dialog .history-list-box .history-result-item .type-wrap .asset-select-box:hover{background:#ededed;color:#181818;border-color:#999}
html:root[data-homeai-theme="light"] .aigc-asset-page .history-list-dialog .history-list-box .history-result-item .type-wrap .asset-select-box.is-checked:hover{background:#333;color:#fff;border-color:#333}
html:root[data-homeai-theme="light"] .canvas-workspace .generate-btn.tool-panel-send-btn{background:#171717!important;color:#fff!important;box-shadow:none!important}
html:root[data-homeai-theme="light"] .canvas-workspace .generate-btn.tool-panel-send-btn:is(.disabled,.is-disabled){background:#e7e7e7!important;color:#666!important;opacity:1!important}
/* The login module can load without commerce tokens. Keep both entry tabs readable. */
html .homeai-login-dialog .segments button{min-height:44px}
html[data-homeai-theme="light"] .homeai-login-dialog .segments button{background:#f7f7f7;color:#181818;border-color:#ccc}
html[data-homeai-theme="light"] .homeai-login-dialog .segments button.selected{background:#171717;color:#fff}

/* Reference selection is an action surface; generic legacy palette conversion
   cannot infer the button foreground from its original white background. */
html:root[data-homeai-theme="light"] .add-to-prompt-btn{background:#171717;color:#fff;opacity:1}
html:root[data-homeai-theme="light"] .add-to-prompt-btn:hover:not(:disabled){background:#333333}
html:root[data-homeai-theme="light"] .add-to-prompt-btn:disabled{background:#e7e7e7;color:#606060;opacity:1;cursor:not-allowed}
html:root[data-homeai-theme="light"] .add-to-prompt-btn:focus-visible{outline:2px solid #171717;outline-offset:3px}
/* Highlight overlays must retain exactly the input's glyph metrics. An opaque
   background masks the underlying glyph instead of doubling its antialiasing. */
html:root[data-homeai-theme="light"] .unified-generate-panel .prompt-highlight-layer .is-reference{color:#075985;background:#e0f2fe;border-radius:3px;text-shadow:none}

/* Native toolbar controls retain the existing theme and Vue actions. */
html:root .left-panel .tool-list button[data-homeai-canvas-tool] {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  box-sizing: border-box;
  touch-action: manipulation;
}
html:root .left-panel .tool-list button[data-homeai-canvas-tool]:focus-visible {
  outline: 2px solid var(--homeai-accent, currentColor);
  outline-offset: 2px;
}
@media (max-width: 768px) {
  html:root .left-panel.left-panel {
    box-sizing: border-box;
    max-width: calc(100vw - 78px);
    padding: 4px;
    min-width: 0;
  }
  html:root .left-panel .tool-list.tool-list {
    min-width: 0;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px;
    scroll-padding-inline: 4px;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  html:root .left-panel .tool-list .tool-item-wrapper {
    flex-shrink: 0;
  }
  html:root .left-panel .tool-list .tool-item-wrapper.has-divider {
    margin-right: 0;
  }
  html:root .left-panel .tool-list .tool-item-wrapper.has-divider::after {
    display: none;
  }
  html:root .left-panel .tool-list button[data-homeai-canvas-tool] {
    /* Override the reference's inline 32px on pan / workflow / clear. */
    width: 44px !important;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    flex-shrink: 0;
  }
}
@media (forced-colors: active) {
  html:root .left-panel .tool-list button[data-homeai-canvas-tool]:focus-visible {
    outline-color: Highlight;
  }
}

/* Quoted totals remain in the existing confirmation dialog. */
.homeai-panel-inline{display:contents}
.homeai-tool-quote-note{position:absolute;top:calc(100% + 5px);right:0;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.5;color:var(--homeai-muted,#a6b3ac);pointer-events:none}
.homeai-quote-inline{font-size:12px;color:var(--homeai-muted,#a6b3ac);white-space:nowrap}
html:root :is(.generate-btn,.tool-panel-send-btn):has(>.homeai-tool-quote-note){overflow:visible!important;margin-bottom:23px!important}
@media(max-width:767px){
 html:root .homeai-mobile-tool-drawer.canvas-workspace{position:fixed;inset:0;z-index:1900;width:100%;height:100dvh;min-width:0;min-height:0;display:flex;flex-direction:column;box-sizing:border-box;background:var(--homeai-surface,#171b19);color:var(--ha-text,#eef7f1);transform:none;overflow:hidden;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);border:0;border-radius:0}
 html:root .homeai-mobile-tool-header{width:100%;box-sizing:border-box;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 16px;min-height:60px;flex:none;border-bottom:1px solid var(--homeai-line,#303a35);font-size:16px;background:var(--homeai-surface,#171b19)}
 html:root .homeai-mobile-tool-header button,html:root .homeai-mobile-tool-reopen{font:inherit;font-size:16px;min-height:44px;padding:10px 16px;border:1px solid var(--homeai-line,#303a35);border-radius:10px;background:var(--homeai-accent-soft,#192c23);color:var(--ha-text,#eef7f1);touch-action:manipulation}
 html:root .homeai-mobile-tool-reopen{position:fixed;z-index:1200;right:16px;bottom:calc(80px + env(safe-area-inset-bottom))}
 html:root .homeai-mobile-tool-body{width:100%;align-self:stretch;flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:12px 12px 36px;touch-action:pan-y;box-sizing:border-box}
 html:root .homeai-mobile-tool-body .canvas-element{position:relative!important;inset:auto!important;transform:none!important;width:100%!important;height:auto!important;min-height:0!important;max-width:100%!important;opacity:1!important;z-index:auto!important;transition:none!important;border:0!important;box-shadow:none!important}
 html:root .homeai-mobile-tool-body :is(.canvas-tool-panel-content,.annotation-panel-content,.canvas-tool-panel-inner,.image-placeholder-panel-preview,.image-placeholder-panel-preview__inner,.panel-scaler-wrapper){position:relative!important;inset:auto!important;transform:none!important;width:100%!important;height:auto!important;min-width:0!important;min-height:0!important;max-width:100%!important;overflow:visible!important}
 html:root .homeai-mobile-tool-body :is(.batch-images-panel,.face-swap-panel,.cloth-change-panel,.character-split-panel,.ecommerce-panel,.annotation-modify-panel,.gen-control-panel,.video-viral-remake-panel,.batch-remove-bg-panel,.batch-hd-panel,.batch-upscale-panel,.batch-watermark-panel){position:relative!important;inset:auto!important;transform:none!important;width:100%!important;min-width:0!important;height:auto!important;min-height:0!important;max-width:100%!important;padding:12px!important;border-radius:12px!important;box-sizing:border-box}
 html:root .homeai-mobile-tool-body :is(.canvas-quick-add-btn,.selection-box-overlay,.selection-box,.element-selection-box,.tool-panel-corner-hotspot,.resize-handle,.handle,.l-resize-handle){display:none!important}
 html:root .homeai-mobile-tool-body :is(.panel-header,.panel-title,.panel-title-in-box){cursor:default!important}
 html:root .homeai-mobile-tool-body :is(input,textarea,[contenteditable="true"],select){font-size:16px!important;line-height:1.6!important;max-width:100%;box-sizing:border-box}
 html:root .homeai-mobile-tool-body :is(.panel-prompt-textarea,.panel-prompt-input,.prompt-input){width:100%!important;min-height:160px!important;height:auto!important;resize:vertical;padding:12px!important}
 html:root .homeai-mobile-tool-body :is(.empty-text,.empty-label,.upload-field-title,.multi-image-box-title,.footer-count){font-size:14px!important;line-height:1.5!important}
 html:root .homeai-mobile-tool-body .batch-images-panel .image-inputs{grid-template-columns:1fr!important;gap:12px!important}
 html:root .homeai-mobile-tool-body .batch-images-panel .image-box{aspect-ratio:auto!important;min-height:160px!important}
 html:root .homeai-mobile-tool-body :is(.face-swap-panel,.cloth-change-panel) .image-box{min-height:180px!important;flex:auto!important}
 html:root .homeai-mobile-tool-body .character-split-panel .image-box{min-height:270px!important;flex:none!important}
 html:root .homeai-mobile-tool-body .character-split-panel{overflow:visible!important}
 html:root .homeai-mobile-tool-body .annotation-modify-panel .image-inputs{display:flex!important;flex-direction:column!important;gap:16px!important}
 html:root .homeai-mobile-tool-body .annotation-modify-panel .image-slot-column{width:100%!important;min-width:0!important}
 html:root .homeai-mobile-tool-body :is(.image-inputs,.panel-body,.prompt-wrap,.prompt-section){height:auto!important;max-height:none!important;min-width:0!important;overflow:visible!important}
 html:root .homeai-mobile-tool-body :is(.panel-footer,.panel-toolbar,.batch-floating-control){position:relative!important;inset:auto!important;transform:none!important;width:100%!important;min-width:0!important;max-width:100%!important;display:flex!important;flex-wrap:wrap!important;gap:10px!important;margin-top:16px!important;height:auto!important;padding:12px 0!important;box-sizing:border-box}
 html:root .homeai-mobile-tool-body :is(.panel-toolbar,.panel-footer) :is(.left-group,.center-group,.right-group){max-width:100%!important;min-width:0!important;flex-wrap:wrap!important}
 html:root .homeai-mobile-tool-body :is(button,.icon-btn,.control-item,.generate-btn,.tool-panel-send-btn,.close-btn){min-height:44px!important;min-width:44px!important;box-sizing:border-box;touch-action:manipulation}
 html:root .homeai-mobile-tool-body :is(.tile-remove-btn,.remove-btn){opacity:1!important}
 html:root .homeai-mobile-tool-body :is(.panel-header .close-btn,.panel-header .panel-close-btn){display:none!important}
 html:root .homeai-mobile-tool-body .gen-control-panel :is(.panel-body,.text-input-area,.prompt-editor-shell,.area-header,.generate-floating-cluster){position:relative!important;inset:auto!important;transform:none!important;width:100%!important;height:auto!important;min-width:0!important;max-width:100%!important;max-height:none!important;flex:none!important;box-sizing:border-box}
 html:root .homeai-mobile-tool-body .gen-control-panel .prompt-editor-shell{min-height:180px!important;overflow:visible!important}
 html:root .homeai-mobile-tool-body .gen-control-panel .prompt-highlight-layer{width:100%!important;max-width:100%!important;height:160px!important;box-sizing:border-box!important;overflow:hidden!important}
 html:root .homeai-mobile-tool-body .gen-control-panel .panel-body{padding:12px!important;gap:12px!important}
 html:root .homeai-mobile-tool-body .gen-control-panel .panel-toolbar{display:flex!important;flex-direction:column!important;flex-wrap:wrap!important;align-items:stretch!important;overflow:visible!important;flex:none!important;margin-top:0!important;gap:8px!important}
 html:root .homeai-mobile-tool-body .gen-control-panel .panel-toolbar :is(.left-group,.center-group,.right-group){width:100%!important;flex:0 1 auto!important;flex-wrap:wrap!important;justify-content:flex-start!important;gap:8px!important}
 html:root .homeai-mobile-tool-body .gen-control-panel .generate-floating-cluster{display:flex!important;align-items:center!important;gap:12px!important;margin:16px 0 24px!important;justify-content:flex-end!important;overflow:visible!important}
 html:root .homeai-mobile-tool-body .gen-control-panel .generate-floating-cluster .batch-floating-control{width:auto!important;flex:0 1 auto!important;flex-wrap:nowrap!important;gap:4px!important;padding:3px!important;margin:0!important;opacity:1!important;pointer-events:auto!important}
 html:root .homeai-mobile-tool-body .gen-control-panel .generate-floating-cluster .generate-floating-btn{flex:0 0 44px!important;margin:0!important;overflow:visible!important;background:var(--ha-text,#eef7f1)!important;color:var(--homeai-surface,#171b19)!important}
 html:root .homeai-mobile-tool-body .homeai-tool-quote-note{font-size:14px}
}
/* Keep the text-model selector and composer reachable on narrow screens. */
@media(max-width:780px){
 .llm-agent-page{margin-left:0!important;min-width:0!important}
 .llm-agent-page .llm-agent-container{flex-direction:column!important;min-width:0!important}
 .llm-agent-page .conversation-list{width:100%!important;height:auto!important;max-height:130px!important;border-right:0!important;flex-shrink:0!important}
 .llm-agent-page .conversation-list .list-header{padding:8px 12px!important}
 .llm-agent-page .conversation-list .list-content{max-height:60px!important;margin-bottom:4px!important}
 .llm-agent-page .chat-container{min-width:0!important;min-height:0!important;width:100%!important;flex:1!important}
 .llm-agent-page .chat-input{padding:8px 12px!important;min-width:0!important}
 .llm-agent-page .chat-input select{width:100%!important;font-size:13px!important}
 .llm-agent-page .input-wrapper,.llm-agent-page .input-container{min-width:0!important;width:100%!important}
 .llm-agent-page .welcome-screen{padding:12px!important}
}

/* Canvas copy stays legible at a reduced zoom; toolbar already compensates its own scale. */
html:root .canvas-workspace .gen-control-panel {
  --homeai-copy-scale: max(1, var(--zoom-inverse, 1));
}
html:root .canvas-workspace .gen-control-panel :is(.prompt-input, .prompt-highlight-layer) {
  font-family: inherit !important;
  font-size: calc(16px * var(--homeai-copy-scale)) !important;
  line-height: 1.65 !important;
  letter-spacing: 0 !important;
  padding: calc(4px * var(--homeai-copy-scale)) 0 !important;
  box-sizing: border-box !important;
  mask-image: none !important;
  -webkit-mask-image: none !important;
}
html:root .canvas-workspace .gen-control-panel .prompt-input {
  min-height: 0 !important;
  height: 100% !important;
  width: 100% !important;
  max-height: 100% !important;
  resize: none !important;
  overflow: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: #828a85 transparent !important;
  color: var(--ha-text, #f2f5f3) !important;
  caret-color: var(--homeai-accent, #acf4ca);
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  cursor: text !important;
  user-select: text !important;
  -webkit-user-select: text !important;
  touch-action: pan-y !important;
  overscroll-behavior: contain;
}
html:root .canvas-workspace .gen-control-panel .prompt-input:focus {
  outline: none !important;
}
html:root .canvas-workspace .gen-control-panel .prompt-input::placeholder { color: var(--ha-muted, #acb5af) !important; opacity: 1; }
html:root .canvas-workspace .gen-control-panel .prompt-input::selection { background: #a5e9c1; color: #12251a; }
html:root .canvas-workspace .gen-control-panel .prompt-highlight-layer { border: 0 !important; border-radius: 0 !important; height: 100% !important; width: 100% !important; }
html:root .canvas-workspace .gen-control-panel .area-title {
  font-size: calc(14px * var(--homeai-copy-scale)) !important;
  color: var(--ha-muted, #b5bdb8) !important;
}
html:root .canvas-workspace .gen-control-panel .area-header {
  height: calc(36px * var(--homeai-copy-scale)) !important;
  min-height: calc(36px * var(--homeai-copy-scale));
}
html:root .canvas-workspace .gen-control-panel .header-actions { gap: calc(4px * var(--homeai-copy-scale)) !important; }
html:root .canvas-workspace .gen-control-panel .header-actions .area-icon-btn {
  width: calc(36px * var(--homeai-copy-scale)) !important;
  height: calc(36px * var(--homeai-copy-scale)) !important;
  padding: calc(6px * var(--homeai-copy-scale)) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: calc(4px * var(--homeai-copy-scale)) !important;
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
  border: 0 !important;
  border-radius: calc(8px * var(--homeai-copy-scale)) !important;
  background: #343b36 !important;
  color: #f2f5f3 !important;
  font: inherit;
  font-size: calc(13px * var(--homeai-copy-scale)) !important;
  line-height: 1 !important;
  cursor: pointer;
}
html:root .canvas-workspace .gen-control-panel .header-actions .area-icon-btn[data-homeai-action-label] {
  width: auto !important;
  padding-inline: calc(8px * var(--homeai-copy-scale)) !important;
}
html:root .canvas-workspace .gen-control-panel .header-actions .area-icon-btn[data-homeai-action-label]::after { content: attr(data-homeai-action-label); white-space: nowrap; }
/* Element Plus clips SVGs to its own 1em box unless the wrapper grows too. */
html:root .canvas-workspace .gen-control-panel .header-actions .area-icon-btn .el-icon {
  width: calc(20px * var(--homeai-copy-scale)) !important;
  height: calc(20px * var(--homeai-copy-scale)) !important;
  font-size: calc(20px * var(--homeai-copy-scale)) !important;
  flex: 0 0 auto !important;
  color: inherit !important;
}
html:root .canvas-workspace .gen-control-panel .header-actions .area-icon-btn svg {
  width: calc(20px * var(--homeai-copy-scale)) !important;
  height: calc(20px * var(--homeai-copy-scale)) !important;
  flex: 0 0 auto !important;
  color: inherit !important;
  stroke: currentColor !important;
}
html:root .canvas-workspace .gen-control-panel .header-actions .area-icon-btn .el-icon svg { fill: currentColor !important; stroke: none !important; }
html:root .canvas-workspace .gen-control-panel .header-actions .area-icon-btn:hover:not(:disabled) { background: #47534a !important; color: #fff !important; }
html:root .canvas-workspace .gen-control-panel .header-actions .area-icon-btn:disabled { opacity: 1 !important; color: #b5bdb8 !important; background: transparent !important; cursor: not-allowed; }
html:root[data-homeai-theme="light"] .canvas-workspace .gen-control-panel .header-actions .area-icon-btn { background: #ededed !important; color: #242424 !important; }
html:root[data-homeai-theme="light"] .canvas-workspace .gen-control-panel .header-actions .area-icon-btn:hover:not(:disabled) { background: #dedede !important; color: #111 !important; }
html:root[data-homeai-theme="light"] .canvas-workspace .gen-control-panel .header-actions .area-icon-btn:disabled { background: transparent !important; color: #5c5c5c !important; }
html:root .canvas-workspace .gen-control-panel .header-actions .area-icon-btn:focus-visible { outline: 2px solid var(--homeai-accent, #acf4ca) !important; outline-offset: 2px; }
html:root .canvas-workspace .gen-control-panel .panel-toolbar :is(.control-item, .text-display) { font-size: 15px !important; }
html:root .canvas-workspace .gen-control-panel:is(.is-image-overlay-mode, .is-prompt-placeholder-mode) .prompt-editor-shell {
  top: calc(44px * var(--homeai-copy-scale)) !important;
}
/* One outer surface; its size is independent of the image and canvas node. */
html:root .canvas-workspace .gen-control-panel .homeai-prompt-surface {
  --homeai-copy-scale: var(--homeai-surface-scale, 1);
  box-sizing: border-box !important;
  width: var(--homeai-surface-width, calc(360px * var(--homeai-copy-scale))) !important;
  height: var(--homeai-surface-height, calc(240px * var(--homeai-copy-scale))) !important;
  min-height: min(calc(200px * var(--homeai-copy-scale)), var(--homeai-surface-max-height, 100vh)) !important;
  min-width: min(calc(320px * var(--homeai-copy-scale)), var(--homeai-surface-max-width, 100vw)) !important;
  max-height: var(--homeai-surface-max-height, none) !important;
  max-width: var(--homeai-surface-max-width, none) !important;
  overflow: visible !important;
  background: var(--ha-panel, #232724) !important;
  border: 1px solid var(--ha-line, #46534a) !important;
  border-radius: calc(12px * var(--homeai-copy-scale)) !important;
  margin: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* A selected surface may extend beyond its image; it must not inherit image-hover hiding. */
html:root .canvas-workspace .gen-control-panel.is-active-panel .homeai-prompt-surface {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
/* Selection keeps a detached editor reachable across the empty gap to its image.
   The archived image-hover rule is more specific than the general active rule.
   Preserve intentional suppression during image dragging and special tool modes. */
html:root .canvas-workspace .element-control-panel-wrapper.is-generated-prompt-image-panel[data-element-id]:not(.is-generated-overlay-drag-collapsed):not(.is-fast-dragging-panel) .gen-control-panel.is-image-overlay-mode.is-selected-image-overlay.is-active-panel:not(.is-prompt-body-suppressed) > .panel-body.homeai-prompt-surface {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
html:root .canvas-workspace .homeai-prompt-surface-anchored {
  position: absolute !important;
  left: var(--homeai-surface-left, 0px) !important;
  top: var(--homeai-surface-top) !important;
  bottom: auto !important;
  right: auto !important;
}
html:root .canvas-workspace .homeai-prompt-surface .text-input-area {
  top: calc(48px * var(--homeai-copy-scale)) !important;
  left: calc(12px * var(--homeai-copy-scale)) !important;
  right: calc(12px * var(--homeai-copy-scale)) !important;
  bottom: calc(52px * var(--homeai-copy-scale)) !important;
}
html:root .canvas-workspace .homeai-prompt-surface .area-title { display: none !important; }
html:root .canvas-workspace .homeai-prompt-surface .area-header { margin: 0 !important; justify-content: flex-start !important; }
html:root .canvas-workspace .homeai-prompt-surface .header-actions { margin-left: 0 !important; }
html:root .canvas-workspace .homeai-prompt-surface::after { display: none !important; }
html:root .homeai-prompt-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(44px * var(--homeai-copy-scale));
  display: flex;
  align-items: center;
  gap: calc(4px * var(--homeai-copy-scale));
  padding: calc(4px * var(--homeai-copy-scale)) calc(8px * var(--homeai-copy-scale));
  box-sizing: border-box;
  z-index: 20;
  color: var(--ha-text, #f2f5f3);
}
html:root .homeai-prompt-chrome button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(6px * var(--homeai-copy-scale));
  height: calc(36px * var(--homeai-copy-scale));
  min-width: calc(36px * var(--homeai-copy-scale));
  padding: calc(6px * var(--homeai-copy-scale));
  font: inherit;
  font-size: calc(14px * var(--homeai-copy-scale));
  line-height: 1;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: calc(6px * var(--homeai-copy-scale));
  cursor: pointer;
  touch-action: none;
}
html:root .homeai-prompt-chrome button svg { width: calc(18px * var(--homeai-copy-scale)); height: calc(18px * var(--homeai-copy-scale)); flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
html:root .homeai-prompt-chrome .homeai-surface-drag-handle { flex: 1; justify-content: flex-start; font-weight: 600; cursor: grab; user-select: none; }
html:root .homeai-prompt-chrome .homeai-surface-drag-handle:active { cursor: grabbing; }
html:root .homeai-prompt-chrome button:hover { background: #7b8c7f1f; }
html:root .homeai-prompt-chrome button:focus-visible { outline: 2px solid var(--homeai-accent, #acf4ca); outline-offset: -2px; }
html:root .canvas-workspace .gen-control-panel .homeai-surface-collapsed { min-width: 0 !important; min-height: 0 !important; overflow: hidden !important; }
html:root .canvas-workspace .gen-control-panel .homeai-prompt-surface.homeai-surface-collapsed > :not(.homeai-prompt-chrome) { display: none !important; }
html:root .homeai-surface-dragging { user-select: none !important; }
html:root .canvas-workspace .homeai-prompt-surface .generate-floating-cluster {
  right: calc(40px * var(--homeai-copy-scale)) !important;
  bottom: calc(8px * var(--homeai-copy-scale)) !important;
  display: flex !important;
  width: auto !important;
  height: calc(36px * var(--homeai-copy-scale)) !important;
  gap: calc(8px * var(--homeai-copy-scale)) !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
html:root .canvas-workspace .homeai-prompt-surface .batch-floating-control {
  display: flex !important;
  width: auto !important;
  min-width: 0 !important;
  height: 100% !important;
  gap: calc(2px * var(--homeai-copy-scale)) !important;
  padding: 0 !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
  font-size: calc(13px * var(--homeai-copy-scale)) !important;
  color: var(--ha-text, #f2f5f3) !important;
}
html:root .canvas-workspace .homeai-prompt-surface .batch-step-btn { width: calc(28px * var(--homeai-copy-scale)) !important; height: calc(36px * var(--homeai-copy-scale)) !important; font-size: calc(17px * var(--homeai-copy-scale)) !important; color: inherit !important; }
html:root .canvas-workspace .homeai-prompt-surface .batch-step-value { min-width: calc(28px * var(--homeai-copy-scale)) !important; font-size: inherit !important; }
html:root .canvas-workspace .homeai-prompt-surface .generate-floating-btn {
  width: calc(36px * var(--homeai-copy-scale)) !important;
  height: calc(36px * var(--homeai-copy-scale)) !important;
  background: #acf4ca !important;
  color: #12251a !important;
  border: 0 !important;
  flex: none !important;
}
html:root[data-homeai-theme="light"] .canvas-workspace .homeai-prompt-surface .generate-floating-btn { background: #171717 !important; color: #fff !important; }
html:root .canvas-workspace .homeai-prompt-surface .generate-floating-btn svg { width: calc(20px * var(--homeai-copy-scale)) !important; height: calc(20px * var(--homeai-copy-scale)) !important; }
html:root .canvas-workspace .homeai-prompt-surface .generate-floating-btn .homeai-tool-quote-note { display: none !important; }
html:root .canvas-workspace .homeai-prompt-surface .generate-floating-btn:disabled { background: #68776d !important; color: #fff !important; opacity: 1 !important; }
html:root[data-homeai-theme="light"] .canvas-workspace .homeai-prompt-surface .generate-floating-btn:disabled { background: #e7e7e7 !important; color: #606060 !important; }
html:root .homeai-resizable-surface:focus-within { outline: 1px solid var(--homeai-accent, #acf4ca); outline-offset: -1px; }
html:root .homeai-surface-resize-handle {
  --homeai-handle-scale: 1;
  position: absolute !important;
  z-index: 8 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: calc(32px * var(--homeai-handle-scale)) !important;
  height: calc(32px * var(--homeai-handle-scale)) !important;
  padding: calc(5px * var(--homeai-handle-scale)) !important;
  display: grid !important;
  place-items: center !important;
  background: transparent !important;
  border: 0 !important;
  color: var(--ha-muted, #aeb9b1) !important;
  cursor: nwse-resize !important;
  touch-action: none !important;
  user-select: none !important;
  border-radius: 0 0 10px 0 !important;
}
html:root .canvas-workspace .homeai-surface-resize-handle { --homeai-handle-scale: var(--homeai-copy-scale); }
html:root .homeai-surface-resize-handle svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
html:root .homeai-surface-resize-handle:hover { color: var(--homeai-accent, #acf4ca) !important; }
html:root .homeai-surface-resize-handle:focus-visible { outline: 2px solid var(--homeai-accent, #acf4ca) !important; outline-offset: -3px; }
html:root .homeai-surface-resizing { user-select: none !important; }
html:root .homeai-surface-resize-x,
html:root .homeai-surface-resize-y { position: absolute; border: 0; padding: 0; background: transparent; z-index: 7; touch-action: none; }
html:root .homeai-surface-resize-x { right: calc(-3px * var(--homeai-copy-scale)); top: calc(44px * var(--homeai-copy-scale)); bottom: calc(32px * var(--homeai-copy-scale)); width: calc(8px * var(--homeai-copy-scale)); cursor: ew-resize; }
html:root .homeai-surface-resize-y { bottom: calc(-3px * var(--homeai-copy-scale)); left: calc(12px * var(--homeai-copy-scale)); right: calc(32px * var(--homeai-copy-scale)); height: calc(8px * var(--homeai-copy-scale)); cursor: ns-resize; }
html:root .homeai-surface-resize-x:focus-visible,
html:root .homeai-surface-resize-y:focus-visible { outline: 2px solid var(--homeai-accent, #acf4ca); outline-offset: 0; }

/* Presets are already outside the canvas scaling through the toolbar's inverse transform. */
html:root .gen-image-preset-popover { width: min(390px, calc(100vw - 32px)) !important; max-width: calc(100vw - 32px) !important; }
html:root .gen-image-preset-popover .image-preset-tab { font-size: 15px !important; min-height: 38px; }
html:root .gen-image-preset-popover .image-preset-option { min-height: 64px; padding: 10px 12px !important; text-align: left; }
html:root .gen-image-preset-popover .image-preset-option-copy strong { font-size: 16px !important; line-height: 1.45 !important; font-weight: 600 !important; white-space: normal !important; color: var(--ha-text, #f2f5f3) !important; }
html:root .gen-image-preset-popover .image-preset-option-copy small { font-size: 14px !important; line-height: 1.5 !important; white-space: normal !important; color: var(--ha-muted, #b5bdb8) !important; }
html:root .gen-image-preset-popover .image-preset-list { max-height: min(440px, 55vh) !important; overflow-y: auto; overscroll-behavior: contain; }
html:root .gen-image-preset-popover button:focus-visible { outline: 2px solid var(--homeai-accent, #acf4ca); outline-offset: -2px; }

/* Dialog copy retains the existing save / insert / replace handlers. */
html:root .tk-dialog.prompt-template-dialog { width: min(480px, calc(100vw - 24px)) !important; max-width: calc(100vw - 24px) !important; max-height: calc(100dvh - 24px) !important; overflow-y: auto !important; box-sizing: border-box !important; }
html:root :is(.optimize-modal-content .prompt-textarea, .template-modal-content .preview-textarea, .inner-dialog .edit-textarea) {
  font-family: inherit !important;
  font-size: 16px !important;
  line-height: 1.65 !important;
  min-height: 144px !important;
  max-height: 55vh !important;
  resize: none !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  color: var(--ha-text, #f2f5f3) !important;
  caret-color: var(--homeai-accent, #acf4ca);
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 6px 0 !important;
  box-sizing: border-box !important;
  user-select: text !important;
  touch-action: pan-y;
}
html:root :is(.optimize-modal-content .prompt-textarea, .template-modal-content .preview-textarea, .inner-dialog .edit-textarea)::placeholder { color: var(--ha-muted, #acb5af) !important; opacity: 1; }
html:root :is(.optimize-modal-content .prompt-textarea, .template-modal-content .preview-textarea, .inner-dialog .edit-textarea):focus { outline: none !important; }
html:root .homeai-optimizer-surface {
  position: relative !important;
  width: var(--homeai-surface-width, 440px) !important;
  height: var(--homeai-surface-height, 340px) !important;
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100vh - 24px) !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
}
html:root .homeai-optimizer-positioned { position: fixed !important; left: var(--homeai-dialog-left) !important; top: var(--homeai-dialog-top) !important; transform: none !important; margin: 0 !important; }
html:root .homeai-optimizer-surface > .body,
html:root .homeai-optimizer-surface .optimize-modal-content,
html:root .homeai-optimizer-surface .modal-body,
html:root .homeai-optimizer-surface .card-content { display: flex !important; flex-direction: column !important; flex: 1 !important; min-height: 0 !important; min-width: 0 !important; }
html:root .homeai-optimizer-surface .modal-header,
html:root .homeai-optimizer-surface .modal-footer,
html:root .homeai-optimizer-surface .card-title { flex-shrink: 0 !important; }
html:root .homeai-optimizer-surface .modal-body { overflow-y: auto !important; overscroll-behavior: contain; max-height: none !important; }
html:root .homeai-optimizer-surface .prompt-card { flex: 1 !important; min-height: 80px !important; }
html:root .homeai-optimizer-surface .card-content { align-self: stretch !important; }
html:root .homeai-optimizer-surface .prompt-textarea { flex: 1 !important; min-height: 0 !important; height: 100% !important; max-height: none !important; }
html:root .homeai-optimizer-surface .modal-footer { padding-right: 20px !important; }
html:root[data-homeai-theme="light"] .gen-image-preset-popover { background: #fff !important; border-color: #b9c2bc !important; }
html:root[data-homeai-theme="light"] .gen-image-preset-popover .image-preset-tab { color: #303b34 !important; }
html:root[data-homeai-theme="light"] .gen-image-preset-popover .image-preset-tab.active { background: #d5eddd !important; }
@media (max-width: 767px) {
  html:root .homeai-mobile-tool-body .gen-control-panel { --homeai-copy-scale: 1; }
  html:root .homeai-mobile-tool-body .gen-control-panel .prompt-input { max-height: none !important; min-height: 0 !important; height: 100% !important; }
  html:root .homeai-mobile-tool-body .gen-control-panel .prompt-editor-shell { top: auto !important; flex: 1 !important; min-height: 0 !important; }
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface {
    position: relative !important; top: auto !important; left: auto !important; right: auto !important; bottom: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: max(340px, var(--homeai-surface-height, 340px)) !important;
    min-height: 320px !important;
    max-height: max(340px, 65dvh) !important;
    display: flex !important; flex-direction: column !important;
    padding: 8px !important; gap: 8px !important;
  }
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface .text-input-area { position: relative !important; inset: auto !important; width: 100% !important; height: auto !important; display: flex !important; flex-direction: column !important; flex: 1 1 auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; gap: 8px !important; }
  html:root .homeai-mobile-tool-body .homeai-prompt-chrome { position: relative; flex: 0 0 44px; height: 44px; padding: 0; }
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface .area-header { position: relative !important; inset: auto !important; height: 44px !important; min-height: 44px !important; flex: 0 0 44px !important; }
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface .header-actions { max-width: 100% !important; gap: 4px !important; }
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface .header-actions .area-icon-btn { width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important; }
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface .header-actions .area-icon-btn[data-homeai-action-label] { width: auto !important; }
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface .prompt-editor-shell { position: relative !important; inset: auto !important; width: 100% !important; height: auto !important; min-height: 0 !important; flex: 1 1 auto !important; }
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface :is(.prompt-input,.prompt-highlight-layer) { min-height: 0 !important; height: 100% !important; max-height: none !important; padding: 4px 0 !important; }
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface .generate-floating-cluster { position: relative !important; inset: auto !important; width: 100% !important; height: 44px !important; min-height: 44px !important; flex: 0 0 44px !important; justify-content: flex-end !important; margin: 0 !important; padding: 0 24px 0 0 !important; }
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface .batch-floating-control { width: auto !important; flex: none !important; height: 44px !important; margin: 0 !important; padding: 0 !important; }
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface .generate-floating-btn { width: 44px !important; height: 44px !important; flex: 0 0 44px !important; }
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface.homeai-surface-collapsed { height: 60px !important; min-height: 0 !important; }
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface.homeai-surface-collapsed > :not(.homeai-prompt-chrome) { display: none !important; }
  html:root .optimize-modal-content { padding: 14px !important; }
  html:root .template-modal-content { padding: 14px !important; min-width: 0 !important; box-sizing: border-box !important; }
  html:root .template-modal-content .modal-header { gap: 8px !important; margin-bottom: 16px !important; }
  html:root .template-modal-content .modal-header .modal-actions { gap: 4px !important; }
  html:root .template-modal-content .modal-header .close-btn { width: 44px !important; height: 44px !important; flex: 0 0 44px !important; }
  html:root .optimize-modal-content .prompt-card { padding: 4px 0 !important; gap: 10px !important; }
  html:root .optimize-modal-content .card-icon { display: none; }
}
@media (max-width: 359px) {
  html:root .homeai-mobile-tool-body .gen-control-panel .homeai-prompt-surface .area-icon-btn[data-homeai-action-label]::after { display: none !important; }
}

/* The node is the editing surface. No detached prompt window or extra chrome. */
html:root .canvas-workspace .homeai-inline-prompt {
 --homeai-copy-scale:1;--homeai-node-bg:#171e1a;
}
html:root .canvas-workspace .homeai-inline-prompt > .panel-body {
 position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
 min-width:0!important;min-height:0!important;margin:0!important;padding:0!important;
 border:1px solid var(--ha-border,#35443c)!important;border-radius:12px!important;background:var(--homeai-node-bg)!important;
 box-shadow:none!important;backdrop-filter:none!important;overflow:visible!important;
 opacity:1!important;visibility:visible!important;pointer-events:auto!important;
}
html:root .canvas-workspace .homeai-inline-prompt .text-input-area {
 position:absolute!important;inset:24px 24px 56px!important;padding:0!important;
 background:transparent!important;border:0!important;
}
html:root .canvas-workspace .homeai-inline-prompt .area-header {
 position:absolute!important;top:auto!important;bottom:-48px!important;left:0!important;
 height:36px!important;min-height:36px!important;margin:0!important;
}
html:root .canvas-workspace .homeai-inline-prompt .area-drag-zone,
html:root .canvas-workspace .homeai-inline-prompt .area-title,
html:root .canvas-workspace .homeai-inline-prompt .header-actions .area-icon-btn:disabled {display:none!important}
html:root .canvas-workspace .homeai-inline-prompt :is(.prompt-editor-shell,.prompt-content) {
 position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
}
html:root .canvas-workspace .homeai-inline-prompt textarea.prompt-input,
html:root .canvas-workspace .homeai-inline-prompt .prompt-highlight-layer {
 padding:0!important;font-size:18px!important;line-height:1.7!important;
 border:0!important;background:transparent!important;box-shadow:none!important;
}
html:root .canvas-workspace .homeai-inline-prompt .prompt-input::placeholder{color:var(--ha-muted,#acb5af)!important}
html:root .canvas-workspace .homeai-inline-prompt .prompt-input:focus-visible{outline:none!important}
html:root .canvas-workspace .homeai-inline-prompt:focus-within{outline:1px solid var(--homeai-accent,#acf4ca);outline-offset:8px;border-radius:12px}
html:root .canvas-workspace .homeai-inline-prompt > .panel-toolbar {
 top:auto!important;bottom:-56px!important;left:50%!important;
}
html:root .canvas-workspace .homeai-inline-prompt .generate-floating-cluster {
 right:16px!important;bottom:10px!important;gap:10px!important;
}
html:root .canvas-workspace .generate-floating-btn:has(.homeai-canvas-price) {
 display:inline-flex!important;visibility:visible!important;align-items:center!important;justify-content:center!important;
 width:auto!important;min-width:124px!important;height:38px!important;padding:0 14px!important;
 gap:6px!important;border-radius:10px!important;font-family:inherit!important;
 font-size:14px!important;line-height:1.2!important;white-space:nowrap!important;
}
html:root .canvas-workspace .homeai-canvas-price{font-size:13px;font-variant-numeric:tabular-nums;font-weight:500}
@media(max-width:767px){
 html:root .canvas-workspace .homeai-inline-prompt .text-input-area{inset:16px 16px 60px!important}
 html:root .canvas-workspace .homeai-inline-prompt textarea.prompt-input{font-size:18px!important}
}
html:root .canvas-workspace .gen-control-panel.homeai-inline-prompt :is(.prompt-editor-shell,.prompt-content){top:0!important;bottom:0!important;height:auto!important}
html:root .canvas-workspace .homeai-inline-prompt .area-header{justify-content:flex-start!important}
html:root .canvas-workspace .homeai-inline-prompt .header-actions{margin-left:0!important}
html:root .canvas-workspace .homeai-inline-prompt .generate-floating-cluster {
 display:flex!important;width:auto!important;height:38px!important;padding:0!important;
 overflow:visible!important;opacity:1!important;pointer-events:auto!important;
 background:transparent!important;border:0!important;box-shadow:none!important;
}
html:root .canvas-workspace .homeai-inline-prompt .batch-floating-control {
 display:flex!important;align-items:center!important;width:auto!important;
 max-width:none!important;opacity:1!important;visibility:visible!important;
 transform:none!important;pointer-events:auto!important;gap:4px!important;
}
html:root .canvas-workspace .homeai-inline-prompt .batch-step-btn{width:28px!important;height:36px!important;font-size:17px!important}
html:root .canvas-workspace .homeai-inline-prompt .batch-step-value{min-width:28px!important;font-size:13px!important}
html:root .canvas-workspace .generate-floating-btn:has(.homeai-canvas-price){flex:0 0 auto!important;background:var(--homeai-accent,#acf4ca)!important;color:var(--ha-on-accent,#10251a)!important;box-shadow:none!important}
html:root .canvas-workspace .gen-control-panel.homeai-inline-prompt {--homeai-copy-scale:max(1,min(2.5,var(--zoom-inverse,1)))}
html:root .canvas-workspace .gen-control-panel.homeai-inline-prompt textarea.prompt-input,
html:root .canvas-workspace .gen-control-panel.homeai-inline-prompt .prompt-highlight-layer{font-size:calc(16px * var(--homeai-copy-scale))!important}
html:root .canvas-workspace .homeai-inline-prompt[data-homeai-compact="true"] .text-input-area {inset:calc(12px * var(--homeai-copy-scale)) calc(12px * var(--homeai-copy-scale)) calc(96px * var(--homeai-copy-scale))!important}
html:root .canvas-workspace .homeai-inline-prompt[data-homeai-compact="true"] .area-header {bottom:calc(-44px * var(--homeai-copy-scale))!important}
html:root .canvas-workspace .homeai-inline-prompt[data-homeai-compact="true"] .generate-floating-cluster {bottom:calc(10px * var(--homeai-copy-scale))!important;right:calc(12px * var(--homeai-copy-scale))!important;transform:scale(var(--homeai-copy-scale))!important;transform-origin:bottom right!important;gap:6px!important}
html:root .canvas-workspace .homeai-inline-prompt[data-homeai-compact="true"] .generate-floating-btn {min-width:0!important;padding:0 10px!important;font-size:13px!important}
html:root .canvas-workspace .homeai-inline-prompt[data-homeai-compact="true"] .homeai-canvas-price{font-size:12px}
html:root .canvas-workspace .homeai-inline-prompt[data-homeai-compact="true"] .header-actions{gap:calc(4px * var(--homeai-copy-scale))!important}
@media(max-width:767px){
 html:root .canvas-workspace .gen-control-panel.homeai-inline-prompt > .panel-toolbar{max-width:calc(100vw - 94px)!important;height:auto!important;bottom:calc(-96px * var(--zoom-inverse,1))!important}
 html:root .canvas-workspace .homeai-inline-prompt > .panel-toolbar .left-group{flex-wrap:wrap!important;justify-content:center!important;gap:2px!important}
}
/* Canvas navigation uses transforms. Focus must not scroll a hidden ancestor. */
html:root .canvas-workspace:has(.homeai-inline-prompt){overflow:clip!important}
@media(max-width:767px){
 html:root .canvas-workspace .gen-control-panel.homeai-inline-prompt > .panel-toolbar{width:calc(100vw - 106px)!important;overflow:visible!important;padding:4px!important}
 html:root .canvas-workspace .homeai-inline-prompt > .panel-toolbar .left-group{min-width:0!important;width:100%!important;white-space:normal!important}
 html:root .canvas-workspace .homeai-inline-prompt > .panel-toolbar .control-item{font-size:13px!important;padding-inline:6px!important}
}
@media(max-width:767px){
 html:root .canvas-workspace .gen-control-panel.homeai-inline-prompt > .panel-toolbar{flex-wrap:wrap!important;justify-content:center!important;gap:4px!important}
 html:root .canvas-workspace .homeai-inline-prompt > .panel-toolbar > .toolbar-divider{display:none!important}
 html:root .canvas-workspace .homeai-inline-prompt > .panel-toolbar .center-group{justify-content:center!important;min-width:0!important}
}
/* Selected finished images edit in-place; deselection restores the full image. */
html:root .canvas-workspace .gen-control-panel.homeai-inline-prompt:is(.is-image-overlay-mode,.is-video-overlay-mode) > .panel-body {
 top:auto!important;bottom:0!important;max-height:100%!important;
 height:calc(180px * var(--homeai-copy-scale))!important;
 background:var(--ha-panel,#232724)!important;border-radius:0 0 12px 12px!important;
 opacity:0!important;visibility:hidden!important;pointer-events:none!important;
}
html:root .canvas-workspace .gen-control-panel.homeai-inline-prompt:is(.is-image-overlay-mode,.is-video-overlay-mode).is-active-panel:not(.is-prompt-body-suppressed) > .panel-body{opacity:1!important;visibility:visible!important;pointer-events:auto!important}
html:root .canvas-workspace .gen-control-panel.homeai-inline-prompt:is(.is-image-overlay-mode,.is-video-overlay-mode) > .panel-toolbar{bottom:calc(-56px * var(--homeai-copy-scale))!important}
@media(max-width:767px){html:root .canvas-workspace .gen-control-panel.homeai-inline-prompt:is(.is-image-overlay-mode,.is-video-overlay-mode) > .panel-toolbar{bottom:calc(-96px * var(--homeai-copy-scale))!important}}
/* Keep the video reservation notice above the action, clear of the prompt. */
html:root .canvas-workspace .homeai-inline-video:not([data-homeai-compact="true"]) .text-input-area{bottom:88px!important}
html:root .canvas-workspace .homeai-inline-video:not([data-homeai-compact="true"]) .area-header{bottom:-80px!important}
html:root .canvas-workspace .homeai-inline-video .seedance-billing-notice--canvas{position:absolute!important;right:calc(16px * var(--homeai-copy-scale))!important;bottom:calc(56px * var(--homeai-copy-scale))!important;max-width:calc(100% - 32px)!important;color:var(--ha-muted,#68746d)!important;font-size:calc(12px * var(--homeai-copy-scale))!important;line-height:1.4!important}
html:root .canvas-workspace .homeai-inline-prompt.is-active-panel > .panel-toolbar{opacity:1!important;visibility:visible!important;pointer-events:auto!important}

/* Opaque in every interaction state. Only actual image pixels remain transparent. */
html[data-homeai-theme="light"] .canvas-workspace .homeai-inline-prompt{--homeai-node-bg:#fff}
html:root .canvas-workspace .homeai-inline-prompt:is(.is-image-overlay-mode,.is-video-overlay-mode) > .panel-body{background:var(--homeai-node-bg)!important}
html:root .canvas-workspace .canvas-element:has(.homeai-inline-prompt) > .selection-box-overlay{z-index:80!important;pointer-events:none!important;border-color:var(--homeai-accent,#acf4ca)!important}
html:root .canvas-workspace .canvas-element:has(.homeai-inline-prompt) > .selection-box-overlay .handle{pointer-events:auto!important;width:12px!important;height:12px!important;background:var(--ha-panel,#fff)!important;border:1px solid var(--homeai-accent,#acf4ca)!important;border-radius:3px!important}

html:root .canvas-workspace .homeai-inline-prompt[data-homeai-compact="true"] .area-header{height:calc(36px * var(--homeai-copy-scale))!important;min-height:calc(36px * var(--homeai-copy-scale))!important}
html:root .canvas-workspace .homeai-inline-prompt[data-homeai-narrow="true"] .header-actions .area-icon-btn[data-homeai-action-label]{width:calc(36px * var(--homeai-copy-scale))!important;padding:0!important}
html:root .canvas-workspace .homeai-inline-prompt[data-homeai-narrow="true"] .header-actions .area-icon-btn[data-homeai-action-label]::after{display:none!important}

/* Tier accents describe the server-returned membership identity, not privileges or price. */
[data-homeai-member="plus"]{--ha-tier-fg:#9edcc5;--ha-tier-bg:#16392e;--ha-tier-line:#487c68}
[data-homeai-member="pro"]{--ha-tier-fg:#aacdff;--ha-tier-bg:#1b304b;--ha-tier-line:#4f729f}
[data-homeai-member="max"]{--ha-tier-fg:#d1baff;--ha-tier-bg:#332448;--ha-tier-line:#80629e}
[data-homeai-member="ultra"]{--ha-tier-fg:#f0cb88;--ha-tier-bg:#40321d;--ha-tier-line:#9d7e43}
[data-homeai-member="studio"]{--ha-tier-fg:#f6bcca;--ha-tier-bg:#452730;--ha-tier-line:#a76879}
html[data-homeai-theme="light"] [data-homeai-member="plus"]{--ha-tier-fg:#176045;--ha-tier-bg:#e7f4ec;--ha-tier-line:#80ad96}
html[data-homeai-theme="light"] [data-homeai-member="pro"]{--ha-tier-fg:#225a99;--ha-tier-bg:#eaf1fc;--ha-tier-line:#8ba9d0}
html[data-homeai-theme="light"] [data-homeai-member="max"]{--ha-tier-fg:#684192;--ha-tier-bg:#f0eafb;--ha-tier-line:#af97cd}
html[data-homeai-theme="light"] [data-homeai-member="ultra"]{--ha-tier-fg:#78510e;--ha-tier-bg:#faf0da;--ha-tier-line:#b7a06a}
html[data-homeai-theme="light"] [data-homeai-member="studio"]{--ha-tier-fg:#934256;--ha-tier-bg:#fbeaf0;--ha-tier-line:#c696a4}
.homeai-membership-badge{display:inline-flex!important;align-items:center;justify-content:center;max-width:100%;padding:3px 8px!important;border-radius:6px;font-size:11px!important;font-weight:700;line-height:1.35;letter-spacing:.01em;white-space:nowrap;background:var(--ha-tier-bg,transparent)!important;color:var(--ha-tier-fg,var(--ha-muted,#a7b3ac))!important;border:1px solid var(--ha-tier-line,transparent)!important}
.upgrade-plan-card[data-homeai-member]:not([data-homeai-member=""]){border-color:var(--ha-tier-line)!important}
.upgrade-plan-card h3{display:flex;align-items:flex-start;flex-wrap:wrap;gap:8px;margin:0!important}
.upgrade-plan-card .homeai-package-name{flex:1;min-width:100px}
.upgrade-plan-card .homeai-membership-badge{margin-top:3px}
.upgrade-plan-card .homeai-package-comparison{font-size:12px;line-height:1.5;color:var(--ha-muted,#a7b3ac)}
.upgrade-plan-card .homeai-package-comparison s{text-decoration-thickness:1px;font-variant-numeric:tabular-nums}
.upgrade-plan-card .upgrade-original-meta{display:flex;flex-wrap:wrap;gap:5px 12px;align-items:center;min-height:22px}
.upgrade-plan-card .homeai-package-estimate{font-size:21px!important;font-weight:600!important;line-height:1.35;color:var(--ha-text,#f0f5f2)!important;margin-top:8px}
.upgrade-plan-card .homeai-package-estimate-basis{display:block;font-size:12px;line-height:1.6;color:var(--ha-muted,#a7b3ac);max-width:36ch}
.upgrade-plan-card .upgrade-flex-desc{gap:8px!important;margin:16px 0 22px!important}
.upgrade-plan-card .upgrade-flex-desc>strong:not(.homeai-package-estimate){font-size:14px!important;font-weight:500!important}
/* Keep the explanation and amount together; the server still confirms the quote. */
html:root :is(.homeai-recharge-topbar,.homeai-pricing-topbar){display:none!important}
.homeai-custom-recharge{display:grid!important;grid-template-columns:minmax(220px,300px) minmax(260px,390px);justify-content:start;gap:6px 28px!important;align-items:center;padding:20px!important;margin:0 0 20px!important}
.homeai-custom-recharge h3{font-size:20px!important;font-weight:600!important;line-height:1.4;margin:0!important}
.homeai-custom-recharge>p{grid-column:1;font-size:15px!important;line-height:1.65;margin:0!important;max-width:28ch}
.homeai-custom-recharge .homeai-recharge-form{grid-column:2;grid-row:1 / 3;margin:0!important;max-width:390px!important;width:100%;display:grid!important;gap:7px!important}
.homeai-custom-recharge .homeai-recharge-form label{font-size:14px!important;line-height:1.4}
.homeai-custom-recharge .homeai-recharge-input{display:flex!important;flex-direction:row!important;gap:10px!important}
.homeai-custom-recharge input{width:0!important;flex:1;min-width:60px;min-height:44px!important;height:44px!important;padding:10px 12px!important;font-size:16px!important}
.homeai-custom-recharge button{width:auto!important;flex:0 0 auto;white-space:nowrap;min-height:44px!important;height:44px!important;padding:10px 18px!important;font-size:15px!important;font-weight:600!important}
.homeai-custom-recharge output{font-size:13px!important;line-height:1.5!important;margin:0!important}
@media(max-width:1050px){.homeai-custom-recharge{grid-template-columns:minmax(0,1fr);padding:18px!important;gap:8px!important}.homeai-custom-recharge .homeai-recharge-form{grid-column:1;grid-row:auto;max-width:440px!important;margin-top:4px!important}.homeai-custom-recharge>p{max-width:none}}

/* Compact, bounded recharge layout; prices and purchase handlers remain untouched. */
html:root .upgrade-plan-grid{display:grid!important;width:100%;max-width:840px;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important;margin-inline:auto}
html:root .upgrade-plan-card{min-height:0!important;padding:12px!important;gap:4px!important;border-radius:12px!important}
html:root .upgrade-plan-card h3{font-size:16px!important;font-weight:600!important;line-height:1.35!important}
html:root .upgrade-plan-card .upgrade-price-row{margin-top:2px!important;gap:3px!important}
html:root .upgrade-plan-card .upgrade-price-row strong{font-size:28px!important;line-height:1.15!important}
html:root .upgrade-plan-card .upgrade-original-meta{margin-top:0!important;min-height:18px}
html:root .upgrade-plan-card .upgrade-flex-desc{margin:2px 0 4px!important;gap:3px!important}
html:root .upgrade-plan-card .homeai-package-estimate{margin-top:0!important;font-size:20px!important;line-height:1.3!important}
html:root .upgrade-plan-card .homeai-package-estimate-basis{font-size:13px!important;line-height:1.45!important}
html:root .upgrade-plan-card .upgrade-plan-action{min-height:40px!important;padding-block:8px!important;margin-top:auto!important;border-radius:8px!important}
html:root .homeai-custom-recharge{width:100%;box-sizing:border-box;max-width:840px;margin-inline:auto!important;padding:16px!important;grid-template-columns:minmax(200px,1fr) minmax(240px,1.2fr);gap:4px 20px!important}
.homeai-custom-recharge>p{max-width:none}
@media(max-width:1100px){html:root .upgrade-plan-grid{max-width:600px;grid-template-columns:repeat(2,minmax(0,1fr))!important}html:root .homeai-custom-recharge{max-width:600px;grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){html:root .upgrade-plan-grid{max-width:360px;grid-template-columns:minmax(0,1fr)!important}html:root .homeai-custom-recharge{max-width:360px}}

/* Approved system type and compact package presentation. */
html:root :is(.upgrade-plan-grid,.upgrade-plan-card,.homeai-custom-recharge,.homeai-production-ui,.homeai-membership-badge){font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif!important;font-synthesis:none}
.homeai-membership-badge{font-weight:600!important}
[data-homeai-member="studio-plus"]{--ha-tier-fg:#f1bfcc;--ha-tier-bg:#452730;--ha-tier-line:#a76879}
[data-homeai-member="business"]{--ha-tier-fg:#b9cff5;--ha-tier-bg:#25344a;--ha-tier-line:#7186ad}
[data-homeai-member="enterprise"]{--ha-tier-fg:#dfc999;--ha-tier-bg:#3d3424;--ha-tier-line:#a48e62}
html[data-homeai-theme="light"] [data-homeai-member="studio-plus"]{--ha-tier-fg:#934256;--ha-tier-bg:#fbeaf0;--ha-tier-line:#c696a4}
html[data-homeai-theme="light"] [data-homeai-member="business"]{--ha-tier-fg:#344f7b;--ha-tier-bg:#edf2fc;--ha-tier-line:#9eafd0}
html[data-homeai-theme="light"] [data-homeai-member="enterprise"]{--ha-tier-fg:#765a25;--ha-tier-bg:#faf3e4;--ha-tier-line:#bfac86}

/* Readable announcement and stable one-line navigation labels. */
.layout-sidebar{width:76px!important;min-width:76px!important;flex-shrink:0}
.layout-sidebar .nav-list{overflow-x:hidden;scrollbar-width:thin}
.layout-sidebar .nav-label,.layout-sidebar .footer-label,.layout-sidebar .homeai-utility-nav span,.layout-sidebar .homeai-theme-toggle span{white-space:nowrap!important;overflow-wrap:normal!important;word-break:normal!important;max-width:none!important;font-size:12px!important;line-height:1.5!important}
.layout-sidebar .nav-item{padding-inline:3px!important}
.promo-banner{height:auto!important;min-height:64px!important;flex:0 0 auto!important;padding-block:12px!important}
.promo-banner .promo-banner-text,.promo-banner .homeai-banner-link{font-size:var(--homeai-announcement-font-size,18px)!important;line-height:1.5!important;max-height:none!important;overflow:visible!important;white-space:normal!important;overflow-wrap:anywhere}
@media(max-width:640px){.layout-sidebar{width:70px!important;min-width:70px!important}.promo-banner{padding-block:10px!important}.promo-banner .promo-banner-text{max-width:100%!important}}
.promo-banner .homeai-banner-link{flex-shrink:0!important;white-space:nowrap!important}
@media(max-width:640px){.promo-banner{flex-direction:column!important;gap:4px!important}.promo-banner .promo-banner-text{width:100%!important;flex:0 0 auto!important}.promo-banner .homeai-banner-link{max-width:100%;text-align:center}}

/* Keep every destination visible; support and appearance share the last row.
   Grid placement preserves the Vue-owned nodes and their existing actions. */
html:root .layout-container .layout-sidebar {
  --sidebar-nav-top-space: 8px;
  --homeai-rail-item-height: 48px;
  width: 76px !important;
  min-width: 76px !important;
  height: 100dvh;
  max-height: 100dvh;
  padding: 8px 0;
  box-sizing: border-box;
  overflow: visible;
}
html:root .layout-sidebar > .header { flex: 0 0 36px; height: 36px; }
html:root .layout-sidebar > .nav-list {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1 0 auto !important;
  height: auto !important;
  min-height: max-content !important;
  overflow: visible !important;
  padding: 8px 0 !important;
}
html:root .layout-sidebar > .nav-list::before { display: none !important; }
html:root .layout-container .layout-sidebar .nav-list .nav-list-inner {
  width: 100%;
  box-sizing: border-box;
  gap: 3px;
  padding: 0 6px;
}
html:root .layout-container .layout-sidebar .nav-list .nav-item {
  height: var(--homeai-rail-item-height);
  min-height: var(--homeai-rail-item-height);
  flex: 0 0 var(--homeai-rail-item-height);
  gap: 3px;
  border-radius: 9px;
}
html:root .layout-sidebar .nav-item > .homeai-nav-glyph { width: 20px; height: 20px; }
html:root .layout-sidebar :is(.nav-label,.footer-label,.homeai-utility-nav span,.homeai-theme-toggle span) {
  line-height: 16px !important;
}
html:root .layout-container .layout-sidebar > .footer {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: center;
  justify-items: center;
  flex: 0 0 auto;
  width: 100%;
  gap: 4px 0;
  padding: 0;
}
html:root .layout-sidebar > .footer > * { grid-column: 1 / -1; }
html:root .layout-sidebar .homeai-utility-nav { padding: 0 6px; }
html:root .layout-sidebar .homeai-utility-nav a,
html:root .layout-sidebar .footer :is(.homeai-account-trigger,.item) {
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  gap: 2px;
  padding: 2px 0;
}
html:root .layout-sidebar .footer :is(.homeai-account-trigger,.item,.upgrade-btn) {
  width: calc(100% - 12px);
}
html:root .layout-sidebar .footer .homeai-account-trigger { border-radius: 9px; }
html:root .layout-sidebar .footer :is(.homeai-account-trigger,.item) > .homeai-nav-glyph {
  width: 20px; height: 20px;
}
html:root .layout-sidebar .footer .upgrade-btn {
  height: 36px;
  min-height: 36px;
  padding: 4px !important;
  gap: 0 !important;
  font-variant-numeric: tabular-nums;
}
html:root .layout-sidebar .upgrade-btn .mt-1 { margin-top: 0; }
html:root .layout-sidebar .upgrade-btn :is(.text-xs,.flex) { line-height: 14px; }
html:root .layout-sidebar .upgrade-btn .homeai-membership-badge { line-height: 14px; padding: 0 !important; border:0 !important; }
html:root .layout-sidebar .footer .homeai-support-trigger,
html:root .layout-sidebar .footer .homeai-theme-toggle {
  grid-column: auto;
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 4px 0 0;
  gap: 2px;
  border-radius: 0;
  border-top: 1px solid var(--ui-secondary-border-color,#25362c);
  box-sizing: border-box;
  font-size: 11px;
  line-height: 16px;
}
html:root .layout-sidebar .footer :is(.homeai-support-trigger,.homeai-theme-toggle) svg {
  width: 18px; height: 18px;
}
html:root .layout-sidebar :is(button,a):focus-visible {
  outline: 2px solid var(--homeai-accent);
  outline-offset: -2px;
}
@media(max-width:640px) {
  html:root .layout-container .layout-sidebar { width:70px !important; min-width:70px !important; }
}
@media(max-height:700px) {
  html:root .layout-container .layout-sidebar { --sidebar-nav-top-space:4px; --homeai-rail-item-height:44px; }
  html:root .layout-sidebar > .header { height:28px; flex-basis:28px; }
  html:root .layout-sidebar > .header .logo img { max-height:28px; }
  html:root .layout-sidebar > .nav-list { padding:4px 0 !important; }
  html:root .layout-container .layout-sidebar .nav-list .nav-list-inner { gap:0; }
  html:root .layout-container .layout-sidebar > .footer { row-gap:0; }
  html:root .layout-sidebar .footer .upgrade-btn { height:28px; min-height:28px; padding:0 !important; }
  html:root .layout-sidebar .upgrade-btn > .flex { line-height:14px; }
  html:root .layout-sidebar .upgrade-btn .text-xs { line-height:14px; }
}
/* Short landscape windows use two visible columns, never a hidden menu. */
@media(max-height:559px) and (min-width:640px) {
  html:root .layout-container .layout-sidebar { width:164px !important; min-width:164px !important; }
  html:root .layout-container .layout-sidebar .nav-list .nav-list-inner { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px; }
  html:root .layout-sidebar > .footer > * { grid-column:auto; }
  html:root .layout-sidebar .homeai-utility-nav { width:100%; padding:0 4px; }
  html:root .layout-sidebar .footer :is(.homeai-account-trigger,.item,.upgrade-btn) { width:calc(100% - 8px); }
}
/* User-selected announcement color; text and link remain admin-configured. */
html:root .layout-container .layout-main .promo-banner,
html:root[data-homeai-theme="light"] .layout-main .promo-banner{background:#e1ff67;color:#161b0d;border-bottom-color:#cde94f}
html:root .layout-main .promo-banner :is(.promo-banner-text,.homeai-banner-link,.promo-banner-close){color:#161b0d}
html:root .layout-main .promo-banner :is(button,a):focus-visible{outline:2px solid #161b0d;outline-offset:3px}

html:root .homeai-management .site-announcement{background:#e1ff67;color:#161b0d;border-color:#cde94f}
html:root .homeai-management .site-announcement :is(a,button,.announcement-content){color:#161b0d}

/* Keep the existing dialog appearance while giving its actions native semantics. */
button[data-homeai-asset-action]{font:inherit;touch-action:manipulation}
.modern-dialog-content button[data-homeai-asset-action]{appearance:none;padding:0;border:0}
button[data-homeai-asset-action]:focus-visible{outline:2px solid var(--ha-accent,#9cf5c5);outline-offset:3px}
button[data-homeai-asset-action]:disabled{cursor:not-allowed}
.aigc-asset-page .asset-action-bar{align-items:center}
.homeai-asset-selection-count{color:var(--ha-text,#edf5ef);font-size:13px;white-space:nowrap;font-variant-numeric:tabular-nums}
.aigc-asset-page button[data-homeai-asset-action="select-page"][aria-pressed="true"]{border-color:var(--homeai-accent);color:var(--homeai-accent)}
@media(max-width:768px){
 .aigc-asset-page .asset-action-bar button{min-height:44px;margin-left:0}
 .modern-dialog-content button[data-homeai-asset-action],.asset-prompt-popover button[data-homeai-asset-action]{width:44px!important;height:44px!important;min-width:44px;min-height:44px}
}
@media(forced-colors:active){button[data-homeai-asset-action]:focus-visible{outline-color:Highlight}}
/* Cross-page selection remains a compact toolbar; the gallery stays paged. */
.aigc-asset-page .homeai-asset-bulk-progress{font-size:13px;color:var(--ha-text,#edf5ef);font-variant-numeric:tabular-nums}
.aigc-asset-page .homeai-asset-bulk-progress:empty{display:none}
.aigc-asset-page .homeai-asset-cancel{padding:7px 12px;border:1px solid var(--ha-border,#526258);border-radius:8px;background:var(--ha-surface,#17231c);color:var(--ha-text,#edf5ef);cursor:pointer}
.aigc-asset-page button[data-homeai-asset-action="select-all"]{font-weight:600}
@media(max-width:768px){.aigc-asset-page .homeai-asset-selection-count{width:100%;order:5}.aigc-asset-page .homeai-asset-bulk-progress{width:100%;order:6}}
html:root .aigc-asset-page button[data-homeai-asset-action="select-all"]:not(:disabled){background:var(--homeai-accent,#9cf5c5);border-color:transparent;color:var(--ha-on-accent,#0b100d)}
html:root .aigc-asset-page button[data-homeai-asset-action="select-all"]:hover:not(:disabled){background:var(--homeai-accent-hover,#bff9d9)}

.homeai-legacy-tool-note{margin:0 0 14px;padding:10px 12px;border:1px solid rgba(128,128,128,.24);border-radius:10px;color:inherit;font-size:12px;line-height:1.7;opacity:.82;overflow-wrap:anywhere}
.homeai-legacy-tool-field{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px;font-size:13px;line-height:1.5;color:inherit}
.homeai-legacy-tool-field select{min-width:88px;min-height:36px;padding:7px 28px 7px 10px;border:1px solid rgba(128,128,128,.4);border-radius:8px;background:transparent;color:inherit;font:inherit}
.homeai-legacy-tool-field select option{color:#111;background:#fff}
.homeai-legacy-tool-field select:focus-visible{outline:2px solid currentColor;outline-offset:3px}
/* Scoped to the old image generator; canvas controls retain their own layout. */
html:root .ai-image-page .ai-image-panel{box-sizing:border-box;min-width:0;min-height:0;padding-bottom:0}
html:root .ai-image-page .tool-tab-pane,html:root .ai-image-page .tool-layout{min-width:0;min-height:0;max-width:100%;box-sizing:border-box}
html:root .ai-image-page .tool-layout>.form{min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;box-sizing:border-box}
html:root .ai-image-page .tool-layout>.submit{flex:0 0 auto;min-width:0;padding:12px 16px max(12px,env(safe-area-inset-bottom));box-sizing:border-box;background:var(--ui-primary-bg-color);border-top:1px solid var(--ui-secondary-border-color,rgba(128,128,128,.18))}
html:root .ai-image-page .tool-layout>.submit>.action-bar{display:flex;align-items:center;justify-content:flex-end;min-width:0;max-width:100%}
html:root .ai-image-page .tool-layout>.submit .generate-floating-cluster{position:static!important;inset:auto!important;transform:none!important;display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;gap:10px;min-width:0;max-width:100%;margin:0!important}
html:root .ai-image-page .tool-layout>.submit .homeai-legacy-price-note{position:static!important;inset:auto!important;transform:none!important;order:0;flex:0 0 auto;display:inline-flex;align-items:center;white-space:nowrap;font-size:12px;line-height:1.5;margin:0;color:var(--ui-secondary-text-color);pointer-events:auto}
html:root .ai-image-page .tool-layout>.submit .generate-floating-btn{position:relative!important;inset:auto!important;transform:none!important;order:1;flex:0 0 44px;width:44px;height:44px;margin:0!important}
html:root .ai-image-page .tool-layout>.submit .generate-status{min-width:0;flex:1 1 auto;max-width:160px}
@media(max-width:768px){
 html:root .ai-image-page{flex-direction:column;min-width:0;max-width:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
 html:root .ai-image-page>.panel{width:100%!important;min-width:0!important;max-width:100%!important;flex:0 0 100%!important;height:100%!important;min-height:0;box-sizing:border-box}
 html:root .ai-image-page>.history{flex:0 0 auto!important;width:100%;min-width:0;height:480px;min-height:320px;max-width:100%;border-top:1px solid var(--ui-secondary-border-color,rgba(128,128,128,.18))}
 html:root .ai-image-page .ai-image-panel{width:100%;max-width:100%;border-right:0;padding-top:12px}
 html:root .ai-image-page .tool-switch-bar{flex:0 0 auto;margin:0 12px;padding:12px;min-width:0;gap:8px}
 html:root .ai-image-page .tool-switch-bar .tool{min-width:0;overflow-wrap:anywhere}
 html:root .ai-image-page .tool-switch-bar .tool-set{flex:0 0 auto}
 html:root .ai-image-page .tool-layout>.form{padding:12px}
 html:root .ai-image-page .tool-layout>.submit{padding-inline:12px}
 html:root .ai-image-page .el-form,html:root .ai-image-page .el-form-item,html:root .ai-image-page .el-form-item__content,html:root .ai-image-page .el-select,html:root .ai-image-page .el-textarea,html:root .ai-image-page .flex-1{min-width:0;max-width:100%;box-sizing:border-box}
 html:root .ai-image-page .el-radio-group{display:flex;flex-wrap:wrap;max-width:100%;gap:4px 0}
 html:root .ai-image-page .el-form-item__label{height:auto;line-height:1.5;white-space:normal}
 html:root .ai-image-page .el-slider{min-width:0}
 html:root .el-popper:has(.tool-group-list[data-v-309af8f4]){position:fixed!important;inset:84px 12px auto 82px!important;transform:none!important;width:auto!important;min-width:0!important;max-width:calc(100vw - 94px)!important;max-height:calc(100dvh - 108px)!important;overflow-x:hidden;overflow-y:auto;box-sizing:border-box;padding:12px}
 html:root .tool-group-list[data-v-309af8f4]{gap:16px;min-width:0;max-width:100%}
 html:root .tool-list[data-v-309af8f4]{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px;min-width:0;max-width:100%}
 html:root .tool-list .tool-item[data-v-309af8f4]{min-width:0;padding:10px 4px;font-size:12px;line-height:1.5;text-align:center;overflow-wrap:anywhere;background:var(--ui-secondary-bg-color);color:var(--ui-secondary-text-color)}
 html:root .tool-list .tool-item.active[data-v-309af8f4]{color:var(--ui-primary-color)}
}
html:root[data-homeai-theme="light"] .ai-image-page .tool-layout>.submit .generate-floating-btn{background:#111!important;color:#fff!important;box-shadow:none!important}
html:root[data-homeai-theme="light"] .ai-image-page .tool-layout>.submit .generate-floating-btn svg{color:inherit!important;stroke:currentColor!important}

/* On narrow screens the desktop right column would otherwise sit off-screen. */
@media(max-width:640px){
 html:root .ai-image-page .agent-panel{position:fixed;inset:0;width:100vw;height:100dvh;z-index:50;border:0}
 html:root .ai-image-page .agent-panel .ai-panel{width:100%!important;max-width:100%;height:100%;padding:12px;min-width:0}
 html:root .ai-image-page .agent-panel .panel-resize-handle{display:none}
 html:root .ai-image-page .agent-trigger-btn{position:fixed;top:auto;bottom:84px;right:12px;z-index:35}
 html:root .ai-image-page .agent-panel .close-toggle-btn{width:36px;height:36px;top:4px;left:4px}
 html:root .ai-panel .homeai-designer-cost{overflow-wrap:anywhere}
}

/* Keep the composer actions reachable with long requirements and plan responses. */
html:root .ai-panel { min-height:0; max-height:100%; overflow:hidden; }
html:root .ai-panel .panel-header { flex-shrink:0; }
html:root .ai-panel .panel-content { min-height:0; flex:1 1 0; overflow-y:auto; overflow-wrap:anywhere; }
html:root .ai-panel .panel-footer { flex:0 0 auto; min-height:0; }
html:root .ai-panel .panel-footer .main-input-box { max-height:min(22dvh,160px)!important; overflow-y:auto!important; overscroll-behavior:contain; }
html:root .ai-panel .commerce-detail-card-config-textarea { max-height:180px; overflow-y:auto; }
@media(max-width:640px){html:root .ai-panel .panel-footer .main-input-box {max-height:18dvh!important;} }

/* Capability choices scroll independently; the composer always fits the panel. */
html:root .ai-panel .panel-footer {display:flex;flex-direction:column;flex:0 1 auto;min-height:0;max-height:calc(100% - 64px);gap:10px}
html:root .ai-panel .panel-footer .mode-entry-inline {min-height:0;max-height:18dvh;overflow:auto;flex:0 1 auto;margin:0}
html:root .ai-panel .panel-footer .ecommerce-kit-type-strip {min-height:0;max-height:14dvh;overflow:auto;flex:0 1 auto;margin:0}
html:root .ai-panel .panel-footer .input-container-modern {flex:0 0 auto;margin:0}
html:root .ai-panel .panel-footer .main-input-box {max-height:min(16dvh,128px)!important}
html:root .ai-panel .action-bar-modern {flex-shrink:0}
@media(max-height:550px){html:root .ai-panel .panel-footer .mode-entry-inline{max-height:12dvh}html:root .ai-panel .panel-footer .ecommerce-kit-type-strip{max-height:12dvh}html:root .ai-panel .panel-footer .main-input-box{max-height:10dvh!important}}
/* Make the action visible in the incumbent light theme, including long drafts. */
html:root .ai-panel .send-circle-btn.ready:not(.disabled){background:#111fbf!important;color:#fff!important}
html:root .ai-panel .send-circle-btn.disabled{background:#e9eaf0!important;color:#737782!important}
@media(max-width:640px){
 .canvas-page:has(.ai-panel:not([style*="display: none"])) .bottom-left-controls-wrap,
 .canvas-page:has(.ai-panel:not([style*="display: none"])) .left-panel{visibility:hidden;pointer-events:none}
}

.asset-meta-bar{flex-wrap:wrap;gap:10px}
.homeai-storage-summary{font-size:12px;line-height:1.6;color:var(--ha-text,#ededed);font-variant-numeric:tabular-nums}
.asset-meta-bar:has(.homeai-storage-summary)>.asset-storage-usage{display:none}
.homeai-trash-toggle,.homeai-recycle-panel button{font:inherit;font-size:13px;min-height:36px;padding:7px 12px;border:1px solid var(--ha-border,#454545);border-radius:8px;background:var(--ha-surface,#202020);color:var(--ha-text,#ededed);cursor:pointer}
.homeai-trash-toggle:hover,.homeai-recycle-panel button:hover:not(:disabled){border-color:var(--ha-text,#ededed)}
.homeai-trash-toggle:focus-visible,.homeai-recycle-panel button:focus-visible{outline:2px solid var(--ha-accent,#9cf5c5);outline-offset:3px}
.homeai-recycle-panel button:disabled{opacity:.5;cursor:not-allowed}
.homeai-recycle-panel{min-height:0;flex:1;overflow:auto;padding:16px 24px 28px;color:var(--ha-text,#ededed)}
.homeai-recycle-panel[hidden]{display:none!important}
.homeai-recycle-heading{display:flex;justify-content:space-between;align-items:center;gap:16px}
.homeai-recycle-heading h2{font:inherit;font-size:18px;font-weight:600;margin:0}
.homeai-recycle-status,.homeai-recycle-notice{font-size:13px;line-height:1.7;margin:10px 0;color:inherit}
.homeai-recycle-notice:empty{display:none}
.homeai-trash-row{display:flex;align-items:center;gap:16px;padding:14px 0;border-bottom:1px solid var(--ha-border,#363636)}
.homeai-trash-row>img,.homeai-trash-type{width:72px;height:72px;flex:none;object-fit:contain;border-radius:6px;background:var(--ha-surface,#202020)}
.homeai-trash-type{display:grid;place-items:center;font-size:13px}
.homeai-trash-detail{display:flex;flex:1;min-width:0;flex-direction:column;gap:6px}
.homeai-trash-detail strong{font-size:14px;font-weight:500;overflow-wrap:anywhere}
.homeai-trash-detail span{font-size:12px;line-height:1.6;font-variant-numeric:tabular-nums}
.homeai-recycle-pager{display:flex;justify-content:center;align-items:center;gap:18px;margin-top:20px}
.homeai-trash-open .history-list-dialog,.homeai-trash-open .asset-action-bar,.homeai-trash-open .header .tab-list{display:none!important}
html[data-homeai-theme=light] .homeai-recycle-panel,html[data-homeai-theme=light] .homeai-storage-summary{color:#202020}
html[data-homeai-theme=light] .homeai-trash-toggle,html[data-homeai-theme=light] .homeai-recycle-panel button{background:#fff;color:#202020;border-color:#bfbfbf}
html[data-homeai-theme=light] .homeai-trash-row{border-color:#dedede}
html[data-homeai-theme=light] .homeai-trash-row>img,html[data-homeai-theme=light] .homeai-trash-type{background:#f4f4f4}
@media(max-width:600px){.homeai-recycle-panel{padding:12px 14px 24px}.homeai-trash-row{gap:10px}.homeai-trash-row>img,.homeai-trash-type{width:56px;height:56px}.homeai-recycle-panel button,.homeai-trash-toggle{min-height:44px}.homeai-storage-summary{flex-basis:100%}.homeai-trash-detail span{font-size:12px}}
@media(max-width:420px){.homeai-trash-row{display:grid;grid-template-columns:48px minmax(0,1fr);column-gap:10px;row-gap:8px}.homeai-trash-row>img,.homeai-trash-type{width:48px;height:48px;grid-row:1/3;align-self:start}.homeai-trash-row>button{grid-column:2;justify-self:start}.homeai-trash-detail strong{font-size:13px}}

/* Same palette as the workspace; every selector is scoped to this dialog. */
.homeai-prompt-templates{box-sizing:border-box;width:min(520px,calc(100vw - 32px));max-height:calc(100dvh - 40px);margin:auto;padding:18px;border:1px solid var(--ha-border,#393939);border-radius:12px;background:var(--ha-panel,#181818);color:var(--ha-text,#ededed);font:13px/1.5 var(--homeai-font,sans-serif);overflow:auto;scrollbar-color:var(--ha-scrollbar,#666) transparent}
.homeai-prompt-templates::backdrop{background:rgb(0 0 0 / .6)}
.homeai-prompt-templates *{box-sizing:border-box}
.homeai-prompt-templates header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:12px}
.homeai-prompt-templates h2{font-size:18px;line-height:1.3;margin:0;font-weight:600}
.homeai-prompt-templates h3{font-size:14px;margin:0;font-weight:600}
.homeai-prompt-templates label{display:block;margin:10px 0 5px;color:var(--ha-muted,#aaa)}
.homeai-prompt-templates :is(textarea,input){display:block;width:100%;border:1px solid var(--ha-border,#393939);border-radius:8px;padding:8px 10px;background:var(--ha-input,#111);color:inherit;font:inherit;caret-color:var(--ha-text,#ededed)}
.homeai-prompt-templates textarea{resize:vertical;height:88px;min-height:72px;max-height:40dvh}
.homeai-prompt-templates :is(textarea,input)::placeholder{color:var(--ha-muted,#aaa)}
.homeai-prompt-templates button{border:1px solid var(--ha-border,#393939);border-radius:8px;min-height:34px;padding:6px 11px;background:var(--ha-elevated,#242424);color:inherit;font:inherit;cursor:pointer}
.homeai-prompt-templates button:hover{background:var(--ha-hover,#333)}
.homeai-prompt-templates button:disabled{opacity:.55;cursor:wait}
.homeai-prompt-templates :is(button,input,textarea):focus-visible{outline:2px solid var(--ha-focus,#ddd);outline-offset:3px}
.homeai-prompt-templates .homeai-template-close{border:0;background:transparent;color:var(--ha-muted,#aaa)}
.homeai-template-name-actions{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:6px}
.homeai-template-name-actions>input{min-width:0}
.homeai-template-name-actions>button{white-space:nowrap;padding-inline:9px}
.homeai-prompt-templates .homeai-template-primary{background:var(--ha-accent,#eee);color:var(--ha-on-accent,#171717);border-color:transparent}
.homeai-prompt-templates .homeai-template-primary:hover{background:var(--ha-accent-hover,#ddd)}
.homeai-template-status{margin:6px 0 0;color:var(--ha-muted,#aaa);font-size:13px}
.homeai-template-history{border-top:1px solid var(--ha-border,#393939);margin-top:12px;padding-top:12px}
.homeai-template-hint{margin:3px 0 8px;font-size:12px;color:var(--ha-muted,#aaa)}
.homeai-template-list{display:flex;flex-direction:column;gap:6px;max-height:220px;overflow:auto;padding:4px}
.homeai-prompt-templates .homeai-template-item{text-align:left;width:100%;padding:8px 10px;flex:none}
.homeai-template-item strong{display:block;font-weight:500;overflow-wrap:anywhere}
.homeai-template-item span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;color:var(--ha-muted,#aaa);margin-top:2px}
@media(max-width:600px){ .homeai-prompt-templates{padding:16px;width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}.homeai-template-name-actions>button{padding-inline:7px;font-size:12px;min-height:38px}.homeai-template-list{max-height:200px}}
.layout-route-view>.homeai-agent-mount,.layout-route-view>.homeai-aplus-mount{height:100%;min-height:0;min-width:0;overflow:hidden;display:block}

.homeai-template-status:empty{display:none}
.homeai-template-list>p{margin:4px 0;color:var(--ha-muted,#aaa)}

.homeai-template-prompt-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:4px 0 5px}
.homeai-template-prompt-heading label{margin:0}
.homeai-prompt-templates .homeai-template-expand{min-height:28px;padding:3px 6px;border:0;background:transparent;color:var(--ha-muted,#aaa);font-size:12px}
.homeai-prompt-templates.homeai-template-expanded{width:min(760px,calc(100vw - 32px))}
.homeai-prompt-templates.homeai-template-expanded textarea{height:min(380px,48dvh);max-height:60dvh}
.homeai-template-entry{display:flex;align-items:center;gap:8px;border:1px solid var(--ha-border,#393939);border-radius:8px;background:var(--ha-elevated,#242424);padding-right:6px;flex:none;min-width:0}
.homeai-prompt-templates .homeai-template-entry>.homeai-template-item{flex:1;min-width:0;width:auto;border:0;background:transparent}
.homeai-template-entry:has(.homeai-template-item:hover){background:var(--ha-hover,#333)}
.homeai-template-delete-controls{display:flex;gap:4px;flex:none}
.homeai-prompt-templates .homeai-template-delete-controls button{padding:4px 7px;min-height:30px;font-size:12px;white-space:nowrap}
.homeai-prompt-templates .homeai-template-delete-controls :is(.homeai-template-delete,.homeai-template-delete-confirm){color:var(--ha-danger,#efaaa4)}
@media(max-width:400px){.homeai-template-name-actions{gap:4px}.homeai-template-name-actions>input{padding-inline:7px}.homeai-template-name-actions>button{padding-inline:5px}.homeai-template-delete-controls{flex-direction:column}}
/* Keep reference thumbnails and actions on the same row, with the native prompt below. */
html:root .generate-dock .homeai-expandable-prompt .prompt-stack{position:relative}
html:root .generate-dock .homeai-expandable-prompt .prompt-actions{position:absolute;right:0;top:0;width:auto;height:28px;align-self:auto}
html:root .generate-dock .homeai-expandable-prompt .reference-area{padding-right:76px;box-sizing:border-box}

/* Keep the original textarea and panel; only their native height changes. */
.homeai-prompt-expand{white-space:nowrap;flex-shrink:0}
.homeai-prompt-expand svg{width:15px;height:15px;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.homeai-prompt-expand[aria-expanded=true]{color:var(--ha-accent,#9cf5c5);background:var(--ha-selected,#263d30)}
@media(max-width:600px){
  html:root .generate-dock .homeai-expandable-prompt{padding-bottom:194px}
  html:root .generate-dock .homeai-expandable-prompt .controls-row{height:156px;grid-template-rows:repeat(4,36px)}
  html:root .generate-dock .homeai-expandable-prompt .controls-row .stepper-pill{grid-area:2 / 2}
  html:root .generate-dock .homeai-expandable-prompt .controls-row .image-preset-anchor{grid-area:3 / 1}
  html:root .generate-dock .homeai-expandable-prompt .controls-row .homeai-prompt-expand{grid-area:3 / 2;justify-self:start;min-width:56px}
}

.homeai-shared-history{width:100%;box-sizing:border-box;padding:20px 24px 40px;color:var(--ha-text,#ecf5ee);text-align:left}
.homeai-shared-history header,.homeai-history-meta,.homeai-history-pagination,.homeai-history-search{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.homeai-shared-history h2{font-size:20px;margin:0 0 6px}.homeai-shared-history header p{color:var(--ha-muted,#a3b2a7);margin:0;font-size:13px}
.homeai-shared-history button,.homeai-history-search input{font:inherit;border:1px solid var(--ha-border,#334239);border-radius:9px;padding:9px 13px;color:var(--ha-text,#ecf5ee);background:var(--ha-panel,#19231d)}
.homeai-shared-history button{cursor:pointer}.homeai-shared-history button:disabled{opacity:.45;cursor:default}.homeai-shared-history button:focus-visible,.homeai-shared-history input:focus-visible,.homeai-shared-history a:focus-visible{outline:2px solid var(--ha-accent,#b9f86d);outline-offset:3px}
.homeai-history-search{justify-content:flex-start;margin:18px 0}.homeai-history-search input{min-width:0;flex:1;max-width:440px}.homeai-history-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:16px}
.homeai-history-card{border:1px solid var(--ha-border,#334239);border-radius:14px;padding:12px;min-width:0;background:var(--ha-panel,#19231d)}
.homeai-history-images{display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:6px}.homeai-history-images a{min-width:0}.homeai-history-images img{display:block;width:100%;height:240px;object-fit:contain;background:var(--ha-input,#111a14);border-radius:8px}
.homeai-history-meta{margin:12px 0 5px;font-size:13px}.homeai-history-meta span,.homeai-history-card time{color:var(--ha-muted,#a3b2a7);font-size:12px}.homeai-history-prompt{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.6;max-height:140px;overflow:auto;margin:12px 0}.homeai-history-error{font-size:12px;color:var(--ha-muted,#a3b2a7);overflow-wrap:anywhere}.homeai-history-pagination{justify-content:center;margin-top:24px;font-size:13px}.homeai-history-empty{padding:36px 0;color:var(--ha-muted,#a3b2a7)}
.homeai-history-tab[aria-pressed=true]{background:var(--ha-selected,#29432f);color:var(--ha-accent,#c8ff7f)}
@media(max-width:600px){.homeai-shared-history{padding:14px 12px 40px}.homeai-history-grid{grid-template-columns:minmax(0,1fr)}.homeai-shared-history header{align-items:flex-start}.homeai-shared-history h2{font-size:17px}.homeai-history-tab{font-size:12px!important;padding:7px 9px!important}}

.homeai-history-tab{width:auto!important;min-width:84px;flex:0 0 auto!important;white-space:nowrap!important}
.generate-toolbar:has(.homeai-history-tab[aria-pressed=true]) .toolbar-left{display:none!important}
.generate-toolbar:has(.homeai-history-tab[aria-pressed=true]) .generate-toolbar-right-actions>*:not(.homeai-history-tab){display:none!important}
@media(max-width:600px){.generate-toolbar:has(.homeai-history-tab) .toolbar-search-group{display:none!important}.generate-toolbar-right-actions:has(.homeai-history-tab){flex-shrink:0!important}}

.generate-toolbar .homeai-history-tab{color:var(--ha-text,#ecf5ee)!important;background:var(--ha-panel,#19231d)!important;border:1px solid var(--ha-border,#334239)!important}

/* Scoped adapter for the existing text assistant; shared model/quote APIs stay intact. */
html:root .llm-agent-page{margin-left:0!important;min-width:0!important;font-family:var(--homeai-font)!important;color:var(--ha-text,#edf5ef)!important;background:var(--ha-canvas,#080b09)!important}
html:root .llm-agent-page .llm-agent-container{min-width:0!important;position:relative}
html:root .llm-agent-page .conversation-list{width:224px!important;height:100%!important;background:var(--ha-input,#0b100d)!important;border-right:1px solid var(--ha-border,#34433a)!important;transition:none!important}
html:root .llm-agent-page.homeai-history-collapsed .conversation-list{display:none!important}
html:root .llm-agent-page .list-header{padding:20px 16px 12px!important;display:flex!important;flex-direction:column;align-items:stretch!important;gap:16px}
html:root .llm-agent-page .header-title{font-size:15px!important;letter-spacing:0!important;color:var(--ha-text,#edf5ef)!important}
html:root .llm-agent-page .new-conversation-btn{border-radius:8px!important;min-height:38px;justify-content:center;padding:8px 12px!important;background:var(--ha-selected,#192c23)!important;color:var(--ha-accent,#9cf5c5)!important;border-color:var(--ha-border,#34433a)!important;font-size:13px!important}
html:root .llm-agent-page .list-content{padding:0 8px!important;margin-bottom:8px!important;scrollbar-width:thin;scrollbar-color:var(--ha-scrollbar,#46534c) transparent}
html:root .llm-agent-page .recent-title{padding:16px 8px 8px!important;letter-spacing:0!important;color:var(--ha-muted,#acbcb2)!important}
html:root .llm-agent-page .conversation-item{gap:10px!important;padding:10px 8px!important;border-radius:8px!important;border-color:transparent!important;min-height:62px}
html:root .llm-agent-page .conversation-item.active,html:root .llm-agent-page .conversation-item:hover{background:var(--ha-selected,#192c23)!important;border-color:transparent!important}
html:root .llm-agent-page .conversation-icon{width:24px!important;height:28px!important;background:transparent!important;color:var(--ha-muted,#acbcb2)!important}
html:root .llm-agent-page .conversation-info{padding-right:28px!important}
html:root .llm-agent-page .conversation-title{font-size:13px!important;color:var(--ha-text,#edf5ef)!important}
html:root .llm-agent-page .conversation-time{font-size:11px!important;color:var(--ha-muted,#acbcb2)!important}
html:root .llm-agent-page .conversation-actions{right:6px!important}
html:root .llm-agent-page .conversation-actions button{width:28px!important;height:32px!important;padding:6px!important;background:transparent!important;border:0!important;color:var(--ha-muted,#acbcb2)!important}
html:root .llm-agent-page .no-more,html:root .llm-agent-page .no-conversations{font-size:12px!important;color:var(--ha-muted,#acbcb2)!important;padding:20px 8px!important}
html:root .llm-agent-page .chat-container{min-width:0!important;min-height:0!important;flex:1!important}
html:root .llm-agent-page .homeai-chat-header{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 24px;flex-shrink:0;border-bottom:1px solid var(--ha-border,#34433a);font-size:14px;color:var(--ha-text,#edf5ef);z-index:3}
html:root .llm-agent-page .homeai-history-toggle{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:8px;background:transparent;color:var(--ha-muted,#acbcb2);cursor:pointer}
html:root .llm-agent-page .homeai-history-toggle:hover{background:var(--ha-hover,#19211c);color:var(--ha-text,#edf5ef)}
html:root .llm-agent-page .homeai-chat-hint{margin-left:auto;color:var(--ha-muted,#acbcb2);font-size:12px}
html:root .llm-agent-page .welcome-screen{position:relative!important;inset:auto!important;flex:1;min-height:120px;height:auto!important;padding:48px 24px 20px!important;justify-content:center!important;overflow:visible!important;animation:none!important}
html:root .llm-agent-page .welcome-screen h1{font-size:clamp(22px,2.3vw,30px)!important;line-height:1.4!important;color:var(--ha-text,#edf5ef)!important;margin:0 0 12px!important}
html:root .llm-agent-page .welcome-screen .gradient-text{background:none!important;-webkit-text-fill-color:currentColor!important;color:var(--ha-text,#edf5ef)!important}
html:root .llm-agent-page .welcome-screen p{font-size:14px!important;line-height:1.7;color:var(--ha-muted,#acbcb2)!important;letter-spacing:0!important;margin:0}
html:root .llm-agent-page .welcome-screen+.chat-messages{display:none!important}
html:root .llm-agent-page .chat-messages{flex:1!important;min-height:0!important;padding:28px max(24px,calc((100% - 860px)/2))!important;gap:28px!important;scrollbar-width:thin;scrollbar-color:var(--ha-scrollbar,#46534c) transparent}
html:root .llm-agent-page .message{gap:12px!important;animation:none!important}
html:root .llm-agent-page .message .avatar{width:28px!important;height:28px!important;background:var(--ha-selected,#192c23)!important;color:var(--ha-accent,#9cf5c5)!important;border-radius:8px!important}
html:root .llm-agent-page .message .content{max-width:calc(100% - 40px)!important;flex:0 1 auto!important;font-size:14px!important;line-height:1.8!important;overflow-wrap:anywhere;box-shadow:none!important}
html:root .llm-agent-page .message.user .content{background:var(--ha-elevated,#1d2721)!important;padding:14px 18px!important;border:0!important;border-radius:14px!important;color:var(--ha-text,#edf5ef)!important}
html:root .llm-agent-page .message.assistant .content{background:transparent!important;border:0!important;padding:2px 0!important;color:var(--ha-text,#edf5ef)!important}
html:root .llm-agent-page .message .message-header{margin-bottom:6px!important}
html:root .llm-agent-page .message .timestamp{font-size:11px!important;color:var(--ha-muted,#acbcb2)!important}
html:root .llm-agent-page .message .text :is(p,li,strong){color:var(--ha-text,#edf5ef)!important}
html:root .llm-agent-page .message .text p{margin:0 0 12px!important}
html:root .llm-agent-page .message .text p:last-child{margin-bottom:0!important}
html:root .llm-agent-page .message-files{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 10px!important}
html:root .llm-agent-page .message-files :is(img,video){display:block;max-width:min(280px,100%)!important;max-height:220px!important;object-fit:contain!important;border:1px solid var(--ha-border,#34433a)!important;border-radius:10px!important;margin:0!important}
html:root .llm-agent-page .chat-input{padding:8px 24px 12px!important;background:var(--ha-canvas,#080b09)!important;flex-shrink:0!important;z-index:10!important}
html:root .llm-agent-page .input-wrapper{max-width:860px!important;margin:0 auto!important}
html:root .llm-agent-page .input-container{border:1px solid var(--ha-border-strong,#4d735c)!important;border-radius:16px!important;background:var(--ha-panel,#141a16)!important;box-shadow:none!important;transition:border-color .16s ease-out!important}
html:root .llm-agent-page .input-container:focus-within{border-color:var(--ha-accent,#9cf5c5)!important;box-shadow:none!important}
html:root .llm-agent-page .input-main{display:flex!important;flex-direction:column!important;align-items:stretch!important;padding:10px 14px 4px!important;gap:8px!important}
html:root .llm-agent-page .upload-previews{width:100%!important;max-width:100%!important;flex-shrink:0!important;gap:8px!important;padding:4px 2px!important;align-items:center!important;scrollbar-width:thin}
html:root .llm-agent-page .preview-item{width:56px!important;height:48px!important}
html:root .llm-agent-page :is(.preview-image,.preview-video){border-radius:8px!important;object-fit:contain!important;background:var(--ha-input,#0b100d)!important}
html:root .llm-agent-page .upload-placeholder{width:90px!important;height:32px!important;flex-direction:row!important;border:1px dashed var(--ha-border-strong,#4d735c)!important;border-radius:8px!important;background:var(--ha-input,#0b100d)!important;gap:2px!important;color:var(--ha-muted,#acbcb2)!important}
html:root .llm-agent-page .upload-placeholder .upload-icon{width:20px!important;height:20px!important;color:var(--ha-muted,#acbcb2)!important}
html:root .llm-agent-page .upload-placeholder-text{font-size:11px!important;color:var(--ha-muted,#acbcb2)!important}
html:root .llm-agent-page .remove-btn{width:24px!important;height:24px!important;background:var(--ha-elevated,#1d2721)!important;color:var(--ha-text,#edf5ef)!important;border:1px solid var(--ha-border,#34433a)!important}
html:root .llm-agent-page .text-input-wrapper{width:100%!important;height:auto!important;min-height:44px!important;flex:auto!important}
html:root .llm-agent-page .el-textarea__inner{min-height:44px!important;max-height:120px!important;padding:0!important;font:14px/1.75 var(--homeai-font)!important;color:var(--ha-text,#edf5ef)!important;caret-color:var(--ha-accent,#9cf5c5)!important;resize:none!important;box-shadow:none!important;background:transparent!important}
html:root .llm-agent-page .el-textarea__inner::placeholder{color:var(--ha-muted,#acbcb2)!important}
html:root .llm-agent-page .input-toolbar{padding:6px 10px 8px!important;display:flex!important;gap:12px!important;align-items:center!important}
html:root .llm-agent-page .toolbar-left{display:flex!important;gap:8px!important;min-width:0!important;align-items:center!important;flex:1!important}
html:root .llm-agent-page :is(.mode-btn,.homeai-model-trigger){display:flex!important;align-items:center!important;gap:8px!important;min-height:40px!important;padding:8px 10px!important;border:1px solid var(--ha-border,#34433a)!important;border-radius:8px!important;background:transparent!important;color:var(--ha-text,#edf5ef)!important;font:13px/1.4 var(--homeai-font)!important;cursor:pointer;white-space:nowrap}
html:root .llm-agent-page :is(.mode-btn,.homeai-model-trigger):hover{background:var(--ha-hover,#19211c)!important}
html:root .llm-agent-page :is(.mode-icon,.dropdown-icon){width:16px!important;height:16px!important;color:var(--ha-muted,#acbcb2)!important}
html:root .llm-agent-page .toolbar-right{gap:12px!important;flex-shrink:0!important}
html:root .llm-agent-page .usage-info{display:flex;align-items:center;gap:4px;color:var(--ha-muted,#acbcb2)!important;white-space:nowrap;font-size:12px!important}
html:root .llm-agent-page .usage-info>svg{display:none!important}
html:root .llm-agent-page .send-btn{width:36px!important;height:36px!important;min-width:36px!important;background:var(--ha-accent,#9cf5c5)!important;color:var(--ha-on-accent,#0c2115)!important;border:0!important}
html:root .llm-agent-page .send-btn:disabled{background:var(--ha-selected,#192c23)!important;color:var(--ha-muted,#acbcb2)!important;opacity:.65!important}
html:root .llm-agent-page .input-footer{margin:10px auto 0!important;font-size:11px!important;color:var(--ha-muted,#acbcb2)!important;text-align:center!important}
html:root .llm-agent-page .homeai-text-model-picker{position:relative;min-width:0}
html:root .llm-agent-page .homeai-model-trigger{max-width:230px}
html:root .llm-agent-page .homeai-model-trigger span{overflow:hidden;text-overflow:ellipsis}
html:root .llm-agent-page .homeai-model-trigger svg{flex-shrink:0}
html:root .llm-agent-page .homeai-model-menu{position:absolute;bottom:calc(100% + 10px);left:0;width:316px;max-width:calc(100vw - 112px);padding:8px;background:var(--ha-elevated,#1d2721);color:var(--ha-text,#edf5ef);border-radius:12px;box-shadow:0 10px 36px #0004;z-index:40}
html:root .llm-agent-page .homeai-model-menu-title{padding:8px 10px 10px;color:var(--ha-muted,#acbcb2);font-size:12px}
html:root .llm-agent-page .homeai-model-option{display:flex;align-items:center;gap:10px;width:100%;padding:12px 10px;border:0;border-radius:8px;background:transparent;color:var(--ha-text,#edf5ef);text-align:left;cursor:pointer;font:13px/1.5 var(--homeai-font)}
html:root .llm-agent-page .homeai-model-option:is(:hover,.is-selected){background:var(--ha-selected,#192c23)}
html:root .llm-agent-page .homeai-model-option-copy{flex:1;min-width:0;display:grid;gap:3px}
html:root .llm-agent-page .homeai-model-option strong{font-size:13px;font-weight:600;color:var(--ha-text,#edf5ef)}
html:root .llm-agent-page .homeai-model-option small{font-size:11px;color:var(--ha-muted,#acbcb2)}
html:root .llm-agent-page .homeai-model-option-price{font-size:12px;color:var(--ha-muted,#acbcb2);white-space:nowrap;font-variant-numeric:tabular-nums}
html:root .llm-agent-page .homeai-model-check{width:16px;color:var(--ha-accent,#9cf5c5)}
html:root .llm-agent-page .dropdown-menu{bottom:calc(100% + 10px)!important;border:0!important;background:var(--ha-elevated,#1d2721)!important;border-radius:12px!important;box-shadow:0 10px 36px #0004!important;min-width:190px!important}
html:root .llm-agent-page :is(button,[role=button]):focus-visible{outline:2px solid var(--ha-accent,#9cf5c5)!important;outline-offset:3px!important}
html:root .llm-agent-page ::selection{background:var(--ha-accent,#9cf5c5);color:var(--ha-on-accent,#0c2115)}
@media(max-width:1100px){html:root .llm-agent-page .conversation-list{width:200px!important}html:root .llm-agent-page .chat-input{padding:12px 16px!important}html:root .llm-agent-page .chat-messages{padding:24px 16px!important}html:root .llm-agent-page .usage-info{display:none!important}}
@media(max-width:760px){
 html:root .llm-agent-page .llm-agent-container{flex-direction:column!important}
 html:root .llm-agent-page .conversation-list{position:absolute;top:56px;left:0;z-index:30;width:min(250px,calc(100% - 24px))!important;height:calc(100% - 56px)!important;max-height:none!important;border-right:1px solid var(--ha-border,#34433a)!important;box-shadow:12px 0 28px #0003}
 html:root .llm-agent-page .list-content{max-height:none!important}
 html:root .llm-agent-page .homeai-chat-header{padding:8px 12px!important}.homeai-chat-hint{display:none}
 html:root .llm-agent-page .chat-input{padding:8px 10px 10px!important}
 html:root .llm-agent-page .input-main{padding:8px 10px 4px!important;gap:6px!important}
 html:root .llm-agent-page .input-toolbar{padding:6px 10px 10px!important;gap:8px!important;flex-wrap:wrap!important}
 html:root .llm-agent-page .toolbar-left{gap:6px!important;flex-wrap:wrap!important}
 html:root .llm-agent-page :is(.mode-btn,.homeai-model-trigger){min-height:36px!important;font-size:12px!important;padding:6px 8px!important;gap:5px!important}
 html:root .llm-agent-page .mode-icon{display:none!important}
 html:root .llm-agent-page .homeai-model-trigger{max-width:170px!important}
 html:root .llm-agent-page .homeai-model-menu{position:fixed;left:auto;right:16px;bottom:100px;width:min(316px,calc(100vw - 100px));max-width:calc(100vw - 100px)}
 html:root .llm-agent-page .message{gap:8px!important}.llm-agent-page .message .avatar{display:none!important}
 html:root .llm-agent-page .message .content{max-width:100%!important}
 html:root .llm-agent-page .chat-messages{padding:18px 12px!important;gap:22px!important}
 html:root .llm-agent-page .input-footer{display:none!important}
}
@media(prefers-reduced-motion:reduce){html:root .llm-agent-page *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

html:root .llm-agent-page .chat-messages{box-sizing:border-box!important;align-items:stretch!important}html:root .llm-agent-page .message{width:100%!important;min-width:0!important}html:root .llm-agent-page .message.assistant .content{flex:1!important}html:root .llm-agent-page .message-actions svg{color:var(--ha-accent,#9cf5c5)!important}
html:root .llm-agent-page .chat-messages{max-width:none!important}

/* Explicit pending feedback without a fabricated progress percentage. */
html:root .llm-agent-page .homeai-reply-pending{display:flex;align-items:flex-start;gap:10px;padding:6px 0 12px;color:var(--ha-text,#edf5ef);font-size:14px;line-height:1.6}
html:root .llm-agent-page .homeai-reply-spinner{width:16px;height:16px;flex:none;margin-top:4px;border:2px solid var(--ha-border,#34433a);border-top-color:var(--ha-accent,#9cf5c5);border-radius:50%;animation:homeai-reply-spin 1s linear infinite}
html:root .llm-agent-page .homeai-reply-wait{display:block;margin-top:4px;font-size:12px;color:var(--ha-muted,#acbcb2)}
html:root .llm-agent-page .homeai-review-note{font-size:11px;color:var(--ha-muted,#acbcb2);white-space:nowrap;cursor:help}
html:root .llm-agent-page .homeai-review-note:focus-visible{outline:2px solid var(--ha-accent,#9cf5c5);outline-offset:3px}
html:root .llm-agent-page .upload-previews:has(.preview-item) .upload-placeholder{height:48px!important;flex-direction:column!important}
html:root .llm-agent-page .send-btn[aria-busy=true]{opacity:1!important;position:relative}
html:root .llm-agent-page .send-btn[aria-busy=true] svg{visibility:hidden}
html:root .llm-agent-page .send-btn[aria-busy=true]::after{content:"";position:absolute;inset:10px;border:2px solid var(--ha-border,#34433a);border-top-color:var(--ha-accent,#9cf5c5);border-radius:50%;animation:homeai-reply-spin 1s linear infinite}
@keyframes homeai-reply-spin{to{transform:rotate(360deg)}}
@media(max-width:760px){html:root .llm-agent-page .homeai-review-note{display:none}html:root .llm-agent-page .toolbar-right{gap:6px!important}}
@media(prefers-reduced-motion:reduce){html:root .llm-agent-page .homeai-reply-spinner,html:root .llm-agent-page .send-btn[aria-busy=true]::after{animation:none!important}}

/* Inline text tools share the HOMEAI theme; menus have opaque surfaces. */
html:root .ai-panel .ha-inline-toolbar{display:flex;align-items:center;gap:8px;min-width:0;margin-left:auto}
html:root .ai-panel .ha-inline-model{position:relative;min-width:0}
html:root .ai-panel .ha-inline-model-trigger{display:flex;align-items:center;gap:8px;max-width:190px;height:36px;padding:0 10px;border:1px solid var(--ha-border,#34433a);border-radius:8px;background:var(--ha-panel,#141a16);color:var(--ha-text,#edf5ef);font:12px var(--homeai-font);cursor:pointer}
html:root .ai-panel .ha-inline-model-trigger span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html:root .ai-panel .ha-inline-model-trigger svg{flex-shrink:0}
html:root .ai-panel .ha-inline-options{position:absolute;bottom:calc(100% + 8px);right:0;width:282px;max-width:calc(100vw - 40px);padding:6px;border-radius:12px;background:var(--ha-elevated,#1d2721);box-shadow:0 12px 32px #0005;z-index:100;color:var(--ha-text,#edf5ef)}
html:root .ai-panel .ha-inline-option{display:flex;align-items:center;gap:8px;width:100%;border:0;background:transparent;color:inherit;padding:11px 10px;border-radius:8px;text-align:left;font:12px/1.5 var(--homeai-font);cursor:pointer}
html:root .ai-panel .ha-inline-option:is(:hover,.is-selected){background:var(--ha-selected,#192c23)}
html:root .ai-panel .ha-inline-option-copy{display:grid;gap:2px;flex:1}
html:root .ai-panel .ha-inline-option-copy strong{font-size:13px;font-weight:600}
html:root .ai-panel .ha-inline-option-copy small,html:root .ai-panel .ha-inline-price,html:root .ai-panel .ha-inline-current-price{color:var(--ha-muted,#acbcb2);font-size:11px;white-space:nowrap}
html:root .ai-panel .ha-inline-check{width:14px;color:var(--ha-accent,#9cf5c5)}
html:root .ai-panel .creation-mode-menu{background:var(--ha-elevated,#1d2721)!important;backdrop-filter:none!important;border:0!important;border-radius:12px!important;box-shadow:0 12px 32px #0005!important;padding:6px!important;color:var(--ha-text,#edf5ef)!important;z-index:100!important}
html:root .ai-panel .creation-mode-option{color:var(--ha-text,#edf5ef)!important;border-radius:8px!important;padding:10px 12px!important}
html:root .ai-panel .creation-mode-option:is(:hover,.active){background:var(--ha-selected,#192c23)!important;color:var(--ha-accent,#9cf5c5)!important}
html:root .ai-panel.ha-inline-text-tool .hero-section .greeting{font-size:24px!important;line-height:1.4!important}
html:root .ai-panel.ha-inline-text-tool .inspiration-text{font-size:14px!important;line-height:1.8!important;color:var(--ha-muted,#acbcb2)!important}
html:root .ai-panel.ha-inline-text-tool .placeholder-row textarea{min-height:56px!important;max-height:140px!important;font-size:14px!important;line-height:1.7!important}
html:root .ai-panel.ha-inline-text-tool .input-box-modern{padding:12px!important}
html:root .ai-panel .action-bar-modern{gap:8px!important;flex-wrap:wrap!important}
html:root .ai-panel .tools-right{margin-left:auto}
html:root .ai-panel .ha-inline-result-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.85;color:var(--ha-text,#edf5ef)}
html:root .ai-panel .ha-inline-result-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
html:root .ai-panel .ha-inline-action{padding:7px 10px;min-height:34px;border:1px solid var(--ha-border,#34433a);border-radius:8px;background:var(--ha-panel,#141a16);color:var(--ha-text,#edf5ef);font:12px/1.5 var(--homeai-font);cursor:pointer}
html:root .ai-panel .ha-inline-primary{background:var(--ha-selected,#192c23);color:var(--ha-accent,#9cf5c5)}
html:root .ai-panel .ha-inline-pending{display:flex;gap:10px;align-items:center;padding:4px 0;font-size:14px;line-height:1.6}
html:root .ai-panel .ha-inline-pending small{display:block;color:var(--ha-muted,#acbcb2);font-size:12px;margin-top:4px}
html:root .ai-panel .ha-inline-spinner{width:16px;height:16px;border:2px solid var(--ha-border,#34433a);border-top-color:var(--ha-accent,#9cf5c5);border-radius:50%;animation:ha-inline-spin 1s linear infinite}
html:root .ai-panel .ha-inline-conflict{margin-top:12px;padding:12px;background:var(--ha-panel,#141a16);border-radius:10px;font-size:12px}
html:root .ai-panel .ha-inline-conflict p{margin:0 0 8px}
html:root .ai-panel .ha-inline-conflict button+button{margin-left:8px}
html:root .ai-panel :is(.ha-inline-action,.ha-inline-model-trigger,.ha-inline-option):focus-visible{outline:2px solid var(--ha-accent,#9cf5c5);outline-offset:2px}
@keyframes ha-inline-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){html:root .ai-panel .ha-inline-spinner{animation:none}}
@media(max-width:760px){html:root .ai-panel .ha-inline-current-price{display:none}html:root .ai-panel .ha-inline-model-trigger{max-width:155px}html:root .ai-panel .ha-inline-toolbar{margin-left:0}}
html:root .ai-panel.ha-inline-text-tool .tools-left{flex:0 1 auto!important;width:auto!important;gap:6px!important}
html:root .ai-panel.ha-inline-text-tool .tools-right>:not(.send-circle-btn){display:none!important}
html:root .ai-panel.ha-inline-text-tool .ha-inline-current-price{display:none}
html:root .ai-panel.ha-inline-text-tool .ha-inline-toolbar{margin-left:0}
html:root .ai-panel.ha-inline-text-tool .creation-mode-trigger{font-size:12px!important;padding:6px 8px!important;gap:5px!important}
html:root .ai-panel.ha-inline-text-tool .ha-inline-model-trigger{max-width:152px}
@media(max-width:760px){html:root .ai-panel.ha-inline-text-tool .ha-inline-model-trigger{max-width:135px;font-size:11px;padding:0 7px}html:root .ai-panel.ha-inline-text-tool .action-bar-modern{gap:6px!important}html:root .ai-panel.ha-inline-text-tool .tools-right{margin-left:0!important}}
