@import url('./assets/fonts.css');
@import url('./tokens.css');
@import url('./vision.css');
@import url('./fabric-panel.css');
@import url('./taste-panel.css');
@import url('./avatar-3d.css');
@import url('./avatar-panel.css');
@import url('./occasion-panel.css');

/* Base and accessibility */
:root { font-family: var(--font-ui); color: var(--text-primary); background: var(--bg-page); font-synthesis: none; -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
body { margin: 0; font-size: var(--text-md); line-height: 1.5; letter-spacing: -.025em; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; border: 0; background: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; }
button, a { touch-action: manipulation; }
:where(button, a, input, select, textarea):focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; display: block; }
input[type=range], input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
input[type=range] { width: 100%; min-height: 28px; cursor: pointer; }
svg.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 100; background: white; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }
.loading-screen { display: grid; place-content: center; justify-items: center; gap: var(--space-6); min-height: 100vh; text-align: center; padding: var(--space-6); }
.hidden { display: none !important; }
.full { width: 100%; }
.center { text-align: center; }
.muted { color: var(--text-secondary); }
.tiny { font-size: var(--text-xs); line-height: 1.7; color: var(--text-secondary); }

/* Navigation and page frame */
.topbar { min-height: 80px; padding: 0 max(var(--space-8), calc((100vw - 1360px) / 2)); background: var(--bg-surface); border-bottom: 1px solid var(--border-default); display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--logo-accent); color: white; }
.brand-mark, .agent-mark { overflow: hidden; flex-shrink: 0; }
.brand-mark img, .agent-mark img { width: 100%; height: 100%; }
.wordmark { font-family: var(--font-ui); font-size: 27px; font-weight: 800; letter-spacing: -1px; line-height: 1; color: var(--logo-accent); white-space: nowrap; }
.wordmark > span { color: inherit; }
.brand-caption, .brand small { color: var(--text-tertiary); font-size: var(--text-xs); font-weight: 500; margin-left: 6px; }
.nav { align-self: stretch; display: flex; align-items: center; gap: var(--space-2); }
.nav button { font-size: 14px; font-weight: 600; color: var(--text-secondary); padding: 11px 17px; border-radius: var(--radius-md); min-height: 44px; transition: background var(--motion-fast); white-space: nowrap; }
.nav button:hover { background: var(--bg-subtle); }
.nav button.active { background: var(--accent-soft); color: var(--accent); }
.nav-count { color: var(--accent); font-size: var(--text-xs); margin-left: 3px; }
.header-actions { display: flex; align-items: center; gap: var(--space-2); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; border-radius: var(--radius-md); color: var(--text-secondary); }
.icon-button:hover { background: var(--bg-subtle); }
.profile-bubble { display: grid; place-items: center; width: 40px; height: 40px; background: var(--color-brand-100); color: var(--accent); border-radius: 50%; font-weight: 750; font-size: var(--text-xs); }
.status-dot { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--bg-subtle); border-radius: var(--radius-pill); color: var(--text-secondary); font-size: var(--text-xs); white-space: nowrap; }
.status-dot:before { content: ''; height: 5px; width: 5px; background: var(--color-green-700); border-radius: 50%; }
.page { max-width: 1424px; padding: 36px var(--space-8) var(--space-12); margin: auto; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); margin-bottom: 30px; }
.eyebrow { color: var(--accent); font-size: var(--text-sm); font-weight: 700; margin-bottom: var(--space-2); letter-spacing: -.02em; }
h1 { font-size: 32px; line-height: 1.4; font-weight: 750; letter-spacing: -1.3px; word-break: keep-all; }
.intro-note { margin-top: 10px; color: var(--text-secondary); font-size: var(--text-md); line-height: 1.7; word-break: keep-all; }
.journey { display: flex; align-items: center; gap: var(--space-2); background: var(--bg-surface); padding: 10px var(--space-3); border: 0; box-shadow: var(--shadow-card); border-radius: var(--radius-lg); margin-bottom: 2px; flex-shrink: 0; }
.journey button { display: flex; align-items: center; gap: 6px; padding: 3px; min-height: 28px; font-size: var(--text-xs); font-weight: 600; white-space: nowrap; color: var(--text-tertiary); }
.journey button span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-subtle); font-size: 11px; }
.journey button.current { color: var(--accent); }
.journey button.current span { background: var(--accent); color: white; }
.journey i { width: 12px; height: 1px; background: var(--border-default); }
.workspace { display: grid; grid-template-columns: 304px minmax(0, 1fr); gap: 28px; align-items: start; }
.fitting-column { position: sticky; top: 24px; }

