:root {
  --paper: #f2ecdf;
  --paper-2: #fbf8f1;
  --ink: #211f1c;
  --muted: #777066;
  --line: rgba(55, 44, 34, .13);
  --wine: #6e2233;
  --wine-2: #8b3247;
  --moss: #46513b;
  --cream: #e9dfc8;
  --gold: #b58a34;
  --graphite: #2e3033;
  --terracotta: #a6543d;
  --shadow: 0 18px 50px rgba(43, 33, 24, .10);
  --radius: 22px;
  --header-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}
button, input, select { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }

body.high-contrast {
  --paper: #171716;
  --paper-2: #232220;
  --ink: #f5f0e6;
  --muted: #b9b0a4;
  --line: rgba(255,255,255,.12);
  --shadow: 0 18px 50px rgba(0,0,0,.32);
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display:flex; align-items:center; gap:12px; color:inherit; text-decoration:none; }
.brand-mark {
  width: 42px; height: 42px; display:grid; place-items:center;
  border-radius: 50%; background: var(--wine); color:#fff;
  font: 700 15px/1 Georgia, serif; letter-spacing:.08em;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.2);
}
.brand strong { display:block; font-family: Georgia, "Times New Roman", serif; font-size:18px; }
.brand small { display:block; margin-top:2px; color:var(--muted); font-size:12px; letter-spacing:.08em; text-transform:uppercase; }
.header-actions { display:flex; gap:8px; }
.icon-button {
  border:1px solid var(--line); background:var(--paper-2); width:42px; height:42px;
  border-radius:50%; cursor:pointer; font-size:21px;
}

.shell { display:grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar {
  position:sticky; top:var(--header-h); height:calc(100vh - var(--header-h));
  padding:24px 18px; border-right:1px solid var(--line); display:flex; flex-direction:column;
}
.desktop-nav { display:grid; gap:7px; }
.nav-item {
  border:0; background:transparent; cursor:pointer; display:flex; align-items:center; gap:12px;
  min-height:48px; padding:0 14px; border-radius:14px; color:var(--muted); text-align:left;
  font-weight:650;
}
.nav-item span { font-size:21px; width:24px; text-align:center; }
.nav-item:hover { background:color-mix(in srgb, var(--wine) 7%, transparent); color:var(--ink); }
.nav-item.is-active { background:var(--wine); color:#fff; box-shadow:0 8px 24px rgba(110,34,51,.22); }
.sidebar-note { margin-top:auto; padding:18px; border:1px solid var(--line); background:var(--paper-2); border-radius:18px; }
.sidebar-note p { margin:8px 0 0; color:var(--muted); font-size:13px; line-height:1.5; }
.eyebrow { color:var(--wine-2); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.12em; }

main { min-width:0; padding:38px clamp(22px, 4vw, 64px) 96px; }
.page { max-width: 1440px; margin:0 auto; animation:fadeUp .35s ease both; }
@keyframes fadeUp { from {opacity:0; transform:translateY(8px)} }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior:auto; }
  *, *::before, *::after {
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
    scroll-behavior:auto !important;
  }
}

