:root {
  --bg: #111111;
  --panel: #181818;
  --panel-soft: #202020;
  --panel-raised: #252525;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f2ea;
  --muted: #9b9b98;
  --dim: #6c6c69;
  --accent: #e8c98d;
  --accent-dark: #9f8350;
  --green: #8bd3a9;
  --danger: #e49b8d;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* Phase 10.5 wardrobe-ingestion review panel. */
.wardrobe-upload-panel {
  display: grid;
  gap: 18px;
  margin: -10px 0 24px;
  padding: 22px;
  border: 1px solid rgba(145, 133, 114, .25);
  border-radius: 22px;
  background: rgba(255, 252, 247, .82);
  box-shadow: 0 18px 45px rgba(78, 66, 50, .08);
}
.wardrobe-upload-panel.hidden { display: none; }
.wardrobe-upload-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.wardrobe-upload-header h3 { margin: 2px 0 6px; color: var(--catalog-ink); font-size: clamp(20px, 2vw, 28px); letter-spacing: -.03em; }
.wardrobe-upload-header .muted { max-width: 620px; margin: 0; line-height: 1.5; }
.upload-status { flex: none; padding: 7px 11px; border: 1px solid rgba(145, 133, 114, .24); border-radius: 999px; color: #625a50; background: rgba(255, 255, 255, .72); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.upload-status-processing, .upload-status-queued, .upload-status-cancelling { color: #795f2c; background: #f8efd8; border-color: #dfc58f; }
.upload-status-review { color: #5b563d; background: #f5edca; border-color: #d8c77d; }
.upload-status-complete { color: #3e684d; background: #e4f0e6; border-color: #b9d6bd; }
.upload-status-failed { color: #8a463e; background: #fae7e2; border-color: #e0b4aa; }
.upload-status-cancelled { color: #716a61; background: #eeece8; border-color: #d4cec4; }
.upload-status-rejected { color: #75604d; background: #f1e9df; border-color: #d8c5ad; }
.wardrobe-upload-body { min-height: 92px; }
.media-artifact-list { display: grid; gap: 12px; }
.media-artifact-card { display: grid; grid-template-columns: minmax(116px, 156px) minmax(0, 1fr); gap: 16px; align-items: stretch; padding: 12px; border: 1px solid rgba(145, 133, 114, .2); border-radius: 17px; background: rgba(255, 255, 255, .72); }
.media-artifact-card.is-rejected { opacity: .7; }
.media-artifact-preview { position: relative; min-height: 156px; overflow: hidden; border-radius: 12px; background: linear-gradient(145deg, #eee9e0, #faf8f3); }
.media-artifact-preview img, .media-source-preview img { display: block; width: 100%; height: 100%; min-height: 156px; object-fit: contain; }
.media-artifact-preview img.is-unavailable { display: none; }
.media-preview-fallback { display: none; position: absolute; inset: 0; place-items: center; padding: 14px; color: #8a8174; font-size: 11px; text-align: center; }
.media-artifact-preview img + .media-preview-fallback { display: grid; }
.media-artifact-preview img:not(.is-unavailable) + .media-preview-fallback { display: none; }
.media-artifact-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; padding: 5px 4px 4px 0; color: #756c60; font-size: 12px; line-height: 1.4; }
.media-artifact-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; width: 100%; }
.media-artifact-heading strong { color: var(--catalog-ink); font-size: 16px; }
.media-artifact-copy p { margin: 0; color: #625a50; }
.media-observations { color: #877c6f; font-size: 11px; }
.media-warnings { color: #8b6c39; font-size: 11px; }
.media-artifact-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.media-artifact-actions .primary-button, .media-artifact-actions .text-button { min-height: 34px; padding: 7px 11px; font-size: 11px; }
.media-review-note { color: #5d725e; font-size: 11px; font-weight: 700; }
.media-inventory-summary { display: grid; gap: 7px; padding: 17px; border: 1px dashed rgba(145, 133, 114, .35); border-radius: 14px; color: #756c60; font-size: 12px; }
.media-inventory-summary strong { color: var(--catalog-ink); font-size: 15px; }
.media-source-preview { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px; align-items: center; color: #756c60; font-size: 12px; }
.media-source-preview img { width: 116px; height: 116px; min-height: 0; border-radius: 12px; background: #f2eee6; }
.media-upload-placeholder { display: flex; align-items: center; gap: 10px; min-height: 92px; color: #776f64; }
.media-upload-placeholder strong { color: var(--catalog-ink); }
.media-upload-placeholder > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-upload-spinner { width: 17px; height: 17px; flex: none; border: 2px solid rgba(145, 133, 114, .25); border-top-color: #8b7653; border-radius: 50%; animation: wardrobe-upload-spin .8s linear infinite; }
@keyframes wardrobe-upload-spin { to { transform: rotate(360deg); } }
.wardrobe-upload-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-height: 34px; }
.wardrobe-upload-feedback { min-height: 18px; margin: 0; color: #5e685b; font-size: 12px; line-height: 1.45; }
.wardrobe-upload-feedback.is-error { color: #8a463e; }

@media (max-width: 760px) {
  .wardrobe-upload-panel { gap: 14px; margin: -4px 0 18px; padding: 15px; border-radius: 18px; }
  .wardrobe-upload-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .wardrobe-upload-header h3 { font-size: 20px; }
  .wardrobe-upload-header .muted { font-size: 12px; }
  .upload-status { padding: 6px 8px; font-size: 9px; }
  .media-artifact-card { grid-template-columns: 92px minmax(0, 1fr); gap: 11px; padding: 9px; border-radius: 14px; }
  .media-artifact-preview { min-height: 112px; }
  .media-artifact-preview img { min-height: 112px; }
  .media-artifact-copy { padding: 2px 2px 2px 0; font-size: 11px; }
  .media-artifact-heading strong { font-size: 14px; }
  .media-artifact-copy p { font-size: 11px; }
  .media-observations, .media-warnings { font-size: 10px; }
  .media-artifact-actions { gap: 5px; padding-top: 5px; }
  .media-artifact-actions .primary-button, .media-artifact-actions .text-button { min-height: 31px; padding: 6px 8px; font-size: 10px; }
  .media-source-preview { grid-template-columns: 88px minmax(0, 1fr); gap: 10px; }
  .media-source-preview img { width: 88px; height: 88px; }
  .wardrobe-upload-actions { gap: 7px; }
  .wardrobe-upload-actions button { min-height: 34px; padding: 7px 10px; font-size: 11px; }
}

/* Phase 4: light editorial dashboard shell and floating wardrobe studio. */
:root {
  --text: #1b1a18;
  --muted: #77736b;
  --dim: #a19b91;
  --line: #ddd6cb;
  --panel: #fffdfa;
  --panel-soft: #f7f2e9;
  --panel-raised: #ffffff;
  --accent: #9a835c;
}

body { background: #f2eee6; color: var(--text); }
.app-shell { min-height: 100vh; background: #f2eee6; }
.sidebar { width: 88px; align-items: center; padding: 24px 14px; background: #f2eee6; border-right: 1px solid #ddd6cb; }
.brand-mark { width: 42px; height: 42px; margin: 0; border-color: #b4a88f; color: #6c604b; background: rgba(255,255,255,.38); border-radius: 14px; }
.brand-copy { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav-list { width: 100%; gap: 9px; margin-top: 48px; }
.nav-item { position: relative; display: grid; place-items: center; width: 58px; height: 58px; padding: 0; border-radius: 17px; color: #898278; text-align: center; cursor: pointer; }
.nav-item:hover, .nav-item:focus-visible { color: #282621; background: rgba(255,255,255,.58); outline: none; }
.nav-item.active { color: #6c604b; background: rgba(255,255,255,.84); box-shadow: 0 8px 22px rgba(76,67,54,.08); }
.nav-item::after { content: attr(data-tooltip); position: absolute; left: calc(100% + 13px); top: 50%; z-index: 30; transform: translateY(-50%) translateX(-4px); padding: 7px 9px; border: 1px solid #d8d0c4; border-radius: 8px; color: #302d28; background: rgba(255,253,250,.96); box-shadow: 0 8px 20px rgba(76,67,54,.12); opacity: 0; pointer-events: none; white-space: nowrap; font-size: 11px; transition: opacity .16s ease, transform .16s ease; }
.nav-item:hover::after, .nav-item:focus-visible::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.nav-icon { display: grid; place-items: center; width: 25px; height: 25px; font-size: 22px; line-height: 1; font-family: Georgia, serif; }
.nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sidebar-footer { width: 100%; display: grid; justify-items: center; gap: 12px; padding: 0; color: #aaa398; }
.sidebar-footer .nav-settings { margin-bottom: 4px; }
.sidebar-footer > span:last-child { display: none; }
.status-dot { width: 6px; height: 6px; }
.main-content { max-width: none; padding: 34px 48px 70px; }
.topbar { align-items: center; }
.topbar .eyebrow { color: #918778; }
.topbar h1 { color: #26231f; }
.icon-button, .profile-pill { border-color: #ddd6cb; background: rgba(255,255,255,.48); color: #403b34; }
.profile-pill { box-shadow: 0 6px 18px rgba(76,67,54,.05); }
.avatar { background: #d6cfbf; color: #413a2e; }
.context-bar { border-color: #ddd6cb; background: rgba(255,255,255,.52); color: #302d28; box-shadow: 0 10px 28px rgba(76,67,54,.05); }
.context-copy span, .context-copy div { color: #77736b; }
.weather-icon { color: #6c604b; background: rgba(173,157,124,.16); }

.wardrobe-catalog-panel .tryon-studio {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  width: min(610px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 28px;
  color: var(--catalog-ink);
  background: rgba(248,245,238,.73);
  backdrop-filter: blur(18px) saturate(118%);
  -webkit-backdrop-filter: blur(18px) saturate(118%);
  box-shadow: 0 22px 60px rgba(65,56,45,.2), inset 0 1px rgba(255,255,255,.8);
  transition: opacity .22s ease, transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear 0s;
}
.wardrobe-catalog-panel .tryon-studio.is-positioned { right: auto; bottom: auto; }
.wardrobe-catalog-panel .tryon-studio.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(calc(100% + 40px)) translateY(10px); transition: opacity .18s ease, transform .24s ease, visibility 0s linear .24s; }
.studio-drag-handle { display: flex; align-items: center; justify-content: center; gap: 4px; width: 62px; height: 18px; margin: -9px auto 5px; padding: 0; border: 0; border-radius: 999px; background: transparent; cursor: grab; touch-action: none; }
.studio-drag-handle:active, .studio-drag-handle.is-dragging { cursor: grabbing; }
.studio-drag-handle span { width: 4px; height: 4px; border-radius: 50%; background: #b8b0a4; }
.studio-drag-handle:hover span, .studio-drag-handle:focus-visible span { background: #776d5e; }
.studio-icon-button { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(120,111,97,.24); border-radius: 50%; color: #37322b; background: rgba(255,255,255,.56); font-size: 20px; line-height: 1; cursor: pointer; }
.studio-icon-button:hover, .studio-icon-button:focus-visible { border-color: #968567; background: rgba(255,255,255,.88); outline: none; }
.wardrobe-catalog-panel .studio-header { align-items: center; }
.wardrobe-catalog-panel .studio-header h3 { font-size: 24px; }
.studio-content { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 13px; align-items: stretch; }
.studio-preview-column { min-width: 0; }
.wardrobe-catalog-panel .tryon-selection { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-height: 0; max-height: 405px; margin: 10px 0 0; overflow-y: auto; scrollbar-width: thin; }
.selection-rail-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 3px 3px; color: #756d61; text-transform: uppercase; letter-spacing: .12em; font-size: 8px; }
.selection-rail-heading b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #665c4c; background: rgba(173,157,124,.2); font-size: 9px; }
.wardrobe-catalog-panel .selection-chip { position: relative; display: grid; grid-template-columns: 1fr; gap: 3px; width: 66px; min-height: 70px; padding: 4px; border: 1px solid rgba(145,133,114,.22); border-radius: 12px; color: #746c60; background: rgba(255,255,255,.4); cursor: pointer; text-align: left; }
.wardrobe-catalog-panel .selection-chip:hover, .wardrobe-catalog-panel .selection-chip:focus-visible { border-color: #a18d68; background: rgba(255,255,255,.78); outline: none; }
.selection-chip-image { display: block; width: 56px; height: 48px; overflow: hidden; border-radius: 8px; background: rgba(255,255,255,.48); }
.selection-chip-image-src { width: 100%; height: 100%; padding: 2px; object-fit: contain; }
.selection-chip-copy { display: grid; gap: 1px; min-width: 0; }
.selection-chip-copy b { color: #968567; font-size: 7px; letter-spacing: .08em; }
.selection-chip-copy span { overflow: hidden; color: #625b51; font-size: 8px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.selection-chip > i { position: absolute; top: 3px; right: 4px; color: #8b8173; font-size: 12px; font-style: normal; opacity: 0; }
.selection-chip:hover > i, .selection-chip:focus-visible > i { opacity: 1; }
.selection-clear { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 5px 2px; border: 0; color: #81786b; background: transparent; font: inherit; font-size: 8px; cursor: pointer; }
.selection-clear:hover, .selection-clear:focus-visible { color: #3e382f; outline: none; }
.selection-clear > span:first-child { display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; }
.selection-empty { display: grid; align-content: center; min-height: 100px; color: #9c9386; text-align: center; font-size: 9px; line-height: 1.4; }
.selection-empty small { color: #b0a79b; font-size: 8px; }
.wardrobe-catalog-panel .tryon-stage { height: 405px; margin: 8px 0 9px; border: 1px solid rgba(145,133,114,.16); border-radius: 20px; background: rgba(255,255,255,.26); }
.wardrobe-catalog-panel .tryon-stage.has-generated-media { height: auto; aspect-ratio: 3 / 4; }
.wardrobe-catalog-panel .tryon-stage.is-reference { background: radial-gradient(circle at 50% 24%, rgba(255,255,255,.74), rgba(236,228,216,.33)); }
.wardrobe-catalog-panel .tryon-stage .stage-label { top: 10px; left: 12px; color: #9a9185; font-size: 8px; }
.wardrobe-catalog-panel .studio-controls { display: none; }
.wardrobe-catalog-panel .studio-media-controls { min-height: 34px; margin: 0 0 8px; padding: 4px 0; }
.wardrobe-catalog-panel .studio-media-note { color: #81786b; font-size: 9px; line-height: 1.35; }
.wardrobe-catalog-panel .studio-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.wardrobe-catalog-panel .studio-action-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; padding: 9px 7px; border: 1px solid rgba(145,133,114,.24); border-radius: 12px; color: #4d463d; background: rgba(255,255,255,.48); font: inherit; font-size: 9px; cursor: pointer; }
.wardrobe-catalog-panel .studio-action-button:hover, .wardrobe-catalog-panel .studio-action-button:focus-visible { border-color: #9a835c; background: rgba(255,255,255,.88); outline: none; }
.wardrobe-catalog-panel .studio-actions #studio-render { color: #f7f2e9; background: #292722; border-color: #292722; }
.wardrobe-catalog-panel .studio-actions #studio-render:hover, .wardrobe-catalog-panel .studio-actions #studio-render:focus-visible { color: #292722; background: #d5c3a1; border-color: #d5c3a1; }
.action-icon { display: grid; place-items: center; width: 18px; height: 18px; font-size: 15px; line-height: 1; }
.wardrobe-catalog-panel .tryon-studio .video-generation-control { grid-template-columns: minmax(0, 1fr) auto; }
.wardrobe-catalog-panel .video-engine-select select { border-radius: 10px; background: rgba(255,255,255,.48); }
.wardrobe-catalog-panel .video-generation-control .text-button { padding: 7px 9px; border: 1px solid rgba(145,133,114,.24); border-radius: 10px; color: #4d463d; background: rgba(255,255,255,.48); font-size: 9px; }
.wardrobe-catalog-panel .video-generation-control .text-button:hover { background: rgba(255,255,255,.86); }
.tryon-launcher { border-radius: 999px; }

@media (max-width: 760px) {
  .sidebar { width: 100%; height: 72px; padding: 9px 12px; border-right: 0; border-bottom: 1px solid #ddd6cb; display: flex; flex-direction: row; align-items: center; gap: 9px; overflow: hidden; }
  .brand-mark { flex: 0 0 auto; width: 38px; height: 38px; }
  .nav-list { display: flex; flex: 1; gap: 4px; width: auto; margin: 0; overflow-x: auto; }
  .nav-item { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 13px; }
  .nav-item::after { top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(-4px); }
  .nav-item:hover::after, .nav-item:focus-visible::after { transform: translateX(-50%) translateY(0); }
  .sidebar-footer { width: auto; display: flex; flex: 0 0 auto; }
  .sidebar-footer .nav-settings { margin: 0; }
  .sidebar-footer .status-dot { display: none; }
  .main-content { padding: 24px 16px 50px; }
  .wardrobe-catalog-panel .tryon-studio { left: 12px; right: 12px; bottom: 12px; width: auto; max-height: calc(100vh - 24px); padding: 14px; border-radius: 24px; }
  .wardrobe-catalog-panel .tryon-studio.is-positioned { left: auto; right: auto; width: min(320px, calc(100vw - 24px)); }
  .studio-content { grid-template-columns: 58px minmax(0, 1fr); gap: 9px; }
  .wardrobe-catalog-panel .tryon-selection { max-height: 320px; }
  .wardrobe-catalog-panel .selection-chip { width: 54px; min-height: 62px; }
  .selection-chip-image { width: 44px; height: 42px; }
  .wardrobe-catalog-panel .tryon-stage { height: 320px; }
  .wardrobe-catalog-panel .tryon-stage.has-generated-media { aspect-ratio: 3 / 4; }
  .wardrobe-catalog-panel .studio-actions { gap: 5px; }
  .wardrobe-catalog-panel .studio-action-button { padding: 8px 4px; font-size: 8px; }
}

/* Final shell pass: keep the icon rail and category bar above all legacy dashboard rules. */
.sidebar { width: 58px; padding: 16px 8px; background: #f2eee6; }
.brand-mark { width: 30px; height: 30px; margin: 0; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #8e877c; }
.brand-mark:hover, .brand-mark:focus-visible { background: rgba(255,255,255,.58); outline: none; }
.nav-list { gap: 7px; margin-top: 36px; }
.nav-item { width: 40px; height: 40px; border-radius: 11px; }
.nav-icon { width: 20px; height: 20px; font-size: 17px; }
.sidebar-footer { gap: 9px; }
.sidebar-footer .nav-settings { width: 40px; height: 40px; }
.app-shell.sidebar-collapsed .sidebar { width: 44px; padding-inline: 5px; }
.app-shell.sidebar-collapsed .nav-item, .app-shell.sidebar-collapsed .sidebar-footer .nav-settings { width: 34px; height: 34px; }
.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-list,
.app-shell.sidebar-collapsed .sidebar-footer { visibility: hidden; opacity: 0; pointer-events: none; }
#menu-toggle { position: relative; z-index: 50; pointer-events: auto; }
body[data-view="wardrobe"] .topbar, body[data-view="wardrobe"] .context-bar { display: none; }
body[data-view="wardrobe"] .main-content { max-width: none; padding: 0 48px 70px; }
.wardrobe-catalog-panel .wardrobe-topnav { display: flex; align-items: center; gap: 0; height: 56px; margin: -42px -48px 34px; padding: 0 24px; border-bottom: 1px solid var(--catalog-line); background: rgba(242,238,230,.92); color: var(--catalog-muted); }
.topnav-menu, .topnav-category, .topnav-utility { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; height: 55px; border: 0; color: inherit; background: transparent; cursor: pointer; }
.topnav-menu { width: 28px; color: #827a6e; }
.topnav-divider { height: 34px; margin: 0 20px 0 10px; border-left: 1px solid var(--catalog-line); }
.topnav-category { position: relative; flex-direction: column; gap: 2px; min-width: 58px; padding: 4px 9px 0; text-transform: uppercase; letter-spacing: .1em; font-size: 8px; }
.topnav-category::after { content: ""; position: absolute; right: 9px; bottom: -1px; left: 9px; border-bottom: 1px solid transparent; }
.topnav-category:hover, .topnav-category:focus-visible, .topnav-category.active { color: var(--catalog-ink); outline: none; }
.topnav-category.active::after { border-color: var(--catalog-ink); }
.topnav-icon { display: grid; place-items: center; height: 19px; color: currentColor; font-family: Georgia, serif; font-size: 18px; line-height: 1; }
.topnav-icon-all { font-size: 13px; }
.topnav-spacer { flex: 1 1 auto; }
.topnav-utility { width: 38px; height: 55px; font-family: Georgia, serif; font-size: 19px; }
.topnav-utility:hover, .topnav-utility:focus-visible { color: var(--catalog-ink); background: rgba(255,255,255,.38); outline: none; }
.wardrobe-catalog-panel .studio-content { grid-template-columns: 76px minmax(0, 1fr) 76px; gap: 9px; }
.wardrobe-catalog-panel .tryon-selection-right .selection-rail-heading { position: relative; display: block; min-height: 20px; padding: 0 21px 3px 0; white-space: nowrap; overflow: visible; }
.wardrobe-catalog-panel .tryon-selection-right .selection-rail-heading span { display: block; overflow: hidden; text-overflow: ellipsis; }
.wardrobe-catalog-panel .tryon-selection-right .selection-rail-heading b { position: absolute; top: 0; right: 0; flex: none; }
@media (max-width: 760px) {
  .app-shell.sidebar-collapsed .sidebar { width: 100%; height: 58px; padding: 9px 12px; }
  .app-shell.sidebar-collapsed .nav-list,
  .app-shell.sidebar-collapsed .sidebar-footer { display: none; }
  .app-shell.sidebar-collapsed .brand-copy { display: none; }
  body[data-view="wardrobe"] .main-content { padding: 0 16px 50px; }
  .wardrobe-catalog-panel .wardrobe-topnav { height: 50px; margin: -10px -16px 28px; padding: 0 9px; overflow: hidden; }
  .topnav-divider { margin-inline: 8px; }
  .topnav-category { min-width: 48px; padding-inline: 3px; font-size: 7px; }
  .topnav-utility { width: 28px; }
  .wardrobe-catalog-panel .studio-content { grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 7px; }
}

/* Editorial dashboard shell: image 1's icon rail and image 2's compact wardrobe bar. */
.sidebar {
  width: 58px;
  padding: 16px 8px;
  background: #f2eee6;
}
.brand-mark {
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8e877c;
}
.brand-mark:hover, .brand-mark:focus-visible { background: rgba(255,255,255,.58); outline: none; }
.brand-menu-icon, .topnav-menu-icon {
  position: relative;
  display: block;
  width: 13px;
  height: 9px;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}
.brand-menu-icon::after, .topnav-menu-icon::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  width: 13px;
  border-top: 1px solid currentColor;
}
.nav-list { gap: 7px; margin-top: 36px; }
.nav-item { width: 40px; height: 40px; border-radius: 11px; }
.nav-icon { width: 20px; height: 20px; font-size: 17px; }
.sidebar-footer { gap: 9px; }
.sidebar-footer .nav-settings { width: 40px; height: 40px; }
.app-shell.sidebar-collapsed .sidebar { width: 44px; padding-inline: 5px; }
.app-shell.sidebar-collapsed .nav-item, .app-shell.sidebar-collapsed .sidebar-footer .nav-settings { width: 34px; height: 34px; }

body[data-view="wardrobe"] .topbar,
body[data-view="wardrobe"] .context-bar { display: none; }
body[data-view="wardrobe"] .main-content { max-width: none; padding: 0 48px 70px; }
.wardrobe-catalog-panel .wardrobe-topnav {
  display: flex;
  align-items: center;
  gap: 0;
  height: 56px;
  margin: -10px -48px 34px;
  padding: 0 24px;
  border-bottom: 1px solid var(--catalog-line);
  background: rgba(242,238,230,.92);
  color: var(--catalog-muted);
}
.topnav-menu, .topnav-category, .topnav-utility {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 55px;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.topnav-menu { width: 28px; color: #827a6e; }
.topnav-divider { height: 34px; margin: 0 20px 0 10px; border-left: 1px solid var(--catalog-line); }
.topnav-category {
  position: relative;
  flex-direction: column;
  gap: 2px;
  min-width: 58px;
  padding: 4px 9px 0;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 8px;
}
.topnav-category::after {
  content: "";
  position: absolute;
  right: 9px;
  bottom: -1px;
  left: 9px;
  border-bottom: 1px solid transparent;
}
.topnav-category:hover, .topnav-category:focus-visible, .topnav-category.active { color: var(--catalog-ink); outline: none; }
.topnav-category.active::after { border-color: var(--catalog-ink); }
.topnav-icon { display: grid; place-items: center; height: 19px; color: currentColor; font-family: Georgia, serif; font-size: 18px; line-height: 1; }
.topnav-icon-all { font-size: 13px; }
.topnav-spacer { flex: 1 1 auto; }
.topnav-utility { width: 38px; height: 55px; font-family: Georgia, serif; font-size: 19px; }
.topnav-utility:hover, .topnav-utility:focus-visible { color: var(--catalog-ink); background: rgba(255,255,255,.38); outline: none; }

.wardrobe-catalog-panel .studio-content { grid-template-columns: 76px minmax(0, 1fr) 76px; gap: 9px; }
.wardrobe-catalog-panel .tryon-selection-right .selection-rail-heading { position: relative; display: block; min-height: 20px; padding: 0 21px 3px 0; white-space: nowrap; overflow: visible; }
.wardrobe-catalog-panel .tryon-selection-right .selection-rail-heading span { display: block; overflow: hidden; text-overflow: ellipsis; }
.wardrobe-catalog-panel .tryon-selection-right .selection-rail-heading b { position: absolute; top: 0; right: 0; flex: none; }

@media (max-width: 760px) {
  body[data-view="wardrobe"] .main-content { padding: 0 16px 50px; }
  .wardrobe-catalog-panel .wardrobe-topnav { height: 50px; margin: -42px -16px 28px; padding: 0 9px; overflow: hidden; }
  .topnav-divider { margin-inline: 8px; }
  .topnav-category { min-width: 48px; padding-inline: 3px; font-size: 7px; }
  .topnav-utility { width: 28px; }
  .wardrobe-catalog-panel .studio-content { grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 7px; }
}

/* Phase 1 mobile fitting-room pass: final cascade override. */
@media (max-width: 760px) {
  .wardrobe-catalog-panel .tryon-studio,
  .wardrobe-catalog-panel .tryon-studio.is-positioned {
    width: min(330px, calc(100vw - 24px));
    height: min(540px, calc(100vh - 24px));
    height: min(540px, calc(100dvh - 24px));
    padding: 12px;
    border-radius: 24px;
  }
  .wardrobe-catalog-panel .tryon-studio .studio-header h3 { font-size: 20px; }
  .wardrobe-catalog-panel .tryon-studio .studio-content {
    grid-template-columns: 50px minmax(0, 1fr) 50px;
    gap: 6px;
    height: calc(100% - 54px);
  }
  .wardrobe-catalog-panel .tryon-studio .tryon-selection { gap: 6px; margin-top: 7px; }
  .wardrobe-catalog-panel .tryon-studio .selection-chip { width: 46px; min-height: 56px; padding: 3px; border-radius: 9px; }
  .wardrobe-catalog-panel .tryon-studio .selection-chip-image { width: 38px; height: 36px; border-radius: 6px; }
  .wardrobe-catalog-panel .tryon-studio .selection-chip-copy b { font-size: 6px; }
  .wardrobe-catalog-panel .tryon-studio .selection-chip-copy span { font-size: 6.5px; }
  .wardrobe-catalog-panel .tryon-studio .tryon-stage,
  .wardrobe-catalog-panel .tryon-studio .tryon-stage.has-generated-media {
    height: 220px;
    min-height: 0;
    aspect-ratio: auto;
    margin-bottom: 6px;
  }
  .wardrobe-catalog-panel .tryon-studio .studio-media-controls { min-height: 24px; margin-bottom: 5px; }
  .wardrobe-catalog-panel .tryon-studio .studio-actions { gap: 5px; }
  .wardrobe-catalog-panel .tryon-studio .studio-action-button,
  .wardrobe-catalog-panel .tryon-studio .studio-actions .primary-button { padding: 7px 3px; font-size: 7.5px; }
}

/* Phase 1 mobile fitting-room pass: compact the island without changing drag behaviour. */
@media (max-width: 760px) {
  .wardrobe-catalog-panel .tryon-studio,
  .wardrobe-catalog-panel .tryon-studio.is-positioned {
    width: min(330px, calc(100vw - 24px));
    height: min(540px, calc(100vh - 24px));
    height: min(540px, calc(100dvh - 24px));
    padding: 12px;
    border-radius: 24px;
  }
  .wardrobe-catalog-panel .studio-header h3 { font-size: 20px; }
  .wardrobe-catalog-panel .studio-content {
    grid-template-columns: 50px minmax(0, 1fr) 50px;
    gap: 6px;
    height: calc(100% - 54px);
  }
  .wardrobe-catalog-panel .tryon-selection { gap: 6px; margin-top: 7px; }
  .wardrobe-catalog-panel .selection-chip { width: 46px; min-height: 56px; padding: 3px; border-radius: 9px; }
  .wardrobe-catalog-panel .selection-chip-image { width: 38px; height: 36px; border-radius: 6px; }
  .wardrobe-catalog-panel .selection-chip-copy b { font-size: 6px; }
  .wardrobe-catalog-panel .selection-chip-copy span { font-size: 6.5px; }
  .wardrobe-catalog-panel .tryon-stage,
  .wardrobe-catalog-panel .tryon-stage.has-generated-media {
    height: 220px;
    min-height: 0;
    aspect-ratio: auto;
    margin-bottom: 6px;
  }
  .wardrobe-catalog-panel .studio-media-controls { min-height: 24px; margin-bottom: 5px; }
  .wardrobe-catalog-panel .studio-actions { gap: 5px; }
  .wardrobe-catalog-panel .studio-action-button,
  .wardrobe-catalog-panel .studio-actions .primary-button { padding: 7px 3px; font-size: 7.5px; }
}

/* Reference icon pass: one hamburger in the rail, outline icons in the wardrobe bar. */
.wardrobe-catalog-panel .wardrobe-topnav { padding-left: 24px; }
.wardrobe-catalog-panel .topnav-menu,
.wardrobe-catalog-panel .topnav-divider { display: none; }
.icon-svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.45; }
.nav-icon { display: grid; place-items: center; }
.nav-icon .icon-svg { width: 20px; height: 20px; }
.topnav-icon { display: grid; place-items: center; width: 22px; height: 20px; font-family: inherit; font-size: inherit; }
.topnav-icon .icon-svg { width: 20px; height: 20px; }
.topnav-icon-all .icon-svg { width: 18px; height: 18px; }
.topnav-utility { font-family: inherit; font-size: inherit; }
.topnav-utility .icon-svg { width: 19px; height: 19px; }
@media (max-width: 760px) {
  .wardrobe-catalog-panel .wardrobe-topnav { padding-left: 9px; }
  .topnav-icon .icon-svg { width: 18px; height: 18px; }
  .topnav-utility .icon-svg { width: 17px; height: 17px; }
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 252px; border-right: 1px solid var(--line); padding: 28px 18px; display: flex; flex-direction: column; flex-shrink: 0; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--accent); color: var(--accent); border-radius: 12px; font-family: Georgia, serif; font-size: 20px; margin: 0 0 16px 10px; }
.brand-copy { display: flex; flex-direction: column; gap: 4px; padding: 0 10px; }
.brand-copy strong { font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.brand-copy span { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.nav-list { display: grid; gap: 6px; margin-top: 54px; }
.nav-item { background: none; border: 0; color: var(--muted); text-align: left; padding: 13px 12px; border-radius: 10px; transition: .2s ease; }
.nav-item:hover, .nav-item.active { color: var(--text); background: var(--panel-soft); }
.nav-item.active { box-shadow: inset 2px 0 var(--accent); }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 12px; padding: 12px; }
.status-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 12px rgba(139, 211, 169, .7); }

.main-content { flex: 1; max-width: 1500px; padding: 32px 48px 70px; margin: 0 auto; width: 100%; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .13em; font-size: 10px; margin: 0 0 10px; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1.05; margin-bottom: 0; letter-spacing: -.04em; }
h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.08; margin-bottom: 0; letter-spacing: -.03em; }
h3 { font-size: 23px; margin-bottom: 8px; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.icon-button, .profile-pill, .secondary-button, .primary-button, .voice-button, .text-button { border: 0; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 50%; font-size: 22px; }
.profile-pill { display: flex; align-items: center; gap: 10px; border-radius: 999px; padding: 5px 13px 5px 5px; color: var(--text); background: var(--panel); }
.avatar { width: 31px; height: 31px; display: grid; place-items: center; background: var(--accent); color: #241e12; border-radius: 50%; font-family: Georgia, serif; }
.profile-name { font-size: 13px; }

.context-bar { margin: 36px 0 42px; padding: 14px 16px; background: #171b1a; border: 1px solid rgba(139, 211, 169, .17); border-radius: 14px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.context-copy { display: flex; align-items: center; gap: 12px; }
.weather-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(139, 211, 169, .13); color: var(--green); font-size: 20px; }
.context-copy div { display: grid; gap: 4px; font-size: 13px; }
.context-copy span { color: var(--muted); font-size: 12px; }
.secondary-button, .primary-button, .voice-button { border-radius: 10px; padding: 11px 15px; font-size: 12px; transition: .2s ease; }
.secondary-button { background: var(--panel-raised); color: var(--text); border: 1px solid var(--line); }
.secondary-button:hover { border-color: var(--accent-dark); }
.primary-button { background: var(--accent); color: #211b10; font-weight: 700; }
.primary-button:hover { background: #f2dba8; transform: translateY(-1px); }
.primary-button.is-rendering { opacity: .72; cursor: wait; }
.voice-button { background: rgba(232, 201, 141, .12); color: var(--accent); border: 1px solid rgba(232, 201, 141, .22); }
.voice-button span { color: var(--danger); font-size: 16px; margin-right: 7px; }
.text-button { color: var(--accent); background: transparent; padding: 0; font-size: 12px; }
.full-width { width: 100%; margin-top: 18px; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 25px; }
.compact-heading { margin-top: 50px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); padding: 20px; border-radius: var(--radius); min-height: 142px; display: flex; flex-direction: column; }
.stat-card strong { font-size: 40px; font-family: Georgia, serif; font-weight: 400; margin-top: auto; }
.stat-label, .stat-note { color: var(--muted); font-size: 12px; }
.stat-note { color: var(--dim); }
.accent-card { background: linear-gradient(140deg, #302815, #1c1b18 70%); border-color: rgba(232, 201, 141, .3); }
.accent-card .stat-label, .accent-card strong { color: var(--accent); }
.dashboard-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; margin-top: 12px; }
.feature-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-height: 260px; }
.stylist-card { background: radial-gradient(circle at 100% 0%, #392e1b, var(--panel) 55%); }
.feature-header { display: flex; justify-content: space-between; gap: 15px; }
.sparkle { color: var(--accent); font-size: 24px; }
.muted { color: var(--muted); line-height: 1.6; font-size: 13px; }
.feature-card .voice-button { margin-top: 28px; }
.tag, .provider-badge { display: inline-flex; align-items: center; width: fit-content; border: 1px solid var(--line); color: var(--muted); background: var(--panel-soft); border-radius: 999px; padding: 6px 9px; font-size: 10px; white-space: nowrap; }
.look-preview { height: 110px; display: flex; align-items: center; justify-content: center; gap: 13px; background: linear-gradient(145deg, #d7cdbb, #8d816e); border-radius: 12px; margin: 18px 0; overflow: hidden; }
.garment-shape { display: block; position: relative; filter: drop-shadow(0 5px 4px rgba(0,0,0,.2)); }
.jacket-shape { width: 66px; height: 68px; border-radius: 13px 13px 5px 5px; clip-path: polygon(26% 0, 74% 0, 100% 30%, 84% 40%, 84% 100%, 16% 100%, 16% 40%, 0 30%); }
.trouser-shape { width: 54px; height: 78px; clip-path: polygon(8% 0, 92% 0, 86% 100%, 57% 100%, 50% 49%, 43% 100%, 14% 100%); border-radius: 4px; }
.shoe-shape { width: 55px; height: 17px; border-radius: 5px 18px 8px 6px; }
.sand { background: #9a7f6d; }.charcoal { background: #34353a; }.black { background: #121212; }

.toolbar { display: flex; justify-content: space-between; gap: 15px; align-items: center; margin-bottom: 22px; }
.filter-tabs, .slot-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.filter-button, .slot-button { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 8px 12px; white-space: nowrap; font-size: 11px; }
.filter-button.active, .slot-button.active { color: #271e0e; background: var(--accent); border-color: var(--accent); }
.search-box { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 0 12px; min-width: 190px; color: var(--dim); }
.search-box input { border: 0; background: transparent; outline: 0; color: var(--text); padding: 10px 0; width: 100%; font-size: 12px; }
.clothing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.compact-grid { grid-template-columns: repeat(4, 1fr); }
.clothing-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; transition: .2s ease; }
.clothing-card:hover { transform: translateY(-3px); border-color: rgba(232, 201, 141, .48); }
.clothing-card.unavailable { opacity: .46; }
.clothing-art { height: 185px; position: relative; display: grid; place-items: center; overflow: hidden; }
.clothing-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.2), transparent 30%); mix-blend-mode: screen; }
.art-cream { background: #d7d0c3; }.art-navy { background: #35465a; }.art-olive { background: #65715a; }.art-rust { background: #8f4e37; }.art-black { background: #2c2e31; }.art-denim { background: #66809b; }.art-sand { background: #b69c7c; }.art-white { background: #c9c6bc; }
.clothing-art .garment-shape { transform: scale(1.55); z-index: 1; }
.clothing-card-body { padding: 13px; display: grid; gap: 6px; }
.clothing-card-body strong { font-size: 13px; font-weight: 600; }
.clothing-card-body span { color: var(--muted); font-size: 11px; }
.availability { display: flex; align-items: center; gap: 5px; color: var(--green) !important; }
.availability::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.unavailable .availability { color: var(--danger) !important; }

.wardrobe-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); gap: 14px; align-items: start; }
.wardrobe-inventory, .tryon-studio { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 18px; }
.inventory-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.wardrobe-inventory .clothing-grid { grid-template-columns: repeat(3, 1fr); }
.clothing-card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 10px 25px rgba(232, 201, 141, .08); }
.clothing-card.selected .availability { color: var(--accent) !important; }
.tryon-studio { position: sticky; top: 22px; }
.studio-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.studio-header h3 { margin-bottom: 0; }
.tryon-stage { height: 470px; margin: 14px 0 10px; position: relative; overflow: hidden; display: grid; place-items: center; border-radius: 15px; background: radial-gradient(circle at 50% 26%, rgba(232,201,141,.18), transparent 25%), linear-gradient(135deg, #2b2927, #151515 70%); perspective: 850px; }
.tryon-stage::before { content: ""; position: absolute; inset: 0; opacity: .28; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 34px 34px; mask-image: linear-gradient(to bottom, black, transparent 78%); }
.stage-label { position: absolute; top: 13px; left: 14px; z-index: 5; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; font-size: 9px; }
.model-shadow { position: absolute; bottom: 33px; width: 180px; height: 24px; background: rgba(0,0,0,.45); filter: blur(11px); border-radius: 50%; }
.model-figure { width: 220px; height: 400px; position: relative; transform-style: preserve-3d; transition: transform .45s ease; z-index: 2; }
.model-reference-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; border-radius: 10px; }
.model-reference-image ~ .model-hair,
.model-reference-image ~ .model-head,
.model-reference-image ~ .model-neck,
.model-reference-image ~ .model-body,
.model-reference-image ~ .model-underwear { display: none; }
.model-hair, .model-head, .model-neck, .model-body, .model-underwear, .model-layer { position: absolute; left: 50%; transform: translateX(-50%); }
.model-hair { width: 62px; height: 30px; top: 31px; z-index: 5; background: #191718; border-radius: 55% 55% 28% 28%; }
.model-head { width: 54px; height: 66px; top: 42px; z-index: 4; background: #9f7867; border-radius: 48% 48% 44% 44%; box-shadow: inset -10px -3px rgba(87,56,45,.14); }
.model-neck { width: 25px; height: 30px; top: 94px; z-index: 2; background: #9f7867; }
.model-body { width: 132px; height: 205px; top: 112px; z-index: 1; background: #9f7867; border-radius: 43px 43px 23px 23px; }
.model-underwear { width: 116px; height: 132px; top: 238px; z-index: 2; background: #26242a; clip-path: polygon(10% 0, 90% 0, 84% 55%, 64% 55%, 50% 100%, 36% 55%, 16% 55%); }
.model-layer { display: none; z-index: 3; transition: opacity .25s ease, transform .45s ease; }
.model-layer.is-visible { display: block; }
.model-bottom-shape { width: 124px; height: 164px; top: 229px; clip-path: polygon(8% 0, 92% 0, 85% 100%, 58% 100%, 50% 47%, 42% 100%, 15% 100%); border-radius: 7px; }
.model-top-shape { width: 142px; height: 163px; top: 105px; clip-path: polygon(25% 0, 75% 0, 100% 24%, 84% 34%, 83% 100%, 17% 100%, 16% 34%, 0 24%); border-radius: 20px 20px 9px 9px; }
.model-outerwear-shape { width: 153px; height: 177px; top: 99px; clip-path: polygon(23% 0, 77% 0, 100% 24%, 86% 35%, 87% 100%, 13% 100%, 14% 35%, 0 24%); border-radius: 18px 18px 8px 8px; opacity: .93; }
.model-shoe-shape { width: 154px; height: 25px; top: 371px; clip-path: polygon(4% 18%, 51% 18%, 62% 0, 75% 0, 100% 44%, 100% 100%, 3% 100%); border-radius: 7px 18px 8px 7px; }
.model-accessory-shape { width: 78px; height: 18px; top: 120px; border: 4px solid #d0d0ca; border-radius: 50%; background: transparent !important; z-index: 6; }
.art-silver { background: #c8c7bd; }.art-brown { background: #704a34; }
.angle-quarter .model-figure { transform: rotateY(18deg) translateX(8px); }
.angle-side .model-figure { transform: rotateY(66deg) scaleX(.72); }
.studio-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.studio-controls .secondary-button { min-width: 42px; padding: 9px 12px; }
.tryon-selection { display: flex; flex-wrap: wrap; gap: 7px; min-height: 35px; margin: 13px 0; }
.selection-chip { display: inline-flex; flex-direction: column; gap: 2px; padding: 7px 9px; border-radius: 9px; background: var(--panel-soft); color: var(--muted); font-size: 10px; }
.selection-chip b { color: var(--accent); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.studio-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.studio-actions button { width: 100%; }

.builder-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 14px; }
.builder-preview, .builder-picker, .conversation-card, .context-card, .guide-card { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 22px; }
.preview-header { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.avatar-canvas { height: 430px; margin: 18px 0; border-radius: 15px; background: radial-gradient(circle at 50% 26%, rgba(232,201,141,.2), transparent 26%), linear-gradient(135deg, #262626, #151515); position: relative; overflow: hidden; display: grid; place-items: center; }
.canvas-glow { position: absolute; width: 240px; height: 240px; border-radius: 50%; background: rgba(232, 201, 141, .08); filter: blur(2px); }
.silhouette-head { width: 52px; height: 64px; background: #9c806e; border-radius: 48% 48% 44% 44%; position: absolute; top: 58px; opacity: .55; }
.silhouette-body { width: 142px; height: 214px; background: #373a3f; border-radius: 42px 42px 18px 18px; position: absolute; top: 122px; opacity: .7; }
.silhouette-legs { width: 105px; height: 150px; background: #202124; clip-path: polygon(10% 0, 90% 0, 78% 100%, 54% 100%, 50% 45%, 43% 100%, 19% 100%); position: absolute; top: 300px; opacity: .72; }
.canvas-placeholder { position: absolute; bottom: 18px; color: var(--dim); font-size: 11px; z-index: 2; }
.preview-summary { min-height: 22px; color: var(--muted); font-size: 12px; }
.builder-intro { margin-bottom: 20px; }
.slot-tabs { margin-bottom: 18px; }
.picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.picker-item { border: 1px solid var(--line); background: var(--panel-soft); border-radius: 12px; padding: 8px; color: var(--text); text-align: left; }
.picker-item.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.picker-item .clothing-art { height: 95px; border-radius: 8px; }
.picker-item .clothing-art .garment-shape { transform: scale(.82); }
.picker-item strong { display: block; font-size: 11px; margin-top: 8px; }
.picker-item span { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.builder-assist { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; }
.builder-assist div { display: flex; align-items: center; gap: 8px; }
.builder-assist .sparkle { font-size: 17px; }

.stylist-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; }
.conversation-card { min-height: 460px; display: flex; flex-direction: column; gap: 12px; }
.message { max-width: 80%; padding: 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.assistant-message { background: var(--panel-soft); color: var(--muted); }
.user-message { align-self: flex-end; background: #3b3426; color: var(--text); }
.voice-input { display: flex; gap: 10px; margin-top: auto; }
.context-card { height: fit-content; }
.context-row { display: grid; gap: 5px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.context-row span { color: var(--dim); }
.context-row strong { font-weight: 500; }

.guide-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.guide-card { min-height: 260px; }
.guide-primary { background: radial-gradient(circle at 100% 0%, #3d3019, var(--panel) 56%); }
.guide-card h3 { margin-top: 28px; }
.guide-card p:not(.eyebrow) { color: var(--muted); line-height: 1.65; font-size: 14px; }
.rule-list, .preference-list { display: grid; gap: 10px; margin-top: 25px; color: var(--muted); font-size: 12px; }
.preference-list span { display: flex; flex-direction: column; gap: 5px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.preference-list strong { color: var(--text); font-weight: 500; }
.render-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.render-card { align-self: start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.render-art { height: 330px; display: flex; align-items: flex-end; padding: 15px; background: linear-gradient(145deg, #d9d0c1, #8d7968); }
.render-art span { padding: 6px 8px; background: rgba(0,0,0,.45); border-radius: 999px; font-size: 10px; }
.render-two { background: linear-gradient(145deg, #273444, #8b765a); }.render-three { background: linear-gradient(145deg, #79876e, #c7b69d); }
.render-meta { display: grid; gap: 5px; padding: 14px; font-size: 12px; }.render-meta span { color: var(--muted); font-size: 11px; }

.hidden { display: none !important; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--accent); color: #241e12; border-radius: 999px; padding: 12px 18px; font-weight: 700; font-size: 12px; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1050px) {
  .sidebar { width: 210px; }
  .main-content { padding: 28px 30px 60px; }
  .clothing-grid, .compact-grid { grid-template-columns: repeat(3, 1fr); }
  .wardrobe-layout { grid-template-columns: 1fr; }
  .tryon-studio { position: relative; top: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; height: auto; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--line); display: block; }
  .brand-mark { display: inline-grid; margin: 0 8px 0 0; vertical-align: middle; }
  .brand-copy { display: inline-flex; vertical-align: middle; padding: 0; }
  .nav-list { display: flex; overflow-x: auto; gap: 5px; margin: 18px -6px -2px; padding-bottom: 2px; }
  .nav-item { white-space: nowrap; padding: 9px 11px; font-size: 11px; }
  .sidebar-footer { display: none; }
  .main-content { padding: 24px 16px 50px; }
  .topbar { align-items: center; }.topbar-actions .icon-button, .profile-name { display: none; }.profile-pill { padding: 4px; }
  .context-bar { margin: 25px 0 30px; align-items: flex-start; flex-direction: column; }.context-bar .secondary-button { width: 100%; }
  .section-heading { align-items: flex-start; flex-direction: column; }.section-heading .primary-button { width: 100%; }
  .dashboard-grid, .builder-layout, .stylist-layout, .guide-layout { grid-template-columns: 1fr; }
  .clothing-grid, .compact-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }.clothing-art { height: 150px; }.compact-grid .clothing-art { height: 135px; }
  .wardrobe-inventory .clothing-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { display: grid; }.search-box { min-width: 0; }.filter-tabs { order: 2; }
  .picker-grid { grid-template-columns: repeat(2, 1fr); }.builder-actions { display: flex; width: 100%; }.builder-actions button { flex: 1; }
  .render-grid { grid-template-columns: 1fr; }.render-art { height: 270px; }
}

/* Real local wardrobe media and phase 1–3 state controls. */
.clothing-art { background: #242424; }
.clothing-art::after { z-index: 2; pointer-events: none; }
.clothing-image { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; padding: 12px; display: block; }
.clothing-card.archived { opacity: .72; }
.clothing-card.unavailable { opacity: .62; }
.card-actions { position: relative; z-index: 3; display: flex; gap: 6px; padding-top: 2px; }
.card-action { border: 1px solid var(--line); background: var(--panel-raised); color: var(--muted); border-radius: 7px; padding: 6px 7px; font-size: 10px; text-align: left; }
.card-action:hover { color: var(--text); border-color: var(--accent-dark); }
.empty-state { display: grid; gap: 5px; align-content: center; min-height: 120px; padding: 20px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; }
.empty-state strong { color: var(--text); font-size: 13px; }
.picker-item.unavailable { opacity: .52; }
.model-layer.is-visible { clip-path: none; width: 145px; height: 180px; background-repeat: no-repeat; background-position: center; background-size: contain; background-color: transparent !important; filter: drop-shadow(0 6px 4px rgba(0,0,0,.22)); }
.model-bottom-shape.is-visible { top: 225px; height: 170px; }
.model-top-shape.is-visible { top: 104px; height: 170px; }
.model-outerwear-shape.is-visible { top: 96px; height: 185px; width: 158px; }
.model-shoe-shape.is-visible { top: 365px; height: 35px; width: 165px; }
.model-accessory-shape.is-visible { top: 112px; height: 70px; width: 105px; border: 0; }
.builder-model-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 16px 54px 10px 22px; opacity: .95; }
.builder-selection-rail { position: absolute; top: 14px; right: 14px; z-index: 3; display: grid; gap: 7px; width: 78px; }
.builder-selection-item { display: grid; gap: 3px; border: 1px solid var(--line); background: rgba(24,24,24,.9); border-radius: 9px; padding: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.builder-selection-item:hover { border-color: var(--accent); color: var(--accent); }
.builder-selection-image { width: 68px; height: 52px; object-fit: contain; border-radius: 6px; background: #2a2a2a; }
.canvas-placeholder { left: 16px; right: 16px; text-align: center; }
.saved-looks-panel { margin-top: 18px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 18px 22px 22px; }
.save-look-form { display: flex; align-items: end; gap: 8px; margin: -8px 0 18px; padding: 12px; border: 1px solid rgba(232, 201, 141, .25); background: rgba(232, 201, 141, .06); border-radius: 12px; }
.save-look-form label { color: var(--muted); font-size: 11px; }
.save-look-form input { min-width: 210px; flex: 1; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; padding: 10px; outline: 0; font-size: 12px; }
.save-look-form input:focus { border-color: var(--accent); }
.saved-looks-panel .compact-heading { margin: 0 0 14px; align-items: center; }
.saved-looks-panel h3 { margin: 0; }
.saved-looks-list { display: grid; gap: 8px; }
.saved-look-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.saved-look-card > div:first-child { display: grid; gap: 4px; }
.saved-look-main { display: flex !important; align-items: center; gap: 12px; }
.saved-look-card span { color: var(--muted); font-size: 11px; }
.saved-look-actions { display: flex; gap: 12px; align-items: center; }
.look-thumbnail-rail { display: flex; align-items: center; min-width: 120px; }
.look-thumbnail { width: 32px; height: 42px; margin-right: -5px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); overflow: hidden; }
.look-thumbnail-image { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.look-thumbnail-empty { width: 70px; color: var(--dim); font-size: 10px; }
.danger-text { color: var(--danger); }
.selection-chip { border: 1px solid var(--line); cursor: pointer; text-align: left; }
.selection-chip:hover { border-color: var(--accent); }
.generation-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0 12px; }
.generation-card .generated-look-art { position: relative; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 35%, rgba(232,201,141,.2), transparent 45%), #25231f; }
.generated-look-art .look-thumbnail-rail { display: flex; justify-content: center; flex-wrap: wrap; max-width: 220px; }
.generated-look-art .look-thumbnail { width: 62px; height: 92px; margin: 0 -5px -6px 0; background: rgba(242,238,230,.92); }
.generated-look-art > span { position: absolute; left: 15px; bottom: 15px; }
.render-meta { min-height: 150px; }
.render-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 8px; }
.render-empty-state { grid-column: 1 / -1; min-height: 190px; }
.render-empty-state .secondary-button { width: fit-content; margin-top: 5px; }
.generated-result-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.generated-look-art.has-generated-image { padding: 0; align-items: stretch; }
.generation-details { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 9px; }
.generation-details summary { cursor: pointer; color: var(--accent); font-size: 11px; }
.generation-prompt { display: grid; gap: 6px; margin-top: 9px; }
.generation-prompt strong { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.generation-prompt pre { max-height: 180px; overflow: auto; white-space: pre-wrap; margin: 0 0 5px; padding: 8px; background: var(--panel-soft); border-radius: 8px; color: var(--muted); font: 10px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }
.generation-error { color: var(--danger); font-size: 11px; line-height: 1.4; margin: 8px 0 0; }

@media (max-width: 760px) {
  .card-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .saved-look-card { align-items: flex-start; flex-direction: column; }
  .saved-look-actions { width: 100%; justify-content: flex-start; }
  .saved-look-main { align-items: flex-start; }
  .generation-toolbar { align-items: flex-start; flex-direction: column; }
  .save-look-form { align-items: stretch; flex-direction: column; }
  .save-look-form input { min-width: 0; width: 100%; }
  .builder-actions { flex-wrap: wrap; }
  .builder-actions button { min-width: 0; }
  .builder-selection-rail { width: 64px; }
  .builder-selection-image { width: 54px; height: 44px; }
}

/* My Wardrobe: editorial catalog surface. Other views retain the dark dashboard theme. */
.wardrobe-catalog-panel {
  --catalog-ink: #1a1917;
  --catalog-muted: #7f7b73;
  --catalog-line: #d8d1c5;
  --catalog-paper: #f2eee6;
  margin: -32px -48px -70px;
  padding: 42px 48px 78px;
  min-height: calc(100vh - 32px);
  color: var(--catalog-ink);
  background: var(--catalog-paper);
}
.wardrobe-catalog-panel .section-heading { align-items: flex-end; margin-bottom: 28px; }
.wardrobe-catalog-panel .eyebrow { color: var(--catalog-muted); letter-spacing: .18em; }
.wardrobe-catalog-panel h2 { color: var(--catalog-ink); font-size: clamp(36px, 5vw, 64px); }
.wardrobe-catalog-panel .primary-button { background: var(--catalog-ink); color: #f8f4ec; border-radius: 0; }
.wardrobe-catalog-panel .primary-button:hover { background: #3a3731; }
.wardrobe-catalog-panel .toolbar { align-items: stretch; margin-bottom: 32px; }
.wardrobe-catalog-panel .filter-tabs { gap: 0; border-top: 1px solid var(--catalog-line); border-bottom: 1px solid var(--catalog-line); }
.wardrobe-catalog-panel .filter-button { border: 0; border-right: 1px solid var(--catalog-line); border-radius: 0; color: var(--catalog-muted); padding: 12px 18px; background: transparent; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.wardrobe-catalog-panel .filter-button:first-child { border-left: 1px solid var(--catalog-line); }
.wardrobe-catalog-panel .filter-button:hover { color: var(--catalog-ink); background: rgba(255,255,255,.36); }
.wardrobe-catalog-panel .filter-button.active { color: #f8f4ec; background: var(--catalog-ink); border-color: var(--catalog-ink); }
.wardrobe-catalog-panel .search-box { min-width: 215px; border: 0; border-bottom: 1px solid var(--catalog-line); border-radius: 0; background: transparent; color: var(--catalog-muted); }
.wardrobe-catalog-panel .search-box input { color: var(--catalog-ink); }
.wardrobe-catalog-panel .search-box input::placeholder { color: var(--catalog-muted); }
.wardrobe-catalog-panel .wardrobe-layout { display: block; }
.wardrobe-catalog-panel .wardrobe-inventory { border: 0; border-radius: 0; background: transparent; padding: 0; }
.wardrobe-catalog-panel .inventory-heading { margin-bottom: 10px; }
.wardrobe-catalog-panel .inventory-heading .muted { color: var(--catalog-muted); font-size: 11px; }
.wardrobe-catalog-panel .inventory-heading .tag { border: 0; border-radius: 0; padding: 0; color: var(--catalog-muted); background: transparent; text-transform: uppercase; letter-spacing: .1em; }
.wardrobe-catalog-panel .catalog-group-list { display: block; }
.wardrobe-catalog-panel .catalog-group { display: flow-root; min-width: 0; }
.wardrobe-catalog-panel .catalog-group + .catalog-group { margin-top: 56px; }
.wardrobe-catalog-panel .catalog-group-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; color: var(--catalog-ink); }
.wardrobe-catalog-panel .catalog-group-heading::after { content: ""; flex: 1; border-top: 1px solid var(--catalog-line); }
.wardrobe-catalog-panel .catalog-group-title { text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 700; }
.wardrobe-catalog-panel .catalog-group-count { color: var(--catalog-muted); font-size: 10px; white-space: nowrap; }
.wardrobe-catalog-panel .clothing-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 54px 28px; align-items: start; }
.wardrobe-catalog-panel .clothing-card { position: relative; overflow: visible; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.wardrobe-catalog-panel .clothing-card:hover { transform: none; border: 0; box-shadow: none; }
.wardrobe-catalog-panel .clothing-art { min-height: 260px; height: auto; display: flex; align-items: flex-start; justify-content: center; overflow: visible; background: transparent; }
.wardrobe-catalog-panel .clothing-art::after { display: none; }
.wardrobe-catalog-panel .clothing-image { --catalog-y-offset: 0px; width: 100%; height: auto; max-height: 360px; padding: 0; object-fit: contain; transform: translateY(var(--catalog-y-offset)); filter: drop-shadow(0 14px 14px rgba(61, 53, 43, .12)); transition: transform .28s ease, filter .28s ease; }
.wardrobe-catalog-panel .clothing-card:hover .clothing-image, .wardrobe-catalog-panel .clothing-card:focus-within .clothing-image { transform: translateY(calc(var(--catalog-y-offset) - 5px)) scale(1.025); filter: drop-shadow(0 18px 18px rgba(61, 53, 43, .17)); }
.wardrobe-catalog-panel .clothing-card.selected .clothing-image { filter: drop-shadow(0 18px 18px rgba(61, 53, 43, .18)); }
.wardrobe-catalog-panel .clothing-card.selected::before { content: "✓"; position: absolute; top: 8px; right: 8px; z-index: 5; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: #f8f4ec; background: var(--catalog-ink); box-shadow: 0 5px 12px rgba(61, 53, 43, .18); font-size: 12px; line-height: 1; }
.wardrobe-catalog-panel .clothing-card-body { position: absolute; z-index: 4; left: 10px; right: 10px; bottom: -64px; min-height: 58px; padding: 10px 12px; display: grid; gap: 4px; background: rgba(248, 245, 238, .96); box-shadow: 0 12px 28px rgba(61, 53, 43, .12); opacity: 0; pointer-events: none; transform: translateY(5px); transition: opacity .18s ease, transform .18s ease; }
.wardrobe-catalog-panel .clothing-card:hover .clothing-card-body, .wardrobe-catalog-panel .clothing-card:focus-within .clothing-card-body, .wardrobe-catalog-panel .clothing-card:focus .clothing-card-body { opacity: 1; pointer-events: auto; transform: translateY(0); }
.wardrobe-catalog-panel .clothing-card-body strong { color: var(--catalog-ink); font-size: 12px; }
.wardrobe-catalog-panel .clothing-card-body span { color: var(--catalog-muted); font-size: 10px; }
.wardrobe-catalog-panel .availability { color: #668a6d !important; }
.wardrobe-catalog-panel .card-actions { gap: 8px; padding-top: 3px; }
.wardrobe-catalog-panel .card-action { border: 0; border-bottom: 1px solid var(--catalog-line); border-radius: 0; padding: 3px 0; color: var(--catalog-muted); background: transparent; font-size: 9px; }
.wardrobe-catalog-panel .card-action:hover { color: var(--catalog-ink); border-color: var(--catalog-ink); }
.wardrobe-catalog-panel .clothing-card.unavailable { opacity: .48; }
.wardrobe-catalog-panel .clothing-card.archived { opacity: .48; }
.tryon-launcher { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--catalog-line); padding: 10px 12px; color: #f8f4ec; background: var(--catalog-ink); font: inherit; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 10px 25px rgba(50,43,34,.18); cursor: pointer; }
.tryon-launcher span:last-child { color: rgba(248,244,236,.7); font-size: 9px; font-weight: 500; letter-spacing: .04em; text-transform: none; }
.wardrobe-catalog-panel .tryon-launcher { position: fixed; right: 24px; bottom: 24px; z-index: 11; }
.wardrobe-catalog-panel .tryon-studio { position: fixed; right: 24px; bottom: 24px; z-index: 10; width: 310px; border: 1px solid rgba(26,25,23,.14); border-radius: 0; padding: 14px; color: var(--catalog-ink); background: rgba(248,245,238,.96); box-shadow: 0 18px 50px rgba(50,43,34,.18); transition: opacity .22s ease, transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear 0s; }
.wardrobe-catalog-panel .tryon-studio.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(calc(100% + 40px)) translateY(10px); transition: opacity .18s ease, transform .24s ease, visibility 0s linear .24s; }
.wardrobe-catalog-panel .tryon-studio .eyebrow { color: var(--catalog-muted); margin-bottom: 5px; }
.wardrobe-catalog-panel .tryon-studio h3 { color: var(--catalog-ink); }
.studio-header-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; }
.tryon-collapse-button { border: 0; border-bottom: 1px solid var(--catalog-line); padding: 3px 0; color: var(--catalog-muted); background: transparent; font: inherit; font-size: 9px; cursor: pointer; }
.tryon-collapse-button:hover { color: var(--catalog-ink); border-color: var(--catalog-ink); }
.wardrobe-catalog-panel .tryon-studio .tag, .wardrobe-catalog-panel .tryon-studio .muted { color: var(--catalog-muted); background: transparent; border-color: var(--catalog-line); }
.wardrobe-catalog-panel .tryon-stage { height: 285px; margin: 10px 0; border-radius: 0; background: #e6dfd3; }
.wardrobe-catalog-panel .tryon-stage.has-generated-media { height: auto; aspect-ratio: 16 / 9; background: #e6dfd3; }
.wardrobe-catalog-panel .stage-label { color: var(--catalog-muted); }
.wardrobe-catalog-panel .studio-controls { display: none; }
.wardrobe-catalog-panel .studio-actions .secondary-button { color: var(--catalog-ink); background: transparent; border-color: var(--catalog-line); border-radius: 0; }
.wardrobe-catalog-panel .studio-actions .primary-button { background: var(--catalog-ink); }
.wardrobe-catalog-panel .selection-chip { color: var(--catalog-muted); border-color: var(--catalog-line); background: transparent; border-radius: 0; }
.selection-clear { border: 0; border-bottom: 1px solid var(--catalog-line); align-self: center; padding: 4px 0; color: var(--catalog-muted); background: transparent; font: inherit; font-size: 10px; cursor: pointer; }
.selection-clear:hover { color: var(--catalog-ink); border-color: var(--catalog-ink); }

/* Live Try-on shows either the model reference or one completed generated asset. */
.tryon-stage .studio-reference-image, .tryon-stage .studio-generated-image, .tryon-stage .studio-generated-video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.tryon-stage.is-reference .studio-reference-image { padding: 12px; }
.tryon-stage.has-generated-media { background: transparent; }
.tryon-stage.has-generated-media::before { display: none; }
.tryon-stage .studio-generated-video { background: transparent; }
.studio-processing { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 34px; background: rgba(24,22,19,.6); text-align: center; color: var(--text); font-size: 11px; }
.studio-processing span:last-child { color: var(--muted); }
.processing-spinner { width: 22px; height: 22px; border: 2px solid rgba(232,201,141,.25); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.studio-media-controls { min-height: 30px; display: flex; align-items: center; margin: 1px 0 8px; }
.studio-media-note { color: var(--muted); font-size: 10px; }
.wardrobe-catalog-panel .studio-media-note { color: var(--catalog-muted); }
.wardrobe-catalog-panel .studio-media-controls .text-button { color: var(--catalog-ink); border-bottom: 1px solid var(--catalog-line); }
.video-generation-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 8px; width: 100%; min-width: 0; }
.video-engine-select { display: block; min-width: 0; }
.video-engine-select > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.video-engine-select select { display: block; width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 4px; padding: 6px 23px 6px 7px; color: var(--text); background: var(--panel-soft); font: inherit; font-size: 10px; cursor: pointer; }
.wardrobe-catalog-panel .video-engine-select select { border-color: var(--catalog-line); color: var(--catalog-ink); background: rgba(248,245,238,.82); }
.video-generation-control .text-button { white-space: nowrap; }
.video-engine-meta { grid-column: 1 / -1; color: var(--muted); font-size: 9px; line-height: 1.2; }
.wardrobe-catalog-panel .video-engine-meta { color: var(--catalog-muted); }
.video-engine-unavailable { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; color: var(--danger); font-size: 10px; line-height: 1.35; }
.video-engine-unavailable .text-button { flex: 0 0 auto; color: inherit; }
.media-tabs { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-soft); }
.media-tab { border: 0; border-radius: 999px; padding: 6px 10px; background: transparent; color: var(--muted); font: inherit; font-size: 10px; cursor: pointer; }
.media-tab.active { background: var(--accent); color: #241e12; font-weight: 700; }
.render-media-tabs { width: fit-content; margin-top: 5px; }
.generated-result-image, .generated-result-video { display: block; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.generated-look-art.has-generated-media { height: auto; aspect-ratio: 16 / 9; padding: 0; align-items: stretch; background: #e6dfd3; }
.generated-look-art.has-generated-media .generated-result-image, .generated-look-art.has-generated-media .generated-result-video { background: transparent; }
.video-action-note { color: var(--muted); font-size: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 1180px) {
  .wardrobe-catalog-panel .clothing-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 1040px) {
  .wardrobe-catalog-panel { margin: -28px -30px -60px; padding: 36px 30px 68px; }
  .wardrobe-catalog-panel .clothing-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .wardrobe-catalog-panel { margin: -24px -18px -50px; padding: 30px 18px 58px; }
  .wardrobe-catalog-panel .section-heading { margin-bottom: 22px; }
  .wardrobe-catalog-panel .toolbar { display: grid; gap: 16px; }
  .wardrobe-catalog-panel .filter-tabs { overflow-x: auto; }
  .wardrobe-catalog-panel .filter-button { padding: 11px 14px; }
  .wardrobe-catalog-panel .search-box { min-width: 0; }
  .wardrobe-catalog-panel .catalog-group + .catalog-group { margin-top: 38px; }
  .wardrobe-catalog-panel .clothing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 18px; }
  .wardrobe-catalog-panel .clothing-art { min-height: 200px; height: auto; }
  .wardrobe-catalog-panel .clothing-image { max-height: 300px; }
  .wardrobe-catalog-panel .clothing-card-body { position: static; min-height: 0; margin-top: 4px; padding: 7px 0 0; background: transparent; box-shadow: none; opacity: 1; pointer-events: auto; transform: none; }
  .wardrobe-catalog-panel .clothing-card-body strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wardrobe-catalog-panel .clothing-card-body .availability, .wardrobe-catalog-panel .clothing-card-body > span:nth-child(2) { display: none; }
  .wardrobe-catalog-panel .card-actions { display: none; }
  .wardrobe-catalog-panel .clothing-card.selected::before { top: 6px; right: 6px; width: 20px; height: 20px; }
  .wardrobe-catalog-panel .tryon-studio { position: relative; right: auto; bottom: auto; width: 100%; margin-top: 42px; }
  .wardrobe-catalog-panel .tryon-studio.is-hidden { display: none; }
  .wardrobe-catalog-panel .tryon-launcher { position: fixed; right: 18px; bottom: 18px; }
}

/* Phase 4 final cascade: these rules intentionally follow the legacy dashboard rules. */
:root { --text: #1b1a18; --muted: #77736b; --dim: #a19b91; --line: #ddd6cb; --panel: #fffdfa; --panel-soft: #f7f2e9; --panel-raised: #ffffff; --accent: #9a835c; }
body { background: #f2eee6; color: var(--text); }
.app-shell { background: #f2eee6; }
.sidebar { width: 88px; align-items: center; padding: 24px 14px; background: #f2eee6; border-right: 1px solid #ddd6cb; }
.brand-mark { width: 42px; height: 42px; margin: 0; border-color: #b4a88f; color: #6c604b; background: rgba(255,255,255,.38); border-radius: 14px; }
.brand-copy { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav-list { width: 100%; gap: 9px; margin-top: 48px; }
.nav-item { position: relative; display: grid; place-items: center; width: 58px; height: 58px; padding: 0; border-radius: 17px; color: #898278; text-align: center; cursor: pointer; }
.nav-item:hover, .nav-item:focus-visible { color: #282621; background: rgba(255,255,255,.58); outline: none; }
.nav-item.active { color: #6c604b; background: rgba(255,255,255,.84); box-shadow: 0 8px 22px rgba(76,67,54,.08); }
.nav-item::after { content: attr(data-tooltip); position: absolute; left: calc(100% + 13px); top: 50%; z-index: 30; transform: translateY(-50%) translateX(-4px); padding: 7px 9px; border: 1px solid #d8d0c4; border-radius: 8px; color: #302d28; background: rgba(255,253,250,.96); box-shadow: 0 8px 20px rgba(76,67,54,.12); opacity: 0; pointer-events: none; white-space: nowrap; font-size: 11px; transition: opacity .16s ease, transform .16s ease; }
.nav-item:hover::after, .nav-item:focus-visible::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.nav-icon { display: grid; place-items: center; width: 25px; height: 25px; font-size: 22px; line-height: 1; font-family: Georgia, serif; }
.nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sidebar-footer { width: 100%; display: grid; justify-items: center; gap: 12px; padding: 0; color: #aaa398; }
.sidebar-footer .nav-settings { margin-bottom: 4px; }
.sidebar-footer > span:last-child { display: none; }
.status-dot { width: 6px; height: 6px; }
.main-content { max-width: none; padding: 34px 48px 70px; }
.topbar { align-items: center; }
.topbar .eyebrow { color: #918778; }
.topbar h1 { color: #26231f; }
.icon-button, .profile-pill { border-color: #ddd6cb; background: rgba(255,255,255,.48); color: #403b34; }
.profile-pill { box-shadow: 0 6px 18px rgba(76,67,54,.05); }
.avatar { background: #d6cfbf; color: #413a2e; }
.context-bar { border-color: #ddd6cb; background: rgba(255,255,255,.52); color: #302d28; box-shadow: 0 10px 28px rgba(76,67,54,.05); }
.context-copy span, .context-copy div { color: #77736b; }
.weather-icon { color: #6c604b; background: rgba(173,157,124,.16); }

.wardrobe-catalog-panel .tryon-studio { position: fixed; right: 24px; bottom: 24px; z-index: 20; width: min(610px, calc(100vw - 48px)); max-height: calc(100vh - 48px); overflow: auto; padding: 18px; border: 1px solid rgba(255,255,255,.82); border-radius: 28px; color: var(--catalog-ink); background: rgba(248,245,238,.73); backdrop-filter: blur(18px) saturate(118%); -webkit-backdrop-filter: blur(18px) saturate(118%); box-shadow: 0 22px 60px rgba(65,56,45,.2), inset 0 1px rgba(255,255,255,.8); }
.wardrobe-catalog-panel .tryon-studio.is-positioned { right: auto; bottom: auto; }
.wardrobe-catalog-panel .tryon-studio.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(calc(100% + 40px)) translateY(10px); }
.studio-drag-handle { display: flex; align-items: center; justify-content: center; gap: 4px; width: 62px; height: 18px; margin: -9px auto 5px; padding: 0; border: 0; border-radius: 999px; background: transparent; cursor: grab; touch-action: none; }
.studio-drag-handle:active, .studio-drag-handle.is-dragging { cursor: grabbing; }
.studio-drag-handle span { width: 4px; height: 4px; border-radius: 50%; background: #b8b0a4; }
.studio-icon-button { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(120,111,97,.24); border-radius: 50%; color: #37322b; background: rgba(255,255,255,.56); font-size: 20px; line-height: 1; cursor: pointer; }
.studio-icon-button:hover, .studio-icon-button:focus-visible { border-color: #968567; background: rgba(255,255,255,.88); outline: none; }
.wardrobe-catalog-panel .studio-header { align-items: center; }
.studio-content { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 13px; align-items: stretch; }
.studio-preview-column { min-width: 0; }
.wardrobe-catalog-panel .tryon-selection { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-height: 0; max-height: 405px; margin: 10px 0 0; overflow-y: auto; scrollbar-width: thin; }
.selection-rail-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 3px 3px; color: #756d61; text-transform: uppercase; letter-spacing: .12em; font-size: 8px; }
.selection-rail-heading b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #665c4c; background: rgba(173,157,124,.2); font-size: 9px; }
.wardrobe-catalog-panel .selection-chip { position: relative; display: grid; grid-template-columns: 1fr; gap: 3px; width: 66px; min-height: 70px; padding: 4px; border: 1px solid rgba(145,133,114,.22); border-radius: 12px; color: #746c60; background: rgba(255,255,255,.4); cursor: pointer; text-align: left; }
.wardrobe-catalog-panel .selection-chip:hover, .wardrobe-catalog-panel .selection-chip:focus-visible { border-color: #a18d68; background: rgba(255,255,255,.78); outline: none; }
.selection-chip-image { display: block; width: 56px; height: 48px; overflow: hidden; border-radius: 8px; background: rgba(255,255,255,.48); }
.selection-chip-image-src { width: 100%; height: 100%; padding: 2px; object-fit: contain; }
.selection-chip-copy { display: grid; gap: 1px; min-width: 0; }
.selection-chip-copy b { color: #968567; font-size: 7px; letter-spacing: .08em; }
.selection-chip-copy span { overflow: hidden; color: #625b51; font-size: 8px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.selection-chip > i { position: absolute; top: 3px; right: 4px; color: #8b8173; font-size: 12px; font-style: normal; opacity: 0; }
.selection-chip:hover > i, .selection-chip:focus-visible > i { opacity: 1; }
.selection-clear { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 5px 2px; border: 0; color: #81786b; background: transparent; font: inherit; font-size: 8px; cursor: pointer; }
.selection-clear:hover, .selection-clear:focus-visible { color: #3e382f; outline: none; }
.selection-clear > span:first-child { display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; }
.selection-empty { display: grid; align-content: center; min-height: 100px; color: #9c9386; text-align: center; font-size: 9px; line-height: 1.4; }
.selection-empty small { color: #b0a79b; font-size: 8px; }
.wardrobe-catalog-panel .tryon-stage { height: 405px; margin: 8px 0 9px; border: 1px solid rgba(145,133,114,.16); border-radius: 20px; background: rgba(255,255,255,.26); }
.wardrobe-catalog-panel .tryon-stage.has-generated-media { height: auto; aspect-ratio: 3 / 4; }
.wardrobe-catalog-panel .tryon-stage.is-reference { background: radial-gradient(circle at 50% 24%, rgba(255,255,255,.74), rgba(236,228,216,.33)); }
.wardrobe-catalog-panel .tryon-stage .stage-label { top: 10px; left: 12px; color: #9a9185; font-size: 8px; }
.wardrobe-catalog-panel .studio-controls { display: none; }
.wardrobe-catalog-panel .studio-media-controls { min-height: 34px; margin: 0 0 8px; padding: 4px 0; }
.wardrobe-catalog-panel .studio-media-note { color: #81786b; font-size: 9px; line-height: 1.35; }
.wardrobe-catalog-panel .studio-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.wardrobe-catalog-panel .studio-action-button, .wardrobe-catalog-panel .studio-actions .primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; padding: 9px 7px; border: 1px solid rgba(145,133,114,.24); border-radius: 12px; color: #4d463d; background: rgba(255,255,255,.48); font: inherit; font-size: 9px; cursor: pointer; }
.wardrobe-catalog-panel .studio-action-button:hover, .wardrobe-catalog-panel .studio-action-button:focus-visible, .wardrobe-catalog-panel .studio-actions .primary-button:hover, .wardrobe-catalog-panel .studio-actions .primary-button:focus-visible { border-color: #9a835c; background: rgba(255,255,255,.88); outline: none; }
.wardrobe-catalog-panel .studio-actions #studio-render { color: #f7f2e9; background: #292722; border-color: #292722; }
.action-icon { display: grid; place-items: center; width: 18px; height: 18px; font-size: 15px; line-height: 1; }
.wardrobe-catalog-panel .video-generation-control .text-button { padding: 7px 9px; border: 1px solid rgba(145,133,114,.24); border-radius: 10px; color: #4d463d; background: rgba(255,255,255,.48); font-size: 9px; }
.wardrobe-catalog-panel .video-engine-select select { border-radius: 10px; background: rgba(255,255,255,.48); }
.tryon-launcher { border-radius: 999px; }

@media (max-width: 760px) {
  .sidebar { width: 100%; height: 72px; padding: 9px 12px; border-right: 0; border-bottom: 1px solid #ddd6cb; display: flex; flex-direction: row; align-items: center; gap: 9px; overflow: hidden; }
  .brand-mark { flex: 0 0 auto; width: 38px; height: 38px; }
  .nav-list { display: flex; flex: 1; gap: 4px; width: auto; margin: 0; overflow-x: auto; }
  .nav-item { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 13px; }
  .nav-item::after { top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(-4px); }
  .nav-item:hover::after, .nav-item:focus-visible::after { transform: translateX(-50%) translateY(0); }
  .sidebar-footer { width: auto; display: flex; flex: 0 0 auto; }
  .sidebar-footer .nav-settings { margin: 0; }
  .sidebar-footer .status-dot { display: none; }
  .main-content { padding: 24px 16px 50px; }
  .wardrobe-catalog-panel .tryon-studio { left: 12px; right: 12px; bottom: 12px; width: auto; max-height: calc(100vh - 24px); padding: 14px; border-radius: 24px; }
  .wardrobe-catalog-panel .tryon-studio.is-positioned { left: auto; right: auto; width: min(320px, calc(100vw - 24px)); }
  .studio-content { grid-template-columns: 58px minmax(0, 1fr); gap: 9px; }
  .wardrobe-catalog-panel .tryon-selection { max-height: 320px; }
  .wardrobe-catalog-panel .selection-chip { width: 54px; min-height: 62px; }
  .selection-chip-image { width: 44px; height: 42px; }
  .wardrobe-catalog-panel .tryon-stage { height: 320px; }
  .wardrobe-catalog-panel .tryon-stage.has-generated-media { aspect-ratio: 3 / 4; }
  .wardrobe-catalog-panel .studio-action-button, .wardrobe-catalog-panel .studio-actions .primary-button { padding: 8px 4px; font-size: 8px; }
}

/* Portrait fitting-room dock: garments left, accessories right, media contained in the centre. */
.wardrobe-catalog-panel .tryon-studio {
  width: min(520px, calc(100vw - 48px));
  height: min(690px, calc(100vh - 48px));
  max-height: none;
  overflow: hidden;
  border-radius: 32px;
}
.wardrobe-catalog-panel .studio-content {
  grid-template-columns: 68px minmax(0, 1fr) 68px;
  gap: 11px;
  min-height: 0;
  height: calc(100% - 61px);
  overflow: hidden;
}
.wardrobe-catalog-panel .studio-preview-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto auto;
  min-height: 0;
  overflow: hidden;
}
.wardrobe-catalog-panel .tryon-selection {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  max-height: none;
  margin: 10px 0 0;
  overflow: hidden;
}
.wardrobe-catalog-panel .tryon-selection-right {
  align-items: stretch;
}
.wardrobe-catalog-panel .selection-rail-heading {
  flex: 0 0 auto;
  min-height: 20px;
}
.wardrobe-catalog-panel .selection-chip {
  flex: 0 0 auto;
}
.wardrobe-catalog-panel .selection-empty {
  flex: 1 1 auto;
  align-content: center;
  min-height: 0;
  padding: 10px 2px;
  border: 1px dashed rgba(145,133,114,.22);
  border-radius: 12px;
}
.selection-empty-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0 auto 6px;
  border: 1px solid rgba(145,133,114,.3);
  border-radius: 50%;
  color: #a18d68;
  font-size: 16px;
  line-height: 1;
}
.wardrobe-catalog-panel .tryon-stage {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 3 / 4;
  margin: 0 0 8px;
  align-self: center;
  overflow: hidden;
  border-radius: 22px;
}
.wardrobe-catalog-panel .tryon-stage.has-generated-media {
  height: auto;
  aspect-ratio: 3 / 4;
}
.wardrobe-catalog-panel .tryon-stage .studio-reference-image,
.wardrobe-catalog-panel .tryon-stage .studio-generated-image,
.wardrobe-catalog-panel .tryon-stage .studio-generated-video {
  object-fit: contain;
}
.wardrobe-catalog-panel .studio-media-controls {
  min-height: 32px;
  margin: 0 0 7px;
  overflow: hidden;
}
.wardrobe-catalog-panel .studio-media-controls > * {
  max-width: 100%;
}
.wardrobe-catalog-panel .studio-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .wardrobe-catalog-panel .tryon-studio {
    width: min(360px, calc(100vw - 24px));
    height: min(650px, calc(100vh - 24px));
    max-height: none;
    border-radius: 26px;
  }
  .wardrobe-catalog-panel .tryon-studio.is-positioned {
    width: min(360px, calc(100vw - 24px));
  }
  .wardrobe-catalog-panel .studio-content {
    grid-template-columns: 54px minmax(0, 1fr) 54px;
    gap: 7px;
    height: calc(100% - 56px);
  }
  .wardrobe-catalog-panel .selection-chip {
    width: 50px;
    min-height: 60px;
  }
  .wardrobe-catalog-panel .selection-chip-image {
    width: 40px;
    height: 40px;
  }
  .wardrobe-catalog-panel .selection-chip-copy span {
    font-size: 7px;
  }
}

/* Phase 4 generated-look pass: preserve complete portrait renders in the lookbook. */
.generation-card .generated-look-art.has-generated-media {
  height: auto;
  min-height: 0;
  aspect-ratio: 3 / 4;
  align-items: stretch;
  background: #e6dfd3;
}

.generation-card .generated-look-art.has-generated-media .generated-result-image,
.generation-card .generated-look-art.has-generated-media .generated-result-video {
  object-fit: contain;
  background: transparent;
}

.generation-card .media-tab[aria-selected="true"] {
  outline: 1px solid currentColor;
  outline-offset: -2px;
}

@media (max-width: 760px) {
  /* Keep the compact wardrobe chrome from creating a page-level horizontal scroll. */
  html,
  body {
    overflow-x: hidden;
  }

  .generation-card .generated-look-art.has-generated-media {
    aspect-ratio: 3 / 4;
  }
}

/* Final shell pass: keep the icon rail, category bar, and accessory badge above legacy rules. */
.sidebar { width: 58px; padding: 16px 8px; background: #f2eee6; }
.brand-mark { width: 30px; height: 30px; margin: 0; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #8e877c; }
.brand-mark:hover, .brand-mark:focus-visible { background: rgba(255,255,255,.58); outline: none; }
.nav-list { gap: 7px; margin-top: 36px; }
.nav-item { width: 40px; height: 40px; border-radius: 11px; }
.nav-icon { width: 20px; height: 20px; font-size: 17px; }
.sidebar-footer { gap: 9px; }
.sidebar-footer .nav-settings { width: 40px; height: 40px; }
.app-shell.sidebar-collapsed .sidebar { width: 44px; padding-inline: 5px; }
.app-shell.sidebar-collapsed .nav-item, .app-shell.sidebar-collapsed .sidebar-footer .nav-settings { width: 34px; height: 34px; }
body[data-view="wardrobe"] .topbar, body[data-view="wardrobe"] .context-bar { display: none; }
body[data-view="wardrobe"] .main-content { max-width: none; padding: 0 48px 70px; }
.wardrobe-catalog-panel .wardrobe-topnav { display: flex; align-items: center; gap: 0; height: 56px; margin: -10px -48px 34px; padding: 0 24px; border-bottom: 1px solid var(--catalog-line); background: rgba(242,238,230,.92); color: var(--catalog-muted); }
/* Phase 1 mobile fitting-room pass: high-specificity override for the final cascade. */
@media (max-width: 760px) {
  .wardrobe-catalog-panel .tryon-studio,
  .wardrobe-catalog-panel .tryon-studio.is-positioned {
    width: min(306px, calc(100vw - 28px)) !important;
    height: min(500px, calc(100vh - 110px)) !important;
    height: min(500px, calc(100dvh - 110px)) !important;
    max-height: calc(100dvh - 110px) !important;
    padding: 12px !important;
    border-radius: 24px !important;
  }
  .wardrobe-catalog-panel .tryon-studio .studio-header h3 { font-size: 20px !important; }
  .wardrobe-catalog-panel .tryon-studio .studio-content {
    grid-template-columns: 50px minmax(0, 1fr) 50px !important;
    gap: 6px !important;
    height: calc(100% - 54px) !important;
  }
  .wardrobe-catalog-panel .tryon-studio .tryon-selection { gap: 6px !important; margin-top: 7px !important; }
  .wardrobe-catalog-panel .tryon-studio .selection-chip { width: 46px !important; min-height: 56px !important; padding: 3px !important; border-radius: 9px !important; }
  .wardrobe-catalog-panel .tryon-studio .selection-chip-image { width: 38px !important; height: 36px !important; border-radius: 6px !important; }
  .wardrobe-catalog-panel .tryon-studio .selection-chip-copy b { font-size: 6px !important; }
  .wardrobe-catalog-panel .tryon-studio .selection-chip-copy span { font-size: 6.5px !important; }
  .wardrobe-catalog-panel .tryon-studio .tryon-stage,
  .wardrobe-catalog-panel .tryon-studio .tryon-stage.has-generated-media {
    height: 220px !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    margin-bottom: 6px !important;
  }
  .wardrobe-catalog-panel .tryon-studio .studio-media-controls { min-height: 24px !important; margin-bottom: 5px !important; }
  .wardrobe-catalog-panel .tryon-studio .studio-actions { gap: 5px !important; }
  .wardrobe-catalog-panel .tryon-studio .studio-action-button,
  .wardrobe-catalog-panel .tryon-studio .studio-actions .primary-button { padding: 7px 3px !important; font-size: 7.5px !important; }
}
.topnav-menu, .topnav-category, .topnav-utility { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; height: 55px; border: 0; color: inherit; background: transparent; cursor: pointer; }
.topnav-menu { width: 28px; color: #827a6e; }
.topnav-divider { height: 34px; margin: 0 20px 0 10px; border-left: 1px solid var(--catalog-line); }
.topnav-category { position: relative; flex-direction: column; gap: 2px; min-width: 58px; padding: 4px 9px 0; text-transform: uppercase; letter-spacing: .1em; font-size: 8px; }
.topnav-category::after { content: ""; position: absolute; right: 9px; bottom: -1px; left: 9px; border-bottom: 1px solid transparent; }
.topnav-category:hover, .topnav-category:focus-visible, .topnav-category.active { color: var(--catalog-ink); outline: none; }
.topnav-category.active::after { border-color: var(--catalog-ink); }
.topnav-icon { display: grid; place-items: center; height: 19px; color: currentColor; font-family: Georgia, serif; font-size: 18px; line-height: 1; }
.topnav-icon-all { font-size: 13px; }
.topnav-spacer { flex: 1 1 auto; }
.topnav-utility { width: 38px; height: 55px; font-family: Georgia, serif; font-size: 19px; }
.topnav-utility:hover, .topnav-utility:focus-visible { color: var(--catalog-ink); background: rgba(255,255,255,.38); outline: none; }
.wardrobe-catalog-panel .studio-content { grid-template-columns: 76px minmax(0, 1fr) 76px; gap: 9px; }
.wardrobe-catalog-panel .tryon-selection-right .selection-rail-heading { position: relative; display: block; min-height: 20px; padding: 0 21px 3px 0; white-space: nowrap; overflow: visible; }
.wardrobe-catalog-panel .tryon-selection-right .selection-rail-heading span { display: block; overflow: hidden; text-overflow: ellipsis; }
.wardrobe-catalog-panel .tryon-selection-right .selection-rail-heading b { position: absolute; top: 0; right: 0; flex: none; }
@media (max-width: 760px) {
  body[data-view="wardrobe"] .main-content { padding: 0 16px 50px; }
  .wardrobe-catalog-panel .wardrobe-topnav { height: 50px; margin: -42px -16px 28px; padding: 0 9px; overflow: hidden; }
  .topnav-divider { margin-inline: 8px; }
  .topnav-category { min-width: 48px; padding-inline: 3px; font-size: 7px; }
  .topnav-utility { width: 28px; }
  .wardrobe-catalog-panel .studio-content { grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 7px; }
}
/* Phase 6 mobile viewport/search safeguards. */
@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  body[data-view="wardrobe"] .main-content {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body[data-view="wardrobe"] .wardrobe-catalog-panel {
    min-width: 0;
    max-width: none;
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
    overflow-x: clip;
  }

  .wardrobe-catalog-panel .wardrobe-layout,
  .wardrobe-catalog-panel .wardrobe-inventory,
  .wardrobe-catalog-panel .catalog-group-list,
  .wardrobe-catalog-panel .catalog-group,
  .wardrobe-catalog-panel .toolbar,
  .wardrobe-catalog-panel .filter-tabs,
  .wardrobe-catalog-panel .search-box {
    min-width: 0;
    max-width: 100%;
  }

  .wardrobe-catalog-panel .toolbar {
    align-items: stretch;
  }

  .wardrobe-catalog-panel .search-box {
    width: 100%;
    min-height: 44px;
    padding-inline: 12px;
    flex: 1 1 auto;
  }

  .wardrobe-catalog-panel .search-box input {
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    padding-block: 10px;
    font-size: 16px;
    scroll-margin-block: 12px;
  }

  .wardrobe-catalog-panel .tryon-launcher {
    max-width: calc(100vw - 24px);
    min-height: 44px;
    padding-inline: 14px;
    white-space: nowrap;
  }

  .wardrobe-catalog-panel .tryon-studio,
  .wardrobe-catalog-panel .tryon-studio.is-positioned {
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .wardrobe-catalog-panel .tryon-studio .studio-drag-handle {
    min-height: 44px;
    margin-top: -22px;
  }

  .wardrobe-catalog-panel .tryon-studio .studio-icon-button,
  .wardrobe-catalog-panel .tryon-studio .studio-action-button,
  .wardrobe-catalog-panel .tryon-studio .studio-actions .primary-button,
  .wardrobe-catalog-panel .tryon-studio .video-generation-control .text-button,
  .wardrobe-catalog-panel .tryon-studio .video-engine-select select,
  .wardrobe-catalog-panel .tryon-studio .selection-clear {
    min-height: 44px;
  }

  .wardrobe-catalog-panel .tryon-studio .studio-icon-button {
    min-width: 44px;
  }

  body:has(#wardrobe-search:focus) .wardrobe-catalog-panel .tryon-studio,
  body:has(#wardrobe-search:focus) .wardrobe-catalog-panel .tryon-launcher {
    visibility: hidden;
    pointer-events: none;
  }
}

/* Phase 6 primary navigation: one class-driven mobile drawer state. */
@media (max-width: 760px) {
  body.mobile-nav-scroll-locked {
    position: fixed;
    top: var(--mobile-nav-scroll-y, 0);
    left: var(--mobile-nav-scroll-x, 0);
    right: 0;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-shell.mobile-nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 98;
    background: rgba(28, 25, 21, .28);
    backdrop-filter: blur(2px);
  }

  .app-shell.mobile-nav-open .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: min(280px, 86vw);
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px 14px;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid #ddd6cb;
    border-bottom: 0;
    background: #f2eee6;
    box-shadow: 12px 0 34px rgba(65, 56, 45, .18);
    overscroll-behavior: contain;
  }

  .app-shell.mobile-nav-open .brand-mark {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin-left: 0;
  }

  .app-shell.mobile-nav-open .brand-copy {
    position: static;
    display: flex;
    width: auto;
    height: auto;
    margin-top: 12px;
    padding: 0 10px;
    overflow: visible;
    visibility: visible;
    opacity: 1;
    clip: auto;
    pointer-events: auto;
  }

  .app-shell.mobile-nav-open .nav-list {
    display: grid;
    flex: 0 0 auto;
    gap: 7px;
    width: 100%;
    margin-top: 32px;
    overflow: visible;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell.mobile-nav-open .sidebar-footer {
    display: grid;
    gap: 9px;
    width: 100%;
    margin-top: auto;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell.mobile-nav-open .nav-item,
  .app-shell.mobile-nav-open .sidebar-footer .nav-item,
  .app-shell.mobile-nav-open .sidebar-footer .nav-settings {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    height: 48px;
    padding: 0 14px;
    text-align: left;
  }

  .app-shell.mobile-nav-open .sidebar .nav-label {
    position: static;
    display: inline;
    width: auto;
    height: auto;
    overflow: visible;
    visibility: visible;
    opacity: 1;
    clip: auto;
    white-space: normal;
  }
}

/* Wishlist private-library surface. Kept separate from wardrobe and try-on rules. */
.wishlist-panel {
  min-height: 60vh;
}

.wishlist-heading {
  align-items: flex-end;
}

.wishlist-heading .muted {
  max-width: 34rem;
  margin: 10px 0 0;
}

.wishlist-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.wishlist-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.wishlist-filter {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
}

.wishlist-filter:hover,
.wishlist-filter:focus-visible,
.wishlist-filter.active {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

.wishlist-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(280px, 100%);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.wishlist-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 9px 0;
  color: var(--text);
  font: inherit;
}

.wishlist-status {
  min-height: 1.3em;
  margin: 0 0 14px;
}

.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.wishlist-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 14px 30px rgba(44, 37, 27, 0.06);
}

.wishlist-card-media {
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  background: var(--panel-soft);
}

.wishlist-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
}

.wishlist-card-body {
  padding: 16px;
}

.wishlist-card-kicker {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wishlist-card h3 {
  margin: 8px 0 7px;
  font-size: 1.05rem;
}

.wishlist-card p {
  min-height: 2.5em;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.wishlist-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 12px;
}

.wishlist-tags span {
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.72rem;
}

.wishlist-card-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.wishlist-discovery-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

.wishlist-discovery-status .text-button {
  padding: 0;
}

.wishlist-matches {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.wishlist-match-disclosure,
.wishlist-no-matches {
  min-height: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.wishlist-match {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.wishlist-match img,
.wishlist-match-placeholder {
  width: 48px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 7px;
  object-fit: contain;
  background: var(--panel-soft);
}

.wishlist-match-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 1.4rem;
}

.wishlist-match-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.wishlist-match-copy strong,
.wishlist-match-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wishlist-match-copy strong {
  font-size: 0.78rem;
}

.wishlist-match-copy span {
  color: var(--muted);
  font-size: 0.7rem;
}

.danger-button {
  color: #8d3f37;
}

.wishlist-empty {
  max-width: 520px;
  margin: 60px auto;
  padding: 44px 26px;
  border: 1px dashed var(--line);
  text-align: center;
}

.wishlist-empty-mark {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 3rem;
}

.wishlist-empty h3 {
  margin: 0 0 8px;
}

.wishlist-empty p {
  margin: 0 auto 20px;
  max-width: 30rem;
  color: var(--muted);
  line-height: 1.5;
}

.wishlist-dialog {
  width: min(620px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(25, 21, 17, 0.25);
}

.wishlist-dialog::backdrop {
  background: rgba(36, 30, 23, 0.32);
  backdrop-filter: blur(5px);
}

.wishlist-dialog form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.wishlist-dialog-header,
.wishlist-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.wishlist-dialog-header h2 {
  margin: 4px 0 0;
}

.wishlist-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
}

.wishlist-dialog input,
.wishlist-dialog select,
.wishlist-dialog textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
}

.wishlist-dialog textarea {
  resize: vertical;
}

.wishlist-file-field {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 14px;
}

.wishlist-file-field span,
.field-hint {
  color: var(--muted);
  font-size: 0.75rem;
}

.wishlist-form-grid {
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: 14px;
}

.wishlist-form-error {
  min-height: 1.2em;
  margin: 0;
  color: #8d3f37;
}

@media (max-width: 760px) {
  .wishlist-heading {
    align-items: flex-start;
    gap: 16px;
  }

  .wishlist-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .wishlist-search {
    min-width: 0;
  }

  .wishlist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .wishlist-card-body {
    padding: 12px;
  }

  .wishlist-card-kicker {
    font-size: 0.58rem;
  }

  .wishlist-card h3 {
    font-size: 0.92rem;
  }

  .wishlist-card p {
    font-size: 0.78rem;
  }

  .wishlist-card-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .wishlist-form-grid {
    grid-template-columns: 1fr;
  }
}
