/* Shoe Rack — one soft, warm system taken from the reference design:
   cream sheets on white, peach as the one action colour, a tall pill per
   shelf with its own tone, and cards that repeat that tone at low strength.
   Text on a tone is always its deep shade, never white, so it stays readable. */

:root {
  color-scheme: light;
  --paper: #ffffff;
  --cream: #fcefe4;
  --cream-2: #f8e4d4;
  --ink: #2d2622;
  --muted: #9c8d83;
  --line: #eedccd;
  --primary: #ef9a6e;
  --primary-deep: #c86a3f;
  --primary-soft: #fbd8c3;
  --danger: #c9534a;
  --ok: #3e8f6a;

  --peach: #f0a07a;  --peach-soft: #f8cfb8;  --peach-deep: #9c4a24;
  --rose: #ec94b0;   --rose-soft: #f9d8e3;   --rose-deep: #9b3558;
  --sun: #f3c65a;    --sun-soft: #fbe9b4;    --sun-deep: #876213;
  --lilac: #ad9bdd;  --lilac-soft: #e5ddf6;  --lilac-deep: #5b4596;
  --mint: #7fc7a7;   --mint-soft: #d4eee1;   --mint-deep: #2f6f53;
  --sky: #8db9e4;    --sky-soft: #dbe8f6;    --sky-deep: #2f5f8c;
  --coral: #ee857c;  --coral-soft: #fbd4cf;  --coral-deep: #9a3a31;
  --stone: #bcb0a6;  --stone-soft: #ece5df;  --stone-deep: #5e534b;

  --radius: 22px;
  --pill: 999px;
  --shadow: 0 18px 40px -22px rgba(170, 100, 60, 0.45);
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 76px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #f3ebe4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 12px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The app is a phone-width column; on a laptop it sits centred like a device. */
.app {
  position: relative;
  max-width: 440px;
  min-height: 100%;
  margin: 0 auto;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}
@media (min-width: 520px) {
  body { padding: 24px 0; }
  .app { min-height: calc(100% - 48px); border-radius: 36px; overflow: hidden; box-shadow: 0 30px 80px -40px rgba(120, 70, 40, 0.5); }
}

main { flex: 1; display: flex; flex-direction: column; }

/* ---------- top of a tab screen ---------- */
.top { padding: 22px 24px 18px; background: var(--paper); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top h1 { margin: 18px 0 2px; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
.top .sub { margin: 0; color: var(--muted); font-size: 0.9rem; }
.count-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--pill);
  background: var(--cream); color: var(--primary-deep); font-size: 0.8rem; font-weight: 600;
}

.avatar {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem; color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 16px -8px rgba(200, 106, 63, 0.7);
}
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 0.7rem; box-shadow: none; }
.avatar.xs { width: 22px; height: 22px; border-radius: 8px; font-size: 0.6rem; box-shadow: none; border: 2px solid var(--paper); }

