/* Cormorant Garamond (SIL Open Font License, see fonts/OFL.txt), bundled so the app needs no network */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/cormorant-garamond-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 500; font-display: swap; src: url(fonts/cormorant-garamond-latin-500-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --bg: #f6f3ee;      /* warm paper */
  --card: #ffffff;    /* tiles, cards */
  --soft: #ece8e1;    /* quiet fills */
  --ink: #2f2b27;
  --ink-2: #6f675e;
  --ink-3: #a59d92;
  --line: rgba(47, 43, 39, 0.08);
  --sage: #96a688;
  --sage-deep: #74856a;
  --danger: #a85544; --on-danger: #ffffff;
  --shadow-md: 0 2px 6px rgba(70, 58, 44, 0.06), 0 16px 40px rgba(70, 58, 44, 0.11);
  --bg-0: rgba(246, 243, 238, 0);       /* the page colour, fully transparent (for fades) */
  --glass: rgba(255, 255, 255, 0.66);   /* tab bar */
  --mark: rgba(47, 43, 39, 0.08);       /* marker under the current tab */
  --scrim: rgba(47, 43, 39, 0.24);
  --pop: rgba(255, 255, 255, 0.92);     /* long-press menu */
  --veil: rgba(255, 255, 255, 0.7);     /* over a photo while it is being cut */
  --track: #d9d4cb;                     /* switch, off */
  --on-sage: #2f2b27;                   /* text on the sage accent, in both themes */
  --ts: 1;                              /* text size multiplier */
  --r: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1b1917;
  --card: #262320;
  --soft: #322e2a;
  --ink: #f1ece4;
  --ink-2: #b9b0a4;
  --ink-3: #82796e;
  --line: rgba(241, 236, 228, 0.10);
  --sage: #a4b595;
  --sage-deep: #b7c7a8;
  --danger: #d98876; --on-danger: #1b1917;
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.5);
  --bg-0: rgba(27, 25, 23, 0);
  --glass: rgba(42, 39, 36, 0.72);
  --mark: rgba(241, 236, 228, 0.13);
  --scrim: rgba(0, 0, 0, 0.5);
  --pop: rgba(48, 44, 40, 0.94);
  --veil: rgba(38, 35, 32, 0.7);
  --track: #4a453f;
  --dot-ring: rgba(255, 255, 255, 0.28);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1917;
    --card: #262320;
    --soft: #322e2a;
    --ink: #f1ece4;
    --ink-2: #b9b0a4;
    --ink-3: #82796e;
    --line: rgba(241, 236, 228, 0.10);
    --sage: #a4b595;
    --sage-deep: #b7c7a8;
    --danger: #d98876; --on-danger: #1b1917;
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.5);
    --bg-0: rgba(27, 25, 23, 0);
    --glass: rgba(42, 39, 36, 0.72);
    --mark: rgba(241, 236, 228, 0.13);
    --scrim: rgba(0, 0, 0, 0.5);
    --pop: rgba(48, 44, 40, 0.94);
    --veil: rgba(38, 35, 32, 0.7);
    --track: #4a453f;
    --dot-ring: rgba(255, 255, 255, 0.28);
    color-scheme: dark;
  }
}
/* a clear ring for keyboard and switch-control users */
:focus-visible { outline: 2px solid var(--sage-deep); outline-offset: 2px; }
.sheet:focus, .input:focus-visible, .pr-input input:focus-visible { outline: none; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
/* figures that read as numbers (0 and 1, not o and I); !important because the font shorthand resets it */
*, *::before, *::after { font-variant-numeric: lining-nums !important; }
html, body { margin: 0; height: 100%; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 calc(15px * var(--ts))/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
img { -webkit-user-drag: none; user-select: none; }

#app { max-width: 720px; margin: 0 auto; min-height: 100%; position: relative; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(20px + var(--safe-t)) 22px 12px;
  background: linear-gradient(var(--bg) 74%, var(--bg-0));
}
.title {
  margin: 0; font: italic 500 calc(40px * var(--ts))/1.05 var(--serif); letter-spacing: -0.01em;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.title.swap { opacity: 0; transform: translateY(6px); }

.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }

/* ---------- press feedback (shared) ---------- */
.pressable { transition: transform .35s var(--spring), opacity .3s; }
.pressing { transform: scale(0.96) !important; transition-duration: .5s !important; transition-timing-function: var(--ease) !important; }
.long-fired { animation: longPop .45s var(--spring); }
@keyframes longPop { 0% { transform: scale(.94); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* ---------- views ---------- */
main { padding: 4px 18px calc(130px + var(--safe-b)); }
.view { display: none; }
.view.active { display: block; animation: viewIn .55s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pieceIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px;
  border-radius: 999px; background: var(--soft); color: var(--ink-2); font-size: calc(14px * var(--ts)); white-space: nowrap;
  transition: background .35s var(--ease), color .35s var(--ease), transform .35s var(--spring);
}
.chip.active { background: var(--ink); color: var(--bg); }
.chip.small { height: 34px; padding: 0 14px; font-size: calc(13px * var(--ts)); }
.chip.small.active { background: var(--sage); color: var(--on-sage); }
.chip.add { background: transparent; border: 1px dashed var(--ink-3); color: var(--ink-2); }
.chip svg { width: 16px; height: 16px; }
/* the category row: plain words, the current one in a soft pill */
.chips.nav { gap: 8px; }
.chips.nav .chip { padding: 0 16px; }
.chips.nav .chip.active { background: var(--ink); color: var(--bg); }
.subchips { overflow: hidden; transition: max-height .45s var(--ease), opacity .35s var(--ease); max-height: 0; opacity: 0; }
.subchips.open { max-height: 60px; opacity: 1; }
.wrap-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- mix: one row per kind of piece, the one in the middle is chosen ---------- */
.mix { --mh: clamp(72px, calc((100vh - 336px - var(--safe-b)) / var(--n, 4)), 168px); --mh: clamp(72px, calc((100dvh - 336px - var(--safe-b)) / var(--n, 4)), 168px); display: flex; flex-direction: column; gap: 8px; margin: 0 -18px; }
.mix-row { position: relative; height: var(--mh); }
.mix-row::before { content: ''; position: absolute; left: 50%; top: 0; width: var(--mh); height: var(--mh); transform: translateX(-50%); border-radius: 26px; background: var(--card); }
.mix-track { position: relative; height: 100%; display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; padding: 0 calc(50% - var(--mh) / 2); scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); }
.mix-track::-webkit-scrollbar { display: none; }
.mix-track:focus-visible { outline: none; }
.mix-row:has(.mix-track:focus-visible)::before { outline: 2px solid var(--sage-deep); outline-offset: 2px; }
.mix-item { flex: none; width: var(--mh); height: var(--mh); padding: 12px; display: flex; align-items: center; justify-content: center; scroll-snap-align: center; transform: scale(.62); opacity: .28; transition: none; will-change: transform, opacity; }
.mix-item img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.mix-item.none span { width: 34%; aspect-ratio: 1; border-radius: 50%; border: 1.5px dashed var(--ink-3); }
.mix-actions { display: flex; gap: 8px; padding: 8px 18px 0; }
.mix-actions .btn { height: 50px; gap: 7px; padding: 0 14px; }
.mix-actions .btn svg { width: 18px; height: 18px; flex: none; }
.mix-actions [data-a=save] { flex: 1; min-width: 0; }
.mix-actions [data-a=save].off { opacity: .45; }
@media (max-width: 359px) { .mix-actions .btn.soft { width: 50px; padding: 0; } .mix-actions .btn.soft span { display: none; } }

/* ---------- search, favourites ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 5px 0 16px; border-radius: 999px; background: var(--card); color: var(--ink-3); }
.tb { position: relative; width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--ink-2); }
.tb svg { width: 19px; height: 19px; }
.tb.fav[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.tb.fav[aria-pressed="true"] svg { fill: currentColor; }
.tb .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--sage-deep); }
.filters .wrap-chips { gap: 6px; }
.chip.col i { width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; box-shadow: inset 0 0 0 1px var(--dot-ring, rgba(0, 0, 0, .1)); }
.filters .row-btns { margin-top: 6px; }
.search > svg { width: 18px; height: 18px; flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 calc(16px * var(--ts)) var(--sans); -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--ink-2); opacity: 1; }
.search button { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.search button svg { width: 16px; height: 16px; }
.chip.fav { padding: 0 12px; }
.chip.fav.active svg { fill: currentColor; }
.fav-mark { position: absolute; top: 10px; right: 10px; color: var(--sage-deep); pointer-events: none; }
.fav-mark svg { display: block; width: 16px; height: 16px; fill: currentColor; stroke: none; }

/* ---------- closet grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; margin-top: 4px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.piece { position: relative; display: block; min-width: 0; animation: pieceIn .6s var(--ease) both; }
.piece-open, .look-open { display: block; width: 100%; min-width: 0; text-align: left; }
.heart { position: absolute; top: 4px; right: 4px; z-index: 1; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.heart svg { width: 17px; height: 17px; }
.heart[aria-pressed="true"] { color: var(--sage-deep); }
.heart[aria-pressed="true"] svg { fill: currentColor; }
.piece .tile { display: block; position: relative; aspect-ratio: 4 / 5; background: var(--card); border-radius: var(--r); }
.piece .sticker {
  position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(70, 58, 44, .08));
  transition: transform .6s var(--spring), opacity .3s var(--ease);
}
@media (hover: hover) and (pointer: fine) { .piece-open:hover .sticker { transform: scale(1.03); } }
.piece .meta, .look .meta { display: flex; flex-direction: column; gap: 6px; margin: 10px 6px 0; }
.piece .name, .look .name { min-width: 0; font: 500 calc(14px * var(--ts))/1.3 var(--sans); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { display: flex; gap: 4px; flex: none; }
.dots i { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--dot-ring, rgba(0, 0, 0, .07)); }

.empty { text-align: center; padding: 80px 20px 40px; color: var(--ink-2); animation: viewIn .7s var(--ease); }
.empty h3 { font: italic 500 calc(28px * var(--ts))/1.2 var(--serif); color: var(--ink); margin: 0 0 20px; }
.empty p { margin: 0; color: var(--ink-3); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 24px; border-radius: 999px; font-size: calc(15px * var(--ts)); font-weight: 500;
  background: var(--ink); color: var(--bg);
  transition: background .35s var(--ease), color .35s var(--ease), transform .35s var(--spring);
}
.btn.soft { background: var(--soft); color: var(--ink); }
.btn.sage { background: var(--sage); color: var(--on-sage); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.danger { background: var(--danger); color: var(--on-danger); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn svg { width: 19px; height: 19px; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn { flex: 1; padding: 0 12px; }

/* ---------- tab bar: liquid glass ---------- */
.tabbar {
  position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%);
  z-index: 20; display: flex; align-items: center; gap: 10px;
  transition: transform .5s var(--ease), opacity .4s;
}
.tabbar.hidden { transform: translate(-50%, 160%); opacity: 0; }
/* a flat frosted capsule: see-through, no shine, no shadow */
.glass {
  position: relative; border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 0 0 1px var(--line);
}
.tabs { display: flex; align-items: center; padding: 5px; }
.tab {
  position: relative; z-index: 1; width: min(68px, calc((100vw - 118px) / 4)); height: 52px; border-radius: 999px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink);
}
.tab span { font-size: calc(10.5px * var(--ts)); letter-spacing: 0.02em; }
.tab svg { width: 21px; height: 21px; }
/* the marker that slides under the current tab */
.tab-ind {
  position: absolute; left: 0; top: 5px; height: 52px; width: 72px; border-radius: 999px; pointer-events: none;
  background: var(--mark);
  transition: transform .6s var(--spring), width .5s var(--ease);
}