/* Personal fitting and profile cards */
.fitting-room, .profile-card, .fit-peek { background: var(--bg-surface); border: 0; border-radius: var(--radius-xl); box-shadow: var(--shadow-card); }
.fitting-room { overflow: hidden; }
.room-head { padding: var(--space-5) var(--space-5) var(--space-4); display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.room-head h2 { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-lg); font-weight: 700; }
.room-head small { font-size: 11px; font-weight: 500; color: var(--text-tertiary); }
.room-tabs { display: flex; width: 100%; padding: var(--space-1); gap: var(--space-1); background: var(--bg-subtle); border-radius: 10px; }
.room-tabs button { flex: 1; font-size: var(--text-xs); font-weight: 600; padding: 7px var(--space-2); border-radius: 7px; min-height: 32px; color: var(--text-tertiary); }
.room-tabs button.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 2px 4px rgb(24 30 41 / 6%); }
.avatar-stage { height: 322px; position: relative; display: grid; place-items: center; overflow: hidden; background: var(--bg-subtle); }
.avatar-stage .model-img { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding-bottom: var(--space-10); object-fit: contain; }
.stage-label { position: absolute; top: 12px; left: 12px; font-size: 11px; color: var(--text-secondary); background: rgb(255 255 255 / 92%); border-radius: 6px; padding: var(--space-1) 7px; }
.stage-switch { position: absolute; bottom: 54px; right: 12px; display: flex; align-items: center; gap: 5px; background: white; color: var(--text-secondary); border-radius: var(--radius-pill); padding: 9px var(--space-3); box-shadow: var(--shadow-card); font-size: 11px; font-weight: 600; }
.stage-switch .icon { width: 14px; height: 14px; }
.avatar-disclaimer { position: absolute; bottom: 9px; left: 12px; right: 12px; font-size: 11px; line-height: 1.55; color: var(--text-secondary); text-align: center; padding: var(--space-1) 6px; background: rgb(255 255 255 / 88%); border-radius: 6px; word-break: keep-all; }
.measurement-diagram { height: 100%; width: 100%; min-height: 0; }
.diagram-measure-line, .diagram-connector { stroke: var(--accent); }
.diagram-dot { fill: var(--accent); }
.diagram-label { fill: var(--accent-hover); }
.diagram-caption { fill: var(--text-secondary); }
.body-summary { display: grid; grid-template-columns: repeat(3, 1fr); padding: var(--space-5) var(--space-3); gap: 0; background: var(--bg-surface); }
.body-summary > div { text-align: center; border-right: 1px solid var(--border-default); }
.body-summary > div:last-child { border: 0; }
.body-summary small { display: block; font-size: var(--text-xs); color: var(--text-secondary); margin-bottom: 6px; }
.body-summary strong { font-size: 22px; line-height: 1.2; font-weight: 750; letter-spacing: -.5px; }
.body-summary em { font-size: var(--text-xs); font-weight: 500; font-style: normal; margin-left: 3px; color: var(--text-tertiary); }
.body-edit { border-top: 1px solid var(--border-default); display: flex; justify-content: center; align-items: center; gap: 7px; width: 100%; min-height: 52px; padding: var(--space-3); font-size: var(--text-xs); color: var(--accent); font-weight: 600; background: var(--bg-surface); }
.body-edit:hover { background: var(--accent-soft); }
.body-edit .icon { width: 15px; height: 15px; }
.profile-card, .fit-peek { padding: var(--space-5); margin-top: var(--space-4); border-radius: var(--radius-lg); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.section-title h3 { display: flex; align-items: center; gap: 7px; font-size: var(--text-md); font-weight: 700; }
.section-title .icon { width: 17px; height: 17px; color: var(--accent); }
.text-button { font-size: var(--text-xs); font-weight: 600; padding: 6px 2px; min-height: 30px; color: var(--text-secondary); text-underline-offset: 4px; }
.text-button:hover { color: var(--accent); text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 9px; background: var(--bg-subtle); border-radius: 7px; color: var(--text-secondary); font-size: var(--text-xs); font-weight: 500; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.profile-footnote { display: flex; align-items: center; gap: 5px; color: var(--text-tertiary); font-size: 11px; margin-top: 14px; }
.profile-footnote .icon { width: 13px; height: 13px; }
.taste-entry { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 12px 0 0; width: 100%; font-size: 12px; font-weight: 650; text-align: left; }
.taste-entry .icon { width: 16px; height: 16px; }
.taste-entry .icon:last-child { margin-left: auto; }
.feature-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.feature-actions > button { flex: 1; min-width: 140px; }
.field > span small { font-size: 11px; color: var(--text-secondary); font-weight: 400; }
.fit-peek { background: var(--accent-soft); }
.fit-peek > small { color: var(--accent); font-size: var(--text-xs); font-weight: 700; }
.fit-peek h3 { font-size: var(--text-md); font-weight: 700; margin: var(--space-2) 0; }
.fit-peek p { font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.7; }
.fit-peek button { display: flex; align-items: center; justify-content: space-between; width: 100%; color: var(--accent); font-size: var(--text-sm); font-weight: 600; min-height: 36px; margin-top: var(--space-3); padding: 0; }
.fit-peek button .icon { width: 16px; }

/* Search and product discovery */
.occasion-entry { display: flex; align-items: center; gap: 13px; width: 100%; padding: 18px 20px; margin-bottom: 18px; background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); text-align: left; }
.occasion-entry > .icon:first-child { color: var(--logo-accent); width: 23px; height: 23px; }
.occasion-entry > .icon:last-child { margin-left: auto; width: 18px; }
.occasion-entry span { min-width: 0; }
.occasion-entry strong { display: block; font-size: 15px; }
.occasion-entry small { display: block; margin-top: 4px; font-size: 12px; color: var(--text-secondary); line-height: 1.6; word-break: keep-all; }
.occasion-entry:hover { box-shadow: var(--shadow-hover); }
.occasion-summary { padding: 20px; margin-bottom: 18px; background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.occasion-summary-heading,.occasion-summary-heading > div { display: flex; gap: 10px; align-items: center; }
.occasion-summary-heading { justify-content: space-between; flex-wrap: wrap; }
.occasion-summary-heading .icon { color: var(--logo-accent); width: 20px; }
.occasion-summary-heading strong { font-size: 15px; }
.occasion-summary > p { margin-top: 8px; font-size: 12px; line-height: 1.7; color: var(--text-secondary); }
.occasion-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.occasion-chips span { padding: 5px 8px; border-radius: 6px; background: var(--bg-subtle); font-size: 11px; }
.occasion-summary > small { display: block; margin-top: 5px; font-size: 10px; color: var(--text-tertiary); line-height: 1.6; }
.occasion-summary .occasion-weather { color: var(--text-primary); }
.price-stack { min-width: 0; }
.sale-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 0 3px; font-size: 10px; }
.sale-type { color: var(--logo-accent); font-weight: 650; }
.sale-line del { color: var(--text-tertiary); }
.sale-rate { color: var(--logo-accent); }
.occasion-product-note { margin: 11px 3px 0; padding-top: 10px; border-top: 1px solid var(--border-default); }
.occasion-product-note p { display: flex; align-items: flex-start; gap: 5px; font-size: 11px; line-height: 1.65; }
.occasion-product-note .icon { width: 13px; height: 13px; color: var(--logo-accent); margin-top: 2px; }
.occasion-product-note small { display: block; margin-top: 5px; color: var(--text-secondary); font-size: 10px; line-height: 1.6; }
.occasion-product-note .occasion-warning { color: var(--color-orange-700); }
.occasion-detail-note { margin: 14px 0 22px; padding: 16px; background: var(--bg-subtle); border-radius: 12px; font-size: 12px; line-height: 1.8; }
.occasion-detail-note strong { display: block; margin-bottom: 6px; }
.occasion-detail-note ul { margin: 10px 0; padding-left: 18px; }
.occasion-detail-note small { color: var(--text-secondary); font-size: 11px; }
@media(max-width:700px) {
  .occasion-entry,.occasion-summary { padding: 16px; }
  .product-bottomline:has(.sale-line) { align-items: flex-start; flex-wrap: wrap; }
  .product-bottomline:has(.sale-line) .size-hint { margin: 4px 0 0 3px; }
  .price-stack .product-price { font-size: 16px; }
}
.catalog { min-width: 0; }
.agent-intro { display: flex; gap: 14px; align-items: flex-start; background: var(--accent-soft); border: 0; box-shadow: var(--shadow-card); padding: 22px var(--space-6); border-radius: var(--radius-xl); margin-bottom: var(--space-5); }
.agent-mark { width: 42px; height: 42px; flex-shrink: 0; background: var(--logo-accent); color: white; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-ui); font-size: 26px; }
.agent-mark .icon { width: 24px; height: 24px; }
.agent-intro h2 { font-size: 18px; line-height: 1.5; font-weight: 700; letter-spacing: -.6px; word-break: keep-all; }
.agent-intro p { margin-top: 5px; font-size: var(--text-sm); line-height: 1.6; color: var(--text-secondary); word-break: keep-all; }
.searchbox { display: flex; align-items: center; gap: var(--space-3); min-height: 58px; border: 1px solid var(--border-strong); background: var(--bg-surface); border-radius: var(--radius-lg); padding: var(--space-2) 10px var(--space-2) 18px; transition: border-color var(--motion-fast), box-shadow var(--motion-fast); }
.searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--color-brand-100); }
.searchbox > .icon { color: var(--text-tertiary); }
.searchbox input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; font-size: var(--text-md); color: var(--text-primary); }
.searchbox input::placeholder { color: var(--text-tertiary); }
.searchbox button { width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0; color: white; border-radius: 11px; background: var(--accent); }
.searchbox button:hover { background: var(--accent-hover); }
.quick-prompts { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0 var(--space-6); }
.quick-prompts button { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-pill); padding: 7px var(--space-3); font-size: var(--text-xs); min-height: 34px; color: var(--text-secondary); }
.quick-prompts button:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--color-brand-200); }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }
.category-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.category-tabs button { min-height: 40px; padding: 9px 15px; border-radius: var(--radius-pill); color: var(--text-secondary); font-size: 14px; font-weight: 600; white-space: nowrap; }
.category-tabs button:hover { background: var(--color-gray-200); }
.category-tabs button.active { background: var(--color-gray-900); color: white; }
.filter-button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; font-size: var(--text-xs); font-weight: 600; padding: 9px var(--space-3); background: white; border: 1px solid var(--border-default); border-radius: var(--radius-md); white-space: nowrap; }
.filter-button .icon { width: 16px; height: 16px; }
.result-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: 14px; font-size: var(--text-xs); color: var(--text-tertiary); }
.result-meta strong { color: var(--text-secondary); font-weight: 600; }
.result-controls { display: flex; align-items: center; gap: var(--space-3); }
.sort-select { color: var(--text-secondary); background: transparent; border: 0; font-size: var(--text-xs); max-width: 136px; min-height: 32px; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5) var(--space-4); }
.product-card { position: relative; min-width: 0; padding: 10px 10px 15px; background: var(--bg-surface); border: 0; border-radius: 20px; box-shadow: var(--shadow-card); transition: box-shadow var(--motion-fast); }
.product-card:hover { box-shadow: var(--shadow-hover); }
.product-picture { position: relative; width: 100%; display: block; overflow: hidden; aspect-ratio: 1; padding: 0; background: var(--bg-subtle); border: 0; border-radius: 12px; }
.product-card:has(.product-picture.active) { box-shadow: var(--shadow-hover); }
.garment-sprite { display: block; position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 1; background-image: url('./assets/products-contact-sheet.png'); background-size: 400% 300%; background-repeat: no-repeat; transition: transform 240ms ease; }
.product-picture:hover .garment-sprite { transform: scale(1.035); }
.product-badge { position: absolute; left: 7px; top: 7px; z-index: 1; display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--color-green-700); background: rgb(255 255 255 / 95%); padding: 5px 7px; border-radius: 7px; }
.product-badge .icon { width: 12px; height: 12px; }
.product-badge.status-snug { color: var(--color-orange-700); }
.product-badge.status-roomy { color: var(--color-blue-700); }
.product-badge.status-unknown { color: var(--text-secondary); }
.like-button { position: absolute; top: 19px; right: 19px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--text-tertiary); background: rgb(255 255 255 / 95%); }
.like-button .icon { width: 17px; height: 17px; }
.like-button.saved { color: var(--accent); }
.like-button.saved .icon { fill: var(--color-brand-100); }
.picture-cta { position: absolute; bottom: 8px; left: 8px; right: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; background: rgb(255 255 255 / 95%); color: var(--accent); padding: 9px 6px; border-radius: 8px; font-size: var(--text-xs); font-weight: 600; opacity: 0; transform: translateY(5px); transition: opacity var(--motion-fast), transform var(--motion-fast); }
.picture-cta .icon { width: 14px; height: 14px; }
.product-picture:hover .picture-cta, .product-picture:focus-visible .picture-cta, .product-picture.active .picture-cta { opacity: 1; transform: none; }
.product-label { font-size: 11px; color: var(--text-tertiary); margin: 13px 3px 3px; line-height: 1.5; letter-spacing: 0; }
.product-name { display: block; padding: 3px; min-height: 30px; font-size: 14px; font-weight: 600; line-height: 1.5; text-align: left; word-break: keep-all; }
.product-price { font-size: var(--text-lg); font-weight: 750; line-height: 1.5; padding: 2px 3px; letter-spacing: -.4px; }
.available-sizes { margin-left: auto; white-space: nowrap; }
.product-color { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); margin: 7px 3px 0; }
.swatch { width: 10px; height: 10px; flex-shrink: 0; border: 1px solid rgb(0 0 0 / 10%); border-radius: 50%; display: inline-block; }
.product-bottomline { display: flex; align-items: center; justify-content: space-between; gap: var(--space-1); margin: var(--space-2) 3px 0; padding-top: 10px; border-top: 1px solid var(--border-default); }
.product-reason { font-size: 11px; color: var(--text-tertiary); line-height: 1.5; margin: var(--space-2) 3px 0; }
.product-bottomline .product-reason { margin: 0; }
.product-reason .dot { display: inline-block; width: 3px; height: 3px; margin: 0 5px; background: var(--color-gray-400); border-radius: 50%; vertical-align: middle; }
.size-hint { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: var(--space-1) 6px; white-space: nowrap; font-weight: 600; }
.catalog-footer { display: flex; justify-content: space-between; gap: var(--space-5); color: var(--text-tertiary); font-size: var(--text-xs); line-height: 1.7; padding: var(--space-6) 0 0; margin-top: var(--space-6); border-top: 1px solid var(--border-default); }
.catalog-footer button { color: var(--text-secondary); font-size: var(--text-xs); white-space: nowrap; padding: var(--space-1) 0; align-self: flex-start; }
.catalog-footer button:hover { color: var(--accent); }
.footer-note { max-width: 1424px; margin: auto; padding: var(--space-6) var(--space-8); display: flex; justify-content: space-between; gap: var(--space-6); color: var(--text-tertiary); font-size: var(--text-xs); line-height: 1.7; border-top: 1px solid var(--border-default); }