/* Family filter chips under the title */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 24px 2px; margin: 0 -24px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 0; border-radius: var(--pill);
  padding: 8px 14px; min-height: 38px;
  background: var(--cream); color: var(--ink); font-size: 0.85rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.15s, color 0.15s;
}
.chip[aria-pressed='true'] { background: var(--primary); color: #fff; box-shadow: 0 10px 18px -10px var(--primary-deep); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }

/* ---------- the cream sheet everything sits on ---------- */
.sheet {
  flex: 1;
  background: var(--cream);
  border-radius: 34px 34px 0 0;
  padding: 26px 20px calc(var(--nav-h) + 40px + var(--safe-b));
}
.sheet.flush { padding-top: 22px; }

/* ---------- the rack timeline ---------- */
.rack { list-style: none; margin: 0; padding: 0; }
.shelf {
  --tone: var(--peach); --tone-soft: var(--peach-soft); --tone-deep: var(--peach-deep);
  display: grid; grid-template-columns: 58px 1fr; gap: 18px;
  position: relative;
  padding-bottom: 26px;
}
.shelf:last-child { padding-bottom: 0; }
/* the dotted thread between one shelf's pill and the next */
.shelf:not(:last-child)::after {
  content: ''; position: absolute; left: 28px; top: calc(100% - 26px); height: 26px;
  border-left: 2px dotted var(--tone);
}
.shelf-pill {
  border: 0; border-radius: var(--pill);
  background: var(--tone); color: #fff;
  min-height: 136px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 0;
  box-shadow: 0 16px 22px -12px var(--tone);
}
.shelf-pill .label { writing-mode: vertical-rl; font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em; }
.shelf-pill .num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.3); font-size: 0.75rem; font-weight: 700;
}
.shelf-card {
  text-align: left; border: 0; width: 100%;
  background: var(--tone-soft);
  border-left: 5px solid var(--tone);
  border-radius: 6px 18px 18px 6px;
  padding: 16px 16px 14px;
  color: var(--tone-deep);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.15s ease;
}
.shelf-card:active { transform: scale(0.985); }
.shelf-card .meta { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 500; }
.shelf-card .meta svg { width: 17px; height: 17px; }
.shelf-card ul { margin: 0; padding-left: 18px; font-size: 0.9rem; line-height: 1.6; }
.shelf-card li::marker { color: var(--tone); }
.shelf-card .empty { font-size: 0.85rem; opacity: 0.8; }
.thumbs { display: flex; align-items: center; }
.thumbs img, .thumbs .more {
  width: 44px; height: 44px; border-radius: 14px; object-fit: cover;
  border: 3px solid var(--tone-soft); margin-left: -8px; background: var(--paper);
}
.thumbs img:first-child { margin-left: 0; }
.thumbs .more { display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; color: var(--tone-deep); }
.shelf.is-empty .shelf-pill { min-height: 96px; opacity: 0.55; box-shadow: none; }
.shelf.is-empty .shelf-card { background: transparent; border: 2px dashed var(--tone-soft); border-left: 5px solid var(--tone-soft); }

.tone-peach { --tone: var(--peach); --tone-soft: var(--peach-soft); --tone-deep: var(--peach-deep); }
.tone-rose  { --tone: var(--rose);  --tone-soft: var(--rose-soft);  --tone-deep: var(--rose-deep); }
.tone-sun   { --tone: var(--sun);   --tone-soft: var(--sun-soft);   --tone-deep: var(--sun-deep); }
.tone-lilac { --tone: var(--lilac); --tone-soft: var(--lilac-soft); --tone-deep: var(--lilac-deep); }
.tone-mint  { --tone: var(--mint);  --tone-soft: var(--mint-soft);  --tone-deep: var(--mint-deep); }
.tone-sky   { --tone: var(--sky);   --tone-soft: var(--sky-soft);   --tone-deep: var(--sky-deep); }
.tone-coral { --tone: var(--coral); --tone-soft: var(--coral-soft); --tone-deep: var(--coral-deep); }
.tone-stone { --tone: var(--stone); --tone-soft: var(--stone-soft); --tone-deep: var(--stone-deep); }

.toggle-empty { display: block; margin: 22px auto 0; border: 0; background: none; color: var(--muted); font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }

/* ---------- a first-run welcome instead of a blank rack ---------- */
.welcome { text-align: center; padding: 30px 12px; }
.welcome .art {
  width: 120px; height: 120px; margin: 0 auto 18px; border-radius: 40px;
  background: var(--primary-soft); display: grid; place-items: center; color: var(--primary-deep);
}
.welcome .art svg { width: 64px; height: 64px; }
.welcome h2 { margin: 0 0 8px; font-size: 1.2rem; }
.welcome p { margin: 0 auto 22px; color: var(--muted); max-width: 30ch; line-height: 1.5; font-size: 0.92rem; }
.steps { list-style: none; padding: 0; margin: 0 0 26px; text-align: left; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: center; background: var(--paper); border-radius: 18px; padding: 12px 14px; font-size: 0.9rem; }
.steps b { width: 28px; height: 28px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-deep); font-size: 0.8rem; }