/* ---------- overlays ---------- */
#layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.scrim {
  position: fixed; inset: 0; background: var(--scrim);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .45s var(--ease); pointer-events: auto;
}
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 720px;
  max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 30px 30px 0 0; box-shadow: var(--shadow-md);
  padding: 10px 20px calc(26px + var(--safe-b)); pointer-events: auto;
  transform: translateY(105%); transition: transform .55s var(--ease);
}
.sheet.show { transform: translateY(0); }
.sheet.full { height: 100vh; height: 100dvh; max-height: none; border-radius: 0; padding-top: calc(12px + var(--safe-t)); }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--ink-3); opacity: .4; margin: 2px auto 14px; }
.sheet h2 { font: italic 500 calc(32px * var(--ts))/1.1 var(--serif); margin: 4px 0 18px; }
.sheet .sub { color: var(--ink-2); margin: -10px 0 20px; }

/* long-press menu */
.ctx {
  position: fixed; pointer-events: auto; z-index: 2; min-width: 220px; padding: 6px;
  background: var(--pop);
  -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5);
  border-radius: 18px; box-shadow: var(--shadow-md);
  transform: scale(.88); opacity: 0; transition: transform .4s var(--spring), opacity .25s var(--ease);
}
.ctx.show { transform: scale(1); opacity: 1; }
.ctx-title { padding: 10px 14px 6px; font-size: calc(13px * var(--ts)); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.ctx button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: calc(15px * var(--ts)); text-align: left; transition: background .2s; }
.ctx button:hover, .ctx button:active { background: var(--soft); }
.ctx button svg { width: 19px; height: 19px; color: var(--ink-2); }
.ctx button.danger, .ctx button.danger svg { color: var(--danger); }
.ctx-preview { position: fixed; pointer-events: none; z-index: 1; transition: transform .45s var(--spring); }

#toast {
  position: fixed; left: 50%; top: calc(16px + var(--safe-t)); z-index: 90;
  transform: translate(-50%, calc(-100% - 80px)); opacity: 0; padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: calc(14px * var(--ts));
  transition: transform .5s var(--ease), opacity .3s var(--ease); pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toast.act { display: flex; align-items: center; gap: 14px; padding: 6px 6px 6px 20px; }
#toast.act.show { pointer-events: auto; }
#toast button { height: 34px; padding: 0 14px; border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 500; }

/* ---------- forms ---------- */
.field { margin: 0 0 20px; }
.field > label, .field-label { display: block; font-size: calc(13px * var(--ts)); color: var(--ink-2); margin: 0 0 8px 4px; }
.input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: 400 calc(16px * var(--ts)) var(--sans); outline: none;
  transition: border-color .3s, box-shadow .3s;
}
.input:focus { border-color: var(--sage); box-shadow: 0 0 0 4px rgba(150, 166, 136, .2); }
.input::placeholder { color: var(--ink-3); }
.price-wrap { position: relative; }
.price-wrap span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font: 500 calc(19px * var(--ts)) var(--serif); }
.price-wrap .input { padding-left: 32px; font: 500 calc(21px * var(--ts)) var(--serif); }

.seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; background: var(--soft); padding: 5px; border-radius: 20px; }
.seg button {
  height: 66px; border-radius: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-size: calc(10.5px * var(--ts)); color: var(--ink-2); white-space: nowrap; min-width: 0;
  transition: background .35s var(--ease), color .35s;
}
.seg button.active { background: var(--card); color: var(--ink); }

/* ---------- photo step ---------- */
.pick-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pick-btns .btn { height: 104px; flex-direction: column; gap: 10px; padding: 0 8px; border-radius: 24px; }
.pick-btns .btn svg { width: 26px; height: 26px; }
.pick-hint { text-align: center; font-size: calc(13px * var(--ts)); color: var(--ink-2); margin: 16px 0 4px; }

