/* Shared semantic tokens and component states. Loaded after legacy page layouts. */
:root{
 --brand-rust:#b83b14;--brand-rust-hover:#942c0e;--brand-peach:#ffb78b;--brand-navy:#17212d;
 --action-background:var(--brand-rust);--action-hover:var(--brand-rust-hover);--action-text:#ffffff;
 --surface-page:#f5f3ef;--surface-card:#fffdf9;--surface-subtle:#f3efea;--text-primary:#202732;--text-secondary:#626975;
 --border-subtle:#dededb;--input-border:#7b837f;--focus-ring:#b83b14;
 --error-text:#a52020;--error-surface:#fff0ef;--success-text:#215c3b;--success-surface:#e9f4ed;--warning-text:#73500a;--warning-surface:#fff2cf;
 --radius-detail:4px;--radius-control:8px;--radius-card:12px;
 --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--space-8:32px;--space-12:48px;
 --type-meta:12px;--type-label:14px;--type-body:16px;--type-card:18px;--type-section:22px;--type-page:clamp(30px,2.8vw,38px);
 --control-compact:44px;--control-height:48px;--control-marketing:52px;--card-shadow:none;
}
:root[data-theme=dark]{
 --action-background:var(--brand-peach);--action-hover:#ffd0b3;--action-text:#321a0d;
 --surface-page:#101822;--surface-card:#1b2531;--surface-subtle:#253141;--text-primary:#f0f2f5;--text-secondary:#b6beca;
 --border-subtle:#3d4652;--input-border:#8492a3;--focus-ring:#ffb78b;
 --error-text:#ffb4af;--error-surface:#3b2328;--success-text:#afe1bd;--success-surface:#193b2c;--warning-text:#ffda83;--warning-surface:#3b301b;
}
/* Keep compatibility names as aliases while old layouts migrate. */
:root,:root[data-theme=dark]{--green:var(--action-background);--muted:var(--text-secondary);--border:var(--border-subtle);--surface:var(--surface-card);--soft:var(--surface-subtle);--ink:var(--text-primary);--workspace-section-gap:var(--space-5);--workspace-panel-padding:var(--space-6);--workspace-field-gap:var(--space-4);--workspace-control-gap:var(--space-3)}
/* Marketing intentionally stays light, including when the workspace theme is dark. */
#account-landing.sales-page,.component-gallery .ds-marketing{
 --action-background:#a63e1c;--action-hover:#843015;--action-text:#ffffff;--focus-ring:#a63e1c;
 --surface-card:#fffefa;--surface-subtle:#f3efea;--border-subtle:#dededb;--text-primary:#17222e;--text-secondary:#59616a;--input-border:#7b837f;
 --error-text:#a52020;--error-surface:#fff0ef;--success-text:#215c3b;--success-surface:#e9f4ed;--warning-text:#73500a;--warning-surface:#fff2cf;
 --sales-accent:var(--action-background);--sales-accent-hover:var(--action-hover);
}
html .primary,html[data-theme=dark] .primary,html .public-book-button,html[data-theme=dark] .public-book-button,html .public-share-actions .public-view-page{background:var(--action-background);border-color:var(--action-background);color:var(--action-text);box-shadow:none}
html .primary:hover,html[data-theme=dark] .primary:hover,html .public-book-button:hover,html[data-theme=dark] .public-book-button:hover,html .public-share-actions .public-view-page:hover{background:var(--action-hover);border-color:var(--action-hover);color:var(--action-text)}
html :is(button,a,summary,input,select,textarea,[tabindex]):focus-visible,html[data-theme=dark] :is(button,a,summary,input,select,textarea,[tabindex]):focus-visible{outline:3px solid var(--focus-ring);outline-offset:3px}
:where(body[data-screen=workspace] main,dialog,.component-gallery) :is(button,.button){min-height:var(--control-height);border-radius:var(--radius-control);font-size:var(--type-label);font-weight:600;line-height:1.4}
:where(body[data-screen=workspace] main,dialog,.component-gallery) button.text{min-height:var(--control-compact)}
:where(body[data-screen=workspace] main,dialog,.component-gallery) :is(.panel,.stat,.card,.settings-card){border-radius:var(--radius-card);box-shadow:var(--card-shadow)}
html dialog{border-radius:var(--radius-card)}
:where(body[data-screen=workspace] main,dialog,.component-gallery) :is(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),select,textarea){border:1px solid var(--input-border);border-radius:var(--radius-control);font-size:var(--type-body);color:var(--text-primary);background:var(--surface-card);line-height:1.5;min-height:var(--control-height)}
:where(body[data-screen=workspace] main,dialog,.component-gallery) .field{font-size:var(--type-label);line-height:1.5}
:where(body[data-screen=workspace] main,dialog,.component-gallery) :is(.privacy,.muted){font-size:var(--type-label);line-height:1.6}
body[data-screen=workspace] main>header h1{font-size:var(--type-page);font-weight:700;line-height:1.2}
:where(body[data-screen=workspace] main,dialog,.component-gallery) h2{font-size:var(--type-section);font-weight:700;line-height:1.3}
:where(body[data-screen=workspace] main,dialog,.component-gallery) h3{font-size:var(--type-card);font-weight:600;line-height:1.4}
:where(body[data-screen=workspace] main,dialog,.component-gallery) :is(.eyebrow,small){font-size:var(--type-meta);line-height:1.5}
.account-toolbar #save-state,.booking-next-step small,.context-followup .chip,.card .card-bottom{font-size:var(--type-label);line-height:1.5}
html .booking-view-tools button[aria-pressed=true],html[data-theme=dark] .booking-view-tools button[aria-pressed=true],html .money-tabs button[aria-pressed=true],html[data-theme=dark] .money-tabs button[aria-pressed=true],html .pipeline-timeline-buttons button.is-selected,html[data-theme=dark] .pipeline-timeline-buttons button.is-selected,html .ux-view-switch button[aria-pressed=true],html[data-theme=dark] .ux-view-switch button[aria-pressed=true]{background:var(--action-background);color:var(--action-text);border-color:var(--action-background)}
html button.danger,html[data-theme=dark] button.danger{background:var(--error-surface);color:var(--error-text);border-color:var(--error-text)}
html button.danger:hover{filter:brightness(.96)}
:where(body[data-screen=workspace] main,dialog,.component-gallery) :is(input,select,textarea)[aria-invalid=true]{border:2px solid var(--error-text)}
:where(body[data-screen=workspace] main,dialog,.component-gallery) [role=alert]:not(:empty){color:var(--error-text);background:var(--error-surface);padding:var(--space-3);border-left:4px solid var(--error-text);border-radius:var(--radius-detail);font-size:var(--type-label);line-height:1.6}
.ds-status{display:inline-flex;align-items:center;gap:var(--space-2);padding:var(--space-1) var(--space-2);border-radius:var(--radius-detail);font-size:var(--type-label);font-weight:600}
.ds-status[data-status=success],.chip.ds-status[data-status=success]{color:var(--success-text);background:var(--success-surface)}
.ds-status[data-status=warning],.chip.ds-status[data-status=warning],html .chip.due,html[data-theme=dark] .chip.due{color:var(--warning-text);background:var(--warning-surface)}
.ds-status[data-status=error],.chip.ds-status[data-status=error]{color:var(--error-text);background:var(--error-surface)}
html button:disabled,html[data-theme=dark] button:disabled,html button[aria-disabled=true],html[data-theme=dark] button[aria-disabled=true],html .sales-page .auth-panel button:disabled{opacity:1;cursor:not-allowed;background:var(--surface-subtle);border-color:var(--input-border);color:var(--text-secondary);box-shadow:none;filter:none}
html button[aria-busy=true]{cursor:progress}
body[data-screen=workspace] main>header>.actions,.workspace-tool-row{gap:var(--space-3);flex-wrap:wrap}
body[data-screen=workspace] .form-grid,dialog .form-grid{gap:var(--space-4)}
body[data-screen=workspace] .toolbar{gap:var(--space-3)}
body[data-screen=workspace] .card .booking-card-title{min-height:var(--control-compact);padding:0;background:transparent;color:inherit;border:0;text-align:left;font:inherit}
.sales-page .sales-cta,.sales-page .sales-demo,.sales-page .sales-login,.sales-page .auth-panel .sales-cta{border-radius:var(--radius-control);font-weight:600}
.sales-page .sales-cta{min-height:var(--control-marketing)}
.sales-page .sales-price-card,.sales-page .sales-product-card,#account-landing .auth-panel{border-radius:var(--radius-card)}
.sales-page .sales-kicker,.sales-page .sales-caption,.sales-screen-label,.sales-screen-label>span:last-child{font-size:var(--type-meta);font-weight:600}
.sales-page .sales-hero h1,.sales-page h2{font-weight:700}.sales-page h3{font-weight:600}
.sales-page .sales-price{font-weight:700}
.sales-page .auth-panel input{border-color:var(--input-border);border-radius:var(--radius-control);font-size:var(--type-body);min-height:var(--control-height)}
.sales-page .auth-panel label,.sales-page .auth-panel .privacy{font-size:var(--type-label);line-height:1.6}
.sales-page .sales-cta-row{gap:var(--space-5)}
@media(max-width:680px){:root{--workspace-panel-padding:var(--space-4)}:where(body[data-screen=workspace] main,dialog,.component-gallery) :is(button,.button){min-height:var(--control-height)}body[data-screen=workspace] main>header h1{font-size:30px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* Focus follows the actual surface, including the always-dark navigation. */
:is(aside,#mobile-account-controls),.sales-product,.sales-hero-screen{--focus-ring:#ffb78b}
.component-gallery .ds-marketing button:not(.primary){background:#fffefa;color:#17222e;border-color:#7b837f}
#save-state[data-save-status=saved]{color:var(--success-text)}
#save-state[data-save-status=error]{color:var(--error-text)}
#save-state[data-save-status=pending]{color:var(--text-secondary)}
body[data-screen=workspace] :is(.card,.settings-card) h3,body[data-screen=workspace] .settings-card strong{font-size:var(--type-card);font-weight:600;line-height:1.4}
body[data-screen=workspace] .today-date{border-radius:var(--radius-card)}
body[data-screen=workspace] .today-date-day{border-radius:var(--radius-control);font-weight:700}
.sales-page .sales-cta{gap:var(--space-5)}
.sales-page .sales-hero-screen{border-radius:var(--radius-card)}
.sales-page .auth-panel label{margin-block:var(--space-4)}
html input:disabled,html select:disabled,html textarea:disabled{background:var(--surface-subtle);color:var(--text-secondary);border-color:var(--input-border);opacity:1;cursor:not-allowed}
.ds-field-error{display:block;margin-top:var(--space-2);font-size:var(--type-label);font-weight:400;line-height:1.5;color:var(--error-text)}
/* State rules repeat the field selector so they outrank its type exclusions. */
:where(body[data-screen=workspace] main,dialog,.component-gallery) :is(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),select,textarea)[aria-invalid=true],.sales-page .auth-panel input[aria-invalid=true]{border:2px solid var(--error-text)}
:where(body[data-screen=workspace] main,dialog,.component-gallery) :is(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),select,textarea):disabled,.sales-page .auth-panel input:disabled{background:var(--surface-subtle);color:var(--text-secondary);border-color:var(--input-border);opacity:1;cursor:not-allowed}

/* Calendar dates remain comfortably clickable without overlapping narrow columns. */
.calendar .calendar-date{min-width:44px;min-height:48px;margin-left:0}
@media(max-width:680px){.ux-calendar-columns .calendar .calendar-date{min-width:24px;width:100%;box-sizing:border-box;padding-inline:0;margin:0}}

/* Native calendar/clock icons and picker surfaces follow the field's theme.
   Keep native input types, keyboard behavior and existing field geometry. */
input:is([type=date],[type=time],[type=datetime-local]){color-scheme:light}
html[data-theme=dark] input:is([type=date],[type=time],[type=datetime-local]){color-scheme:dark}
html[data-theme=dark] :is(#account-landing.sales-page,.component-gallery .ds-marketing) input:is([type=date],[type=time],[type=datetime-local]){color-scheme:light}

/* Theme native page, form and textarea scrollbars without changing their size.
   Overlay indicators remain under the browser/OS's control. */
:root{color-scheme:light;scrollbar-color:#8a929e #f3efea}
:root[data-theme=dark]{color-scheme:dark;scrollbar-color:#7b8ca3 #1b2531}
:is(aside,.sales-product,.sales-hero-screen){color-scheme:dark;scrollbar-color:#7b8ca3 #17212d}
:is(#account-landing.sales-page,.component-gallery .ds-marketing,#mobile-account-menu){color-scheme:light;scrollbar-color:#8a929e #f3efea}
html[data-theme=dark] #mobile-account-menu{color-scheme:dark;scrollbar-color:#7b8ca3 #1b2531}
/* The workspace sets its scheme inline; the light landing page overrides it. */
:root:has(body[data-screen=landing]){color-scheme:light!important;scrollbar-color:#8a929e #f3efea}

/* Secondary booking workflows use the same paired dark surfaces and text. */
html[data-theme=dark] .outreach-preview{background:var(--surface-subtle);color:var(--text-primary)}
html[data-theme=dark] .outreach-preview small{color:var(--text-secondary)}
html[data-theme=dark] .outreach-state{background:var(--surface-subtle);color:var(--text-primary)}
html[data-theme=dark] .outreach-state.is-saved,html[data-theme=dark] .outreach-warning{background:var(--warning-surface);color:var(--warning-text);border-color:var(--warning-text)}
html[data-theme=dark] .outreach-state.is-sent{background:var(--success-surface);color:var(--success-text)}
html[data-theme=dark] .proposal-date-field[data-level=warning] .proposal-date-check{color:var(--warning-text)}
html[data-theme=dark] .proposal-date-field[data-level=conflict],html[data-theme=dark] .proposal-date-field[data-level=conflict] .proposal-date-check{color:var(--error-text)}
html[data-theme=dark] #modal-body .recurring-preview-table tr.has-conflict{background:var(--warning-surface);color:var(--warning-text)}
html[data-theme=dark] #modal-body .recurring-preview-table tr:has(.recurring-conflict.is-conflict){background:var(--error-surface);color:var(--error-text)}
html[data-theme=dark] .recurring-conflict.is-warning{color:var(--warning-text)}
html[data-theme=dark] .recurring-conflict.is-conflict{color:var(--error-text)}
html[data-theme=dark] .recurring-conflict.is-clear{color:var(--success-text)}
html[data-theme=dark] .public-show time,html[data-theme=dark] .public-social-links a{background:var(--surface-subtle);color:var(--green)}
/* Light surfaces keep readable helper, financial and error colors. */
html .public-placeholder{color:var(--text-secondary)}
html .business-kpi{background:var(--surface-card)}
html .business-kpi.is-negative>strong{color:var(--warning-text)}
#business-cost-error{color:var(--error-text)}
html:not([data-theme=dark]) :is(.business-revenue-dot,.business-bar.revenue){background:#3c788b}
html:not([data-theme=dark]) :is(.business-cost-dot,.business-bar.cost){background:#9a5e28}
/* Let tool names keep their words at narrow widths, wrapping the row if needed. */
@media(max-width:680px){body[data-screen=workspace] .contextual-workspace-tools{display:flex;flex-wrap:wrap}body[data-screen=workspace] .contextual-workspace-tools button{flex:1 0 auto;width:auto;white-space:nowrap;overflow-wrap:normal;word-break:normal}}
/* State colors stay paired when legacy hover rules and local surfaces overlap. */
html[data-theme=dark] .public-link-button:hover,html[data-theme=dark] .calendar-provider-actions .button:hover{background:var(--surface-subtle);color:var(--text-primary)}
html .csv-error{color:var(--error-text)}
#proposal-response-status,#quote-response-status,.ds-field-error{overflow-wrap:anywhere;word-break:normal}
html input:disabled::placeholder,html textarea:disabled::placeholder{color:var(--text-secondary);opacity:1}
html .proposal-public-date.is-unavailable{opacity:1;background:var(--surface-subtle);color:var(--text-secondary);border-color:var(--input-border)}
html .component-gallery [aria-pressed=true]:hover{background:var(--action-background);color:var(--action-text);border-color:var(--action-background)}
html .component-gallery .ds-marketing{background:var(--surface-card);color:var(--text-primary);--ink:var(--text-primary);--muted:var(--text-secondary)}
html #account-landing.sales-page a:not(.primary):not(.sales-cta):not(.sales-demo){color:inherit}
html #account-landing.sales-page button.sales-inline-action{color:var(--action-background);background:transparent}
html #account-landing.sales-page button.sales-inline-action:hover{color:var(--action-hover);background:transparent}
/* A disabled action never regains its active appearance under a pointer. */
html :is(button,.button):is(:disabled,[aria-disabled=true]),html :is(button,.button):is(:disabled,[aria-disabled=true]):hover,html[data-theme=dark] :is(button,.button):is(:disabled,[aria-disabled=true]),html[data-theme=dark] :is(button,.button):is(:disabled,[aria-disabled=true]):hover,html #account-landing.sales-page button:is(:disabled,[aria-disabled=true]),html #account-landing.sales-page button:is(:disabled,[aria-disabled=true]):hover{background:var(--surface-subtle);color:var(--text-secondary);border-color:var(--input-border);opacity:1;cursor:not-allowed;box-shadow:none;filter:none}
/* Commitment titles wrap inside the same bounded cells as venue names. */
.ux-month-panel .calendar-card.artist-event{overflow-wrap:anywhere;word-break:normal}
/* Native choice controls keep their text and feedback in separate readable rows. */
html .proposal-public-date>input[type=radio]{flex:0 0 20px;width:20px;height:20px;min-width:20px;min-height:20px;padding:0;margin:0;accent-color:var(--action-background)}
html .proposal-public-date>span{min-width:0;overflow-wrap:anywhere}
html label.check:has(>.ds-field-error),html #modal-body label.check:has(>.ds-field-error){display:grid;grid-template-columns:20px minmax(0,1fr);align-items:start}
html label.check>.ds-field-error{grid-column:1/-1;order:1}
html label.check:has(>.ds-field-error)>input[type=checkbox]{width:20px;height:20px;min-height:20px;padding:0;margin:3px 0 0}
/* Recipient headers remain one balanced row with a readable original logo. */
.proposal-public-header{box-sizing:border-box;width:100%;flex-direction:row;gap:12px;height:auto;min-height:72px}
.proposal-public-header>a{display:flex;flex:0 0 auto;min-width:0;padding:4px 6px;border-radius:8px;background:#fffdf9}
.proposal-public-header>span{min-width:0;text-align:right;overflow-wrap:anywhere}
@media(max-width:680px){.proposal-public-header{min-height:60px}}
/* Keep focus visible inside clipped form regions and on each local surface. */
#modal :is(button,a,input,select,textarea,summary):focus-visible{outline-offset:-3px}
html:not([data-theme=dark]) #mobile-account-menu[open]{--focus-ring:var(--brand-rust)}
@media(max-width:680px){#nav button:focus-visible{outline-offset:2px}}
/* At high zoom/short windows, scroll the complete form instead of squeezing fields. */
@media(max-height:320px){
 html #modal:has(.ux-form-dialog){overflow-y:auto;scroll-padding:10px}
 html #modal .ux-form-dialog,html #modal .ux-dialog-form,html #modal .ux-form-scroll{display:block;height:auto;max-height:none;overflow:visible;flex:none}
 html #modal .ux-form-scroll textarea{min-height:48px;max-height:120px}
}

@media(max-width:1024px){html{scroll-padding-block:80px 90px}main :is(button,a,input,select,textarea,summary,[tabindex]){scroll-margin-block:8px}}

html #modal .ux-dialog-form>.form-actions{margin-inline:0;min-width:0}
@media(max-height:320px){html #modal textarea{min-height:48px;max-height:120px}}

#mobile-account-menu[open] :is(button,a):focus-visible,#more-menu-items button:focus-visible{outline-offset:-3px}

html:has(body[data-view=profile]){scroll-padding-block:30px 140px}
@media(max-width:680px){html:has(body[data-view=profile]){scroll-padding-block:80px 260px}}
@media(max-height:440px){
 html body[data-screen=workspace][data-view=profile] .profile-editor-toolbar{position:static}
 html:has(body[data-view=profile]){scroll-padding-block:80px 80px}
 html body[data-view=profile] textarea{min-height:48px;max-height:72px}
}

html body[data-screen=workspace][data-view=profile]>main{padding-bottom:180px}
html body[data-view=profile] .public-show-picker{max-height:min(360px,max(72px,calc(100dvh - 180px)))}
@media(max-width:680px){html body[data-screen=workspace][data-view=profile]>main{padding-bottom:300px}}

#modal .primary:focus-visible{outline-color:var(--action-text);outline-offset:-5px}
#mobile-account-menu[open] :is(button,a):focus-visible,#more-menu-items button:focus-visible{outline-color:currentColor}

/* Text enlargement must grow native fields and mobile navigation, not clip labels. */
html #modal .field :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select),html body[data-view=profile] .field :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select){height:max(48px,calc(1.5em + 22px))}
.venue-directory .venue-actions button{white-space:normal;overflow-wrap:normal;min-width:max-content}
@media(max-width:680px){
 html body[data-screen=workspace] #nav{grid-template-columns:repeat(auto-fit,minmax(4em,1fr))}
 html body[data-screen=workspace] #nav>button,html body[data-screen=workspace] #nav>.secondary-navigation>.more-toggle{height:auto;min-height:max(44px,calc(1.2em + 14px))}
 html body[data-screen=workspace]>main{padding-bottom:calc(var(--workspace-nav-height,76px) + 28px)}
 html:has(body[data-screen=workspace]){scroll-padding-top:calc(var(--workspace-header-height,60px) + 14px);scroll-padding-bottom:calc(var(--workspace-nav-height,76px) + 14px)}
 html:has(body[data-view=profile]){scroll-padding-bottom:calc(var(--workspace-nav-height,76px) + 190px)}
 html body[data-screen=workspace][data-view=profile]>main{padding-bottom:calc(var(--workspace-nav-height,76px) + 224px)}
}

html body[data-screen=workspace] .venue-directory .venue-actions>button:not(:first-child){min-width:min-content;white-space:normal}
html :is(aside,#mobile-account-controls) .sidebar-utilities :is(#theme-toggle,.settings-shortcut){white-space:normal;flex-wrap:wrap;height:auto;min-height:44px}
@media(max-width:680px){html body[data-view=calendar] main>header>.actions{grid-template-columns:repeat(auto-fit,minmax(min(100%,8em),1fr))}}

html #modal[data-form-flow=full]:has(.ux-form-dialog){overflow-y:auto;scroll-padding:10px}
html #modal[data-form-flow=full] :is(.ux-form-dialog,.ux-dialog-form,.ux-form-scroll){display:block;height:auto;max-height:none;overflow:visible;flex:none}

/* Public copy and email links must also wrap when readers enlarge text. */
body:not([data-screen=workspace]) :is(h1,h2,h3,p,a,button,summary,dt,dd,li){overflow-wrap:anywhere}
body:not([data-screen=workspace])>header{flex-wrap:wrap}
body:not([data-screen=workspace])>header>nav{flex-wrap:wrap;min-width:0;max-width:100%}
body:not([data-screen=workspace]) .brand{min-width:0;max-width:100%;white-space:normal}
.proposal-artist-card{min-width:0;max-width:100%;grid-template-columns:76px minmax(0,1fr)}
.proposal-artist-card>*{min-width:0}

body:not([data-screen=workspace]) .eyebrow{overflow-wrap:anywhere}