/* ---------- form screens (Add / Edit), after the "Creat New Task" screen ---------- */
.form-screen { background: var(--primary); min-height: 100%; display: flex; flex-direction: column; }
.form-head { padding: 22px 24px 64px; color: #fff; position: relative; overflow: hidden; }
.form-head::before, .form-head::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.14);
}
.form-head::before { width: 64px; height: 64px; right: 22px; top: 70px; }
.form-head::after { width: 34px; height: 34px; right: 96px; top: 124px; }
.back {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: var(--pill); padding: 8px 16px 8px 12px; min-height: 40px;
  background: rgba(255, 255, 255, 0.24); color: #fff; font-size: 0.85rem; font-weight: 500;
}
.back svg { width: 16px; height: 16px; }
.form-head h1 { margin: 30px 0 0; font-size: 1.55rem; font-weight: 600; }
.form-body {
  flex: 1; margin-top: -36px; background: var(--cream);
  border-radius: 34px 34px 0 0; padding: 28px 24px calc(34px + var(--safe-b));
}
.field { margin-bottom: 26px; }
.field > .label, .field > label.label { display: block; font-weight: 600; font-size: 1.02rem; margin-bottom: 12px; }
.card { background: var(--paper); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.input {
  width: 100%; border: 0; border-radius: 16px; background: var(--paper);
  padding: 15px 18px; font-size: 0.95rem; min-height: 52px;
}
.input::placeholder { color: #c8bab0; }
.hint { margin: 8px 2px 0; font-size: 0.8rem; color: var(--muted); line-height: 1.45; }

/* photo capture */
.capture { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.shoot {
  border: 2px dashed var(--primary-soft); background: var(--paper); border-radius: var(--radius);
  min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--primary-deep); font-weight: 600; font-size: 0.95rem;
}
.shoot svg { width: 38px; height: 38px; }
.library {
  border: 0; background: var(--paper); border-radius: var(--radius); width: 84px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--muted); font-size: 0.75rem; font-weight: 500;
}
.library svg { width: 26px; height: 26px; }
.photo { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--paper); box-shadow: var(--shadow); }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo .retake {
  position: absolute; right: 12px; bottom: 12px; border: 0; border-radius: var(--pill);
  background: rgba(45, 38, 34, 0.72); color: #fff; padding: 8px 14px; font-size: 0.8rem; min-height: 38px;
  display: inline-flex; align-items: center; gap: 6px;
}
.photo .retake svg { width: 16px; height: 16px; }

/* what Claude made of the photo */
.status {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: var(--paper);
  font-size: 0.86rem; line-height: 1.45;
}
.status svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.status.working { color: var(--primary-deep); }
.status.done { color: var(--ok); }
.status.warn { color: var(--danger); }
.status button { border: 0; background: none; padding: 0; color: inherit; font-weight: 600; text-decoration: underline; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* type picker — the calendar grid of the reference, as pills */
.types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.type {
  border: 0; border-radius: var(--pill); background: var(--paper); min-height: 42px;
  font-size: 0.8rem; font-weight: 500; color: var(--ink); padding: 0 4px;
}
.type[aria-pressed='true'] { background: var(--primary); color: #fff; box-shadow: 0 10px 16px -10px var(--primary-deep); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line); padding: 0;
}
.swatch[aria-pressed='true'] { box-shadow: 0 0 0 3px var(--primary); }

.owners { display: flex; flex-wrap: wrap; gap: 8px; }
.owners .chip { background: var(--paper); }
.owners .chip[aria-pressed='true'] { background: var(--primary); color: #fff; }

.goes {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px;
  background: var(--tone-soft); color: var(--tone-deep); font-size: 0.9rem; margin-bottom: 26px;
}
.goes b { font-weight: 700; }
.goes .num {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--tone); color: #fff; font-weight: 700;
}

/* the Alarm + Save row */
.save-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.switch-field .label { display: block; font-weight: 600; font-size: 1.02rem; margin-bottom: 12px; }
.switch {
  position: relative; width: 58px; height: 32px; border: 0; border-radius: var(--pill);
  background: #e8d9cd; padding: 0; transition: background 0.2s;
}
.switch::after {
  content: ''; position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); transition: transform 0.2s;
}
.switch[aria-checked='true'] { background: var(--primary); }
.switch[aria-checked='true']::after { transform: translateX(26px); }