.stage { position: relative; background: var(--card); border-radius: 26px; min-height: 250px; display: grid; place-items: center; padding: 20px; margin-bottom: 14px; overflow: hidden; }
.stage img, .stage canvas { max-width: 100%; max-height: 44vh; display: block; animation: stickerIn .7s var(--spring); }
.stage.erasing { cursor: crosshair; touch-action: none; background: repeating-conic-gradient(#9b948a 0 25%, #8a8379 0 50%) 0 0 / 18px 18px; }
.stage .busy { position: absolute; inset: 0; display: grid; place-items: center; background: var(--veil); opacity: 0; transition: opacity .3s; pointer-events: none; }
.stage.loading .busy { opacity: 1; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--soft); border-top-color: var(--sage); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes stickerIn { from { opacity: 0; transform: scale(.9) rotate(-3deg); } to { opacity: 1; transform: none; } }
.stage-hint { position: absolute; left: 50%; top: 12px; transform: translate(-50%, -8px); padding: 7px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: calc(13px * var(--ts)); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease); }
.stage.erasing .stage-hint { opacity: 1; transform: translate(-50%, 0); }
.cut-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.cut-tools .chip.icon { width: 38px; padding: 0; justify-content: center; }
.cut-tools [data-a=bg] { padding: 0 12px; }
.cut-more { display: flex; gap: 10px; margin: 0 0 22px; }
.cut-more .btn { height: 48px; gap: 8px; padding: 0 16px; }
.cut-more .btn svg { width: 18px; height: 18px; flex: none; }
.cut-more [data-a=erase], .cut-more [data-a=add] { flex: 1; min-width: 0; padding: 0 12px; }
.cut-more [data-a=erase].active, .cut-more [data-a=add].active { background: var(--sage); color: var(--on-sage); }
.cut-more [data-a=undo] { width: 48px; padding: 0; justify-content: center; flex: none; }
.cut-more .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 46px; padding: 0 4px; margin: -6px 0 12px; color: var(--ink-2); font-size: calc(14px * var(--ts)); }
.more-toggle svg { width: 16px; height: 16px; transition: transform .4s var(--ease); }
.more-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.more { display: none; }
.more.open { display: block; animation: viewIn .4s var(--ease); }
[data-a=next] { margin-top: 6px; }
.empty.start { padding-top: 56px; }
.empty.start p { max-width: 300px; margin: 0 auto 24px; color: var(--ink-2); line-height: 1.5; }
.empty.start .pick-btns { max-width: 340px; margin: 0 auto; }

.slider-row { display: flex; align-items: center; gap: 12px; font-size: calc(13px * var(--ts)); color: var(--ink-2); margin: 0 4px 18px; }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 4px; border-radius: 2px; background: var(--soft); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--sage-deep); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--sage-deep); }

.seg.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg.three button { height: 44px; flex-direction: row; font-size: calc(14px * var(--ts)); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-bottom: 10px; border-radius: 18px; background: var(--card); }
.switch { position: relative; width: 46px; height: 28px; border-radius: 999px; background: var(--track); transition: background .35s var(--ease); flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .4s var(--spring); }
.switch.on { background: var(--sage); }
.switch.on::after { transform: translateX(18px); }

/* ---------- batch add ---------- */
.batch { display: flex; flex-direction: column; min-height: 100%; }
.batch .editor-top h2 { margin: 0 0 0 6px; }
.batch-progress { display: flex; align-items: center; gap: 12px; margin: 4px 2px 18px; font-size: calc(13px * var(--ts)); color: var(--ink-2); }
.batch-progress .bar { flex: 1; min-width: 64px; height: 4px; border-radius: 2px; background: var(--soft); overflow: hidden; }
.batch-progress .bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--sage); transition: width .6s var(--ease); }
.batch-progress span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-all { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; margin-bottom: 4px; }
.batch-all .field-label { margin: 0 0 10px 4px; flex: none; }
.batch-all .chips { flex: 1 1 auto; flex-wrap: wrap; overflow: visible; gap: 6px; padding: 0 0 10px; }
.batch-all .chip.small { padding: 0 10px; }
.batch-list { flex: 1; }
.batch-row { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 10px; border-radius: var(--r); background: var(--card); animation: pieceIn .5s var(--ease) both; }
.b-thumb { position: relative; width: 64px; height: 64px; flex: none; display: grid; place-items: center; padding: 5px; border-radius: 16px; background: var(--bg); }
.b-thumb img { max-width: 100%; max-height: 54px; object-fit: contain; animation: stickerIn .6s var(--spring); transition: opacity .3s; }
.b-thumb .spinner { position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; opacity: 0; transition: opacity .3s; }
.batch-row.busy .b-thumb .spinner { opacity: 1; }
.batch-row.busy .b-thumb img { opacity: .3; }
.b-tune {
  position: absolute; right: -5px; bottom: -5px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--card); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line);
  transform: scale(0); transition: transform .4s var(--spring);
}
.b-tune svg { width: 13px; height: 13px; stroke-width: 1.9; }
.batch-row.ready .b-tune { transform: scale(1); }
.b-main { flex: 1; min-width: 0; }
.b-cats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; background: var(--soft); padding: 4px; border-radius: 16px; }
.b-cats button { height: 46px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); transition: background .35s var(--ease), color .35s; }
.b-cats button.active { background: var(--ink); color: var(--bg); }
.b-x { width: 30px; height: 44px; flex: none; display: grid; place-items: center; color: var(--ink-3); }
.b-x svg { width: 16px; height: 16px; }
.batch-row.nudge { animation: nudge .5s var(--ease); }
@keyframes nudge { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.batch-foot { position: sticky; bottom: 0; margin-top: 4px; padding: 18px 0 calc(14px + var(--safe-b)); background: linear-gradient(var(--bg-0), var(--bg) 22%); }
.batch-hint { text-align: center; font-size: calc(13px * var(--ts)); color: var(--ink-2); margin: 10px 0 0; }
@media (max-width: 360px) {
  .batch-row { gap: 8px; padding: 8px; }
  .b-thumb { width: 54px; height: 54px; }
  .b-thumb img { max-height: 44px; }
  .b-x { width: 24px; }
}
.tuner .stage { min-height: 200px; }
.tuner .stage img, .tuner .stage canvas { max-height: 38vh; }

/* ---------- looks ---------- */
.looks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
@media (min-width: 560px) { .looks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.look { position: relative; display: block; min-width: 0; text-align: left; animation: pieceIn .6s var(--ease) both; container-type: inline-size; }
/* on a look the heart sits straight on the board, with only a faint shadow to lift it off any board colour */
.look .heart { top: 4px; right: 4px; width: 40px; height: 40px; filter: drop-shadow(0 1px 1.5px rgba(30, 24, 18, .18)); }
.look .thumb-wrap { position: relative; display: block; border-radius: var(--r); overflow: hidden; }

.look .thumb { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: contain; }
.look.new { aspect-ratio: 4 / 5; align-self: start; display: grid; place-items: center; text-align: center; border-radius: var(--r); border: 1.5px dashed var(--ink-3); color: var(--ink-2); }
.look.new .plus { width: 50px; height: 50px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); }
.look.new span { font: italic 500 calc(20px * var(--ts)) var(--serif); }

/* ---------- look editor ---------- */
.editor { display: flex; flex-direction: column; height: 100%; }
.editor-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.editor-top .input { height: 46px; border-color: transparent; background: transparent; padding: 0 8px; font: italic 500 calc(26px * var(--ts)) var(--serif); }
.editor-top .input:focus { background: var(--card); box-shadow: none; border-color: var(--line); }
.board { position: relative; isolation: isolate; flex: 1; min-height: 300px; overflow: hidden; border-radius: 28px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); touch-action: none; transition: background .6s var(--ease); }
.board .hint { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--ink-3); font: italic 500 calc(22px * var(--ts)) var(--serif); padding: 30px; pointer-events: none; transition: opacity .4s; }
.bitem { position: absolute; left: 0; top: 0; transform-origin: center; touch-action: none; cursor: grab; will-change: transform; }
.bitem img { display: block; width: 100%; pointer-events: none; transition: filter .3s; }
.bitem.pop img { animation: dropIn .6s var(--spring); }
@keyframes dropIn { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.bitem.sel img { filter: drop-shadow(0 10px 18px rgba(70, 58, 44, .22)); }
.bitem.sel::after { content: ''; position: absolute; inset: -6px; border-radius: 14px; border: 1.5px dashed rgba(116, 133, 106, .7); pointer-events: none; animation: fadeIn .3s; }
.bitem .handle { position: absolute; right: -14px; bottom: -14px; width: 30px; height: 30px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 1px var(--line); display: none; place-items: center; color: var(--ink-2); touch-action: none; }
.bitem .handle svg { width: 15px; height: 15px; }
.bitem.sel .handle { display: grid; animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; } }
.editor { position: relative; }
.editor-bar { margin: 12px 0 0; }
.bar-main, .bar-piece { display: flex; align-items: flex-start; gap: 6px; }
.bar-piece { display: none; justify-content: space-between; }
.bar-piece .tool { flex: 1; min-width: 0; }
.bar-piece .tool.danger { color: var(--danger); }
.editor.has-sel .bar-main { display: none; }
.editor.has-sel .bar-piece { display: flex; animation: fadeIn .25s; }
.tool [data-bgdot].auto { box-shadow: inset 0 0 0 1.5px var(--ink-3), 0 0 0 3px var(--bg), 0 0 0 4.5px var(--sage-deep); }
.ed-tray .sw.auto { display: grid; place-items: center; color: #fff; }
.ed-tray .sw.auto svg { width: 18px; height: 18px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); }
.tool { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 52px; flex: none; color: var(--ink-2); }
.tool small { font-size: calc(11px * var(--ts)); letter-spacing: 0.01em; white-space: nowrap; }
.tool [data-bgdot] { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.editor-top .palette-tray { flex: none; width: 68px; margin: 0; }
.editor-top .pill-strip { height: 22px; border-radius: 11px; }
.worn-tool { margin-left: auto; }
.stepper { display: flex; align-items: center; height: 46px; border-radius: 999px; background: var(--soft); color: var(--ink-2); }
.stepper button { width: 40px; height: 46px; display: grid; place-items: center; color: var(--ink-2); }
.stepper button:disabled { opacity: .35; }
.stepper button svg { width: 17px; height: 17px; }
.stepper b { min-width: 20px; text-align: center; font: 500 calc(19px * var(--ts))/1 var(--serif); color: var(--ink); }
.look .sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.look .wn { flex: none; font-size: calc(12px * var(--ts)); color: var(--ink-2); }
/* the tray above the toolbar: background colours, or pieces to swap in */
.ed-tray { position: absolute; left: 0; right: 0; bottom: 86px; z-index: 3; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 24px; background: var(--pop); box-shadow: var(--shadow-md); overflow-x: auto; scrollbar-width: none; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .3s, transform .45s var(--ease); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.ed-tray::-webkit-scrollbar { display: none; }
.ed-tray.open { opacity: 1; transform: none; pointer-events: auto; }
.ed-tray .sw { flex: 1; min-width: 34px; max-width: 48px; aspect-ratio: 1; border-radius: 50%; margin: 0 auto; box-shadow: inset 0 0 0 1px var(--line), inset 0 0 0 1.5px rgba(128, 128, 128, .25); }
.ed-tray .sw[aria-pressed="true"] { outline: 2px solid var(--sage-deep); outline-offset: 3px; }
.ed-tray .swp { flex: none; width: 58px; height: 58px; border-radius: 16px; background: var(--card); padding: 6px; display: grid; place-items: center; }
.ed-tray .swp img { width: 100%; height: 100%; object-fit: contain; }
.ed-tray .swp[aria-pressed="true"] { outline: 2px solid var(--sage-deep); outline-offset: 2px; }
.round { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--ink-2); flex: none; }
.round.dark { background: var(--ink); color: var(--bg); }
.round svg { width: 20px; height: 20px; }
/* the colours of the look sit beside the tools, no label needed */
.palette-tray { flex: 1; min-width: 0; margin-left: 4px; }
.pill-strip { display: flex; height: 30px; border-radius: 15px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05); }
.pill-strip button { flex: 1; transition: flex .5s var(--ease); }
.pill-strip button:hover, .pill-strip button:active { flex: 1.6; }