/* Shared actions, feedback and empty states */
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px; padding: var(--space-3) 18px; border-radius: var(--radius-md); font-size: 14px; font-weight: 650; line-height: 1.5; transition: background var(--motion-fast), border-color var(--motion-fast); }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-hover); }
.secondary { border: 1px solid var(--border-default); background: white; color: var(--text-secondary); }
.secondary:hover { background: var(--bg-subtle); border-color: var(--border-strong); }
.primary .icon, .secondary .icon { width: 18px; height: 18px; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 64px var(--space-6); background: white; border: 0; box-shadow: var(--shadow-card); border-radius: var(--radius-xl); color: var(--text-tertiary); }
.empty-state > .icon { width: 32px; height: 32px; }
.empty-state h3 { color: var(--text-primary); font-size: var(--text-xl); font-weight: 700; margin: var(--space-4) 0 10px; }
.empty-state p { font-size: 14px; line-height: 1.8; }
.empty-state button { margin-top: var(--space-6); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 16px); max-width: min(90vw, 560px); background: rgb(37 45 58 / 96%); color: white; border-radius: var(--radius-md); box-shadow: var(--shadow-hover); font-size: var(--text-sm); padding: 14px var(--space-5); line-height: 1.7; text-align: center; z-index: 150; pointer-events: none; opacity: 0; transition: opacity var(--motion-fast), transform var(--motion-fast); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* Dialogs and product detail */
dialog { width: 640px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--border-default); border-radius: var(--radius-xl); background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-dialog); }
dialog::backdrop { background: rgb(24 30 41 / 38%); backdrop-filter: blur(4px); }
dialog.drawer { width: 480px; height: calc(100dvh - 32px); max-height: none; margin: var(--space-4) var(--space-4) var(--space-4) auto; border-radius: var(--radius-xl); }
dialog.wide-modal { width: 920px; }
dialog.wide-modal .taste-heading h2,
dialog.wide-modal .taste-eyebrow,
dialog.wide-modal .taste-close { display: none; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-6); border-bottom: 1px solid var(--border-default); position: sticky; top: 0; z-index: 3; background: rgb(255 255 255 / 98%); }
.modal-header h2 { font-size: 21px; font-weight: 750; letter-spacing: -.7px; word-break: keep-all; }
.modal-header .eyebrow { font-size: var(--text-xs); margin-bottom: 5px; }
.modal-header .icon-button { flex-shrink: 0; }
.modal-body { padding: var(--space-6); }
.modal-body h3 { font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-3); }
.modal-lead { font-size: 14px; color: var(--text-secondary); line-height: 1.8; margin-bottom: var(--space-6); word-break: keep-all; }
.product-detail-top { display: flex; align-items: center; gap: 18px; margin-bottom: var(--space-6); }
.detail-thumbnail { width: 116px; height: 128px; position: relative; flex-shrink: 0; background: var(--bg-subtle); border-radius: var(--radius-md); overflow: hidden; }
.detail-thumbnail .garment-sprite { top: 4%; }
.detail-title { min-width: 0; }
.detail-title .product-label { margin: 0; font-size: 11px; }
.detail-title h3 { font-size: 18px; line-height: 1.5; margin: 6px 0; }
.detail-title > strong { font-size: 18px; }
.detail-title .product-color { font-size: var(--text-xs); margin-left: 0; }
.size-selector { display: flex; gap: var(--space-2); margin: var(--space-3) 0 var(--space-6); }
.size-selector button { flex: 1; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: var(--space-3) var(--space-1); min-height: 64px; font-size: var(--text-md); color: var(--text-secondary); }
.size-selector button.active { border: 2px solid var(--accent); padding: 11px 3px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.size-selector button small { display: block; margin-top: var(--space-1); font-size: 10px; color: var(--accent); font-weight: 600; }
.detail-tabs { display: flex; gap: var(--space-6); border-bottom: 1px solid var(--border-default); margin: var(--space-6) 0; }
.detail-tabs button { color: var(--text-tertiary); border-bottom: 2px solid transparent; padding: 0 0 var(--space-3); font-size: 14px; min-height: 38px; font-weight: 600; }
.detail-tabs button.active { border-color: var(--accent); color: var(--accent); }
.fit-headline { background: var(--accent-soft); border-radius: var(--radius-lg); padding: var(--space-5); margin: var(--space-3) 0 var(--space-5); }
.fit-headline h3 { font-size: 18px; line-height: 1.5; color: var(--text-primary); margin-bottom: var(--space-2); }
.fit-headline p { font-size: var(--text-sm); line-height: 1.8; color: var(--text-secondary); }
.evidence-badge { display: inline-block; font-size: 11px; font-weight: 500; color: var(--accent); background: white; padding: var(--space-1) 7px; border-radius: 6px; margin-bottom: var(--space-3); }
.region-row { padding: var(--space-4) 0; border-bottom: 1px solid var(--border-default); }
.region-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.fit-tag { border-radius: 6px; padding: var(--space-1) 7px; font-size: 11px; font-weight: 500; color: var(--color-green-700); background: var(--color-green-50); }
.fit-tag.snug { color: var(--color-orange-700); background: var(--color-orange-50); }
.fit-tag.roomy { color: var(--color-blue-700); background: var(--color-blue-50); }
.fit-tag.unknown { color: var(--text-secondary); background: var(--bg-subtle); }
.region-compare { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-size: var(--text-xs); color: var(--text-secondary); }
.region-compare strong { font-size: var(--text-xl); font-weight: 750; color: var(--text-primary); }
.compare-bar { height: 5px; border-radius: var(--radius-pill); margin-top: var(--space-3); background: var(--color-gray-100); overflow: hidden; }
.compare-bar span { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--color-brand-600); }
.notes { font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.8; margin: var(--space-4) 0; word-break: keep-all; }
.note-block { background: var(--bg-subtle); border-radius: var(--radius-md); padding: var(--space-4); margin: var(--space-4) 0; font-size: var(--text-sm); line-height: 1.8; color: var(--text-secondary); word-break: keep-all; }
.note-block strong { display: block; font-size: 14px; color: var(--text-primary); margin-bottom: 5px; font-weight: 650; }
.detail-actions { display: flex; gap: var(--space-2); margin: var(--space-6) 0 var(--space-2); }
.detail-actions .primary { flex: 1; }
.detail-actions .secondary { padding: var(--space-3); min-width: 48px; }
.composition-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--border-default); font-size: 14px; }
.composition-row strong { font-size: 16px; }
.fabric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: var(--space-5) 0; }
.fabric-grid > div { padding: var(--space-4); border-radius: var(--radius-md); background: var(--bg-page); }
.fabric-grid span { display: block; font-size: var(--text-xs); color: var(--text-secondary); margin-bottom: var(--space-2); }
.fabric-grid strong { font-size: 14px; font-weight: 650; }
.measure-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.measure-table th { color: var(--text-secondary); font-weight: 500; text-align: left; padding: var(--space-3) 10px; border-bottom: 1px solid var(--border-default); }
.measure-table td { padding: 14px 10px; border-bottom: 1px solid var(--border-default); }
.measure-table .selected { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.compare-grid { display: grid; grid-template-columns: repeat(var(--compare-count, 2), minmax(0, 1fr)); gap: var(--space-4); }

/* Forms and preferences */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5) var(--space-4); }
.field { display: block; margin-bottom: var(--space-1); }
.field > span { display: block; font-size: var(--text-sm); color: var(--text-secondary); font-weight: 600; margin-bottom: 9px; }
.input-unit { position: relative; }
.input-unit input, .field select, .field textarea { width: 100%; min-height: 48px; padding: var(--space-3) 36px var(--space-3) 14px; color: var(--text-primary); background: var(--bg-page); border: 1px solid var(--border-default); border-radius: var(--radius-md); font-size: var(--text-md); }
.input-unit input:focus, .field select:focus, .field textarea:focus { background: white; border-color: var(--accent); }
.input-unit small { position: absolute; right: 14px; top: 14px; color: var(--text-tertiary); font-size: var(--text-sm); }
.field textarea { min-height: 108px; resize: vertical; padding: var(--space-3) 14px; line-height: 1.7; }
.form-divider { border: 0; border-top: 1px solid var(--border-default); margin: var(--space-6) 0; }
.form-actions { display: flex; gap: 10px; margin-top: var(--space-6); }
.form-actions .primary { flex: 1; }
.preset-row { display: flex; flex-wrap: wrap; gap: 7px; margin: var(--space-3) 0 var(--space-6); }
.preset-row button { font-size: var(--text-xs); color: var(--text-secondary); padding: var(--space-2) 10px; min-height: 36px; border-radius: 8px; background: var(--bg-subtle); }
.preset-row button:hover { color: var(--accent); background: var(--accent-soft); }
.check-row { display: flex; align-items: flex-start; gap: 9px; font-size: var(--text-xs); line-height: 1.8; color: var(--text-secondary); margin-top: var(--space-6); }
.check-row input { width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; }
.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: var(--space-3) 0 28px; }
.option-grid label { position: relative; cursor: pointer; text-align: center; font-size: var(--text-sm); font-weight: 600; padding: 18px var(--space-2); border-radius: var(--radius-md); border: 1px solid var(--border-default); background: white; }
.option-grid label:has(input:checked), .feedback-options label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.option-grid input, .feedback-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-grid label:has(input:focus-visible), .feedback-options label:has(input:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.option-grid small { display: block; font-size: 11px; font-weight: 400; color: var(--text-tertiary); margin-top: 6px; line-height: 1.6; }
.range-label { display: flex; justify-content: space-between; gap: var(--space-3); font-size: 14px; color: var(--text-secondary); margin-bottom: var(--space-3); }
.range-label output { color: var(--accent); font-weight: 700; }
.range-group { margin: var(--space-6) 0 var(--space-8); }
.validation-error { font-size: var(--text-sm); color: var(--color-red-600); padding: var(--space-2) 0; line-height: 1.7; }

/* Capture and purchase demo */
.camera-view { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-lg); background: var(--bg-subtle); margin-bottom: var(--space-4); }
.camera-view video { position: absolute; inset: 0; height: 100%; width: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-placeholder { padding: 28px; text-align: center; }
.camera-placeholder > .icon { width: 40px; height: 40px; color: var(--color-gray-400); }
.camera-placeholder p { font-size: var(--text-sm); line-height: 1.8; color: var(--text-secondary); margin-top: var(--space-4); }
.camera-outline { position: absolute; inset: 10% 30%; border: 2px dashed rgb(255 255 255 / 75%); border-radius: 40% 40% 15% 15%; pointer-events: none; }
.camera-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: var(--space-5) 0; }
.camera-slot { display: grid; place-items: center; position: relative; overflow: hidden; aspect-ratio: 3 / 4; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--bg-page); color: var(--color-gray-400); }
.camera-slot img { width: 100%; height: 100%; object-fit: cover; }
.camera-slot span { position: absolute; bottom: 8px; padding: 3px var(--space-2); background: white; border-radius: var(--radius-pill); color: var(--text-secondary); font-size: 11px; }
.camera-slot button { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; background: white; color: var(--text-secondary); border-radius: 50%; font-size: var(--text-xl); }
.camera-error { color: var(--color-red-600); font-size: var(--text-sm); line-height: 1.8; margin-bottom: var(--space-3); }
.upload-label { cursor: pointer; }
.step-count { font-size: var(--text-sm); font-weight: 650; color: var(--accent); margin-bottom: 10px; }
.checkout-summary { background: var(--bg-page); border-radius: var(--radius-lg); padding: var(--space-5); margin-bottom: var(--space-5); }
.checkout-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: 10px 0; font-size: 14px; }
.checkout-row.total { border-top: 1px solid var(--border-default); margin-top: var(--space-3); padding-top: 18px; font-size: 18px; font-weight: 700; }
.success-mark { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin: var(--space-3) auto var(--space-6); }
.success-mark .icon { width: 32px; height: 32px; stroke-width: 2.3; }
.receipt-id { font-size: var(--text-xs); color: var(--text-tertiary); margin: 14px 0 var(--space-6); }
.feedback-options { display: flex; gap: var(--space-2); margin: var(--space-3) 0 var(--space-6); }
.feedback-options label { position: relative; flex: 1; padding: 13px 6px; min-height: 48px; text-align: center; font-size: var(--text-sm); font-weight: 600; border: 1px solid var(--border-default); border-radius: var(--radius-md); cursor: pointer; }
.about-list { padding-left: var(--space-5); color: var(--text-secondary); font-size: 14px; line-height: 2; }
.mobile-profile-button { display: none; }