.btn {
  border: 0; border-radius: 20px; min-height: 58px; padding: 0 34px;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 1.05rem;
  box-shadow: 0 16px 26px -14px var(--primary-deep);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:disabled { opacity: 0.45; box-shadow: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--paper); color: var(--primary-deep); box-shadow: none; }
.btn.small { min-height: 46px; padding: 0 20px; font-size: 0.92rem; border-radius: 16px; }
.btn svg { width: 20px; height: 20px; }
.link-danger { border: 0; background: none; color: var(--danger); font-weight: 500; padding: 12px 0; min-height: 44px; }

/* ---------- lists: shelf detail, family, check results, settings ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  border: 0; background: var(--paper); border-radius: 20px; padding: 12px;
}
.row img { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; flex: none; background: var(--cream); }
.row .pos {
  width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--tone-soft); color: var(--tone-deep); font-weight: 700; font-size: 0.8rem;
}
.row .body { flex: 1; min-width: 0; }
.row .title { font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .desc { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.row .end { color: var(--muted); display: flex; align-items: center; }
.row .end svg { width: 20px; height: 20px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: var(--pill); background: var(--primary-soft); color: var(--primary-deep); font-size: 0.7rem; font-weight: 600; margin-left: 6px; vertical-align: 1px; }

.section-title { font-weight: 600; font-size: 1.02rem; margin: 30px 0 12px; }
.section-title:first-child { margin-top: 0; }
.lede { margin: 0 0 18px; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }

.check-item { display: flex; gap: 12px; align-items: center; background: var(--paper); border-radius: 18px; padding: 14px; }
.check-item .icon { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.check-item .icon svg { width: 18px; height: 18px; }
.check-item.ok .icon { background: var(--mint-soft); color: var(--mint-deep); }
.check-item.move .icon { background: var(--coral-soft); color: var(--coral-deep); }
.check-item .title { font-weight: 600; font-size: 0.92rem; }
.check-item .desc { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.verdict { border-radius: var(--radius); padding: 18px; margin-bottom: 14px; font-weight: 600; display: flex; gap: 12px; align-items: center; }
.verdict svg { width: 26px; height: 26px; flex: none; }
.verdict.ok { background: var(--mint-soft); color: var(--mint-deep); }
.verdict.move { background: var(--coral-soft); color: var(--coral-deep); }

.order-row { display: flex; align-items: center; gap: 12px; background: var(--paper); border-radius: 18px; padding: 8px 8px 8px 12px; }
.order-row .num { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--tone); color: #fff; font-weight: 700; font-size: 0.85rem; flex: none; }
.order-row .name { flex: 1; font-weight: 500; }
.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--cream);
  display: grid; place-items: center; color: var(--ink);
}
.icon-btn:disabled { opacity: 0.3; }
.icon-btn svg { width: 20px; height: 20px; }
.inline { display: flex; gap: 10px; }
.inline .input { flex: 1; }

/* ---------- bottom navigation with the raised + ---------- */
.nav {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 440px; height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--cream-2);
  display: grid; grid-template-columns: 1fr 1fr 86px 1fr 1fr; align-items: center;
  z-index: 10;
}
@media (min-width: 520px) { .nav { bottom: 24px; border-radius: 0 0 36px 36px; } }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 52px; justify-content: center;
  color: #d9b8a2; text-decoration: none; font-size: 0.66rem; font-weight: 600;
}
.nav a svg { width: 24px; height: 24px; }
.nav a[aria-current='page'] { color: var(--primary); }
.fab {
  justify-self: center; margin-top: -48px;
  width: 64px; height: 64px; border-radius: 50%; border: 6px solid var(--paper);
  background: var(--primary); color: #fff; display: grid; place-items: center;
  box-shadow: 0 16px 24px -12px var(--primary-deep);
}
.fab svg { width: 26px; height: 26px; }