.picker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .picker-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pick-item { aspect-ratio: 1; min-width: 0; overflow: hidden; background: var(--card); border-radius: 18px; padding: 12px; display: grid; place-items: center; position: relative; }
.pick-item img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.pick-item .on { position: absolute; top: 7px; right: 7px; width: 22px; height: 22px; border-radius: 50%; background: var(--sage); color: var(--on-sage); display: grid; place-items: center; transform: scale(0); transition: transform .4s var(--spring); }
.pick-item .on svg { width: 12px; height: 12px; stroke-width: 2.4; }
.pick-item.in .on { transform: scale(1); }

/* ---------- piece detail ---------- */
.detail-img { position: relative; display: grid; place-items: center; padding: 6px 0 18px; }
.fav-btn { position: absolute; top: 0; right: 0; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--ink-2); }
.fav-btn.on { color: var(--sage-deep); }
.fav-btn.on svg { fill: currentColor; }
.worn { margin: -12px 0 18px; font-size: calc(13px * var(--ts)); color: var(--ink-2); }
.in-looks { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 18px; scrollbar-width: none; }
.in-looks::-webkit-scrollbar { display: none; }
.in-looks button { flex: none; width: 54px; height: 81px; border-radius: 12px; overflow: hidden; background: var(--card); }
.in-looks img { display: block; width: 100%; height: 100%; object-fit: cover; }
.detail-img img { max-width: 74%; max-height: 40vh; animation: stickerIn .7s var(--spring); filter: drop-shadow(0 12px 20px rgba(70, 58, 44, .12)); }
.detail-meta { display: flex; align-items: center; gap: 10px; color: var(--ink-2); margin: -10px 0 22px; }
.detail-meta .dots i { width: 12px; height: 12px; }

