/* Neutral black/grey, SMARTi orange. Explicit selection always wins over OS theme. */
html[data-portal-theme],html[data-portal-theme] body{--ink:#202020;--muted:#686868;--paper:#f6f6f6;--surface:#ffffff;--line:#dedede;--accent:#ff7900;--accent-ink:#a44700;--charcoal:#181818;color:var(--ink);background:var(--paper);color-scheme:light}
html[data-portal-theme=dark],html[data-portal-theme=dark] body{--ink:#f5f5f5;--muted:#b4b4b4;--paper:#101010;--surface:#1e1e1e;--line:#393939;--accent:#ff7900;--accent-ink:#ff922e;--charcoal:#080808;color-scheme:dark}
html[data-portal-theme] input,html[data-portal-theme] textarea,html[data-portal-theme] select{background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-portal-theme] button:hover:not(:disabled),html[data-portal-theme] .button:hover{background:color-mix(in srgb,var(--ink) 8%,var(--surface));color:var(--ink);border-color:var(--muted)}
html[data-portal-theme] .primary,html[data-portal-theme] button.primary,html[data-portal-theme] .button.primary{background:var(--accent);border-color:var(--accent);color:#121212}
html[data-portal-theme] button.primary:hover,html[data-portal-theme] .button.primary:hover{background:#ff922e;border-color:#ff922e;color:#121212}
html[data-portal-theme] .masthead{background:var(--charcoal);color:#fff}
html[data-portal-theme] .masthead nav a:hover,html[data-portal-theme] .masthead nav a[aria-current=page]{background:#292929;color:#fff}
html[data-portal-theme] .toolbar,html[data-portal-theme] th,html[data-portal-theme] .pill{background:color-mix(in srgb,var(--ink) 5%,var(--surface));color:var(--ink)}
html[data-portal-theme] tbody tr:hover td,html[data-portal-theme] .case-row:nth-child(odd){background:var(--surface)}
html[data-portal-theme] body:where([data-customer-portal] *) .home-card:before{background-color:transparent}
html[data-portal-theme] body:where([data-customer-portal] *) .photo-picker:has(img[hidden]):before{background-color:#e1e1e1}
html[data-portal-theme] body:where([data-customer-portal] *) .home-heading>a.primary{background:transparent;color:var(--ink)}
html[data-portal-theme] .masthead .portal-theme{display:flex;gap:3px;padding:4px;border:1px solid var(--line);border-radius:9px;align-self:flex-start;flex-shrink:0;background:var(--surface)}
html[data-portal-theme] .masthead .portal-theme button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:7px 12px;margin:0;border:0;border-radius:6px;font-size:13px;background:transparent;color:var(--muted)}
html[data-portal-theme] .masthead .portal-theme button[aria-pressed=true]{background:color-mix(in srgb,var(--accent) 15%,var(--surface));color:var(--accent-ink)}
html[data-portal-theme] .masthead .portal-theme span{margin:0;padding:0;border:0;color:inherit;font-size:17px;line-height:1}
html[data-portal-theme] body:where([data-customer-portal] *):not(:has(.welcome-layout:not([hidden]))) .masthead{gap:28px}
html[data-portal-theme] .home-page:has(#auth:not([hidden])){background:#101010;color:#fff}
html[data-portal-theme] .home-page:has(#auth:not([hidden])):before{background:linear-gradient(180deg,#000c,#0006 45%,#0007),url('/assets/login-home.webp') center/cover no-repeat}
html[data-portal-theme] .home-page .welcome-form{background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-portal-theme] .home-page .welcome-form h2,html[data-portal-theme] .home-page .welcome-form label,html[data-portal-theme] .home-page .new-customer h3,html[data-portal-theme] .home-page .new-customer a,html[data-portal-theme] .home-page .signup-link,html[data-portal-theme] .home-page .password-toggle{color:var(--ink)}
html[data-portal-theme] .home-page .welcome-form>p:not(.eyebrow),html[data-portal-theme] .home-page .new-customer p,html[data-portal-theme] .home-page .welcome-form input::placeholder{color:var(--muted)}
html[data-portal-theme] .home-page .new-customer,html[data-portal-theme] .home-page .new-customer a{border-color:var(--line)}
html[data-portal-theme] .home-page .welcome-form input{background:var(--surface);color:var(--ink);border-color:var(--line)}
@media(max-width:700px){html[data-portal-theme] .masthead .portal-theme{align-self:flex-start}html[data-portal-theme] body:where([data-customer-portal] *):not(:has(.welcome-layout:not([hidden]))) .masthead{gap:16px}}

/* Compact customer workspace on phones; desktop keeps the sidebar layout. */
@media(max-width:700px){
 html[data-customer-portal] body:not(:has(.welcome-layout:not([hidden]))) .masthead{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:calc(env(safe-area-inset-top,0px) + 12px) max(16px,env(safe-area-inset-right,0px)) 10px max(16px,env(safe-area-inset-left,0px))}
 html[data-customer-portal] body:not(:has(.welcome-layout:not([hidden]))) .masthead>a{grid-column:1;grid-row:1;font-size:21px;align-self:center}
 html[data-customer-portal] body:not(:has(.welcome-layout:not([hidden]))) .masthead nav{grid-column:1/-1;grid-row:2;display:flex;flex-wrap:nowrap;gap:4px;overflow-x:auto}
 html[data-customer-portal] body:not(:has(.welcome-layout:not([hidden]))) .masthead nav a{flex:1;justify-content:center;white-space:nowrap;min-height:44px;padding:10px 6px;font-size:13px;gap:6px}
 html[data-customer-portal] body:not(:has(.welcome-layout:not([hidden]))) .masthead .portal-theme{grid-column:2;grid-row:1;padding:2px;gap:0;align-self:center}
 html[data-customer-portal] body:not(:has(.welcome-layout:not([hidden]))) .portal-theme button{width:44px;min-height:44px;font-size:0;gap:0;padding:0}
 html[data-customer-portal] body:not(:has(.welcome-layout:not([hidden]))) .portal-theme span{font-size:21px}
 html[data-customer-portal] body:not(:has(.welcome-layout:not([hidden]))) main{padding:24px 16px 32px;min-height:0}
 html[data-customer-portal] body:not(:has(.welcome-layout:not([hidden]))) main h1{font-size:30px;line-height:1.15;margin:0 0 10px;letter-spacing:-.035em}
 html[data-customer-portal] .heading{gap:16px;padding-bottom:20px;margin-bottom:20px}
 html[data-customer-portal] .heading p:not(.eyebrow),html[data-customer-portal] .account-intro{font-size:15px;line-height:1.5;margin:0}
 html[data-customer-portal] .eyebrow{margin:0 0 10px;font-size:10px}
 html[data-customer-portal] .home-heading>.button{min-height:44px;padding:10px 14px;font-size:14px}
 html[data-customer-portal] .home-workspace{gap:24px}
 html[data-customer-portal] .section-heading,html[data-customer-portal] .shortcuts-column>h2{margin:0 0 14px;align-items:center}
 html[data-customer-portal] .section-heading h2,html[data-customer-portal] .shortcuts-column>h2{font-size:22px}
 html[data-customer-portal] .home-card{display:grid;grid-template-columns:minmax(0,1fr) 64px;column-gap:10px;padding:18px}
 html[data-customer-portal] .home-card:before{grid-column:2;grid-row:1/3;width:64px;height:64px;margin:0;align-self:center}
 html[data-customer-portal] .home-card h2{grid-column:1;grid-row:1;font-size:22px;margin:0 0 8px;overflow-wrap:anywhere}
 html[data-customer-portal] .home-card .connection-state{grid-column:1;grid-row:2;font-size:13px;line-height:1.5;margin:0 0 16px}
 html[data-customer-portal] .home-card>.button,html[data-customer-portal] .home-options{grid-column:1/-1}
 html[data-customer-portal] .home-card>.button{min-height:48px;font-size:16px}
 html[data-customer-portal] .home-options{margin-top:14px;padding-top:6px;font-size:14px}
 html[data-customer-portal] .account-resources>a{padding:18px 0}
 html[data-customer-portal] .account-resources h3{font-size:17px}
 html[data-customer-portal] .account-editor{padding:16px;margin:20px 0}
 html[data-customer-portal] .photo-picker{gap:10px;padding-bottom:18px;display:grid;grid-template-columns:56px minmax(0,1fr) minmax(0,1fr)}
 html[data-customer-portal] .photo-picker>span{grid-column:1/-1;font-size:14px;order:-1}
 html[data-customer-portal] .photo-picker img,html[data-customer-portal] .photo-picker:has(img[hidden]):before{width:56px;height:56px;grid-column:1;grid-row:2}
 html[data-customer-portal] .photo-button{font-size:12px;min-height:44px;display:flex;align-items:center;justify-content:center;padding:8px;text-align:center;margin:0}
 html[data-customer-portal] #photo-remove{grid-column:2/-1;justify-self:start;font-size:13px;min-height:44px;padding:8px 0;border:0;background:transparent;color:var(--muted);text-decoration:underline}
 html[data-customer-portal] #photo-status{grid-column:1/-1;margin:0}
 html[data-customer-portal] .profile-section{padding:20px 0;gap:14px}
 html[data-customer-portal] .profile-controls{gap:14px}
 html[data-customer-portal] .profile-controls input{font-size:16px}
 html[data-customer-portal] .verification-row{gap:12px;padding:18px 0;margin-bottom:16px}
 html[data-customer-portal] .account-editor>button:last-child{width:100%;min-height:48px}
 html[data-customer-portal] #workspace>.toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px 10px;padding:16px;align-items:center}
 html[data-customer-portal] #queue-title{grid-column:1;grid-row:1;font-size:21px}
 html[data-customer-portal] .case-count{grid-column:2;grid-row:1;justify-self:end;font-size:14px}
 html[data-customer-portal] #workspace>.toolbar>label{grid-column:1/-1;grid-row:2;width:100%;margin:0}
 html[data-customer-portal] #filter{width:100%;min-width:0;min-height:44px;font-size:16px}
 html[data-customer-portal] #workspace>.toolbar>div{grid-column:1/-1;grid-row:3;display:grid;grid-template-columns:1fr 1fr;width:100%;gap:10px;margin:0}
 html[data-customer-portal] #workspace>.toolbar button{min-height:44px;padding:10px 8px;font-size:14px;justify-content:center}
 html[data-customer-portal] #cases .empty-state{padding:24px 18px;margin:16px 0 24px}
 html[data-customer-portal] #cases .empty-state:before{width:38px;height:38px;margin-bottom:14px}
 html[data-customer-portal] #cases .empty-state h3{font-size:22px}
 html[data-customer-portal] #cases .empty-state p{font-size:15px;margin-bottom:18px}
 html[data-customer-portal] .service-link{padding:18px;margin-top:24px}
 html[data-customer-portal] body:not(:has(.welcome-layout:not([hidden]))) .site-footer{padding:20px 16px calc(20px + env(safe-area-inset-bottom,0px));font-size:11px}
}

/* No customer/staff destinations before a session has been confirmed. */
html:not([data-portal-session=authenticated]) .masthead nav a:not(.public-about),
html:not([data-portal-session=authenticated]) .masthead nav:before,
html:not([data-portal-session=authenticated]) .masthead .sidebar-about,
html[data-portal-session=authenticated] .masthead nav a.public-about{display:none!important}
html[data-portal-theme] .masthead .portal-theme{padding:0;border:0;background:transparent}
html[data-portal-theme] .masthead .portal-theme button{width:44px;min-height:44px;padding:0;gap:0;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--ink)}
html[data-portal-theme] .masthead .portal-theme span{font-size:22px}
.masthead nav a.public-about:before{display:none}

/* The webview extends behind iOS system UI. Keep every portal header below it,
   including the photographic login whose padding otherwise overrides the inset. */
@media(max-width:1100px){
 html[data-portal-theme] body .masthead{
  padding-top:calc(20px + var(--portal-safe-area-top,env(safe-area-inset-top,0px)))!important;
  padding-left:max(16px,env(safe-area-inset-left,0px))!important;
  padding-right:max(16px,env(safe-area-inset-right,0px))!important;
 }
}

/* Compact mobile tasks; vector icons retain their appearance on iOS. */
.direction-icon{display:inline-block;width:1.15em;height:1.15em;vertical-align:middle;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.auth-tabs{display:flex;gap:4px;border-bottom:1px solid #ffffff30;margin-bottom:24px;padding-bottom:8px}
.auth-tabs button{flex:1;background:transparent;color:inherit;border:0;border-radius:8px;padding:12px;font:inherit}
.auth-tabs [aria-selected=true]{background:#ff7900;color:#111;font-weight:650}
.home-page #setup-panel{margin-top:0;border-top:0;padding-top:12px}
.mobile-add-home{display:none!important}
button.danger{color:#e5484d!important;border-color:#e5484d!important;background:transparent!important}
button.danger:hover{background:#e5484d18!important}
.verification-row .is-verified{color:#169b64;font-weight:650}
.verification-row .is-verified::before{content:'✓';display:inline-grid;place-items:center;border-radius:50%;width:26px;height:26px;background:#169b6420;margin-right:8px}
.member-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 0;border-bottom:1px solid #8883}
.member-row small{display:block;opacity:.7;margin-top:4px}
.portal-dialog{background:var(--portal-surface,#fff);color:var(--portal-text,#171717);border:1px solid #8885;border-radius:20px;padding:28px;width:min(460px,calc(100vw - 32px));max-height:85dvh;overflow:auto;box-sizing:border-box}
html[data-portal-theme=dark] .portal-dialog{background:#202020;color:#f5f5f5}
.portal-dialog::backdrop{background:#0009;backdrop-filter:blur(4px)}
.portal-dialog form{display:grid;gap:16px}.portal-dialog h2{margin:0}.portal-dialog label{display:grid;gap:8px}.portal-dialog .dialog-actions{display:flex;gap:12px;justify-content:flex-end}.portal-dialog input{width:100%;box-sizing:border-box;font-size:16px}
.price-icon{display:block;width:32px;height:32px;margin-bottom:14px;background:#ff7900;mask:url('/assets/icon-help.svg') center/contain no-repeat}
.price-icon-simple{mask-image:url('/assets/icon-home.svg')}.price-icon-complex{mask-image:url('/assets/icon-hub.svg')}.price-icon-advanced{mask-image:url('/assets/icon-grid.svg')}
@media(max-width:700px){
 html[data-portal-theme] body input,html[data-portal-theme] body select,html[data-portal-theme] body textarea{font-size:16px!important}
 .home-heading>a{display:none!important}.mobile-add-home{display:flex!important;grid-column:1/-1;margin-top:4px!important;justify-content:center}
 .home-heading{margin-bottom:18px!important}.home-heading h1{font-size:28px!important}.home-heading p:not(.eyebrow){margin:8px 0!important}
 .homes-column>.section-heading{margin-bottom:12px!important}.home-workspace{gap:28px!important}
 #workspace>.toolbar[hidden]{display:none!important}
 .auth-tabs{margin-bottom:20px}.auth-tabs button{min-height:44px}
 .member-row{align-items:flex-start;flex-wrap:wrap}.member-row button{font-size:14px!important;min-height:40px}
}

#workspace>.toolbar[hidden],.auth-tabs~[hidden]{display:none!important}
.price-icon-hourly{mask-image:url('/assets/icon-clock.svg')}
html:not([data-portal-session=authenticated]) .staff-page #logout{display:none!important}
.staff-page .masthead nav{flex-wrap:wrap}.staff-page #logout{flex-shrink:0;white-space:nowrap}

html[data-portal-theme] .home-page .new-customer a{background:#ff7900;color:#171717;border-color:#ff7900;font-weight:600}
html[data-portal-theme] .home-page .new-customer a:hover{background:#ff8c24}
.registration-options{border:0;padding:0;margin:20px 0}.registration-options label,.marketing-choice{display:flex!important;align-items:flex-start;gap:12px;line-height:1.5;margin:16px 0!important}.registration-options input[type=checkbox],.marketing-choice input{width:20px!important;height:20px!important;flex:0 0 20px;margin-top:2px}.password-checks{font-size:14px;color:var(--muted);margin:10px 0 20px}.password-checks .met{color:#238054}.registration-options a{text-decoration:underline}.terms-document{max-width:800px;margin:40px auto;padding:24px;line-height:1.7}
