:root {
  --paper: #f4f0ea;
  --panel: #ebe5dd;
  --panel-2: #e3dcd2;
  --ink: #141210;
  --muted: #8a8279;
  --line: #ddd5ca;
  --white: #fbf9f6;
  --accent: #8c1c24;
  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --top: 68px;
  font-family: var(--sans);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--paper); }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.kicker { margin: 0; font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 28px; background: rgba(244, 240, 234, .92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-left { display: flex; align-items: center; gap: 22px; min-width: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--muted); padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; transition: color .2s, border-color .2s; }
.back svg { width: 16px; height: 16px; }
.back:hover { color: var(--ink); border-color: var(--ink); }
.wordmark { font-size: 13px; letter-spacing: .28em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.wm-serif { font-family: var(--serif); font-style: italic; font-size: 24px; letter-spacing: 0; text-transform: none; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 18px; }
.link-btn { border: 0; background: none; padding: 4px 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; border-bottom: 1px solid transparent; }
.link-btn:hover { border-bottom-color: var(--ink); }
.link-btn.small { font-size: 11px; }
.bag-btn { display: flex; align-items: center; gap: 7px; border: 1px solid var(--ink); background: var(--ink); color: var(--white); border-radius: 999px; padding: 8px 16px 8px 13px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.bag-btn svg { width: 17px; height: 17px; }
.bag-count { font-weight: 600; }
.bag-total { opacity: .7; letter-spacing: .04em; }
.bag-total:not(:empty)::before { content: "· "; }
.bag-btn.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.07); } }

/* model picker */
.models { display: flex; align-items: center; gap: 4px; }
.models-label { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-right: 10px; }
.mchip { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 12px 4px 4px; border-radius: 999px; font-size: 13px; color: var(--muted); transition: background .2s, color .2s; flex: none; }
.mchip img, .mchip .ph { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; object-position: 50% 3%; background: var(--panel); box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s; }
.mchip:hover { color: var(--ink); }
.mchip[aria-checked="true"] { color: var(--ink); font-weight: 600; background: var(--white); }
.mchip[aria-checked="true"] img { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }

/* ---------- three-column layout ---------- */
.layout {
  --stage-h: calc(100svh - var(--top) - 36px);
  display: grid;
  grid-template-columns: minmax(300px, 1fr) min(calc(var(--stage-h) * 2 / 3), 46vw) minmax(330px, 1fr);
  gap: 36px; padding: 18px 28px; height: calc(100svh - var(--top)); min-height: 620px;
}
.shop, .look { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* left: shop */
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; }
.search { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); padding: 4px 0; width: 150px; }
.search svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.search input { border: 0; outline: 0; background: transparent; font-size: 13px; width: 100%; }
.cats { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 2px 0 16px; position: sticky; top: 0; background: var(--paper); z-index: 2; }
.cat { border: 0; background: none; padding: 4px 0; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid transparent; }
.cat:hover { color: var(--ink); }
.cat[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 22px 14px; padding-bottom: 24px; }
.grid .empty { color: var(--muted); font-size: 13px; }
.pcard { position: relative; border: 0; background: none; padding: 0; text-align: left; display: grid; gap: 3px; }
.pcard .ph { position: relative; aspect-ratio: 4 / 5; background: var(--panel); overflow: hidden; display: grid; place-items: center; margin-bottom: 7px; transition: background .2s; outline: 1px solid transparent; }
.pcard .ph img { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; mix-blend-mode: multiply; transition: transform .4s ease; }
.pcard .ph svg { width: 72%; height: 72%; }
.pcard:hover .ph img { transform: scale(1.04); }
.pcard[aria-pressed="true"] .ph { outline: 1.5px solid var(--ink); background: var(--panel-2); }
.pcard .nm { font-size: 13px; line-height: 1.3; }
.pcard .pr { font-size: 12.5px; color: var(--muted); }
.pcard .badge { position: absolute; top: 8px; left: 8px; z-index: 1; font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; background: var(--ink); color: var(--white); padding: 4px 7px; }
.pcard .badge.brand { background: var(--accent); }

/* centre: stage */
.stage-col { min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.stage-box { flex: 1; min-height: 0; position: relative; container-type: size; }
.stage { position: absolute; left: 50%; top: 0; transform: translateX(-50%); margin: 0; height: min(100cqh, 150cqw); aspect-ratio: 2 / 3; overflow: hidden; background: var(--panel); }
.stage img, .stage .figure { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage img { object-fit: cover; cursor: zoom-in; animation: fade .45s ease; }
.figure svg { width: 100%; height: 100%; display: block; }
@keyframes fade { from { opacity: .25; } }
.stage-title { position: absolute; left: 18px; top: 16px; display: grid; gap: 2px; pointer-events: none; }
.stage-title span { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: rgba(20, 18, 16, .6); }
.stage-title em { font-family: var(--serif); font-size: 22px; font-style: italic; color: var(--ink); }
.zoom-btn { position: absolute; right: 14px; bottom: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(251, 249, 246, .9); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.zoom-btn svg { width: 19px; height: 19px; }
.chip-mode { position: absolute; left: 18px; bottom: 18px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; background: rgba(251,249,246,.85); padding: 5px 9px; color: var(--muted); }
.hs { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 0; padding: 0; background: rgba(251, 249, 246, .95); box-shadow: 0 2px 10px rgba(0,0,0,.22); display: grid; place-items: center; }
.hs::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); transition: transform .2s; }
.hs::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid rgba(251,249,246,.85); animation: pulse 2.4s ease-out infinite; }
.hs:hover::before, .hs[aria-expanded="true"]::before { transform: scale(1.5); background: var(--accent); }
@keyframes pulse { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.55); opacity: 0; } }
.note { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }

.pop { position: absolute; z-index: 15; width: 236px; background: var(--white); padding: 12px; box-shadow: 0 18px 44px rgba(20,18,16,.18); display: grid; gap: 10px; }
.pop-top { display: grid; grid-template-columns: 60px 1fr; gap: 12px; align-items: center; }
.thumb { width: 60px; aspect-ratio: 4 / 5; background: var(--panel); display: grid; place-items: center; overflow: hidden; position: relative; }
.thumb img { position: absolute; inset: 5%; width: 90%; height: 90%; object-fit: contain; mix-blend-mode: multiply; }
.thumb svg { width: 80%; height: 80%; }
.pop h3 { margin: 0; font-size: 14px; font-weight: 500; }
.pop p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.pop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pop-actions a, .pop-actions button { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 9px 6px; text-align: center; text-decoration: none; border: 1px solid var(--line); background: transparent; }
.pop-actions .primary { grid-column: 1 / -1; }

/* right: the look */
.look { display: flex; flex-direction: column; gap: 22px; padding-right: 4px; }
.ask-wrap { display: grid; gap: 8px; }
.ask-q { margin: 0; font-family: var(--serif); font-size: 19px; font-style: italic; }
.ask-q.reply { font-family: var(--sans); font-style: normal; font-size: 13.5px; background: var(--ink); color: var(--white); padding: 10px 14px; }
.ask { display: flex; align-items: center; border-bottom: 1px solid var(--ink); }
.ask input { flex: 1; border: 0; outline: 0; background: transparent; padding: 9px 0; font-size: 14px; min-width: 0; }
.ask button { border: 0; background: none; width: 34px; height: 34px; display: grid; place-items: center; }
.ask button svg { width: 19px; height: 19px; }
.look-head { display: flex; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); padding-top: 22px; }
.look-title { margin: 6px 0; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(30px, 2.6vw, 42px); line-height: 1.05; letter-spacing: -.01em; }
.look-caption { margin: 0; font-size: 14px; line-height: 1.5; color: #4a4540; }
.heart { flex: none; width: 42px; height: 42px; border: 1px solid var(--line); background: transparent; border-radius: 50%; display: grid; place-items: center; }
.heart svg { width: 19px; height: 19px; fill: none; }
.heart[aria-pressed="true"] svg { fill: var(--accent); color: var(--accent); }
.pieces { list-style: none; margin: 0; padding: 0; display: grid; }
.piece { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.piece:first-child { border-top: 1px solid var(--line); }
.piece .nm { font-size: 13.5px; }
.piece .tg { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.piece .acts { display: flex; gap: 12px; margin-top: 6px; }
.piece .acts button, .piece .acts a { border: 0; background: none; padding: 0; font-size: 11.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.piece .acts button:hover, .piece .acts a:hover { color: var(--ink); }
.piece .pr { font-size: 13.5px; align-self: start; padding-top: 2px; }
.piece.in-bag .pr::after { content: " ✓"; color: #2f6b3a; }
.total { display: grid; gap: 12px; }
.total > div { display: flex; justify-content: space-between; align-items: baseline; }
.total span { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.total strong { font-family: var(--serif); font-size: 26px; font-weight: 400; }
.primary { border: 0; background: var(--ink); color: var(--white); padding: 17px 18px; font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; transition: background .2s; }
.primary:hover { background: #2c2824; }
.primary:disabled { opacity: .4; cursor: default; }
.primary.done { background: #2f5a37; }
.tags { margin: -8px 0 0; display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.more { display: grid; gap: 12px; padding-bottom: 20px; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lthumb { border: 0; background: none; padding: 0; text-align: left; display: grid; gap: 6px; align-content: start; }
.lthumb .lph { aspect-ratio: 2 / 3; background: var(--panel); overflow: hidden; outline: 1.5px solid transparent; outline-offset: 2px; }
.lthumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; display: block; }
.lthumb:hover img { transform: scale(1.04); }
.lthumb span { font-size: 11.5px; line-height: 1.3; }
.lthumb[aria-current="true"] .lph { outline-color: var(--ink); }
.lthumb.saved span::before { content: "♥ "; color: var(--accent); }

/* footer */
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 28px 30px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.foot a { color: var(--ink); }
.foot-cta { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; border: 1px solid var(--ink); padding: 10px 16px; }

/* zoom */
.zoom { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(20,18,16,.94); }
.zoom::backdrop { background: rgba(20,18,16,.6); }
.zoom-frame { position: absolute; inset: 3vh 0 6vh; display: grid; place-items: center; overflow: hidden; }
.zoom-frame img { height: 100%; max-width: 100%; object-fit: contain; cursor: zoom-in; transition: transform .25s ease; }
.zoom-frame.zoomed img { transform: scale(2.3); cursor: zoom-out; }
.zoom-close { position: absolute; top: 18px; right: 22px; z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; font-size: 16px; }
.zoom-hint { position: absolute; bottom: 2vh; left: 0; right: 0; margin: 0; text-align: center; color: rgba(255,255,255,.55); font-size: 12px; letter-spacing: .1em; }

/* dialogs */
.sheet { border: 0; padding: 24px; width: min(420px, calc(100% - 24px)); background: var(--white); box-shadow: 0 30px 80px rgba(0,0,0,.3); max-height: calc(100vh - 40px); }
.sheet.wide { width: min(560px, calc(100% - 24px)); }
.sheet::backdrop { background: rgba(20,18,16,.45); backdrop-filter: blur(3px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet h2 { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 24px; }
.icon-btn { width: 34px; height: 34px; border: 0; background: transparent; font-size: 15px; }
.bag-list { list-style: none; margin: 0; padding: 0; display: grid; max-height: 50vh; overflow: auto; }
.bag-list li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bag-list .thumb { width: 52px; }
.bag-list .rm { border: 0; background: transparent; color: var(--muted); font-size: 12px; text-decoration: underline; }
.bag-list .empty { color: var(--muted); grid-template-columns: 1fr; border: 0; }
.bag-foot { display: grid; gap: 12px; margin-top: 16px; }
.bag-sum { display: flex; justify-content: space-between; align-items: baseline; }
.bag-sum span { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.bag-sum strong { font-family: var(--serif); font-size: 24px; font-weight: 400; }
.fine { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.5; }
.fine.lead { margin-bottom: 14px; font-size: 13px; }
.brand-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brand-form label { display: grid; gap: 5px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.brand-form .file, .brand-form button { grid-column: 1 / -1; }
.brand-form input, .brand-form select { border: 1px solid var(--line); padding: 9px 10px; font-size: 14px; background: #fff; color: var(--ink); letter-spacing: 0; text-transform: none; }
.brand-list { display: grid; gap: 6px; margin: 16px 0 10px; }
.brand-list:empty { display: none; }
.brand-list div { display: flex; justify-content: space-between; align-items: center; font-size: 13px; background: var(--panel); padding: 8px 12px; }
.brand-list button { border: 0; background: transparent; font-size: 12px; text-decoration: underline; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: var(--white); padding: 12px 18px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- tablet: model + look side by side, shop below ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: min(calc(var(--stage-h) * 2 / 3), 56vw) 1fr; grid-template-areas: "stage look" "shop shop"; height: auto; }
  .stage-col { grid-area: stage; height: var(--stage-h); }
  .look { grid-area: look; max-height: var(--stage-h); }
  .shop { grid-area: shop; overflow: visible; }
  .cats { position: static; }
  /* the header no longer fits three equal columns: back link becomes an icon, model chips take the middle */
  .top { grid-template-columns: auto minmax(0, 1fr) auto; }
  .models { justify-content: center; }
  .models-label { display: none; }
  .back { padding: 6px; }
  .back span { display: none; }
}

/* ---------- small tablet: tighter header ---------- */
@media (max-width: 960px) {
  .top { padding: 0 20px; gap: 12px; }
  .top-left, .top-actions { gap: 12px; }
  .mchip { padding: 3px 10px 3px 3px; font-size: 12.5px; }
  .mchip img, .mchip .ph { width: 32px; height: 32px; }
  .bag-btn > span:not(.bag-count):not(.bag-total) { display: none; }
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  :root { --top: 56px; }
  .top { grid-template-columns: 1fr auto; padding: 0 14px; }
  .wm-serif { font-size: 20px; }
  .wordmark { font-size: 11px; letter-spacing: .2em; }
  .top-left { gap: 10px; }
  .back { padding: 6px; }
  .back span { display: none; }
  #brandBtn { display: none; }
  .bag-btn > span:not(.bag-count):not(.bag-total) { display: none; }
  .models { position: fixed; top: var(--top); left: 0; right: 0; justify-content: safe center; background: rgba(244,240,234,.95); backdrop-filter: blur(12px); padding: 6px 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; z-index: 29; }
  .models-label { display: none; }
  .mchip { padding: 3px 10px 3px 3px; font-size: 12.5px; }
  .mchip img, .mchip .ph { width: 32px; height: 32px; }
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "look" "shop"; gap: 26px; padding: 58px 0 0; height: auto; min-height: 0; }
  .stage-col { height: auto; }
  .stage-box { flex: none; height: min(150vw, 80svh); }
  .look, .shop { padding: 0 16px; max-height: none; overflow: visible; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .total { position: sticky; bottom: 0; background: var(--paper); padding: 10px 0 12px; z-index: 5; border-top: 1px solid var(--line); }
  .foot { flex-direction: column; text-align: center; padding: 22px 16px 30px; }
  .brand-form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