/* ---------- toast and confirm ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 22px + var(--safe-b)); transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 16px; font-size: 0.88rem;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 30; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
dialog { border: 0; border-radius: 28px; padding: 24px; max-width: min(360px, calc(100% - 32px)); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgba(45, 38, 34, 0.4); }
dialog h2 { margin: 0 0 8px; font-size: 1.1rem; }
dialog p { margin: 0 0 20px; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
dialog .actions { display: flex; gap: 10px; justify-content: flex-end; }
.btn.danger { background: var(--danger); box-shadow: none; }

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

/* ---------- small fixes ---------- */
a { color: inherit; text-decoration: none; }
.count-chip { white-space: nowrap; }
.count-chip svg { width: 16px; height: 16px; }
.types.shelves { grid-template-columns: repeat(2, 1fr); }
.types.shelves .type { text-align: left; padding: 0 16px; }
.row .title, .row .desc { display: block; }
.row .body { overflow: hidden; }
.row > .avatar svg { width: 60%; height: 60%; }
.list > li, .row { min-width: 0; }

/* ================= v2: smart features ================= */

.muted { color: var(--muted); font-weight: 400; }
.bad { color: var(--danger); font-weight: 600; }
.head-sub { margin: 8px 0 0; opacity: 0.92; font-size: 0.92rem; line-height: 1.45; max-width: 32ch; }

.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn.plain { background: var(--cream); color: var(--primary-deep); }

/* quick actions under the Rack title */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.quick button {
  border: 0; border-radius: 18px; background: var(--cream); color: var(--primary-deep);
  min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600;
}
.quick svg { width: 22px; height: 22px; }

/* a one-line notice that leads somewhere */
.notice {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; border-radius: 18px; padding: 14px 16px; margin-bottom: 20px;
  background: var(--paper); color: var(--ink); font-size: 0.88rem; line-height: 1.45;
}
.notice svg { width: 20px; height: 20px; flex: none; color: var(--primary-deep); }
.notice > span { flex: 1; }
.notice.warn { background: var(--coral-soft); color: var(--coral-deep); }
.notice.warn svg { color: var(--coral-deep); }

/* how full a shelf is */
.meter { display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.7); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--tone); border-radius: 99px; }
.tag.full { background: var(--coral-soft); color: var(--coral-deep); }
.overflow { margin-top: 26px; }
.overflow .section-title { display: flex; align-items: center; gap: 8px; color: var(--coral-deep); }
.overflow .section-title svg { width: 18px; height: 18px; }

/* a pair with no photo */
.thumb-blank {
  width: 64px; height: 64px; border-radius: 16px; flex: none; display: grid; place-items: center;
  background: var(--tone-soft); color: var(--tone-deep);
}
.thumb-blank svg { width: 55%; height: 55%; }