.hero {
  position:relative; overflow:hidden; padding:clamp(28px, 5vw, 68px); border-radius:30px;
  background:linear-gradient(125deg, var(--wine) 0%, #3a2228 60%, var(--moss) 100%); color:white;
  box-shadow:var(--shadow);
}
.hero::after { content:""; position:absolute; width:380px; height:380px; right:-120px; top:-190px; border:1px solid rgba(255,255,255,.14); border-radius:50%; box-shadow:0 0 0 45px rgba(255,255,255,.04), 0 0 0 90px rgba(255,255,255,.025); }
.hero > * { position:relative; z-index:1; }
.hero .eyebrow { color:#e3c98a; }
.hero h1 { max-width:760px; margin:12px 0 14px; font:500 clamp(38px, 7vw, 78px)/.98 Georgia, "Times New Roman", serif; letter-spacing:-.04em; }
.hero p { max-width:640px; margin:0; color:rgba(255,255,255,.72); font-size:clamp(15px, 2vw, 19px); line-height:1.55; }
.hero-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:28px; }
.primary-button, .secondary-button {
  min-height:46px; padding:0 19px; border-radius:999px; cursor:pointer; font-weight:750; border:1px solid transparent;
}
.primary-button { background:#fff; color:#40232b; }
.secondary-button { background:rgba(255,255,255,.08); color:#fff; border-color:rgba(255,255,255,.22); }

.stats { display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; margin:18px 0 42px; }
.stat { background:var(--paper-2); border:1px solid var(--line); border-radius:18px; padding:18px; }
.stat strong { display:block; font:600 32px/1 Georgia, serif; }
.stat span { display:block; color:var(--muted); font-size:12px; margin-top:6px; text-transform:uppercase; letter-spacing:.08em; }

.section-heading { display:flex; align-items:end; justify-content:space-between; gap:18px; margin:38px 0 18px; }
.section-heading h2, .page-heading h1 { margin:0; font:500 clamp(30px, 4vw, 48px)/1.05 Georgia, serif; letter-spacing:-.025em; }
.section-heading p, .page-heading p { margin:8px 0 0; color:var(--muted); line-height:1.55; }
.text-button { border:0; background:transparent; color:var(--wine-2); font-weight:800; cursor:pointer; }

.board-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:16px; }
.board-card { margin:0; border-radius:var(--radius); overflow:hidden; background:var(--paper-2); border:1px solid var(--line); cursor:pointer; }
.board-card img { aspect-ratio:1.42; width:100%; object-fit:cover; transition:transform .45s ease; }
.board-card:hover img { transform:scale(1.02); }
.board-card figcaption { padding:15px 17px 17px; font-weight:750; }

.palette { display:grid; grid-template-columns:repeat(6, 1fr); gap:10px; }
.swatch { min-height:118px; padding:14px; display:flex; flex-direction:column; justify-content:end; border-radius:18px; border:1px solid var(--line); box-shadow: inset 0 -60px 55px rgba(0,0,0,.16); }
.swatch strong { color:#fff; font-size:13px; }
.swatch small { color:rgba(255,255,255,.72); margin-top:3px; }
.swatch.light strong, .swatch.light small { color:#332d26; }

.page-heading { margin-bottom:24px; }
.filters {
  display:grid; grid-template-columns:minmax(220px, 1fr) repeat(3, minmax(140px, .32fr)); gap:10px;
  padding:13px; border:1px solid var(--line); border-radius:20px; background:var(--paper-2); margin-bottom:16px;
}
.search-wrap { position:relative; }
.search-wrap > span[aria-hidden] { position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--muted); }
.filters input, .filters select {
  width:100%; min-height:44px; border:1px solid var(--line); border-radius:12px; background:var(--paper); color:var(--ink); padding:0 13px;
}
.filters input { padding-left:42px; }
.filter-chips { display:flex; gap:8px; flex-wrap:wrap; margin:0 0 20px; }
.chip { border:1px solid var(--line); background:var(--paper-2); color:var(--muted); border-radius:999px; padding:8px 12px; cursor:pointer; font-size:13px; font-weight:700; }
.chip.is-active { background:var(--moss); color:#fff; border-color:transparent; }
.results-count { color:var(--muted); font-size:13px; margin:0 0 12px; }

.piece-grid { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:16px; }
.piece-card { position:relative; overflow:hidden; border-radius:var(--radius); background:var(--paper-2); border:1px solid var(--line); transition:transform .22s ease, box-shadow .22s ease; }
.piece-card-open { position:absolute; inset:0; z-index:1; width:100%; border:0; background:transparent; cursor:pointer; }
.piece-card-open:focus-visible { outline:3px solid var(--wine-2); outline-offset:-3px; border-radius:var(--radius); }
.piece-card:hover { transform:translateY(-3px); box-shadow:var(--shadow); }
.piece-image { position:relative; aspect-ratio:.78; overflow:hidden; background:#e4e3e0; }
.piece-image img { width:100%; height:100%; object-fit:contain; object-position:center; transition:transform .45s ease; }
.piece-card:hover .piece-image img { transform:scale(1.025); }
.image-placeholder {
  display:flex; width:100%; height:100%; min-height:inherit; align-items:center; justify-content:center;
  flex-direction:column; gap:9px; padding:14px; background:linear-gradient(145deg, #e8e7e3, #d9d8d4);
  color:#625e58; text-align:center;
}
.image-placeholder > span { font-size:26px; line-height:1; }
.image-placeholder strong { max-width:18ch; font-size:12px; line-height:1.35; }
body.high-contrast .image-placeholder { background:linear-gradient(145deg, #343330, #292826); color:#d3cec5; }
.media-retry {
  position:relative; z-index:3;
  min-height:34px; padding:0 12px; border:1px solid currentColor; border-radius:999px;
  background:var(--paper-2); color:var(--wine-2); cursor:pointer; font-size:11px; font-weight:800;
}
.media-retry:focus-visible { outline:3px solid var(--wine-2); outline-offset:2px; }
.favorite-button { position:absolute; z-index:2; right:12px; top:12px; width:38px; height:38px; border-radius:50%; border:1px solid rgba(255,255,255,.5); background:rgba(34,29,25,.35); color:white; cursor:pointer; backdrop-filter:blur(8px); font-size:18px; }
.favorite-button.is-active { background:var(--wine); }
.piece-body { padding:16px; }
.badges { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.badge { display:inline-flex; align-items:center; min-height:23px; padding:0 8px; border-radius:999px; background:color-mix(in srgb, var(--moss) 12%, transparent); color:var(--moss); font-size:10px; font-weight:850; letter-spacing:.06em; text-transform:uppercase; }
body.high-contrast .badge { color:#cdd8c6; }
.badge.signature { background:rgba(110,34,51,.12); color:var(--wine-2); }
.piece-body h3 { margin:0; font:600 20px/1.15 Georgia, serif; }
.piece-meta { display:flex; justify-content:space-between; gap:10px; align-items:center; margin-top:12px; color:var(--muted); font-size:12px; }
.status-select { position:relative; z-index:2; max-width:112px; border:1px solid var(--line); border-radius:999px; color:var(--ink); background:var(--paper); padding:7px 9px; font-size:11px; }
.empty-state { padding:56px 20px; text-align:center; border:1px dashed var(--line); border-radius:var(--radius); color:var(--muted); }

.look-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:18px; }
.look-card { overflow:hidden; border-radius:var(--radius); background:var(--paper-2); border:1px solid var(--line); }
.look-card img, .look-card > .image-placeholder {
  width:100%; aspect-ratio:2 / 3; object-fit:contain; object-position:center; background:#e4e3e0;
}
.look-info { padding:18px; }
.look-info h3 { margin:8px 0 7px; font:600 23px/1.1 Georgia, serif; }
.look-info p { margin:0; color:var(--muted); line-height:1.5; font-size:14px; }
.look-pieces { display:flex; flex-wrap:wrap; gap:6px; margin-top:14px; }
.look-pieces button { border:1px solid var(--line); background:var(--paper); border-radius:999px; padding:6px 9px; font-size:11px; cursor:pointer; }

.context-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:16px; }
.context-card { padding:24px; min-height:245px; border-radius:var(--radius); border:1px solid var(--line); background:var(--paper-2); display:flex; flex-direction:column; }
.context-icon { font-size:32px; }
.context-card h2 { margin:28px 0 7px; font:600 27px/1.1 Georgia, serif; }
.context-card p { color:var(--muted); margin:0; line-height:1.5; }
.context-count { margin-top:auto; padding-top:20px; color:var(--wine-2); font-weight:800; font-size:13px; }
.context-section { margin-top:42px; }

.piece-dialog { width:min(1060px, calc(100vw - 24px)); max-height:calc(100vh - 24px); padding:0; border:0; border-radius:26px; background:var(--paper-2); color:var(--ink); box-shadow:0 30px 100px rgba(0,0,0,.35); overflow:auto; }
.piece-dialog::backdrop { background:rgba(23,17,15,.68); backdrop-filter:blur(5px); }
.dialog-close { position:fixed; z-index:2; top:26px; right:max(20px, calc((100vw - 1060px) / 2 + 14px)); width:42px; height:42px; border:0; border-radius:50%; background:rgba(22,19,17,.62); color:#fff; font-size:25px; cursor:pointer; backdrop-filter:blur(8px); }
.piece-sheet { min-width:0; }
.sheet-hero { display:grid; grid-template-columns:minmax(300px, .82fr) minmax(0, 1fr); min-height:570px; border-bottom:1px solid var(--line); }
.sheet-image { min-width:0; min-height:570px; overflow:hidden; background:#e4e3e0; }
.sheet-image img { width:100%; height:100%; object-fit:contain; object-position:center; }
.sheet-summary { align-self:center; min-width:0; padding:clamp(30px, 5vw, 64px); }
.sheet-title-row { display:flex; align-items:flex-start; gap:14px; margin:10px 0 14px; }
.sheet-title-row h2 { flex:1; min-width:0; overflow-wrap:anywhere; margin:0; font:500 clamp(34px, 5vw, 56px)/1 Georgia, serif; }
.sheet-favorite { flex:0 0 auto; width:44px; height:44px; border:1px solid var(--line); border-radius:50%; background:var(--paper); color:var(--wine-2); cursor:pointer; font-size:21px; }
.sheet-favorite.is-active { background:var(--wine); border-color:var(--wine); color:#fff; }
.sheet-summary > p { margin:0; color:var(--muted); line-height:1.6; }
.detail-list { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:25px 0; }
.detail { min-width:0; padding:13px; background:var(--paper); border:1px solid var(--line); border-radius:14px; }
.detail small { display:block; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; font-size:9px; }
.detail strong { display:block; overflow-wrap:anywhere; margin-top:5px; font-size:13px; }
.dialog-status { display:block; margin-top:26px; }
.dialog-status select { width:100%; min-height:46px; margin-top:8px; border:1px solid var(--line); border-radius:12px; background:var(--paper); color:var(--ink); padding:0 12px; }
.sheet-section { padding:clamp(28px, 4vw, 48px); border-bottom:1px solid var(--line); }
.sheet-section > h3.eyebrow { margin:0; }
.shopping-section { background:color-mix(in srgb, var(--gold) 5%, var(--paper-2)); }
.shopping-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; }
.shopping-heading h3 { margin:0; }
.shopping-heading p { margin:7px 0 0; color:var(--muted); font-size:13px; line-height:1.45; }
.shopping-heading > span { flex:none; color:var(--muted); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.shopping-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap:14px; margin-top:18px; }
.shopping-card { display:grid; grid-template-columns:minmax(170px, .72fr) minmax(0, 1fr); min-width:0; overflow:hidden; border:1px solid var(--line); border-radius:18px; background:var(--paper-2); }
.shopping-card-image { min-width:0; min-height:280px; background:#f2f2f0; }
.shopping-card-image img, .shopping-card-image > .image-placeholder { width:100%; height:100%; min-height:280px; object-fit:contain; object-position:center; background:#f2f2f0; }
.shopping-card-body { display:flex; min-width:0; flex-direction:column; align-items:flex-start; padding:18px; }
.shopping-card-labels { display:flex; flex-wrap:wrap; gap:6px; }
.shopping-tier, .shopping-availability { display:inline-flex; min-height:23px; align-items:center; padding:0 8px; border-radius:999px; background:color-mix(in srgb, var(--gold) 15%, transparent); color:color-mix(in srgb, var(--gold) 55%, var(--ink)); font-size:9px; font-weight:850; letter-spacing:.06em; text-transform:uppercase; }
.shopping-availability { background:color-mix(in srgb, var(--muted) 12%, transparent); color:var(--muted); }
.shopping-availability.is-available { background:color-mix(in srgb, var(--moss) 14%, transparent); color:var(--moss); }
body.high-contrast .shopping-availability.is-available { color:#cdd8c6; }
.shopping-card h4 { margin:13px 0 4px; overflow-wrap:anywhere; font:600 20px/1.15 Georgia, serif; }
.shopping-store { margin:0; color:var(--muted); font-size:12px; }
.shopping-price { display:block; margin-top:13px; color:var(--wine-2); font-size:21px; }
.shopping-note { margin:10px 0 17px; color:var(--muted); font-size:12px; line-height:1.5; }
.shopping-buy { display:inline-flex; min-height:42px; align-items:center; justify-content:center; gap:8px; margin-top:auto; padding:0 15px; border-radius:999px; background:var(--wine); color:#fff; text-decoration:none; font-size:12px; font-weight:850; }
.shopping-buy.is-disabled { cursor:not-allowed; background:color-mix(in srgb, var(--muted) 68%, var(--paper)); color:var(--paper-2); }
.shopping-buy:focus-visible { outline:3px solid var(--wine-2); outline-offset:3px; }
.shopping-disclaimer { margin:12px 0 0; color:var(--muted); font-size:10px; line-height:1.45; }
.piece-gallery { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; margin-top:16px; }
.piece-gallery figure { min-width:0; margin:0; overflow:hidden; border:1px solid var(--line); border-radius:16px; background:var(--paper); }
.piece-gallery img, .piece-gallery > figure > .image-placeholder {
  width:100%; aspect-ratio:2 / 3; object-fit:contain; object-position:center; background:#e4e3e0;
}
.relation-groups { display:grid; gap:28px; margin-top:16px; }
.relation-group h4 { margin:0 0 10px; font:600 20px/1.2 Georgia, serif; }
.relation-list { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
.relation-card { position:relative; display:grid; grid-template-columns:76px minmax(0, 1fr); min-width:0; min-height:96px; padding:0; overflow:hidden; text-align:left; cursor:pointer; border:1px solid color-mix(in srgb, var(--moss) 55%, var(--line)); border-radius:16px; background:color-mix(in srgb, var(--moss) 7%, var(--paper-2)); }
.relation-card-action, .builder-slot-action, .builder-candidate-action { position:absolute; inset:0; z-index:1; width:100%; border:0; background:transparent; cursor:pointer; }
.relation-card-action:focus-visible, .builder-slot-action:focus-visible, .builder-candidate-action:focus-visible { outline:3px solid var(--wine-2); outline-offset:-3px; border-radius:inherit; }
.relation-card.is-test { border-style:dashed; border-color:color-mix(in srgb, var(--muted) 55%, transparent); background:var(--paper); }
.relation-card img { width:76px; height:100%; min-height:96px; object-fit:contain; object-position:center; background:#e4e3e0; }
.relation-card > .image-placeholder { width:76px; min-height:96px; padding:7px; gap:4px; }
.relation-card > .image-placeholder > span { font-size:18px; }
.relation-card > .image-placeholder strong { font-size:8px; line-height:1.2; }
.relation-copy { display:flex; min-width:0; flex-direction:column; align-items:flex-start; justify-content:center; gap:5px; padding:11px 12px; }
.relation-copy strong { max-width:100%; overflow-wrap:anywhere; font:600 15px/1.15 Georgia, serif; }
.relation-copy > span { color:var(--muted); font-size:11px; line-height:1.35; }
.relation-badge { display:inline-flex; padding:4px 7px; border-radius:999px; background:color-mix(in srgb, var(--wine) 12%, transparent); color:var(--wine-2); font-size:8px; font-weight:850; letter-spacing:.06em; text-transform:uppercase; }
.relation-card.is-test .relation-badge { background:color-mix(in srgb, var(--muted) 12%, transparent); color:var(--muted); }
.sheet-look-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:12px; margin-top:16px; }
.sheet-look-card { min-width:0; overflow:hidden; border:1px solid var(--line); border-radius:16px; background:var(--paper); }
.sheet-look-card > img, .sheet-look-card > .image-placeholder {
  width:100%; aspect-ratio:2 / 3; object-fit:contain; object-position:center; background:#e4e3e0;
}
.sheet-look-card > div { padding:12px; }
.sheet-look-card .badges { margin-bottom:7px; }
.sheet-look-card h4 { margin:0; overflow-wrap:anywhere; font:600 16px/1.2 Georgia, serif; }
.sheet-empty { margin:15px 0 0; padding:24px; border:1px dashed var(--line); border-radius:15px; color:var(--muted); text-align:center; }
.personal-look-list { display:grid; gap:9px; margin-top:16px; }
.personal-look-list article { display:grid; gap:4px; padding:14px; border:1px solid var(--line); border-radius:14px; background:var(--paper); }
.personal-look-list strong { font-family:Georgia, serif; }
.personal-look-list span { overflow-wrap:anywhere; color:var(--muted); font-size:12px; line-height:1.45; }
.sheet-actions { padding:24px clamp(28px, 4vw, 48px) 34px; }
.sheet-builder-button { width:100%; min-height:50px; padding:0 20px; border:0; border-radius:999px; background:var(--wine); color:#fff; cursor:pointer; font-weight:800; box-shadow:0 9px 24px rgba(110,34,51,.2); }

.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.builder { min-width:0; }
.builder-header { padding:clamp(32px, 5vw, 56px) clamp(24px, 5vw, 54px) 28px; border-bottom:1px solid var(--line); }
.builder-header h2 { margin:9px 0 8px; font:500 clamp(34px, 5vw, 52px)/1 Georgia, serif; }
.builder-header p, .builder-candidates > p, .builder-personal-looks > p { margin:0; color:var(--muted); line-height:1.5; }
.builder-layout { display:grid; grid-template-columns:minmax(300px, .9fr) minmax(0, 1.1fr); min-width:0; }
.builder-controls, .builder-candidates { min-width:0; padding:clamp(24px, 4vw, 42px); }
.builder-controls { border-right:1px solid var(--line); }
.builder h3 { margin:0 0 14px; font:600 22px/1.15 Georgia, serif; }
.builder-slots { display:grid; gap:10px; }
.builder-slot { position:relative; min-width:0; overflow:hidden; border:1px solid var(--line); border-radius:16px; background:var(--paper); }
.builder-slot.is-active { border-color:var(--wine-2); box-shadow:0 0 0 2px color-mix(in srgb, var(--wine) 12%, transparent); }
.builder-slot.is-anchor { border-color:color-mix(in srgb, var(--moss) 65%, var(--line)); background:color-mix(in srgb, var(--moss) 6%, var(--paper)); }
.builder-slot-main { display:grid; grid-template-columns:72px minmax(0, 1fr); width:100%; min-width:0; min-height:82px; padding:0 84px 0 0; border:0; background:transparent; text-align:left; cursor:pointer; }

.builder-slot-main.is-empty { display:block; min-height:62px; padding:0 16px; color:var(--wine-2); font-weight:800; }
.builder-slot-main img { width:72px; height:82px; object-fit:contain; object-position:center; background:#e4e3e0; }
.builder-slot-main > .image-placeholder { width:72px; height:82px; padding:6px; gap:3px; align-items:center; justify-content:center; }
.builder-slot-main > .image-placeholder > span { font-size:17px; }
.builder-slot-main > .image-placeholder strong { font-size:8px; line-height:1.15; }
.builder-slot-main > span { display:flex; min-width:0; flex-direction:column; align-items:flex-start; justify-content:center; gap:4px; padding:10px 12px; }
.builder-slot-main strong, .builder-saved-look strong { max-width:100%; overflow-wrap:anywhere; font-family:Georgia, serif; }
.builder-slot-main small { color:var(--muted); font-size:11px; }
.builder-slot-main em { padding:4px 7px; border-radius:999px; background:var(--moss); color:#fff; font-size:9px; font-style:normal; font-weight:850; letter-spacing:.06em; text-transform:uppercase; }
.builder-remove { position:absolute; z-index:2; right:10px; top:50%; transform:translateY(-50%); padding:7px 9px; border:1px solid var(--line); border-radius:999px; background:var(--paper-2); color:var(--wine-2); cursor:pointer; font-size:10px; font-weight:800; }
.builder-save-panel { display:grid; grid-template-columns:minmax(0, 1fr) auto; gap:8px; margin-top:25px; }
.builder-save-panel label { grid-column:1/-1; font-size:12px; font-weight:800; }
.builder-save-panel input { min-width:0; min-height:45px; padding:0 12px; border:1px solid var(--line); border-radius:12px; background:var(--paper-2); color:var(--ink); }
.builder-save { min-height:45px; padding:0 15px; border:0; border-radius:12px; background:var(--wine); color:#fff; cursor:pointer; font-weight:800; }
.builder-save:disabled { cursor:not-allowed; opacity:.42; }
.builder-confirmation { grid-column:1/-1; min-height:20px; margin:1px 0 0; color:var(--moss); font-size:12px; font-weight:750; }
.builder-candidates > p { margin:-6px 0 16px; font-size:13px; }
.builder-candidate-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; min-width:0; }
.builder-candidate { position:relative; display:grid; grid-template-columns:76px minmax(0, 1fr); min-width:0; min-height:100px; padding:0; overflow:hidden; border:1px solid var(--line); border-radius:15px; background:var(--paper); text-align:left; cursor:pointer; }
.builder-candidate img { width:76px; height:100%; min-height:100px; object-fit:contain; object-position:center; background:#e4e3e0; }
.builder-candidate > .image-placeholder { width:76px; min-height:100px; padding:7px; gap:4px; }
.builder-candidate > .image-placeholder > span { font-size:18px; }
.builder-candidate > .image-placeholder strong { font-size:8px; line-height:1.2; }
.builder-candidate > span { display:flex; min-width:0; flex-direction:column; justify-content:center; gap:7px; padding:10px; }
.builder-candidate strong { overflow-wrap:anywhere; font:600 14px/1.15 Georgia, serif; }
.builder-candidate small { color:var(--muted); font-size:9px; font-weight:800; line-height:1.3; text-transform:uppercase; }
.builder-candidate.is-safe { border-color:color-mix(in srgb, var(--moss) 68%, var(--line)); background:color-mix(in srgb, var(--wine) 5%, var(--paper)); }
.builder-candidate.is-safe small { color:var(--wine-2); }
.builder-candidate.is-test { border-style:dashed; border-color:color-mix(in srgb, var(--muted) 65%, transparent); }
.builder-no-candidates { grid-column:1/-1; padding:28px 12px; border:1px dashed var(--line); border-radius:14px; color:var(--muted); text-align:center; }
.builder-personal-looks { min-width:0; padding:clamp(28px, 4vw, 42px); border-top:1px solid var(--line); }
.builder-saved-list { display:grid; gap:9px; }
.builder-saved-look { display:flex; min-width:0; align-items:center; justify-content:space-between; gap:14px; padding:14px; border:1px solid var(--line); border-radius:14px; background:var(--paper); }
.builder-saved-look > div:first-child { display:grid; min-width:0; gap:4px; }
.builder-saved-look span { overflow-wrap:anywhere; color:var(--muted); font-size:11px; line-height:1.4; }
.builder-saved-actions { display:flex; flex:none; gap:7px; }
.builder-saved-actions button, .builder-footer button { padding:8px 11px; border:1px solid var(--line); border-radius:999px; background:var(--paper-2); cursor:pointer; font-size:11px; font-weight:800; }
.builder-saved-actions button:last-child { color:var(--wine-2); }
.builder-footer { padding:20px clamp(24px, 4vw, 42px) 32px; border-top:1px solid var(--line); }
.builder-footer button { min-height:42px; padding-inline:16px; color:var(--wine-2); }

.mobile-nav { display:none; }

@media (max-width: 1180px) {
  .piece-grid { grid-template-columns:repeat(3, 1fr); }
  .filters { grid-template-columns:1fr 1fr; }
  .board-grid, .context-grid { grid-template-columns:1fr 1fr; }
  .board-card:last-child, .context-card:last-child { grid-column:span 2; }
  .palette { grid-template-columns:repeat(3,1fr); }
}

@media (max-width: 820px) {
  :root { --header-h:66px; }
  .site-header { padding:0 16px; }
  .brand strong { font-size:16px; }
  .shell { display:block; }
  .sidebar { display:none; }
  main { padding:18px 14px 96px; }
  .hero { border-radius:22px; padding:32px 24px; }
  .hero h1 { font-size:46px; }
  .stats { grid-template-columns:1fr 1fr; margin-bottom:30px; }
  .piece-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
  .piece-body { padding:13px; }
  .piece-body h3 { font-size:17px; }
  .look-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .board-grid, .context-grid { grid-template-columns:1fr; }
  .board-card:last-child, .context-card:last-child { grid-column:auto; }
  .mobile-nav { position:fixed; z-index:40; display:grid; grid-template-columns:repeat(4,1fr); bottom:0; left:0; right:0; padding:7px 8px calc(7px + env(safe-area-inset-bottom)); background:color-mix(in srgb, var(--paper) 92%, transparent); border-top:1px solid var(--line); backdrop-filter:blur(16px); }
  .mobile-nav .nav-item { min-height:54px; padding:5px; justify-content:center; flex-direction:column; gap:1px; border-radius:12px; }
  .mobile-nav .nav-item span { font-size:19px; line-height:1; }
  .mobile-nav .nav-item small { font-size:10px; }
  .mobile-nav .nav-item.is-active { box-shadow:none; }
  .sheet-hero { grid-template-columns:1fr; }
  .sheet-image { min-height:52vh; height:52vh; }
  .sheet-summary { padding:32px 26px; }
  .piece-gallery { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .sheet-look-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .builder-layout { grid-template-columns:1fr; }
  .builder-controls { border-right:0; border-bottom:1px solid var(--line); }
  .builder-candidate-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .hero h1 { font-size:40px; }
  .hero-actions { display:grid; }
  .stats { gap:8px; }
  .stat { padding:14px; }
  .stat strong { font-size:27px; }
  .section-heading { align-items:start; }
  .section-heading .text-button { flex:none; }
  .board-grid { gap:10px; }
  .palette { grid-template-columns:1fr 1fr; }
  .filters { grid-template-columns:1fr; }
  .piece-image { aspect-ratio:.72; }
  .piece-meta { display:block; }
  .status-select { width:100%; max-width:none; margin-top:10px; }
  .look-grid { grid-template-columns:1fr; }

  .piece-dialog { max-height:calc(100vh - 12px); width:calc(100vw - 12px); border-radius:20px; }
  .dialog-close { top:12px; right:12px; }
  .sheet-image { min-height:48vh; height:48vh; }
  .sheet-summary { padding:26px 18px 30px; }
  .sheet-title-row { gap:8px; }
  .sheet-title-row h2 { font-size:34px; }
  .detail-list { grid-template-columns:1fr; }
  .sheet-section { padding:28px 18px; }
  .shopping-heading { align-items:flex-start; }
  .shopping-card { grid-template-columns:1fr; }
  .shopping-card-image, .shopping-card-image img, .shopping-card-image > .image-placeholder { min-height:260px; height:260px; }
  .relation-list, .sheet-look-grid, .piece-gallery { grid-template-columns:1fr; }
  .relation-card { grid-template-columns:72px minmax(0, 1fr); }
  .relation-card img { width:72px; }
  .sheet-actions { padding:20px 18px 28px; }
  .builder-header, .builder-controls, .builder-candidates, .builder-personal-looks { padding-left:16px; padding-right:16px; }
  .builder-candidate-grid { grid-template-columns:1fr; }
  .builder-candidate { grid-template-columns:70px minmax(0, 1fr); }
  .builder-candidate img { width:70px; }
  .builder-save-panel { grid-template-columns:1fr; }
  .builder-save-panel label, .builder-confirmation { grid-column:1; }
  .builder-saved-look { align-items:flex-start; flex-direction:column; }
  .builder-slot-main { padding-right:76px; }
  .builder-footer { padding-left:16px; padding-right:16px; }
}