/* ---------- tally ---------- */
.big-total { text-align: center; padding: 0 0 18px; }
.big-total .v { font: 500 calc(60px * var(--ts))/1 var(--serif); }
.big-total small { display: block; font-size: calc(14px * var(--ts)); color: var(--ink-2); margin-top: 4px; }
.breakdown .line { display: flex; align-items: center; gap: 14px; padding: 11px 4px; }
.breakdown .nm { width: 96px; color: var(--ink-2); }
.breakdown .bar { flex: 1; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.breakdown .bar i { display: block; height: 100%; border-radius: 4px; background: var(--sage); transform-origin: left; animation: growX 1s var(--ease) both; }
@keyframes growX { from { transform: scaleX(0); } }
.breakdown .amt { width: 26px; text-align: right; font: 500 calc(19px * var(--ts))/1 var(--serif); }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.kv.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kv.three div { padding: 12px 12px; }
.stats { padding-top: 6px; animation: viewIn .5s var(--ease); }
.st-h { margin: 26px 4px 10px; font: 500 calc(13px * var(--ts)) var(--sans); color: var(--ink-2); }
.st-pieces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.st-pieces button { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.st-tile { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 18px; background: var(--card); }
.st-tile img { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain; }
.st-n { font: 500 calc(17px * var(--ts)) var(--serif); }
.st-look { display: flex; align-items: center; gap: 14px; width: 100%; padding: 8px; border-radius: 18px; background: var(--card); text-align: left; }
.st-look .thumb-wrap { width: 62px; aspect-ratio: 2 / 3; flex: none; border-radius: 12px; overflow: hidden; display: block; }
.st-look img { width: 100%; height: 100%; object-fit: contain; display: block; }
.st-look b { display: block; font-weight: 500; }
.st-look small { color: var(--ink-2); }
.st-row { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; padding: 15px 16px; border-radius: 18px; background: var(--card); text-align: left; }
.st-row span { flex: 1; color: var(--ink-2); }
.st-row b { font: 500 calc(19px * var(--ts)) var(--serif); }
.st-row .vp-c { width: 14px; height: 14px; transform: rotate(180deg); color: var(--ink-3); }
.stats .value-pill { margin-top: 26px; }
.kv div { background: var(--card); padding: 13px 16px; border-radius: 18px; min-width: 0; }
.kv small { display: block; font-size: calc(13px * var(--ts)); color: var(--ink-2); margin-bottom: 2px; }
.kv b { display: block; font: 500 calc(16px * var(--ts))/1.3 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the one small place the closet's cost appears: last thing on the sheet */
.value-pill { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 10px; width: 100%; margin-top: 10px; padding: 13px 16px; border-radius: 18px; background: var(--card); text-align: left; }
.value-pill .vp-l { grid-column: 1; grid-row: 1; font-size: calc(13px * var(--ts)); color: var(--ink-2); margin-bottom: 2px; }
.value-pill .vp-v { grid-column: 1; grid-row: 2; font: 500 calc(21px * var(--ts))/1.1 var(--serif); }
.value-pill .vp-s { grid-column: 2; grid-row: 1 / span 2; font-size: calc(13px * var(--ts)); color: var(--ink-2); white-space: nowrap; }
.value-pill .vp-c { grid-column: 3; grid-row: 1 / span 2; width: 14px; height: 14px; transform: rotate(180deg); color: var(--ink-3); }
@media (max-height: 600px) { .big-total .v { font-size: calc(44px * var(--ts)); } .breakdown .line { padding: 8px 4px; } }

/* ---------- price list ---------- */
.price-total { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; gap: 10px; padding: 14px 16px; border-radius: 18px; background: var(--card); }
.price-total span { font-size: calc(13px * var(--ts)); color: var(--ink-2); }
.price-total b { font: 500 calc(26px * var(--ts))/1 var(--serif); }
.price-total small { margin-left: auto; font-size: calc(13px * var(--ts)); color: var(--ink-2); }
.price-head { font-size: calc(13px * var(--ts)); color: var(--ink-2); margin: 22px 4px 4px; }
.price-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; animation: pieceIn .5s var(--ease) both; }
.price-row img { width: 48px; height: 48px; object-fit: contain; flex: none; }
.pr-text { flex: 1; min-width: 0; }
.pr-name { font: 500 calc(15px * var(--ts))/1.25 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-sub { font-size: calc(13px * var(--ts)); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-input { flex: none; display: flex; align-items: center; gap: 3px; width: 108px; height: 46px; padding: 0 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); transition: border-color .3s, box-shadow .3s; }
.price-row.focus .pr-input { border-color: var(--sage); box-shadow: 0 0 0 4px rgba(150, 166, 136, .2); }
.pr-input span { color: var(--ink-3); font: 500 calc(16px * var(--ts)) var(--serif); }
.pr-input input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 calc(19px * var(--ts)) var(--serif); text-align: right; padding: 0; }
.pr-input input::placeholder { color: var(--ink-3); }
.pr-empty { color: var(--ink-3); text-align: center; padding: 30px 0; }
/* touch devices: room to scroll the last rows above the on-screen keyboard */
@media (hover: none) and (pointer: coarse) { .prices [data-list] { padding-bottom: 42vh; } }

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

@media (max-width: 359px) { .seg button { font-size: 9px; letter-spacing: -0.02em; } }

/* ---------- More: settings ---------- */
.settings { margin-top: 30px; }
.more-empty { padding-top: 40px; padding-bottom: 10px; }
.set-card { background: var(--card); border-radius: 20px; padding: 6px; margin-bottom: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 10px; }
.set-row > span { color: var(--ink); font-size: calc(15px * var(--ts)); }
.set-row > span small { display: block; margin-top: 3px; font-size: calc(12.5px * var(--ts)); color: var(--ink-2); line-height: 1.35; }
.set-row .seg.three { flex: 0 1 220px; }
.set-row.opt { background: transparent; padding: 10px; margin: 0; border-radius: 0; }
.set-row .switch { flex: none; }
.set-link { display: flex; align-items: center; gap: 12px; width: 100%; height: 50px; padding: 0 12px; border-radius: 14px; color: var(--ink); font-size: calc(15px * var(--ts)); text-align: left; }
.set-link svg { width: 19px; height: 19px; color: var(--ink-2); }
.set-link.danger, .set-link.danger svg { color: var(--danger); }
.set-link + .set-link { box-shadow: 0 -1px 0 var(--line); border-radius: 0; }
/* ---------- inside the iOS app: the native tab bar replaces the web one ---------- */
.native-bar #tabbar { display: none; }
.native-bar main { padding-bottom: calc(var(--native-bar, 90px) + 28px); }
.detail-img.tinted { border-radius: 26px; padding: 22px 0; margin-bottom: 18px; }

/* ---------- header text button (Select / Done) ---------- */
.text-btn { height: 40px; padding: 0 14px; margin-right: -6px; border-radius: 999px; background: var(--soft); color: var(--ink); font: 500 calc(14px * var(--ts)) var(--sans); transition: background .3s var(--ease), transform .35s var(--spring); }
/* ---------- choosing several items ---------- */
.piece.choosing .piece-open { transition: transform .35s var(--spring); }
.piece.choosing .heart { display: none; }
.tick-mark { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--ink-3); color: transparent; pointer-events: none; transition: background .25s var(--ease), color .25s, box-shadow .25s, transform .35s var(--spring); }
.tick-mark svg { width: 14px; height: 14px; stroke-width: 2.4; }
.piece.chosen .tick-mark { background: var(--sage-deep); color: var(--bg); box-shadow: none; transform: scale(1.08); }
.piece.chosen .tile { box-shadow: inset 0 0 0 2.5px var(--sage-deep); }
.piece.chosen .piece-open { transform: scale(.96); }
.select-bar { position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); z-index: 30; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; animation: barUp .45s var(--spring); }
.select-bar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 74px; height: 54px; border-radius: 999px; color: var(--ink); font-size: calc(11px * var(--ts)); transition: opacity .3s, background .25s; }
.select-bar button svg { width: 20px; height: 20px; }
.select-bar button.danger { color: var(--danger); }
.select-bar.none button { opacity: .4; }
@keyframes barUp { from { transform: translate(-50%, 140%); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
body.choosing #tabbar { transform: translate(-50%, 160%); opacity: 0; pointer-events: none; }
/* ---------- brands ---------- */
.select-wrap { position: relative; }
.select-wrap select { -webkit-appearance: none; appearance: none; padding-right: 40px; }
.select-wrap svg { position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--ink-2); pointer-events: none; }
.brand-new { display: flex; gap: 8px; margin-top: 8px; }
.brand-new .input { flex: 1; min-width: 0; }
.brand-new .btn { flex: none; padding: 0 18px; }
.detail-meta .brand { font-weight: 600; color: var(--ink); }

/* Arrange: each item hops as it moves to its new place */
.bitem.hop img { animation: hop .75s cubic-bezier(.3,1.45,.5,1) both; }
@keyframes hop { 0% { transform: scale(1); } 35% { transform: scale(1.08) rotate(-3deg); } 70% { transform: scale(.97) rotate(1deg); } 100% { transform: none; } }

/* Mix rows */
.mix-none { margin: 24px 18px; text-align: center; color: var(--ink-2); font-size: calc(14px * var(--ts)); }
.rows-ed .sub svg.inline { width: 15px; height: 15px; vertical-align: -3px; }
.rows-list { list-style: none; margin: 0 0 12px; padding: 6px; background: var(--card); border-radius: 22px; display: flex; flex-direction: column; gap: 4px; }
.rows-item { position: relative; display: flex; align-items: center; gap: 2px; min-height: 58px; border-radius: 16px; background: var(--card); transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .2s, opacity .2s; }
.rows-item + .rows-item::before { content: ''; position: absolute; left: 50px; right: 12px; top: -2px; height: 1px; background: var(--line); }
.rows-list.moving .rows-item::before { opacity: 0; }
.rows-item.dragging { z-index: 3; transition: box-shadow .2s; box-shadow: 0 12px 30px rgba(0,0,0,.16); }
.rows-item .grip { flex: none; width: 46px; height: 54px; display: grid; place-items: center; color: var(--ink-3); touch-action: none; cursor: grab; }
.rows-item.dragging .grip { cursor: grabbing; color: var(--ink); }
.rows-item .grip svg { width: 20px; height: 20px; }
.rows-item .rk { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 4px 8px; border-radius: 12px; color: var(--ink); text-align: left; }
.rows-item .rk > svg:first-child { width: 24px; height: 24px; flex: none; }
.rows-item .rk span { flex: 1; min-width: 0; font-size: calc(15px * var(--ts)); }
.rows-item .rk small { display: block; margin-top: 2px; font-size: calc(12px * var(--ts)); color: var(--ink-2); }
.rows-item .rk > svg:last-child { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
.rows-item .rm { flex: none; width: 44px; height: 44px; margin-right: 4px; border-radius: 50%; display: grid; place-items: center; color: var(--danger); }
.rows-item .rm svg { width: 18px; height: 18px; stroke-width: 2.2; padding: 3px; box-sizing: content-box; border-radius: 50%; background: color-mix(in srgb, var(--danger) 14%, transparent); }
.rows-item .rm:disabled { opacity: .3; }
.rows-item.out { animation: row-out .22s ease forwards; }
.rows-item.in { animation: row-in .36s cubic-bezier(.3,1.4,.5,1); }
@keyframes row-out { to { opacity: 0; transform: translateX(28px) scale(.96); } }
@keyframes row-in { from { opacity: 0; transform: translateY(-8px) scale(.95); } }
.rows-add { width: 100%; height: 50px; gap: 8px; margin-bottom: 14px; }
.rows-add svg { width: 18px; height: 18px; }
.rows-add.off { opacity: .45; }
.set-link span small { display: block; margin-top: 2px; font-size: calc(12px * var(--ts)); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-link span { flex: 1; min-width: 0; }
.set-link svg.go { width: 16px; height: 16px; color: var(--ink-3); flex: none; transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) { .rows-item, .rows-item.in, .rows-item.out { animation: none; transition: none; } }

/* tapping the photo: zoom in to reach the small bits */
.stage.erasing canvas { transform-origin: 0 0; will-change: transform; animation: none; }
.stage.zoomed { cursor: grab; }
.stage.adding { background: repeating-conic-gradient(#d9d3c9 0 25%, #cfc8bd 0 50%) 0 0 / 18px 18px; }
.zoom-fit { position: absolute; right: 12px; bottom: 12px; z-index: 2; height: 34px; padding: 0 12px; border-radius: 999px; display: flex; align-items: center; gap: 6px; background: var(--ink); color: var(--bg); font-size: calc(13px * var(--ts)); animation: fit-in .3s var(--spring); }
.zoom-fit svg { width: 15px; height: 15px; }
.zoom-fit[hidden] { display: none; }
@keyframes fit-in { from { opacity: 0; transform: scale(.8); } }

/* very narrow phones: the fixer's two tools drop their icons so "Add back" fits beside Undo */
@media (max-width: 359px) { .cut-more [data-a=erase] svg, .cut-more [data-a=add] svg { display: none; } }

/* ---------- the + in the middle of the tab bar ---------- */
.tab { width: min(66px, calc((100vw - 48px - 58px) / 4)); }
.tab-plus { position: relative; z-index: 1; flex: none; width: 58px; height: 52px; display: grid; place-items: center; }
.tab-plus > span { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--sage); color: var(--on-sage); box-shadow: 0 6px 16px -8px rgba(60, 80, 50, .6); transition: transform .45s var(--spring); }
.tab-plus svg { width: 22px; height: 22px; stroke-width: 1.8; transition: transform .5s var(--spring); }
.tab-plus.pressing > span { transform: scale(.86); }
.tab-plus.pressing svg { transform: rotate(90deg); }

/* ---------- Mix: rows keep their size and scroll; the buttons stay above the tab bar ---------- */
.mix {
  --mh: clamp(100px, calc((100vh - 300px - var(--safe-b)) / min(var(--n, 4), 4)), 168px);
  --mh: clamp(100px, calc((100dvh - 300px - var(--safe-b)) / min(var(--n, 4), 4)), 168px);
  padding-bottom: 84px;
}
.mix-dock { position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); width: min(720px, 100%); bottom: calc(14px + 62px + 10px + var(--safe-b)); pointer-events: none; }
.mix-dock[hidden] { display: none; }
.mix-dock::before { content: ''; position: absolute; left: 0; right: 0; top: -24px; bottom: -110px; z-index: -1; pointer-events: none; background: linear-gradient(to top, var(--bg) 64%, transparent); }
.mix-dock .mix-actions { pointer-events: auto; padding: 0 18px; animation: dockIn .5s var(--spring) both; }
.native-bar .mix-dock { bottom: calc(var(--native-bar, 90px) + 10px); }
@keyframes dockIn { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Rows: the kinds open right under a row ---------- */
.rows-item { display: block; min-height: 0; }
.ri-main { display: flex; align-items: center; gap: 2px; min-height: 58px; }
.kinds { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .34s var(--ease); }
.kinds > div { min-height: 0; overflow: hidden; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 0 8px; }
.open > .kinds { grid-template-rows: 1fr; }
.kinds button { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 1px 8px; margin-bottom: 10px; border-radius: 14px; background: var(--soft); color: var(--ink-2); font-size: calc(9.5px * var(--ts)); letter-spacing: -0.01em; transition: background .25s var(--ease), color .25s var(--ease), transform .35s var(--spring); }
.kinds button svg { width: 20px; height: 20px; }
.kinds button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kinds button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.open > .kinds button { animation: kindIn .4s var(--spring) both; }
.open > .kinds button:nth-child(2) { animation-delay: 30ms; }
.open > .kinds button:nth-child(3) { animation-delay: 60ms; }
.open > .kinds button:nth-child(4) { animation-delay: 90ms; }
.open > .kinds button:nth-child(5) { animation-delay: 120ms; }
@keyframes kindIn { from { opacity: 0; transform: translateY(-6px) scale(.9); } }
.rows-item .rk > svg:last-child { transition: transform .35s var(--ease); }
.rows-item.open .rk > svg:last-child { transform: rotate(180deg); }
.rows-item.swap { animation: rowSwap .5s var(--spring); }
@keyframes rowSwap { 0% { transform: scale(.96); opacity: .5; } 100% { transform: none; opacity: 1; } }
.rows-adder { margin-bottom: 14px; }
.rows-adder .rows-add { margin-bottom: 0; }
.rows-adder .kinds > div { padding: 0; }
.rows-adder .kinds button { margin: 10px 0 0; }
.rows-adder.open .rows-add svg { transform: rotate(45deg); }
.rows-add svg { transition: transform .4s var(--spring); }

/* ---------- motion: pages, tabs, menus, hearts, settings ---------- */
.view.active.from-right { animation: fromRight .46s var(--ease); }
.view.active.from-left { animation: fromLeft .46s var(--ease); }
@keyframes fromRight { from { opacity: 0; transform: translateX(34px); } }
@keyframes fromLeft { from { opacity: 0; transform: translateX(-34px); } }
.tab.active svg { animation: tabPop .5s var(--spring); }
@keyframes tabPop { 40% { transform: translateY(-3px) scale(1.18); } }
.ctx.show button[role=menuitem] { animation: ctxItem .42s var(--spring) both; animation-delay: calc(var(--i, 0) * 32ms + 30ms); }
@keyframes ctxItem { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.heart.popped svg, .fav-btn.popped svg { animation: heartPop .5s var(--spring); }
@keyframes heartPop { 0% { transform: scale(.6); } 55% { transform: scale(1.28); } 100% { transform: none; } }
.chip.active { animation: chipPop .38s var(--spring); }
@keyframes chipPop { 0% { transform: scale(.92); } 100% { transform: none; } }
.seg button { transition: background .3s var(--ease), color .3s var(--ease); }
.seg button.active { animation: chipPop .38s var(--spring); }
.stats > *, .settings > * { animation: pieceIn .55s var(--ease) both; }
.stats > *:nth-child(2), .settings > *:nth-child(2) { animation-delay: 40ms; }
.stats > *:nth-child(3), .settings > *:nth-child(3) { animation-delay: 80ms; }
.stats > *:nth-child(4), .settings > *:nth-child(4) { animation-delay: 120ms; }
.stats > *:nth-child(5), .settings > *:nth-child(5) { animation-delay: 160ms; }
.stats > *:nth-child(n+6), .settings > *:nth-child(n+6) { animation-delay: 200ms; }
.btn { transition: transform .35s var(--spring), background .3s var(--ease), color .3s var(--ease), opacity .3s; }
.btn.pressing { transform: scale(.95) !important; }

/* ---------- Settings: a slimmer Appearance control ---------- */
.set-row .seg.three { padding: 3px; gap: 3px; border-radius: 13px; }
.set-row .seg.three button { height: 32px; border-radius: 10px; font-size: calc(13.5px * var(--ts)); }

/* ---------- the Create sheet (the +) ---------- */
.sheet.tall { min-height: 84vh; min-height: 84dvh; }
.create h2 { margin-bottom: 8px; }
.cr-h { margin: 18px 2px 10px; font-size: calc(13px * var(--ts)); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.cr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cr-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px;
  min-height: clamp(150px, 25vh, 230px); padding: 18px 16px; border-radius: 26px; text-align: left; color: var(--ink); overflow: hidden;
  animation: tileIn .55s var(--spring) both;
}
.cr-tile svg { position: absolute; top: 18px; left: 16px; width: 34px; height: 34px; stroke-width: 1.4; }
.cr-tile b { font: italic 500 calc(23px * var(--ts))/1.1 var(--serif); }
.cr-tile small { font-size: calc(12.5px * var(--ts)); color: var(--ink-2); line-height: 1.3; }
.cr-tile.t1 { background: #e6ece0; } .cr-tile.t2 { background: #efe7db; } .cr-tile.t3 { background: #f1e6e1; } .cr-tile.t4 { background: #e4e9ee; }
.cr-tile.off { opacity: .55; }
.cr-grid:nth-of-type(1) .cr-tile:nth-child(2) { animation-delay: 50ms; }
.create .cr-grid:last-of-type .cr-tile:nth-child(1) { animation-delay: 100ms; }
.create .cr-grid:last-of-type .cr-tile:nth-child(2) { animation-delay: 150ms; }
@keyframes tileIn { from { opacity: 0; transform: translateY(18px) scale(.96); } }
:root[data-theme="dark"] .cr-tile.t1 { background: #2a3127; } :root[data-theme="dark"] .cr-tile.t2 { background: #322b23; }
:root[data-theme="dark"] .cr-tile.t3 { background: #33282a; } :root[data-theme="dark"] .cr-tile.t4 { background: #262c32; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-tile.t1 { background: #2a3127; } :root:not([data-theme="light"]) .cr-tile.t2 { background: #322b23; }
  :root:not([data-theme="light"]) .cr-tile.t3 { background: #33282a; } :root:not([data-theme="light"]) .cr-tile.t4 { background: #262c32; }
}

/* ---------- long-press menus: softer, roomier, icons in little circles ---------- */
.ctx { min-width: 236px; padding: 7px; border-radius: 22px; box-shadow: 0 22px 54px -14px rgba(40, 30, 20, .38), 0 0 0 .5px var(--line); }
.ctx-title { padding: 8px 14px 8px; font-size: calc(12.5px * var(--ts)); letter-spacing: .02em; }
.ctx button { gap: 13px; padding: 9px 12px 9px 9px; min-height: 48px; border-radius: 15px; font-size: calc(15.5px * var(--ts)); font-weight: 450; }
.ctx button svg { width: 17px; height: 17px; padding: 7px; box-sizing: content-box; border-radius: 50%; background: var(--soft); color: var(--ink); flex: none; transition: transform .35s var(--spring); }
.ctx button:active svg { transform: scale(.88); }
.ctx button.danger { margin-top: 7px; position: relative; }
.ctx button.danger::before { content: ''; position: absolute; left: 12px; right: 12px; top: -4px; height: 1px; background: var(--line); }
.ctx button.danger svg { background: color-mix(in srgb, var(--danger) 13%, transparent); }
.ctx-preview { filter: drop-shadow(0 18px 30px rgba(40, 30, 20, .22)); }

/* ---------- Create: big tiles, just their names ---------- */
.cr-tile { justify-content: flex-end; }
.cr-tile b { font-size: calc(25px * var(--ts)); }

/* ---------- notes ---------- */
textarea.input.notes { height: auto; min-height: 84px; padding-top: 12px; padding-bottom: 12px; resize: vertical; line-height: 1.4; font: inherit; font-size: calc(16px * var(--ts)); }
.notes { white-space: pre-wrap; margin: -4px 0 14px; color: var(--ink-2); font-size: calc(14.5px * var(--ts)); line-height: 1.45; }
.chip.add svg { width: 14px; height: 14px; margin-right: 2px; }

/* ---------- More > Types ---------- */
.ty-sec { margin-bottom: 20px; }
.ty-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; font-size: calc(15px * var(--ts)); font-weight: 500; }
.ty-sec h3 svg { width: 20px; height: 20px; }
.ty-chip { display: inline-flex; align-items: center; height: 36px; border-radius: 999px; background: var(--soft); color: var(--ink-2); transition: background .25s var(--ease), color .25s var(--ease); }
.ty-chip.on { background: var(--ink); color: var(--bg); }
.ty-t { display: inline-flex; align-items: center; gap: 5px; height: 100%; padding: 0 14px; font-size: calc(14px * var(--ts)); color: inherit; }
.ty-t svg { width: 14px; height: 14px; stroke-width: 2.2; display: none; }
.ty-chip.on .ty-t svg { display: block; animation: chipPop .35s var(--spring); }
.ty-x { width: 30px; height: 30px; margin-right: 3px; margin-left: -8px; border-radius: 50%; display: grid; place-items: center; color: inherit; opacity: .75; }
.ty-x svg { width: 13px; height: 13px; }
.ty-in { height: 36px; width: 140px; font-size: 14px; }
.ty-add { height: 36px; }

/* ---------- the page under a sheet or a menu stays put ---------- */
html.locked, html.locked body { overflow: hidden; overscroll-behavior: none; }
html.locked body { height: auto; min-height: 100%; }
.scrim, .ctx, .ctx-preview { touch-action: none; overscroll-behavior: none; }

/* ---------- a heart on a closet card only for a favourite ---------- */
.piece .heart { color: var(--sage-deep); }
.piece .heart.gone { opacity: 0; transform: scale(.6); transition: opacity .25s var(--ease), transform .25s var(--ease); }

/* ---------- Types: Select ---------- */
.ty-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ty-head h2 { margin-bottom: 18px; }
.ty-head .text-btn { margin-top: -12px; }
.types-ed.choosing .ty-chip { background: var(--soft); color: var(--ink); box-shadow: inset 0 0 0 1.5px transparent; }
.types-ed.choosing .ty-chip:not(.on) { color: var(--ink-3); }
.types-ed.choosing .ty-chip .ty-t svg { display: none; }
.types-ed.choosing .ty-chip.picked { background: color-mix(in srgb, var(--sage) 26%, var(--soft)); box-shadow: inset 0 0 0 1.5px var(--sage-deep); }
.types-ed.choosing .ty-chip.picked .ty-t svg { display: block; color: var(--sage-deep); }
.ty-bar { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 12px 0 4px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.ty-bar .btn { flex: 1; gap: 6px; height: 50px; }
.ty-bar .btn svg { width: 17px; height: 17px; }
.ty-bar .btn.off { opacity: .45; }
.types-ed .row-btns { margin-top: 6px; }

/* ---------- look pictures fade in once drawn for the light or dark in use ---------- */
.look .thumb, .in-looks img, .st-look img { transition: opacity .35s var(--ease); }
.look .thumb.coming, .in-looks img.coming, .st-look img.coming { opacity: 0; }
.look .thumb-wrap { transition: background-color .35s var(--ease); }
/* a heart on a look card only for a favourite */
.look .heart { color: var(--sage-deep); }
.look .heart.gone { opacity: 0; transform: scale(.6); transition: opacity .25s var(--ease), transform .25s var(--ease); }

/* ---------- thrifted ---------- */
.set-row.thrift-row { padding: 6px 2px 4px; margin: -4px 0 14px; }
.set-row.thrift-row > span { display: inline-flex; align-items: center; gap: 10px; }
.set-row.thrift-row > span svg { width: 19px; height: 19px; color: var(--ink-2); }
.detail-meta .thrift { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; border-radius: 999px; background: color-mix(in srgb, var(--sage) 22%, transparent); color: var(--sage-deep); font-size: calc(12.5px * var(--ts)); font-weight: 500; }
.detail-meta .thrift svg { width: 13px; height: 13px; }
.detail-meta { flex-wrap: wrap; row-gap: 8px; }

/* ---------- privacy ---------- */
.privacy-doc h3 { font-size: calc(15px * var(--ts)); font-weight: 600; margin: 18px 0 6px; }
.privacy-doc p, .privacy-doc li { color: var(--ink-2); font-size: calc(14.5px * var(--ts)); line-height: 1.5; margin: 0 0 8px; }
.privacy-doc ul { padding-left: 20px; margin: 0 0 8px; }
.privacy-doc .when { color: var(--ink-3); font-size: calc(12.5px * var(--ts)); margin: -12px 0 14px; }

/* ---------- a small loading card while photos are read and cut out ---------- */
.loading-screen {
  position: fixed; inset: 0; z-index: 85; display: grid; place-items: center;
  background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .3s var(--ease); touch-action: none;
}
.loading-screen.out { opacity: 0; pointer-events: none; }
.ld-card {
  display: flex; flex-direction: column; align-items: center; gap: 16px; min-width: 210px; max-width: calc(100vw - 64px);
  padding: 28px 30px 24px; border-radius: 26px; background: var(--bg); box-shadow: var(--shadow-md);
  transition: transform .3s var(--ease);
}
.loading-screen.out .ld-card { transform: scale(.96); }
.ld-ring { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--soft); border-top-color: var(--sage-deep); animation: spin .9s linear infinite; will-change: transform; }
.ld-text { margin: 0; text-align: center; color: var(--ink); font-size: calc(15px * var(--ts)); font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .ld-ring { animation-duration: 2.4s; } }

/* ---------- photo tips, before the camera or the photos ---------- */
.guide .sub { margin-top: -8px; }
.g-eg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 18px; }
.g-eg figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.g-pic { display: grid; place-items: center; aspect-ratio: 1; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line); }
.g-pic svg { width: 62%; height: 62%; }
.g-eg figcaption { display: flex; align-items: flex-start; gap: 4px; font-size: calc(12px * var(--ts)); line-height: 1.3; color: var(--ink-2); }
.g-eg figcaption svg { width: 14px; height: 14px; flex: none; stroke-width: 2.4; margin-top: 1px; }
.g-eg .ok figcaption svg { color: var(--sage-deep); }
.g-eg .no figcaption svg { color: var(--danger); }
.g-eg .no .g-pic { opacity: .75; }
.g-tips { margin: 0 0 20px; padding-left: 20px; color: var(--ink-2); font-size: calc(14.5px * var(--ts)); line-height: 1.5; }
.g-tips li { margin-bottom: 4px; }
.guide .row-btns .btn { gap: 8px; }
.guide .row-btns .btn svg { width: 19px; height: 19px; }
.g-skip { display: flex; align-items: center; gap: 10px; margin: 14px auto 0; padding: 8px 6px; color: var(--ink-2); font-size: calc(14px * var(--ts)); }
.g-skip i { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--ink-3); transition: background .2s, box-shadow .2s; }
.g-skip i svg { width: 14px; height: 14px; stroke-width: 2.6; color: var(--bg); opacity: 0; transition: opacity .2s; }
.g-skip[aria-checked="true"] i { background: var(--sage-deep); box-shadow: none; }
.g-skip[aria-checked="true"] i svg { opacity: 1; }

/* ---------- moving items and looks into one's own order ---------- */
.grid.moving, .looks.moving { position: relative; }
.grid.moving > [data-id], .looks.moving > [data-id] { touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; }
.grid.moving .piece-open, .looks.moving .look-open { pointer-events: none; }
.grid.moving > [data-id]:not(.dragging), .looks.moving > [data-id]:not(.dragging) { animation: wobble .5s ease-in-out infinite alternate; }
.grid.moving > [data-id]:nth-child(2n):not(.dragging), .looks.moving > [data-id]:nth-child(2n):not(.dragging) { animation-delay: -.25s; }
@keyframes wobble { from { rotate: -.6deg; } to { rotate: .6deg; } }
/* the card being moved leaves a faint gap where it will land; a copy of it follows the finger */
.moving > .dragging { animation: none !important; opacity: .22; }
.drag-ghost { position: fixed; z-index: 95; margin: 0; pointer-events: none; animation: none !important; cursor: grabbing;
  transition: transform .18s var(--ease), filter .18s var(--ease); will-change: transform; }
.drag-ghost.up { transition: filter .2s var(--ease); filter: drop-shadow(0 22px 28px rgba(40, 30, 20, .28)); }
.drag-ghost.settle { transition: transform .26s var(--spring), filter .26s var(--ease); }
.drag-ghost .heart { display: none; }
.moving .heart { display: none; }
#select-btn.done { background: var(--ink); color: var(--bg); }
@media (prefers-reduced-motion: reduce) { .grid.moving > [data-id], .looks.moving > [data-id] { animation: none !important; } }

/* ---------- iPad and other wide screens ---------- */
/* three columns from a small iPad up (two on phones and narrow Split View), four on a wide landscape iPad */
@media (min-width: 600px) {
  .grid, .looks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 16px; }
  .picker-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  #app { max-width: 1100px; }
  main { padding-left: 28px; padding-right: 28px; }
  .top { padding-left: 32px; padding-right: 32px; }
  /* pages that read best narrow stay a comfortable width in the middle */
  #view-mix, #view-more { max-width: 720px; margin-left: auto; margin-right: auto; }
  /* sheets float as cards above the page instead of filling its width */
  .sheet:not(.full) { max-width: 640px; bottom: calc(24px + var(--safe-b)); border-radius: 30px; max-height: calc(100dvh - 80px - var(--safe-b)); padding-bottom: 26px; transform: translateY(calc(100% + 60px)); }
  .sheet:not(.full).show { transform: translateY(0); }
  .sheet.tall:not(.full) { min-height: 0; }
}
@media (min-width: 1180px) {
  .grid, .looks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* photos dragged in from another app */
.drop-hint { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: none; background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fadeIn .2s var(--ease); transition: opacity .25s var(--ease); }
.drop-hint.out { opacity: 0; }
.drop-hint > div { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 34px 44px; border-radius: 28px; border: 2px dashed var(--sage-deep); background: var(--bg); color: var(--ink); box-shadow: var(--shadow-md); }
.drop-hint svg { width: 34px; height: 34px; color: var(--sage-deep); }
.drop-hint b { font-weight: 500; font-size: calc(16px * var(--ts)); }
