/* Armario — heritage design system.
   Bone paper, forest green, tobacco leather and old-gold hairlines; Cormorant for titles, Jost for labels. */

@font-face { font-family: 'Cormorant Garamond'; src: url('fonts/CormorantGaramond.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('fonts/CormorantGaramond-Italic.woff2') format('woff2'); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('fonts/Jost.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #f9f6f0;
  --paper: #fcfaf6;
  --paper-2: #f0eadf;
  --ink: #26241f;
  --muted: #7b7367;
  --faint: #a59d90;
  --hair: rgb(160 132 82 / .42);
  --hair-soft: rgb(160 132 82 / .22);
  --gold: #a2844c;
  --green: #1f3a2c;
  --green-ink: #f9f6f0;
  --green-soft: rgb(31 58 44 / .06);
  --leather: #8a5a32;
  --danger: #8c2f24;
  --serif: 'Cormorant Garamond', 'Cormorant', Garamond, 'Times New Roman', serif;
  --sans: 'Jost', 'Futura', 'Century Gothic', -apple-system, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 22px;
  color-scheme: light;
}
/* "Nuit": jet black with old gold for evenings */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0c0a; --paper: #14120f; --paper-2: #1c1915; --ink: #ede6d6; --muted: #a2998a; --faint: #6f675b;
    --hair: rgb(184 151 90 / .38); --hair-soft: rgb(184 151 90 / .18); --gold: #b8975a;
    --green: #b8975a; --green-ink: #0d0c0a; --green-soft: rgb(184 151 90 / .08); --leather: #c08a57; --danger: #d7826f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0c0a; --paper: #14120f; --paper-2: #1c1915; --ink: #ede6d6; --muted: #a2998a; --faint: #6f675b;
  --hair: rgb(184 151 90 / .38); --hair-soft: rgb(184 151 90 / .18); --gold: #b8975a;
  --green: #b8975a; --green-ink: #0d0c0a; --green-soft: rgb(184 151 90 / .08); --leather: #c08a57; --danger: #d7826f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font: 300 14px/1.65 var(--sans);
  letter-spacing: .012em;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /* Fine linen: a whisper of grain plus a woven crosshatch */
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .26 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    repeating-linear-gradient(0deg, rgb(120 100 60 / .025) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgb(120 100 60 / .02) 0 1px, transparent 1px 3px);
}
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--green); color: var(--green-ink); }

#view {
  max-width: 600px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--gutter) calc(var(--nav-h) + var(--safe-b) + 110px);
}
#view.fade-in { animation: fadeUp .7s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Masthead ---------- */
.mast { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; padding: 6px 0 14px; border-bottom: .5px solid var(--hair); margin-bottom: 34px; }
.seal {
  width: 34px; height: 34px; border-radius: 50%; border: .5px solid var(--gold); display: grid; place-items: center;
  font: 500 12px/1 var(--serif); letter-spacing: .08em; color: var(--gold); position: relative;
}
.seal::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: .5px solid var(--hair-soft); }
.brand { text-align: center; line-height: 1; }
.brand b { display: block; font: 500 15px/1 var(--serif); letter-spacing: .62em; margin-right: -.62em; }
.brand small { display: block; margin-top: 6px; font: 400 8.5px/1 var(--sans); letter-spacing: .34em; margin-right: -.34em; text-transform: uppercase; color: var(--faint); }
.mast-btn { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); transition: color .3s; }
.mast-btn:hover { color: var(--ink); }
.mast-btn svg { width: 20px; height: 20px; }

/* ---------- Type ---------- */
.top { margin-bottom: 28px; }
h1 { font: 400 38px/1.05 var(--serif); letter-spacing: .015em; margin: 8px 0 0; }
h1 em { font-style: italic; }
h2, h3 { margin: 0; font-weight: 400; }
.eyebrow { margin: 0; font: 400 10px/1.4 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.section-title { display: flex; align-items: baseline; gap: 12px; font: 400 24px/1.15 var(--serif); letter-spacing: .01em; margin: 52px 0 6px; }
.section-title .num { font: italic 400 15px/1 var(--serif); color: var(--gold); min-width: 18px; }
.section-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 16px; }
.section-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 52px; }
.section-row .section-title { margin: 0; }
.label { font: 400 9.5px/1.4 var(--sans); letter-spacing: .28em; text-transform: uppercase; color: var(--muted); margin: 18px 0 9px; }
.center { text-align: center; }
.hint { color: var(--faint); font-size: 11.5px; margin: 12px 0 0; letter-spacing: .03em; }
.muted { color: var(--muted); }
.rule { height: .5px; background: var(--hair); border: 0; margin: 28px 0; }

