:root{--page:#f4f5f6;--surface:#fff;--surface-raised:#f0f2f5;--ink:#171b23;--secondary:#626d7c;--edge:#dfe3e9;--accent:#ffd400}
.appearance-card{margin-bottom:24px;max-width:850px}
.appearance-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:22px}
.appearance-kicker{font-size:10px;font-weight:750;letter-spacing:.12em;color:var(--secondary)}
.appearance-heading h2{font-size:26px;letter-spacing:-.04em;margin:7px 0 0}
.appearance-symbol{width:44px;height:44px;display:grid;place-items:center;border-radius:14px;background:var(--surface-raised);font-size:28px}
.theme-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;border:0;padding:0;margin:0;min-width:0}
.theme-options legend{font-size:14px;font-weight:650;margin-bottom:12px}
.theme-choice{display:flex;flex-direction:column;gap:8px;position:relative;padding:10px;border:2px solid var(--edge);border-radius:14px;cursor:pointer;min-width:0}
.theme-choice:has(input:checked){border-color:#baa000;background:var(--surface-raised)}
.theme-choice:focus-within{outline:2px solid var(--ink);outline-offset:3px}
.theme-choice input{position:absolute;top:16px;right:16px;z-index:1;width:18px;height:18px;margin:0;accent-color:#bba000}
.theme-preview{height:80px;border-radius:8px;padding:13px 9px;display:flex;flex-direction:column;gap:7px;background:#f0f2f5;border:1px solid #dce0e6}
.theme-preview i{display:block;height:7px;width:60%;background:#c4cad2;border-radius:3px}.theme-preview i:first-child{width:33%;background:#d5b000}.theme-preview i:last-child{width:78%}
.preview-dark{background:#171d25;border-color:#333d49}.preview-dark i{background:#475466}.preview-dark i:first-child{background:#ffd400}
.preview-system{background:linear-gradient(90deg,#f0f2f5 50%,#171d25 50%)}
.theme-choice-title{font-size:13px;font-weight:750;overflow-wrap:anywhere}.theme-choice small{font-size:11px;color:var(--secondary);line-height:1.4}
.appearance-card .local-note{margin-bottom:0}
.theme-choice.theme-selected{border-color:#baa000;background:var(--surface-raised)}
html[data-theme=dark]{--page:#101318;--surface:#1b212a;--surface-raised:#252d38;--ink:#f0f3f8;--secondary:#acb6c5;--edge:#394453;--text:#f0f3f8;--muted:#acb6c5;--line:#394453;--soft:#252d38;--card:#1b212a;--shadow:0 14px 40px #0004}
html[data-theme=dark] body,html[data-theme=dark] body.wizard-page{background:var(--page);color:var(--ink)}
html[data-theme=dark] :is(.card,.auth-card,.auth-main,.form-card,.offer-card,.lead-card,.request-row,.category-card,.category-option,.review-row,.modal-card,.notification,.empty,.upload-box,.optional-fields,.fold,.topbar,.detail-grid .tabs,.chat-compose,.wizard-footer,.bottom-nav){background:var(--surface);color:var(--ink);border-color:var(--edge)}
html[data-theme=dark] :is(.data-item,.doc-row,.security-row,.company-box,.upload-file,.request-icon,.sub-tabs,.operation-tabs,.auth-tabs,.lead-meta span,.offer-calculations .faq,.wizard-steps span){background:var(--surface-raised);color:var(--ink);border-color:var(--edge)}
html[data-theme=dark] :is(input,select,textarea,.wizard .field input,.wizard .field select,.wizard .field textarea,.search-box,.filter,.icon-btn,.user-chip,.btn.ghost,.btn.soft,.close){background:var(--surface-raised);color:var(--ink);border-color:var(--edge)}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#9da8b9;opacity:1}
html[data-theme=dark] :is(.wizard,.wizard-exit,.category-option>span:first-child,.review-icon,.upload-copy strong,.fold p b,.wizard .optional-fields summary,.detail-grid .tab.active,.bottom-nav button.active){color:var(--ink)}
html[data-theme=dark] :is(.local-note,.muted,.section-head p,.request-row p,.request-row small,.field span,.wizard .field span,.review-row small,.fold p,.offer-meta,.offer-details small,.company p,.lead-card p,.doc-row small,.upload-copy small,.upload-file small,.stat-top,.data-item small,.case-current small,.detail-head p,.status-step small,.notification p,.empty,.security-row small,.offer-conditions small,.offer-calculations>small,.topbar small,#stepLabel,#autosave,.wizard #autosave){color:var(--secondary)}
html[data-theme=dark] :is(.detail-grid .tab,.sub-tabs button,.operation-tabs button,.bottom-nav button,.upload-remove){color:var(--secondary)}
html[data-theme=dark] :is(.note,.comparison,.category-option.selected,.msg.system,.upload-symbol){background:#39341d;color:#f9e795;border-color:#8f7a29}
html[data-theme=dark] .category-option.selected{color:var(--ink)}


html[data-theme=dark] .msg{background:var(--surface-raised);color:var(--ink)}
html[data-theme=dark] .msg.client{background:#3b361a;color:#fff1ae}
html[data-theme=dark] .chat-file{background:#ffffff12;color:inherit;border-color:var(--edge)}
html[data-theme=dark] .badge{background:#303948;color:#e1e7ee}
html[data-theme=dark] .badge.yellow{background:#40391b;color:#ffe278}
html[data-theme=dark] .badge.green{background:#173e30;color:#9be2bb}
html[data-theme=dark] .badge.red,html[data-theme=dark] .btn.danger{background:#44252c;color:#ffb3b9;border-color:#75404b}
html[data-theme=dark] .badge.blue{background:#223955;color:#aad1ff}
html[data-theme=dark] .filter.active{background:#ffd400;color:#15191e}
html[data-theme=dark] :is(.sub-tabs button.active,.operation-tabs button.active,.role-switch button.active,.btn.yellow,.upload-pick,.brand-mark,.bottom-nav button.active span){background:#ffd400;color:#15191e;border-color:#ffd400}
html[data-theme=dark] .review-row button{color:#91c2ff}
html[data-theme=dark] .step-track span{background:#394453}html[data-theme=dark] .step-track span.active{background:#ffd400}
html[data-theme=dark] .status-step>span{background:var(--surface);border-color:var(--edge)}html[data-theme=dark] .status-step:after{background:var(--edge)}
html[data-theme=dark] :is(.status-step.current,.status-step.done)>span{background:#ffd400;border-color:#ffd400}
html[data-theme=dark] .theme-choice:has(input:checked){border-color:#ffd400}
html[data-theme=dark] .theme-choice.theme-selected{border-color:#ffd400}
html[data-theme=dark] :is(.workflow-strip .flow-step,.request-intro,.form-actions,.task-row,.task-row.done,.task-check,.checklist-item,.checklist-item>span:first-child,.upload-retry-card .doc-row){background:var(--surface);color:var(--ink);border-color:var(--edge)}
html[data-theme=dark] :is(.task-summary span,.activity-icon,.priority-normal){background:var(--surface-raised);color:var(--secondary);border-color:var(--edge)}
html[data-theme=dark] :is(.priority-important,.priority-urgent,.task-row.overdue,.activity-icon.tone-yellow,.upload-retry-card){background:#39341d;color:#f9e795;border-color:#8f7a29}
html[data-theme=dark] .activity-icon.tone-red{background:#44252c;color:#ffb3b9}
html[data-theme=dark] :is(.fold details,.upload-box.has-files .upload-list){border-color:var(--edge)}
html[data-theme=dark] :is(button,a,input,select,textarea,summary):focus-visible{outline:2px solid #ffd400;outline-offset:3px}
/* Fluid dimensions and readable controls, including small iPhones and landscape. */
html{-webkit-text-size-adjust:100%;scroll-padding-bottom:130px}body{min-width:280px}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button,a,summary{touch-action:manipulation}
.main,.content,.profile-grid,.form-grid,.theme-options,.modal-head h2{min-width:0}
.modal-head h2{overflow-wrap:anywhere}.modal-head .close{flex-shrink:0;width:44px;height:44px}
.appearance-card{scroll-margin-top:80px}.theme-choice input:focus-visible{outline:0}
@supports not (height:100dvh){.modal-card{max-height:85vh}.wizard-page .shell{min-height:100vh}.sidebar{height:100vh}}
@media(max-width:1000px){
 input,textarea,select{font-size:16px!important}

 .topbar{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
 .content{padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right))}
 .profile-grid{grid-template-columns:1fr}.appearance-card{padding:18px}
 .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .detail-grid .tabs{top:0}
 .bottom-nav button{min-height:52px}.filter,.tab,summary{min-height:44px}.fold summary,.optional-fields summary{display:flex;align-items:center}
}
@media(max-width:400px){
 .theme-options{gap:6px}.theme-choice{padding:7px;gap:7px}.theme-choice small{font-size:10px}.theme-choice-title{font-size:12px}.theme-preview{height:65px}.theme-choice input{top:12px;right:12px}
 .form-grid,.data-grid{grid-template-columns:1fr}.wizard .form-grid{grid-template-columns:1fr}
 .section-head{align-items:flex-start;flex-wrap:wrap}.auth-card{padding:20px}.appearance-heading h2{font-size:24px}
}
@media(orientation:landscape) and (max-height:500px){.detail-grid .tabs{top:0}.theme-preview{height:56px}.auth-side{min-height:0}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{animation:none!important;transition:none!important}}