/* a list row with a side button (wear, keep, remove) */
.row-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-wrap .row { flex: 1; }
.wear {
  width: 52px; height: 52px; flex: none; border: 0; border-radius: 16px; background: var(--paper); color: #d2b9a8;
  display: grid; place-items: center;
}
.wear svg { width: 24px; height: 24px; }
.wear.on { background: var(--primary); color: #fff; }
.mini {
  border: 0; border-radius: 12px; min-height: 40px; padding: 0 12px; background: var(--primary); color: #fff;
  font-size: 0.78rem; font-weight: 600; flex: none;
}
.mini.ghost { background: var(--paper); color: var(--primary-deep); box-shadow: inset 0 0 0 1px var(--line); }
.mini-pair { display: flex; flex-direction: column; gap: 6px; flex: none; }

/* form bits */
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field.two .label { margin-bottom: 12px; display: block; font-weight: 600; font-size: 1.02rem; }
.tip { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 12px 14px; border-radius: 16px; background: var(--sky-soft); color: var(--sky-deep); font-size: 0.85rem; line-height: 1.45; }
.tip svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.card.stack { display: grid; gap: 14px; }
.wear-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.9rem; }
.wear-row .chip { background: var(--cream); flex: none; }
.wear-row .chip svg { width: 18px; height: 18px; }
.wear-row .chip.solid { background: var(--primary); color: #fff; }
.goes.warn { width: 100%; border: 0; text-align: left; background: var(--coral-soft); color: var(--coral-deep); }
.goes.warn .num { background: var(--coral); }

/* scan */
.tips { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; font-size: 0.88rem; }
.tips li { display: flex; gap: 10px; align-items: center; }
.tips svg { width: 18px; height: 18px; color: var(--ok); flex: none; }
.scan-item { background: var(--paper); border-radius: 20px; padding: 12px; min-width: 0; }
.scan-item.off { opacity: 0.6; }
.scan-top { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.scan-top input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }
.scan-top img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; background: var(--cream); }
.scan-top .body { flex: 1; min-width: 0; }
.scan-top .title { display: block; font-weight: 600; font-size: 0.92rem; }
.scan-top .desc { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.scan-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.scan-edit .input, select.input { min-height: 46px; padding: 10px 12px; font-size: 0.88rem; background: var(--cream); appearance: auto; }
select.input { background: var(--paper); }
.scan-edit .input { background: var(--cream); }

/* panels on Insights and Style */
.panel { background: var(--paper); border-radius: 26px; padding: 18px; margin-top: 18px; }
.panel h2 { margin: 0 0 14px; font-size: 1.02rem; display: flex; align-items: center; gap: 10px; }
.panel h2 svg { width: 20px; height: 20px; color: var(--primary-deep); }
.panel .row, .panel .scan-item { background: var(--cream); }
.panel .wear, .panel .mini.ghost { background: var(--cream); }
.panel .shoot, .panel .library { background: var(--cream); }
.panel .chip { background: var(--cream); }
.panel .chip[aria-pressed='true'] { background: var(--primary); }
.panel .lede { margin-bottom: 14px; }

/* photo tiles to tap: wore today, pick for style */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  position: relative; border: 0; padding: 0 0 8px; border-radius: 18px; background: var(--paper);
  display: flex; flex-direction: column; gap: 6px; text-align: left; overflow: hidden; min-width: 0;
}
.tile img, .tile .thumb-blank { width: 100%; height: auto; aspect-ratio: 1; border-radius: 0; object-fit: cover; }
.tile > span { padding: 0 8px; font-size: 0.72rem; font-weight: 500; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile i { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; }
.tile i svg { width: 15px; height: 15px; }
.tile.on { box-shadow: 0 0 0 3px var(--primary); }
.panel .tile { background: var(--cream); }

.stat { width: 64px; height: 64px; flex: none; border-radius: 16px; background: var(--primary-soft); color: var(--primary-deep); display: grid; place-content: center; text-align: center; }
.stat b { font-size: 1.2rem; line-height: 1; }
.stat small { font-size: 0.65rem; }

/* planner */
.stepper { display: flex; align-items: center; justify-content: space-between; background: var(--paper); border-radius: 16px; padding: 6px; }
.stepper b { font-size: 1.2rem; }
.stepper .icon-btn { font-size: 1.3rem; font-weight: 600; }
.order-row { display: block; padding: 8px 8px 8px 12px; }
.order-main { display: flex; align-items: center; gap: 10px; }
.order-row .name { display: flex; flex-direction: column; font-size: 0.9rem; min-width: 0; }
.order-row .name small { color: var(--muted); font-size: 0.75rem; }
.order-edit { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 4px; }
.order-edit .chip { background: var(--cream); min-height: 36px; font-size: 0.8rem; }
.order-edit .chip[aria-pressed='true'] { background: var(--tone); color: #fff; }
.order-edit .hint { width: 100%; }
.section-title svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--primary-deep); }