/* Responsive layouts */
@media (min-width: 1450px) {
  .workspace { grid-template-columns: 320px minmax(0, 1fr); gap: var(--space-8); }
  .avatar-stage { height: 350px; }
  .product-grid { gap: var(--space-6) var(--space-5); }
  .product-name { font-size: var(--text-md); }
}
@media (max-width: 1180px) {
  .brand-caption, .brand small { display: none; }
  .journey { display: none; }
  .workspace { grid-template-columns: 284px minmax(0, 1fr); gap: var(--space-6); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-intro { padding: var(--space-5); }
  .category-tabs button { padding: var(--space-2) var(--space-3); }
}
@media (max-width: 820px) {
  .topbar { padding: 0 var(--space-6); gap: var(--space-4); }
  .status-dot { display: none; }
  .page { padding: 28px var(--space-6) 36px; }
  .workspace { grid-template-columns: 250px minmax(0, 1fr); gap: var(--space-5); }
  .room-head { padding: 18px var(--space-4) 14px; }
  .agent-intro h2 { font-size: var(--text-lg); }
  .agent-intro { padding: 18px; gap: 10px; }
  .agent-mark { width: 36px; height: 36px; border-radius: 12px; }
  .catalog-heading { flex-wrap: wrap; }
  .category-tabs { gap: 3px; }
  .category-tabs button { font-size: var(--text-sm); }
  .filter-button { padding: var(--space-2); }
  .product-grid { gap: var(--space-4) var(--space-3); }
  .product-badge { font-size: 10px; left: 5px; top: 5px; }
  .product-badge .icon { display: none; }
  .product-bottomline { flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .topbar { min-height: 68px; flex-wrap: wrap; padding: var(--space-4) var(--space-5) 0; column-gap: var(--space-3); row-gap: var(--space-3); }
  .brand { flex: 1; gap: var(--space-2); }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .wordmark { font-size: 24px; letter-spacing: -.8px; }
  .header-actions { gap: var(--space-1); }
  .header-actions .icon-button { min-width: 36px; min-height: 36px; }
  .profile-bubble { height: 36px; width: 36px; }
  .nav { order: 3; width: 100%; justify-content: space-between; gap: var(--space-2); padding-bottom: 10px; }
  .nav button { flex: 1; padding: 9px var(--space-2); min-height: 40px; font-size: var(--text-sm); border-radius: 10px; }
  .page { padding: 28px var(--space-5) var(--space-8); }
  .page-intro { margin-bottom: var(--space-6); }
  h1 { font-size: 28px; line-height: 1.4; letter-spacing: -1px; }
  .eyebrow { font-size: var(--text-xs); }
  .intro-note { font-size: 14px; margin-top: var(--space-2); }
  .workspace { display: block; }
  .fitting-column { position: static; margin-bottom: 28px; }
  .fitting-room { display: grid; grid-template-columns: 138px minmax(0, 1fr); grid-template-rows: auto auto auto; border-radius: 20px; }
  .room-head { grid-column: 1 / -1; padding: var(--space-4); gap: var(--space-3); }
  .room-head h2 { font-size: 16px; flex: 1; }
  .room-head small { font-size: 10px; }
  .room-tabs { width: auto; gap: 2px; padding: 3px; }
  .room-tabs button { font-size: 11px; min-height: 30px; padding: 6px var(--space-2); white-space: nowrap; }
  .avatar-stage { grid-column: 1; grid-row: 2 / 4; height: 196px; }
  .avatar-stage .model-img { padding-bottom: 42px; }
  .avatar-disclaimer { left: 5px; right: 5px; bottom: 5px; font-size: 10px; line-height: 1.45; padding: 3px; }
  .stage-label, .stage-switch { display: none; }
  .body-summary { grid-column: 2; padding: var(--space-5) 6px; align-items: center; }
  .body-summary small { font-size: 11px; }
  .body-summary strong { font-size: var(--text-xl); }
  .body-summary em { display: block; font-size: 10px; margin: var(--space-1) 0 0; }
  .body-edit { grid-column: 2; align-self: end; min-height: 58px; padding: var(--space-3) 9px; font-size: 11px; line-height: 1.7; gap: 5px; }
  .body-edit .icon { width: 14px; height: 14px; }
  .body-edit .icon:last-child { display: none; }
  .profile-card { padding: var(--space-4); margin-top: var(--space-3); }
  .profile-card .section-title { margin-bottom: var(--space-2); }
  .profile-footnote, .fit-peek { display: none; }
  .chip { font-size: 11px; padding: 6px var(--space-2); }
  .agent-intro { padding: 18px; border-radius: 20px; margin-bottom: var(--space-4); gap: var(--space-3); }
  .agent-intro h2 { font-size: var(--text-lg); line-height: 1.5; }
  .agent-intro p { font-size: var(--text-xs); }
  .agent-mark { width: 34px; height: 34px; font-size: 24px; border-radius: 11px; }
  .agent-mark .icon { width: 20px; height: 20px; }
  .searchbox { min-height: 56px; padding-left: 14px; gap: 9px; }
  .searchbox input { font-size: 14px; }
  .searchbox > .icon { width: 18px; height: 18px; }
  .searchbox button { height: 38px; width: 38px; }
  .quick-prompts { gap: 6px; margin: 10px 0 var(--space-5); }
  .quick-prompts button { font-size: 11px; padding: 7px 9px; }
  .catalog-heading { flex-wrap: nowrap; gap: var(--space-2); margin-bottom: var(--space-4); }
  .category-tabs { flex-wrap: nowrap; gap: 1px; }
  .category-tabs button { font-size: var(--text-xs); min-height: 36px; padding: 7px 10px; }
  .filter-button { font-size: 0; min-height: 36px; width: 36px; padding: var(--space-2); flex-shrink: 0; }
  .filter-button .icon { width: 17px; height: 17px; }
  .result-meta { gap: 6px; font-size: 11px; flex-wrap: wrap; }
  .result-controls { gap: 6px; }
  .sort-select { font-size: 11px; max-width: 124px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .product-card { padding: 6px 6px var(--space-3); border-radius: 16px; }
  .product-picture { border-radius: 10px; aspect-ratio: 1 / 1.12; }
  .garment-sprite { top: 5%; }
  .product-badge { top: 5px; left: 5px; font-size: 10px; padding: var(--space-1) 5px; border-radius: 5px; }
  .like-button { width: 28px; height: 28px; top: 13px; right: 13px; }
  .like-button .icon { width: 15px; height: 15px; }
  .picture-cta { font-size: 10px; padding: 6px 3px; left: 5px; right: 5px; bottom: 5px; }
  .product-label { font-size: 10px; margin-top: 10px; }
  .product-name { font-size: var(--text-sm); min-height: 42px; padding: 3px; }
  .product-price { font-size: 16px; }
  .product-color, .product-reason, .size-hint { font-size: 10px; }
  .product-bottomline { gap: 6px; margin-top: var(--space-2); padding-top: var(--space-2); }
  .catalog-footer { display: block; font-size: 11px; margin-top: var(--space-6); }
  .catalog-footer button { display: block; margin-top: var(--space-3); font-size: var(--text-xs); }
  .footer-note { display: block; padding: var(--space-6) var(--space-5); font-size: 11px; }
  .footer-note span { display: block; margin-bottom: 6px; }
  dialog { max-width: calc(100vw - 24px); border-radius: 20px; }
  dialog.drawer { width: calc(100vw - 16px); max-width: calc(100vw - 16px); height: calc(100dvh - 16px); margin: var(--space-2); border-radius: 20px; }
  .modal-header { padding: var(--space-5); gap: var(--space-3); }
  .modal-header h2 { font-size: var(--text-xl); }
  .modal-body { padding: var(--space-5); }
  .modal-lead { font-size: var(--text-sm); }
  .detail-thumbnail { width: 100px; height: 114px; }
  .product-detail-top { gap: 14px; }
  .detail-title h3 { font-size: 16px; }
  .form-grid { gap: var(--space-4) var(--space-3); }
  .input-unit input, .field select, .field textarea { font-size: 16px; }
  .field > span { font-size: var(--text-xs); }
  .option-grid { gap: 7px; }
  .option-grid label { font-size: var(--text-xs); padding: var(--space-4) 6px; }
  .option-grid small { font-size: 10px; word-break: keep-all; }
  .primary, .secondary { font-size: var(--text-sm); padding: var(--space-3) 14px; }
  .range-label { font-size: var(--text-sm); }
  .fit-headline { padding: var(--space-4); }
  .fit-headline h3 { font-size: var(--text-lg); }
  .region-compare { font-size: 11px; gap: 5px; }
  .region-compare strong { font-size: 19px; }
  .camera-placeholder { padding: var(--space-5); }
  .camera-placeholder p { font-size: var(--text-xs); }
  .about-list { font-size: var(--text-sm); }
  .form-actions { flex-wrap: wrap; }
}
@media (max-width: 360px) {
  .page, .topbar { padding-left: var(--space-4); padding-right: var(--space-4); }
  h1 { font-size: 26px; }
  .fitting-room { grid-template-columns: 116px minmax(0, 1fr); }
  .room-head { gap: var(--space-2); padding: 14px var(--space-3); }
  .room-head h2 { font-size: 14px; }
  .room-head small { display: none; }
  .room-tabs button { padding: 6px; }
  .body-summary strong { font-size: 18px; }
  .category-tabs button { padding-left: var(--space-2); padding-right: var(--space-2); }
  .product-badge { font-size: 10px; padding: var(--space-1); }
  .like-button { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