/* ---------- Chips (departments, filters) ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 1px var(--gutter); margin: 0 calc(-1 * var(--gutter)); }
.chips::-webkit-scrollbar { display: none; }
.form .chips, .sheet .chips { flex-wrap: wrap; margin: 0; padding-inline: 0; overflow: visible; }
.chip {
  flex: none; padding: 9px 15px; border-radius: 2px; border: .5px solid var(--hair);
  font: 400 10px/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; color: var(--muted);
  transition: color .4s var(--ease), border-color .4s var(--ease), background-color .4s var(--ease);
}
.chip:hover { color: var(--ink); }
.chip.on { color: var(--green); border-color: var(--green); background: var(--green-soft); }

.swatches { gap: 4px 2px; }
.chip.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 7px 3px; width: 58px; border-color: transparent; background: transparent; letter-spacing: .08em; text-transform: none; }
.chip.swatch.on { border-color: var(--gold); background: transparent; color: var(--ink); }
.sw-name { font-size: 9.5px; color: var(--muted); letter-spacing: .06em; }
.dot { width: 26px; height: 26px; border-radius: 1px; background: var(--c); box-shadow: inset 0 0 0 .5px rgb(0 0 0 / .18); display: inline-block; }
.dot.sm { width: 11px; height: 11px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 2px; border: .5px solid transparent;
  font: 400 10px/1.2 var(--sans); letter-spacing: .24em; text-transform: uppercase; text-align: center;
  transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease);
}
a.btn { text-decoration: none; }
.btn.primary { background: var(--green); color: var(--green-ink); border-color: var(--green); }
.btn.primary:hover { background: transparent; color: var(--green); }
.btn.ghost { border-color: var(--hair); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 9.5px; }
.btn.block { width: 100%; margin-top: 10px; }
.btn.danger, .link.danger { color: var(--danger); }
.btn:disabled { opacity: .55; cursor: default; }
.link {
  font: italic 400 16px/1.3 var(--serif); letter-spacing: .01em; color: var(--ink); padding: 8px 0;
  text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: .5px; text-underline-offset: 5px;
  transition: color .3s;
}
.link:hover { color: var(--green); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; flex: none; color: var(--muted); border: .5px solid var(--hair); border-radius: 50%; transition: color .3s, border-color .3s; }
.icon-btn:hover { color: var(--ink); border-color: var(--ink); }
.icon-btn svg { width: 14px; height: 14px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.actions.two { grid-template-columns: 1fr 1fr; }
.actions .btn { padding: 0 6px; letter-spacing: .16em; }

.fab {
  position: fixed; right: max(var(--gutter), calc(50% - 278px)); bottom: calc(var(--nav-h) + var(--safe-b) + 18px); z-index: 5;
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 20px; border-radius: 2px;
  background: var(--green); color: var(--green-ink); border: .5px solid var(--green);
  font: 400 10px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  transition: background-color .45s var(--ease), color .45s var(--ease);
}
.fab:hover { background: var(--bg); color: var(--green); }
.fab svg { width: 12px; height: 12px; }

/* ---------- Icons ---------- */
.ico { fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ico * { vector-effect: non-scaling-stroke; }

/* ---------- Cards ---------- */
.card { background: var(--paper); border: .5px solid var(--hair); border-radius: 2px; padding: 20px; }
.card-kicker { margin: 0 0 14px; font: 400 9.5px/1.4 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.filters { margin-bottom: 30px; }

.suggestion { margin-top: 18px; }
.sugg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sugg-grid.n1 { grid-template-columns: 1fr; }
.sugg-grid.n3 > :last-child, .sugg-grid.n5 > :last-child { grid-column: span 2; aspect-ratio: 2 / 1; }
.sugg-item { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--paper-2); border: .5px solid var(--hair-soft); border-radius: 1px; transition: border-color .4s var(--ease); }
.sugg-item.locked { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.sugg-item img, .sugg-item .ph { width: 100%; height: 100%; object-fit: cover; }
.lock { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgb(249 246 240 / .9); color: #26241f; display: grid; place-items: center; border: .5px solid var(--hair); }
.lock svg { width: 12px; height: 12px; }
.sugg-item.locked .lock { background: var(--gold); color: #fff; border-color: var(--gold); }
.cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 9px; text-align: left; color: #f9f6f0; font: 400 15px/1.15 var(--serif); letter-spacing: .01em; background: linear-gradient(transparent, rgb(20 18 14 / .58)); }
.sugg-meta { padding: 18px 0 0; }
.reason { position: relative; margin: 7px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink); }
.reason::before { content: ""; position: absolute; left: 0; top: .82em; width: 9px; height: .5px; background: var(--gold); }
.reason.warn { color: var(--danger); }
.reason.warn::before { background: var(--danger); }
.reason b { font-weight: 500; }

.today-wear { display: flex; gap: 16px; align-items: center; margin-bottom: 30px; }
.today-wear .collage { width: 82px; flex: none; }
.tw-names { margin: 4px 0 0; font: 400 17px/1.25 var(--serif); }

/* Placeholder for pieces without a photo: parchment, a line drawing and a fabric swatch */
.ph { width: 100%; height: 100%; position: relative; display: grid; place-items: center; background: var(--paper-2); color: var(--faint); }
.ph svg { width: 34%; max-width: 64px; height: auto; }
.ph i { position: absolute; left: 8px; top: 8px; width: 13px; height: 13px; background: var(--c); box-shadow: inset 0 0 0 .5px rgb(0 0 0 / .2); }
.sugg-item:has(.ph) .cap { background: none; color: var(--ink); }
.salon .ph { background: #1c1915; color: #6f675b; }
.salon .sugg-item:has(.ph) .cap { color: var(--s-ink); }

/* ---------- Collage ---------- */
.collage { display: grid; gap: 1px; aspect-ratio: 4 / 5; overflow: hidden; background: var(--hair-soft); border: .5px solid var(--hair-soft); grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.collage .cell { overflow: hidden; min-height: 0; background: var(--paper-2); }
.collage .cell img, .collage .cell .ph { width: 100%; height: 100%; object-fit: cover; }
.collage.n0, .collage.n1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.collage.n2 { grid-template-rows: 1fr; }
.collage.n3 .cell:first-child { grid-row: span 2; }
.collage.mini .ph i { width: 7px; height: 7px; left: 4px; top: 4px; }
.collage.big { margin-bottom: 18px; }

/* ---------- La Colección ---------- */
.palette { display: flex; height: 3px; overflow: hidden; gap: 2px; margin: 0 0 8px; }
.palette span { background: var(--c); min-width: 6px; }
.palette-legend { margin: 0 0 26px; color: var(--muted); font-size: 11px; letter-spacing: .06em; }
.item-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 34px 18px; margin-top: 30px; }
.item-card, .outfit-card, .wish-card { position: relative; text-align: left; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.item-card > img, .item-card > .ph { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; border: .5px solid var(--hair-soft); transition: opacity .5s var(--ease); }
.item-card > img { background: var(--paper-2); }
.item-card:hover > img, .item-card:hover > .ph { opacity: .88; }
.meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.no { font: 400 9px/1 var(--sans); letter-spacing: .26em; color: var(--gold); }
.meta .name, .forgot .name { font: 400 17px/1.2 var(--serif); letter-spacing: .005em; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.meta .sub, .forgot .sub { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.outfit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 34px 18px; margin-top: 8px; }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 54px 24px 46px; border: .5px solid var(--hair); background: var(--paper); margin-top: 18px; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--gold); margin-bottom: 22px; }
.ornament::before, .ornament::after { content: ""; width: 44px; height: .5px; background: var(--hair); }
.ornament svg { width: 30px; height: 30px; }
.empty h3 { font: 400 25px/1.2 var(--serif); margin: 0 0 10px; }
.empty p { color: var(--muted); font-size: 12.5px; margin: 0 auto 26px; max-width: 320px; }

/* ---------- Horizontal scrollers ---------- */
.hscroll { display: flex; gap: 14px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 8px; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); }
.hscroll::-webkit-scrollbar { display: none; }
.recent { flex: none; width: 78px; display: flex; flex-direction: column; gap: 8px; font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); text-align: center; scroll-snap-align: start; }
.forgot { flex: none; width: 124px; display: flex; flex-direction: column; gap: 4px; text-align: left; scroll-snap-align: start; }
.forgot > img, .forgot > .ph { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; border: .5px solid var(--hair-soft); margin-bottom: 8px; }

/* ---------- Atelier ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: .5px solid var(--hair); border-left: .5px solid var(--hair); margin-top: 8px; }
.stat-grid.three { grid-template-columns: repeat(3, 1fr); margin: 22px 0; }
.stat { padding: 18px 14px; border-right: .5px solid var(--hair); border-bottom: .5px solid var(--hair); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat b { font: 400 30px/1 var(--serif); }
.stat span { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; line-height: 1.5; }
.moodboard { columns: 2; column-gap: 14px; margin-top: 16px; }
.inspo { display: block; width: 100%; margin-bottom: 14px; break-inside: avoid; text-align: left; border: .5px solid var(--hair-soft); background: var(--paper); }
.inspo span { display: block; padding: 10px 12px; font: italic 400 15px/1.3 var(--serif); }
.inspo-big { width: 100%; border: .5px solid var(--hair-soft); }

/* ---------- Sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(18 16 12 / .42); animation: fade .5s var(--ease); }
.sheet-panel {
  position: relative; width: 100%; max-width: 600px; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background-color: var(--bg); background-image: inherit; border-top: .5px solid var(--gold); border-radius: 2px 2px 0 0;
  padding: 10px var(--gutter) calc(var(--safe-b) + 32px);
  animation: up .55s var(--ease);
}
.sheet-panel::before { content: ""; display: block; width: 36px; height: .5px; background: var(--gold); margin: 6px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0 16px; margin-bottom: 18px; position: sticky; top: -10px; background: var(--bg); z-index: 2; border-bottom: .5px solid var(--hair); }
.sheet-head h2 { font: 400 26px/1.15 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head .no { display: block; margin-bottom: 6px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

.form { display: flex; flex-direction: column; gap: 22px; }
.form > p { margin: 0; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 9px; }
.field > span { font: 400 9.5px/1.4 var(--sans); letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.field small, .form > small { font-size: 11px; color: var(--faint); letter-spacing: .02em; }
input, textarea {
  font: 400 19px/1.3 var(--serif); color: var(--ink); background: transparent;
  border: 0; border-bottom: .5px solid var(--hair); border-radius: 0; padding: 8px 0 10px; width: 100%;
  transition: border-color .4s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--faint); font-style: italic; }
input:focus, textarea:focus { outline: none; border-bottom-color: var(--green); }
textarea { resize: vertical; }

.photo-drop { display: block; cursor: pointer; }
.photo-drop .preview {
  aspect-ratio: 16 / 10; border: .5px solid var(--hair); background: var(--paper);
  display: grid; place-items: center; text-align: center; color: var(--muted); overflow: hidden; position: relative;
}
.photo-drop .preview::after { content: ""; position: absolute; inset: 8px; border: .5px dashed var(--hair); pointer-events: none; }
.photo-drop .preview span { font: italic 400 18px/1.5 var(--serif); }
.photo-drop .preview span small { display: block; font: 400 9.5px/1.6 var(--sans); letter-spacing: .26em; text-transform: uppercase; font-style: normal; color: var(--faint); margin-top: 6px; }
.photo-drop.has .preview { aspect-ratio: auto; max-height: 380px; background: var(--paper-2); }
.photo-drop.has .preview::after { display: none; }
.photo-drop.has .preview img { max-height: 380px; width: 100%; object-fit: contain; }
.photo-drop.busy { opacity: .5; pointer-events: none; }

.builder-preview { width: 50%; margin: 0 auto; position: sticky; top: 58px; z-index: 1; }
.bp-empty { aspect-ratio: 4 / 5; border: .5px dashed var(--hair); display: grid; place-items: center; color: var(--muted); font: italic 400 16px/1.3 var(--serif); background: var(--paper); padding: 12px; text-align: center; }
.pick-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px; }
.pick-row::-webkit-scrollbar { display: none; }
.pick { flex: none; width: 72px; aspect-ratio: 4 / 5; overflow: hidden; position: relative; border: .5px solid var(--hair-soft); transition: border-color .4s var(--ease); }
.pick img, .pick .ph { width: 100%; height: 100%; object-fit: cover; }
.pick.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.pick.on::after { content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

.detail-photo { background: var(--paper-2); border: .5px solid var(--hair-soft); }
.detail-photo img { width: 100%; max-height: 440px; object-fit: contain; }
.detail-photo .ph { aspect-ratio: 4 / 3; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; }
.tag { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; padding: 5px 10px; border: .5px solid var(--hair); color: var(--muted); }
.notes { border-left: .5px solid var(--gold); padding: 2px 0 2px 14px; font: italic 400 17px/1.45 var(--serif); margin: 20px 0 0; white-space: pre-wrap; }
.item-list { display: flex; flex-direction: column; margin-top: 22px; border-top: .5px solid var(--hair); }
.item-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: .5px solid var(--hair); text-align: left; }
.item-row > img, .item-row > .ph { width: 44px; height: 55px; object-fit: cover; flex: none; border: .5px solid var(--hair-soft); }
.item-row > .ph svg { width: 55%; }
.item-row > span:not(.dot) { flex: 1; font: 400 17px/1.2 var(--serif); }

/* ---------- Salon privé (AI stylist): always in jet black and old gold ---------- */
.salon {
  --s-ink: #ede6d6; --s-muted: #a2998a; --s-gold: #b8975a; --s-hair: rgb(184 151 90 / .4);
  background: #0e0d0b; color: var(--s-ink); border: .5px solid var(--s-hair); padding: 22px 20px; margin-bottom: 8px;
}
.salon .card-kicker { color: var(--s-gold); }
.salon p { color: var(--s-muted); }
.salon .reason { color: var(--s-ink); }
.salon .reason::before { background: var(--s-gold); }
.salon .btn.primary { background: var(--s-gold); border-color: var(--s-gold); color: #0e0d0b; }
.salon .btn.primary:hover { background: transparent; color: var(--s-gold); }
.salon .btn.ghost { color: var(--s-ink); border-color: var(--s-hair); }
.salon .btn.ghost:hover { border-color: var(--s-ink); }
.salon .sugg-item { border-color: rgb(184 151 90 / .25); }
.salon .tip { background: transparent; border-left-color: var(--s-gold); color: var(--s-ink); }
.salon .upgrade { border-color: var(--s-hair); }
.salon .upgrade small { color: var(--s-muted); }
.salon .score { color: var(--s-gold); border-color: var(--s-hair); }
.salon .spin { color: var(--s-gold); }
.salon-cta h3 { font: 400 26px/1.2 var(--serif); margin: 0 0 10px; color: var(--s-ink); }
.salon-cta p { margin: 0 0 20px; font-size: 12.5px; }

.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-head .card-kicker { margin: 0; }
.score { font: italic 400 20px/1 var(--serif); padding: 7px 10px; border: .5px solid var(--hair); color: var(--gold); white-space: nowrap; }
.ai-title { font: 400 28px/1.15 var(--serif); margin: 12px 0 18px; }
.ai-loading { display: flex; align-items: center; gap: 16px; padding: 22px 0 8px; }
.ai-loading p { margin: 0; font: italic 400 17px/1.4 var(--serif); color: var(--s-ink); }
.ai-loading small { display: block; font: 400 10px/1.6 var(--sans); letter-spacing: .2em; text-transform: uppercase; font-style: normal; color: var(--s-muted); margin-top: 4px; }
.tip { margin: 16px 0 0; padding: 4px 0 4px 14px; border-left: .5px solid var(--gold); font: italic 400 16px/1.4 var(--serif); }
.upgrade { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding: 14px 0 0; border-top: .5px solid var(--hair); font-size: 12.5px; }
.upgrade b { display: block; font: 400 17px/1.25 var(--serif); }
.upgrade .kick { display: block; font-size: 9px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.upgrade small { color: var(--muted); font-size: 11.5px; }
.upgrade .btn { flex: none; }
.ai-box { margin-top: 22px; }
.ai-box > p { margin: 8px 0; font-size: 13px; }
.ai-box ul { margin: 10px 0 0; padding-left: 0; list-style: none; }
.ai-box li { position: relative; padding-left: 18px; margin: 6px 0; font-size: 12.5px; }
.ai-box li::before { content: ""; position: absolute; left: 0; top: .82em; width: 9px; height: .5px; background: var(--gold); }
.ai-box .link { margin-top: 8px; display: inline-block; }
.ai-box .label { margin-top: 16px; }
.ai-desc-p { font: italic 400 18px/1.45 var(--serif) !important; color: var(--ink); }
.ai-nudge { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; margin-top: 18px; padding: 18px 20px; border: .5px solid var(--hair); background: var(--paper); transition: border-color .4s var(--ease); }
.ai-nudge:hover { border-color: var(--gold); }
.ai-nudge b { font: 400 19px/1.2 var(--serif); }
.ai-nudge span { font-size: 12px; color: var(--muted); }
.ai-nudge .kick { font-size: 9px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.ai-status { margin: -8px 0 0; font: italic 400 15px/1.4 var(--serif); color: var(--muted); display: flex; align-items: center; gap: 10px; }
.ai-desc:empty { display: none; }
.ai-desc { font: italic 400 17px/1.45 var(--serif); padding: 2px 0 2px 14px; border-left: .5px solid var(--gold); }
.ai-badge { position: absolute; top: 8px; right: 8px; font: italic 400 11px/1 var(--serif); letter-spacing: .04em; color: var(--gold); background: rgb(249 246 240 / .92); padding: 4px 6px; border: .5px solid var(--hair); }
.local-notes { margin-top: 14px; }
.verdict { font: 400 22px/1.2 var(--serif) !important; margin-top: 10px !important; }

.spin { width: 14px; height: 14px; border-radius: 50%; border: .5px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin 1.1s linear infinite; flex: none; }
.spin.big { width: 30px; height: 30px; color: var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }

details.details { border-top: .5px solid var(--hair); border-bottom: .5px solid var(--hair); padding: 16px 0; gap: 18px; }
details.details summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font: 400 19px/1.2 var(--serif); }
details.details summary::-webkit-details-marker { display: none; }
details.details summary::after { content: "+"; font: 300 18px/1 var(--sans); color: var(--gold); transition: transform .4s var(--ease); }
details.details[open] summary::after { transform: rotate(45deg); }
details.details summary small { font: 400 9px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); margin-left: auto; }
details.details[open] > :not(summary) { margin-top: 18px; }

/* ---------- Carnet de deseos & acquisitions ---------- */
.wish-img { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #fff; border: .5px solid var(--hair-soft); }
.wish-img img { width: 100%; height: 100%; object-fit: contain; }
.wish-img .ph { height: 100%; }
.verdict-badge { position: absolute; left: 8px; bottom: 8px; padding: 4px 8px; background: rgb(249 246 240 / .94); color: #26241f; border: .5px solid var(--hair); font: 400 9px/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.shop-link { margin-top: 18px; }
.input-row { display: flex; gap: 10px; align-items: flex-end; }
.input-row input { flex: 1; min-width: 0; }
.input-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mini-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.mini-row::-webkit-scrollbar { display: none; }
.mini { flex: none; width: 46px; aspect-ratio: 4 / 5; overflow: hidden; border: .5px solid var(--hair-soft); }
.mini img, .mini .ph { width: 100%; height: 100%; object-fit: cover; }
.mini .ph i { width: 6px; height: 6px; left: 3px; top: 3px; }
.wish-outfit { margin-top: 14px; padding-top: 14px; border-top: .5px solid var(--hair); }
.wish-outfit small { color: var(--muted); display: block; margin-top: 6px; font: italic 400 15px/1.35 var(--serif); }

.diag { margin-top: 16px; }
.diag p { margin: 0 0 8px; font-size: 13px; }
.diag .style-line { font: italic 400 20px/1.35 var(--serif); color: var(--ink); }
.diag small { color: var(--faint); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; }
.recs { display: flex; flex-direction: column; margin-top: 16px; border-top: .5px solid var(--hair); }
.rec { padding: 20px 0; border-bottom: .5px solid var(--hair); display: grid; grid-template-columns: 34px 1fr; gap: 0 14px; }
.rec-no { font: italic 400 22px/1 var(--serif); color: var(--gold); padding-top: 2px; }
.rec-body b { font: 400 19px/1.25 var(--serif); }
.rec-body p { margin: 6px 0 8px; font-size: 12.5px; color: var(--muted); }
.rec-meta { font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--leather); }
.rec-actions { grid-column: 2; display: flex; gap: 8px; margin-top: 14px; }

/* ---------- Nav ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 0;
  padding: 8px 6px calc(var(--safe-b) + 8px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: .5px solid var(--hair);
}
.tabs button { flex: 1; min-width: 0; max-width: 118px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0 4px; color: var(--faint); font: 400 8.5px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; position: relative; transition: color .45s var(--ease); }
.tabs svg { width: 22px; height: 22px; }
.tabs button.on { color: var(--ink); }
.tabs button.on::before { content: ""; position: absolute; top: -8px; left: 30%; right: 30%; height: .5px; background: var(--gold); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 24px); z-index: 30;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: #1a1815; color: #ede6d6; padding: 13px 20px; border-radius: 2px; border: .5px solid rgb(184 151 90 / .5);
  font: italic 400 16px/1.3 var(--serif); letter-spacing: .01em;
  max-width: calc(100vw - 44px); width: max-content; text-align: center; transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= Colour & craft ================= */
:root {
  --forest: #1f3a2c; --forest-2: #2a4a39; --bone: #f9f6f0; --gold-light: #d4b77c;
  --tan: #a3693a; --tan-dark: #7f4f2a; --oxblood: #6b2723;
  /* Twill weave, as on tailoring cloth */
  --twill: repeating-linear-gradient(45deg, rgb(255 255 255 / .04) 0 1.5px, transparent 1.5px 6px),
           repeating-linear-gradient(-45deg, rgb(0 0 0 / .07) 0 1px, transparent 1px 7px);
  --stitch: rgb(249 246 240 / .6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --forest: #15291f; --forest-2: #1e3a2c; --tan: #9c6436; --tan-dark: #7a4c28; }
}
:root[data-theme="dark"] { --forest: #15291f; --forest-2: #1e3a2c; --tan: #9c6436; --tan-dark: #7a4c28; }

/* Masthead: a forest-green band, gold double rule underneath */
.mast {
  margin: calc(-1 * (env(safe-area-inset-top, 0px) + 14px)) calc(-1 * var(--gutter)) 36px;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) var(--gutter) 18px;
  background: var(--twill), var(--forest); color: var(--bone); border-bottom: 0;
  box-shadow: inset 0 -1px 0 var(--gold), inset 0 -4px 0 var(--forest), inset 0 -4.5px 0 rgb(212 183 124 / .45);
}
.brand small { color: rgb(249 246 240 / .55); }
.seal { color: var(--gold-light); border-color: var(--gold-light); background: rgb(0 0 0 / .12); }
.seal::after { border-color: rgb(212 183 124 / .35); }
.mast-btn { color: rgb(249 246 240 / .75); }
.mast-btn:hover { color: var(--gold-light); }

/* Trunk stripes under every page title: forest over tobacco */
.top::after {
  content: ""; display: block; width: 72px; height: 7px; margin-top: 20px;
  background: linear-gradient(var(--forest) 0 0) top / 100% 3px no-repeat, linear-gradient(var(--tan) 0 0) bottom / 100% 3px no-repeat;
}
h1 em { color: var(--forest); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) h1 em { color: var(--gold-light); } }
:root[data-theme="dark"] h1 em { color: var(--gold-light); }

/* Roman numerals stamped in green and gold */
.section-title .num {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; transform: translateY(-3px);
  background: var(--forest); color: var(--gold-light); font: 500 12px/1 var(--serif); letter-spacing: .08em;
  box-shadow: inset 0 0 0 2px var(--forest), inset 0 0 0 2.5px rgb(212 183 124 / .55);
}

/* Departments and filters: the chosen one is filled forest green */
.chip.on { background: var(--forest); border-color: var(--forest); color: var(--bone); }
.chip.swatch.on { background: transparent; color: var(--ink); border-color: var(--tan); }

/* Buttons: forest with an inner gold hairline */
.btn.primary { background: var(--forest); border-color: var(--forest); color: var(--bone); box-shadow: inset 0 0 0 3px var(--forest), inset 0 0 0 3.5px rgb(212 183 124 / .5); }
.btn.primary:hover { background: var(--forest-2); color: var(--bone); }

/* Leather pieces: tobacco with saddle stitching */
.fab { background: var(--tan); border-color: var(--tan-dark); color: var(--bone); }
.fab::after { content: ""; position: absolute; inset: 3px; border: .5px dashed var(--stitch); pointer-events: none; }
.fab:hover { background: var(--tan-dark); color: var(--bone); }
.leather-tag {
  position: absolute; top: 12px; left: -5px; z-index: 2;
  background: var(--tan); color: var(--bone); font: 400 9px/1 var(--sans); letter-spacing: .2em;
  padding: 7px 13px 7px 10px; clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 50%, 100% 100%, 0 100%);
  box-shadow: 0 1px 0 var(--tan-dark);
}
.leather-tag::after { content: ""; position: absolute; inset: 2.5px 9px 2.5px 2.5px; border: .5px dashed var(--stitch); pointer-events: none; }
.wish-img .leather-tag { left: 0; }
.meta .no { color: var(--tan); text-transform: uppercase; }
.item-card .ph i, .wish-img .ph i { display: none; }

/* The house proposal opens with a leather band */
.suggestion { padding-top: 0; overflow: hidden; }
.suggestion > .card-kicker {
  position: relative; margin: 0 -20px 20px; padding: 12px 20px;
  background: var(--twill), var(--tan); color: var(--bone);
}
.suggestion > .card-kicker::after { content: ""; position: absolute; inset: 3.5px; border: .5px dashed var(--stitch); pointer-events: none; }

/* Salon privé: a gold double frame */
.salon { background: var(--twill), #0e0d0b; box-shadow: inset 0 0 0 5px #0e0d0b, inset 0 0 0 5.5px rgb(184 151 90 / .5); }

/* Empty states on forest cloth */
.empty { background: var(--twill), var(--forest); border-color: var(--forest); color: var(--bone); box-shadow: inset 0 0 0 6px var(--forest), inset 0 0 0 6.5px rgb(212 183 124 / .5); }
.empty p { color: rgb(249 246 240 / .72); }
.empty .ornament { color: var(--gold-light); }
.empty .ornament::before, .empty .ornament::after { background: rgb(212 183 124 / .5); }
.empty .btn.primary { background: var(--bone); color: var(--forest); border-color: var(--bone); box-shadow: none; }
.empty .btn.primary:hover { background: transparent; color: var(--bone); }

/* Pieces without a photo take a wash of their own colour */
.ph[style*="--tint"] { background: color-mix(in srgb, var(--tint) 24%, var(--paper-2)); color: color-mix(in srgb, var(--tint) 55%, var(--ink)); }
.palette { height: 6px; }

/* Figures in green and tobacco */
.stat b { color: var(--green); }
.stat:nth-child(even) b { color: var(--tan); }
.rec-no { color: var(--tan); }
.rec-meta { color: var(--tan); }
.reason::before { background: var(--tan); }
.reason.warn::before { background: var(--danger); }
.ai-box .card-kicker, .card-kicker { color: var(--tan); }
.salon .card-kicker { color: var(--s-gold); }

/* Usage of the AI stylist */
.usage { display: grid; grid-template-columns: 1.4fr 1fr 1fr; border: .5px solid var(--hair); margin-top: 6px; }
.usage > div { padding: 14px 12px; border-right: .5px solid var(--hair); display: flex; flex-direction: column; gap: 6px; }
.usage > div:last-child { border-right: 0; }
.usage .kick { font-size: 8.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--tan); }
.usage b { font: 400 24px/1 var(--serif); color: var(--green); }
.usage > div:last-child b { font-size: 19px; }
.usage-note { display: block; margin-top: 8px; font-size: 10.5px; color: var(--faint); }

/* Bottom bar: forest cloth with gold for the current salon */
.tabs { background: var(--twill), var(--forest); border-top: 0; box-shadow: inset 0 1px 0 rgb(212 183 124 / .6); backdrop-filter: none; -webkit-backdrop-filter: none; }
.tabs button { color: rgb(249 246 240 / .55); }
.tabs button:hover { color: rgb(249 246 240 / .85); }
.tabs button.on { color: var(--gold-light); }
.tabs button.on::before { background: var(--gold-light); height: 1px; top: -8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