/* style */
.photo.small img { aspect-ratio: 16 / 9; }
.pick.best .row { box-shadow: 0 0 0 2px var(--primary); }
.pick .tag { margin: 0 0 4px; display: inline-block; }
.pick .desc { white-space: normal; }
.look { background: var(--paper); border-radius: 20px; padding: 16px; }
.look .title { margin: 0 0 8px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.pieces { margin: 0 0 10px; padding-left: 18px; font-size: 0.9rem; line-height: 1.6; }
.colours { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.colours span { padding: 3px 10px; border-radius: 99px; background: var(--cream); font-size: 0.75rem; }
.look .desc { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.45; }

/* ask */
.sheet.chat { display: flex; flex-direction: column; padding-bottom: calc(var(--nav-h) + 110px + var(--safe-b)); }
.starters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.starters .chip { background: var(--paper); text-align: left; }
.bubbles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bubble {
  align-self: flex-start; max-width: 88%; background: var(--paper); border-radius: 20px 20px 20px 6px;
  padding: 12px 16px; font-size: 0.92rem; line-height: 1.5; white-space: pre-wrap;
}
.bubble.me { align-self: flex-end; background: var(--primary); color: #fff; border-radius: 20px 20px 6px 20px; }
.bubble .status { margin: 0; padding: 0; background: none; }
.refs { display: grid; gap: 8px; margin-top: 10px; white-space: normal; }
.ref { display: flex; align-items: center; gap: 10px; background: var(--cream); border-radius: 14px; padding: 6px; font-size: 0.82rem; font-weight: 500; }
.ref img, .ref .thumb-blank { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.ref small { display: block; color: var(--muted); font-weight: 400; }
.ask-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 10px);
  width: calc(100% - 32px); max-width: 408px; display: flex; gap: 8px; z-index: 9;
  background: var(--cream); padding: 8px; border-radius: 22px; box-shadow: 0 10px 30px -18px rgba(120, 70, 40, 0.6);
}
@media (min-width: 520px) { .ask-bar { bottom: calc(var(--nav-h) + 34px); } }
.ask-bar .input { flex: 1; }
.ask-bar .btn { padding: 0 16px; }

/* family */
.member { background: var(--paper); border-radius: 20px; min-width: 0; }
.member .row { background: transparent; }
.member-edit { padding: 0 14px 14px; }
.member-edit .switch-field .label { margin-bottom: 12px; }
.link-danger { display: inline-flex; align-items: center; gap: 6px; }
.link-danger svg { width: 18px; height: 18px; }
.form-screen { flex: 1; }

/* ---------- outfit board (Style It) ---------- */
.board {
  display: grid; grid-template-columns: 3fr 2fr; gap: 6px; align-items: center;
  margin: 4px 0 12px; padding: 14px 10px; border-radius: 18px;
  background:
    radial-gradient(circle at 1px 1px, rgba(156, 141, 131, 0.16) 1px, transparent 0) 0 0 / 14px 14px,
    var(--cream);
}
.board-main, .board-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.board-side { display: grid; grid-template-columns: 1fr 1fr; justify-items: center; gap: 8px 4px; }
.piece { margin: 0; transform: rotate(var(--tilt, 0deg)); filter: drop-shadow(0 6px 6px rgba(120, 70, 40, 0.14)); }
.piece .garment { display: block; width: 100%; height: 100%; }
.piece.tall { width: 88%; aspect-ratio: 1 / 1.25; }
.piece.tall .garment { height: 100%; }
.piece.wide { width: 78%; aspect-ratio: 1; }
.board-main .piece.wide + .piece.wide { margin-top: -10%; }
.piece.outer { grid-column: 1 / -1; width: 78%; aspect-ratio: 1; }
.piece.small { width: 100%; aspect-ratio: 1; }
.piece.shoe { grid-column: 1 / -1; width: 86%; }
.piece.shoe img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; border: 4px solid var(--paper); }
.legend { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.legend li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 99px; background: var(--cream); font-size: 0.76rem; }
.legend .dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(45, 38, 34, 0.18); flex: none; }
/* With only one or two accessories there is room to show them properly. */
.board { grid-template-columns: 5fr 4fr; }
.board-side.roomy { grid-template-columns: 1fr; }
.board-side.roomy .piece.small { width: 64%; }
