:root{
  --surface:#fff;--on-surface:#123858;--strong-surface:#051e40;--on-strong:#fff;
  --muted:#465f73;--action:#075a9c;--on-action:#fff;--attention:#a83b00;--on-attention:#fff;
  --text:var(--on-surface);--accent:var(--action)
}
body[data-theme=dark]{
  --surface:#0d2434;--on-surface:#f2f7fa;--strong-surface:#041521;--on-strong:#fff;
  --muted:#b7c9d4;--action:#7ebcff;--on-action:#041521;--attention:#ff9a5f;--on-attention:#241006;
  --text:var(--on-surface);--accent:var(--action)
}
body[data-theme=vision]{
  --surface:#000;--on-surface:#fff;--strong-surface:#ffe500;--on-strong:#000;
  --muted:#fff;--action:#ffe500;--on-action:#000;--attention:#ffe500;--on-attention:#000;
  --text:var(--on-surface);--accent:var(--action)
}

/* Semantic surfaces: light surfaces always carry dark content; dark surfaces carry light content. */
.auth-card,.status-card,.quick-grid button,.dialog,.suggestions,.suggestions button,
.summary-card,.request-card,.notification-card,.object-card,.workspace-card,.workspace-row-button,
.filter-scroll button,.icon-action,.service-card,.object-switcher select,.chat-launch-actions button,
.chat-conversation-card,.chat-message,.chat-detail-quick button,.chat-compose,.theme-choice,
.request-form select,.request-form textarea,.comment-form textarea,.phone-field{
  background:var(--surface);color:var(--on-surface)
}
.brand-bar,.toast{background:var(--strong-surface);color:var(--on-strong)}
.brand-bar *, .toast *{color:inherit}
.brand-bar .brand-copy small{color:var(--on-strong);opacity:1}
h1,h2,h3,h4,b,strong,label,legend,.account-facts b,.account-facts span,.chat-empty b{color:var(--on-surface)}
p,small,time,.security-note,.auth-hint,.password-rule,.request-meta,.form-footnote,
.service-context,.service-card small,.module-state p,.module-title p,.capability-settings small,
.chat-conversation-card small,.chat-conversation-card i,.chat-message time,.chat-message>small,
.chat-human-state span,.chat-request-draft small,.chat-request-draft i,.push-setting-row small{color:var(--muted)}
input,textarea,select{color:var(--on-surface);caret-color:var(--action)}
input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}

.primary,.chat-empty button{background:var(--attention);color:var(--on-attention);border-color:transparent;text-shadow:none}
.install-button{background:var(--attention);color:var(--on-attention);border-color:transparent}
.install-button b,.install-button small,.install-button .install-icon{color:var(--on-attention)}
.install-button small{opacity:1}
.secondary,.text-action,.access-help,.avatar-file-button,.chat-request-link,.chat-request-created button{
  color:var(--action)
}
.eyebrow{color:var(--action)}
.segmented button{color:var(--muted)!important}
.segmented button.active{background:var(--action)!important;background-image:none!important;color:var(--on-action);border-color:transparent}
.segmented button.active{color:var(--on-action)!important}
.registration-cta-icon,.registration-cta-copy small{color:var(--attention);opacity:1}
.workspace-nav{background:var(--surface);border-color:var(--line)}
.workspace-nav button{color:var(--muted)}
.workspace-nav button.active{color:var(--attention)}
.workspace-nav .nav-create span,.workspace-nav i,.icon-action b,.create-round,
.chat-conversation-card strong,.chat-emergency a{background:var(--attention);color:var(--on-attention)}

