/* The original, configurable atelier palette is the default. */
html[data-theme="light"] { color-scheme: light; }
mto-theme-switch { display: inline-flex; align-items: center; flex: 0 0 auto; }
mto-theme-switch .mto-theme-button {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink,#272329); cursor: pointer;
}
.mto-theme-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mto-theme-button .theme-moon { fill: #000; stroke: #000; }
.site-header .header-actions [data-icon="bag"] { display: grid; place-items: center; }
@media (hover: hover) and (pointer: fine) {
  .mto-theme-button:hover { background: var(--blush,#f3e7e3); }
}
.mto-theme-button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.mto-theme-button .theme-sun, [data-theme="dark"] .mto-theme-button .theme-moon { display: none; }
[data-theme="dark"] .mto-theme-button .theme-sun { display: inline; }
.mto-entry-mobile-logo { position: relative; align-items: center; min-height: 60px; padding-inline: 62px; }
.mto-entry-mobile-logo mto-theme-switch { position: absolute; inset-inline-end: 14px; }
.mto-entry-mobile-logo img { max-width: 100%; object-fit: contain; }
@media (min-width:1080px) {
  .mto-entry-logo { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  .mto-entry-logo img { max-width: calc(100% - 54px); object-fit: contain; }
}
.mto-access-top img { margin-inline-start: auto; }
.work-heading-count, .topbar > mto-theme-switch { margin-inline-start: auto; }
.a-login > mto-theme-switch { float: right; margin-inline-start: 8px; }
.a-login .a-brand { max-width: calc(100% - 54px); }
.auth-form-wrap > mto-theme-switch { align-self: flex-end; margin-block-end: 12px; }
@media (max-width:480px) {
  .site-header .brand { min-width: 0; flex: 1 1 auto; }
  .site-header .brand img { max-width: 100%; object-fit: contain; }
  .site-header .header-actions { flex: 0 0 auto; gap: 1px; }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --night: #101012;
  --surface: #1c1b1f;
  --customer-auth-surface: var(--surface);
  --raised: #29262b;
  --edge: #4a4148;
  --text: #f6f0ef;
  --secondary-text: #c5b8bb;
  --accent: #f1adbd;
  --action: #7d2941;
  --selected: #422932;
  --positive-bg: #20362d;
  --positive-text: #b0dec2;
  --warning-bg: #3b3022;
  --warning-text: #efd29c;
  /* The administration panel sets the light palette inline on the root. */
  --paper: var(--night) !important;
  --blush: var(--surface) !important;
  --ink: var(--text) !important;
  --muted: var(--secondary-text) !important;
  --wine: var(--accent) !important;
  --burgundy: var(--accent) !important;
  --wine-light: #96354e;
  --rose: var(--selected);
  --line: var(--edge);
  --primary: var(--accent);
  --atelier-white: var(--surface);
  --atelier-cream: #211f23;
  --atelier-sand: var(--raised);
  --atelier-stitch: var(--edge);
  --atelier-pink: var(--selected);
  --atelier-dark: #31151f;
  background: var(--night);
  color: var(--text);
}
html[data-theme="dark"] {
  body, body.site-mode-workshop:has(.work-layout), .mto-entry-screen, .mto-public-page {
    background: var(--night); color: var(--text);
  }
  :is(.site-header,.mto-entry-mobile-logo,.mto-entry-logo,.mto-access-top,.brand,footer,.a-login,.a-sidebar,.auth-story) img[src$="brand-logo.png"] {
    filter: brightness(0) invert(.95);
  }
  :focus-visible { outline-color: var(--accent); }
  ::placeholder { color: #ad9fa5; opacity: 1; }

  /* Entry cards, headings and account selection */
  .mto-entry-art { background: radial-gradient(circle at 1px 1px,#53333d 1px,transparent 1.4px) 0 0 / 22px 22px,#1b171a; }
  :is(.mto-entry-card,.mto-entry-card.entry-workwear,.mto-entry-card.entry-business,.mto-entry-card.entry-demo) { background: var(--surface); color: var(--text); border-color: var(--edge); }
  .mto-entry-card.entry-client { background: var(--action); color: white; border-color: #aa5270; }
  :is(.mto-entry-icon,.entry-workwear .mto-entry-icon) { background: var(--selected); color: var(--accent); }
  :is(.mto-entry-eyebrow,.mto-entry-arrow,.mto-entry-art-caption,.mto-entry-art-caption i,.mto-entry-register button,.mto-entry-links a,.mto-entry-links button) { color: var(--accent); }
  :is(.mto-entry-copy p,.mto-entry-label small,.mto-entry-label > span,.mto-entry-register,.mto-entry-links) { color: var(--secondary-text); }
  .entry-client :is(.mto-entry-label small,.mto-entry-label > span) { color: #ffe5eb; }
  .mto-entry-card.entry-client :is(.mto-entry-icon,.mto-entry-arrow) { color: white; }
  .mto-workshop-art li { color: var(--text); }

  /* Shared customer surfaces and navigation */
  .header-shell, .mobile-nav, footer { color: var(--text); background: var(--night); border-color: var(--edge); }
  :is(.panel,.c-page .panel,.modal,.search-box,.segmented,.profile-main,.menu-list,.option-card,
      .skip-link,.fitting-stage.personal-stage,.demo-outfit-selected button,.c-collection-shortcut > button,
      .c-avatar-missing,.c-photo-preview,.c-source-strip > button,.c-measure-illustration--none,
      .c-atelier-account .menu-list,.c-page .account-profile,.c-page .profile-main,
      .demo-single-profile,.scan-guide,.c-auth,.c-bg-ready,.c-bg-menu,.c-bg-loading,.c-bg-shell,
      .scan-result-grid figure,.c-measure-card,.modal.c-measure-modal,.c-workflow-bar,
      .c-fitting-page .c-fit-stage.panel,.c-fitting-page .c-fit-details.panel,.c-gallery,.c-gallery-item,
      .fit-catalog-reference,.mto-fashion-grid.product-grid .product-visual > .favorite,
      .c-shop-grid .c-product-image > .round-arrow,.round-arrow,.favorite,.modal-close) {
    background: var(--surface); color: var(--text); border-color: var(--edge);
  }
  .c-collection-empty { background: var(--surface) !important; }
  :is(.mto-fashion-grid .favorite,.favorite,.round-arrow,.c-workflow-close,.c-fit-stage-heading,.c-gender-badge,.work-kicker) { color: var(--accent); }
  :is(.c-page p,.c-landing p,.c-demo-card small,.c-product-copy small,.c-shop-grid .c-product-copy > span,
      .c-account-card > small,.c-fields label small,.c-catalog-bar,.c-summary small,.c-order-item small,
      .c-order-row small,.c-order-timeline li,.c-try-references figcaption,.c-fit-stage-heading span:last-child,
      .c-atelier-account .menu-list small,.c-atelier-account .account-profile > p,.c-model-test p,.c-tailor-note small,
      .c-try-progress li,.c-try-progress small,.c-auth-tabs button,.c-muted,.c-checkout-steps li,
      .c-capture-card > small,.timeline > div,.hero-caption) { color: var(--secondary-text); }
  :is(.c-auth label,.c-page label,.c-new-profile label,.c-form label,.c-shop-grid .c-product-copy > strong) { color: var(--text); }
  .c-summary > p, .c-order-item { color: var(--text) !important; }
  .c-summary .c-total, .c-try-progress p { color: var(--accent) !important; }
  :is(input:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),select,textarea) {
    background-color: #19181b; color: var(--text); border-color: var(--edge);
  }
  :is(.button.light,.c-page .button.light,.segmented button.selected,.verified,.button.glass-button,.c-gender-badge,
      .c-page label.c-radio,.c-choice > span,.c-poses,.fit-pose-controls,.c-fit-badge,.c-checkout-steps b,
      .c-fit-custom,.c-selected-garment,.c-fit-reference,.c-page .c-fit-details,.c-direct-scan > summary,
      .c-source-strip > button,.c-section-title > span,.c-gallery .c-section-title > span,.c-model-test,
      .c-review-box,.stage-tag,.stage-bottom,.timeline > div > span,.product-tag,.floating-pill,.quantity button,
      .fit-catalog-reference summary,.scan-result-grid figcaption,.c-result-measures > div,.c-try-progress,
      .c-measure-expand,.c-measure-detail-symbol,.c-workflow-track,.c-motion-wait,
      .c-fitting-page .c-fit-stage .c-poses,.c-fitting-page .c-fit-custom,.c-fitting-page .c-source-strip > button) {
    background: var(--raised); color: var(--text); border-color: var(--edge);
  }
  .c-fabric-options .c-choice > span { background: var(--raised); color: var(--text); border-color: var(--edge) !important; }
  .c-fabric-options .c-choice > span > small { color: var(--secondary-text); }
  .c-fabric-options .c-choice input:checked + span { background: var(--selected) !important; border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent); }
  :is(.c-choice input:checked + span,.c-radio:has(:checked),.c-payment-options button[aria-pressed=true],
      .payment-options button[aria-pressed=true],.c-initial,.c-order-timeline li[aria-current],
      .work-progress li[aria-current],.mobile-nav button.active > span:first-child) {
    background: var(--selected); color: var(--accent); border-color: var(--accent);
  }
  :is(.c-order-timeline b,.c-scan-guide b) { background: var(--raised); color: var(--text); }
  :is(.c-status.ready,.c-order-timeline .done b) { background: var(--positive-bg); color: var(--positive-text); }
  :is(.c-order-timeline .done,.work-progress .done) { color: var(--positive-text); }
  :is(.c-notice,.c-delivery-note,.c-status:not(.ready)) { background: var(--warning-bg); color: var(--warning-text) !important; border-color: #65533a; }
  .c-error:not(:empty), .form-error { color: #ffc3c8 !important; background: #382126; }
  :is(.button:not(.light):not(.glass-button),.icon-button b,.option-card.burgundy,.marquee,.hero-stamp,
      .c-checkout-steps .active b,.filter-row button[aria-pressed=true],.timeline .done > span,
      .c-poses button[aria-pressed=true],.fit-pose-controls button[aria-pressed=true],
      .c-collection-shortcut > button[aria-current=page],.c-page .c-product-image[aria-pressed=true] .round-arrow,
      .c-workflow-view,.c-credit-card,.payment-preview,.c-fit-catalog .c-outfit-chosen) {
    background: var(--action); border-color: #a95670; color: white;
  }
  .c-page .button:not(.light):not(.glass-button), .button:not(.light):not(.glass-button) { background-color: var(--action); border-color: #a95670; color: white; }
  .c-checkout-steps .active, .c-try-progress li[aria-current=step], .c-auth-tabs button[aria-pressed=true] { color: var(--accent); }
  .c-page .c-credit-card :is(p,small),.option-card.burgundy :is(p,.option-icon) { color: #ffe4e9; }
  .c-camera-modal, .modal.c-lightbox-modal { background: #101012; color: white; }
  .c-camera-modal .c-camera-shutter { color: #630b1b !important; }
  .c-bg-tools > summary { background: var(--raised); color: var(--text); }

  /* Workshop orders, shipping and settlements */
  .workshop,.work-login { --work-ink: var(--text); --work-muted: var(--secondary-text); --work-accent: var(--accent); --work-border: var(--edge); }
  :is(.work-card,.work-table-wrap,.work-flat,.work-scan,.work-shipment,.work-shipment:nth-child(even),.workshop tbody tr) { background: var(--surface); border-color: var(--edge); }
  :is(.workshop th,.workshop tbody tr:nth-child(even),.work-shipment:nth-child(even)) { background: var(--raised); color: var(--text); }
  .workshop :is(th,td,input,select) { border-color: var(--edge); }
  .workshop :is(input,select) { background: #19181b; color: var(--text); }
  .work-metrics .work-card:first-child, .work-status.pending { background: var(--warning-bg); color: var(--warning-text); border-color: #65533a; }
  .work-status.positive { background: var(--positive-bg); color: var(--positive-text); }
  .work-status,.work-link,.work-secondary,.workshop .work-link:hover,.work-order-list [data-work-row]:is(:hover,:focus-within) { background: var(--selected); color: var(--accent); }
  .work-order-id,.work-due.overdue { color: var(--accent); }
  .work-button:not(.work-secondary) { background: var(--action); color: white; }
  .work-step-bars i { background: var(--edge); }
  .work-step-bars i.active { background: var(--accent); }
  .work-flat svg { stroke: var(--accent); }
  .work-scan svg { color: var(--positive-text); }
  .work-scan svg .scan-value { fill: var(--positive-text); }
  .work-sidebar .work-tabs button[aria-current=page] { background: var(--selected); color: var(--accent); }

  /* Administration, business clothing and the alterations conversation */
  :is(.a-login,.a-sidebar,.a-card,.a-btn,.a-savebar,.a-image-version,.a-upload-field,
      .sidebar,.topbar,.stat,.company-card,.scan-card,.auth-story,.dialog-footer,dialog,
      .alt-inbox,.alt-dialog,.alt-dialog form,.alt-bubble,.alt-close,.alt-bell) {
    background: var(--surface); color: var(--text); border-color: var(--edge);
  }
  :is(.a-table th,.a-table tbody tr:nth-child(even),.a-accounts tbody tr:nth-child(even),
      .a-badge,.a-avatar,.badge,.avatar,.history-values span,.a-image-version > a,
      .company-card .company-symbol,.alt-attach,.alt-order-button,.alt-mine,.iconbutton) {
    background: var(--raised); color: var(--text); border-color: var(--edge);
  }
  :is(.a-alert,.a-badge.warn,.alert,.badge.pending,.demo-banner) { background: var(--warning-bg); color: var(--warning-text); border-color: #65533a; }
  :is(.a-badge.ok,.badge.ready,.alert.info) { background: var(--positive-bg); color: var(--positive-text); }
  :is(.a-nav[aria-current=page],.a-accounts .is-selected,.side-nav button:not([aria-current=page]):hover) { background: var(--selected); color: var(--accent); }
  :is(.a-btn.primary,.side-nav button[aria-current=page],.stat.emphasis,.alt-tools > button) { background: var(--action); color: white; }
  :is(.a-nav,.a-legend,.a-metric h3,.alt-empty,.alt-row small,.alt-row time,.alt-bubble small,.alt-dialog header small,
      .auth-story > p,.auth-form-wrap > p,.auth-note,.auth-back,.page-head p,.stat small,.stat span,.topbar label,
      .module-tag,.muted,.side-bottom p) { color: var(--secondary-text); }
  :is(.a-btn.danger,.a-error,.alt-error,.alt-file button,.auth-links button,.auth-flow svg,.auth-form-wrap .eyebrow) { color: var(--accent); }
  .a-donut text { fill: var(--text); }
  .a-donut .track { stroke: var(--edge); }
  :is(.alt-dialog header,.alt-dialog form,.alt-row,.a-table td) { border-color: var(--edge); }
  .alt-row { color: var(--text); }
  .alt-dialog textarea { color: var(--text); background: var(--night); border-color: var(--edge); }
  .workspace .eyebrow,.workspace .steps b { color: var(--accent); }
  .workspace small { color: var(--secondary-text); }
  .workspace :is(th,tbody tr:nth-child(even)) { background: var(--raised); color: var(--text); }
  .workspace tbody tr:hover { background: var(--selected); }
  .workspace .button.secondary,.workspace .button.quiet,.workspace .button.danger { background: var(--raised); color: var(--accent); border-color: var(--edge); }
}

/* Shared display preferences use the same position in every navigation header. */
mto-theme-switch { align-items: center; gap: 1px; }
mto-theme-switch .mto-pref-button {
  display:inline-flex; align-items:center; justify-content:center; gap:3px; min-width:40px; min-height:44px;
  padding:0 3px; background:transparent; color:inherit; border:0; border-radius:12px;
  font:700 .76rem/1 Comfortaa,var(--sans, sans-serif); cursor:pointer; white-space:nowrap;
}
mto-theme-switch .mto-pref-button svg { width:16px; height:16px; stroke:currentColor; stroke-width:1.65; fill:none; }
mto-theme-switch .mto-font-size b { font:600 1rem/1 Comfortaa, sans-serif; }
mto-theme-switch .mto-pref-button[aria-pressed="true"] { background:var(--rose,#e8d5d8); color:var(--wine,#630b1b); }
mto-theme-switch button:focus-visible { outline:2px solid currentColor; outline-offset:1px; }
html[data-mto-large-text] { font-size: 130%; }
html[data-mto-large-text] :is(nav,header,.mto-entry-card,.c-check) { overflow-wrap:break-word; }
html[data-mto-large-text] .mobile-nav button { min-width:0; white-space:normal; line-height:1.2; }
html[data-mto-large-text] .mobile-nav { align-items:start; }
@media (max-width:1079px) {
  .mto-entry-mobile-logo { justify-content:space-between; gap:8px; padding-inline:16px; }
  .mto-entry-mobile-logo img { max-width:calc(100% - 145px); height:auto; max-height:25px; }
  .mto-entry-mobile-logo mto-theme-switch { position:static; }
}
@media (max-width:760px) {
  .site-header { gap:4px; padding-inline:10px; }
  .site-header .brand { min-width:0; flex:1 1 auto; }
  .site-header .header-actions { flex:0 0 auto; }
  .mto-access-top { flex-wrap:wrap; gap:4px; }
  .mto-access-top img { max-width:min(42vw,175px); }
}
@media (max-width:400px) {
  mto-theme-switch .mto-theme-button, mto-theme-switch .mto-pref-button { min-width:36px; width:auto; }
  .site-header .header-actions { gap:0; }
}
#app footer:has(>img[src$="brand-logo.png"]) {
  display:grid; justify-items:center; align-content:center; gap: .9rem;
  padding:clamp(22px,4vw,52px) max(16px,5%) clamp(26px,5vw,54px); text-align:center;
}
#app footer > img[src$="brand-logo.png"] { display:block; width:clamp(130px,24vw,225px); height:auto; margin:0; }
html[data-theme="dark"] #app footer > img[src$="brand-logo.png"] { mix-blend-mode:normal; }
#app footer:has(>img[src$="brand-logo.png"]) > p {
  align-self:center; margin:0; padding:.24em 0; max-width:22ch; text-wrap:balance;
  font:400 clamp(2.9rem,8.6vw,5.4rem)/1.15 "Silverline Script",cursive;
  color:var(--wine); text-align:center;
}
html[data-mto-script-font="no"] #app footer > p,
html[data-mto-large-text] #app footer > p { font-family:Comfortaa,var(--sans); font-size:clamp(2.6rem,7vw,4.5rem); line-height:1.25; }
#app footer:has(>img[src$="brand-logo.png"]) > small { margin:0 auto; }
html[lang="en"] .lettering[aria-label] { mask:none!important; -webkit-mask:none!important; background:none!important; width:auto!important; height:auto!important; aspect-ratio:auto!important; font:400 clamp(2.5rem,6vw,4.5rem)/1.12 "Silverline Script",cursive; }
html[lang="en"] .lettering[aria-label]:empty::after { content:attr(aria-label); }
#app > .screen:has(+ footer) { padding-bottom:clamp(16px,3vw,36px); }
#app > footer.c-atelier-footer { margin-top:0; }
#app footer:has(>img[src$="brand-logo.png"]) > p { width:100%; max-width:54rem; }
#app footer > p > span { display:inline-block; }
@media (max-width:760px) { #app footer > p > span { display:block; } }
@media (max-width:760px) {
  .mto-access-top { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:6px; }
  .mto-access-top img { width:min(100%,144px); max-width:100%; height:auto; margin:auto; }
}

.c-consent-dialog > h2 { padding-inline-end: 40px; }
html[data-theme="dark"] .c-consent-dialog .c-scan-choices .c-check:has(:disabled) {
  color: var(--secondary-text);
  opacity: 1;
}