.status-pill.NEW{background:#dceeff;color:#164f7f}
.status-pill.ACCEPTED,.status-pill.IN_PROGRESS{background:#ffe4d4;color:#873200}
.status-pill.WAITING_RESIDENT{background:#fff0c9;color:#735000}
.status-pill.COMPLETED{background:#d8f4e5;color:#17663e}
.status-pill.CANCELLED{background:#ffe0e0;color:#8b2525}
.priority-pill.EMERGENCY,.priority-pill.HIGH,.logout-row{color:#9b2929}
.stale-notice,.conditional-note{background:#fff0c9;color:#684800}
.address-object-state{background:#d8f4e5;color:#17663e}
.chat-emergency{background:#ffe3e3;color:#542020}
.chat-emergency b{color:#842727}
.chat-human-state,.chat-request-draft{background:#fff0d8;color:#5d3900}
.chat-human-state a{color:#7b4500}
.chat-message.resident{background:#dceeff;color:#123858}
.chat-message.system{color:var(--on-surface)}
.chat-message header span,.chat-avatar,.service-icon,.module-state>span,.module-title>span,.push-setting-icon{
  background:var(--action);color:var(--on-action)
}

button:disabled,input:disabled,textarea:disabled,select:disabled,.service-card.disabled{
  opacity:1;color:var(--muted);background:color-mix(in srgb,var(--surface) 88%,var(--muted) 12%);cursor:not-allowed
}
.ios-switch:disabled{opacity:1;background:#66727c}.ios-switch:checked{background:#16823a}

body[data-theme=dark] .status-pill.NEW{background:#163d5c;color:#c7e5ff}
body[data-theme=dark] .status-pill.ACCEPTED,body[data-theme=dark] .status-pill.IN_PROGRESS{background:#542b18;color:#ffd6bd}
body[data-theme=dark] .status-pill.WAITING_RESIDENT{background:#4a3b12;color:#ffe8a3}
body[data-theme=dark] .status-pill.COMPLETED{background:#153e2b;color:#bff1d4}
body[data-theme=dark] .status-pill.CANCELLED{background:#4d2228;color:#ffc8cd}
body[data-theme=dark] .priority-pill.EMERGENCY,body[data-theme=dark] .priority-pill.HIGH,body[data-theme=dark] .logout-row{color:#ffb9bd}
body[data-theme=dark] .stale-notice,body[data-theme=dark] .conditional-note,
body[data-theme=dark] .chat-human-state,body[data-theme=dark] .chat-request-draft{background:#433317;color:#ffe2a7}
body[data-theme=dark] .chat-human-state a{color:#ffe2a7}
body[data-theme=dark] .address-object-state{background:#153e2b;color:#bff1d4}
body[data-theme=dark] .chat-emergency{background:#45242a;color:#ffd5d8}
body[data-theme=dark] .chat-emergency b{color:#ffb9bd}
body[data-theme=dark] .chat-message.resident{background:#123f61;color:#f2f7fa}

body[data-theme=vision] .status-pill,body[data-theme=vision] .priority-pill,
body[data-theme=vision] .stale-notice,body[data-theme=vision] .conditional-note,
body[data-theme=vision] .address-object-state,body[data-theme=vision] .chat-emergency,
body[data-theme=vision] .chat-human-state,body[data-theme=vision] .chat-request-draft{
  background:#000;color:#fff;border:2px solid #fff
}
body[data-theme=vision] .status-pill,body[data-theme=vision] .chat-emergency b,
body[data-theme=vision] .chat-human-state a{color:#ffe500}
body[data-theme=vision] .chat-message.resident{background:#000;color:#fff;border-color:#ffe500}
body[data-theme=vision] .primary,body[data-theme=vision] .chat-empty button,
body[data-theme=vision] .workspace-nav .nav-create span,body[data-theme=vision] .workspace-nav i{
  background:#ffe500;color:#000
}
body[data-theme=vision] .install-button{background:#ffe500;color:#000;border-color:#ffe500}
body[data-theme=vision] .install-button b,body[data-theme=vision] .install-button small,
body[data-theme=vision] .install-button .install-icon{color:#000}

@supports not (color:color-mix(in srgb,#000,#fff)){button:disabled,input:disabled,textarea:disabled,select:disabled,.service-card.disabled{background:var(--surface)}}
