/* White dotted canvas. Tops and jackets sit on the right, trousers and shoes
   on the left, and the outfit is assembled in the middle; lines connect each
   piece to its place. Blue marks what you chose yourself. */
:root {
  --ground: #ffffff;
  --panel: #ffffff;
  --soft: #f3f4f6;
  --ink: #111318;
  --muted: #5d636e;
  --line: #dfe2e7;
  --line-strong: #9aa1ad;
  --accent: #0b57d0;
  --accent-soft: #e4edfd;
  --danger: #b3261e;
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 26px;
  --bar: 60px;
  --colors: 54px;
  --stylebar: 92px;
  --font: "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 300 15px/1.6 var(--font);
  background: var(--ground) radial-gradient(#c9ced6 1px, transparent 1.5px) 0 0 / 22px 22px;
  background-attachment: fixed;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 500; line-height: 1.3; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link { border: 0; background: none; padding: 4px; color: var(--muted); text-decoration: underline; font-size: 13px; justify-self: center; }
.link:hover { color: var(--ink); }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30; height: var(--bar);
  display: flex; align-items: center; gap: 22px; padding: 0 clamp(12px, 2.4vw, 28px);
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { position: relative; margin: 0; padding-bottom: 5px; font-family: Didot, "Bodoni 72", "Bodoni Moda", Georgia, serif; font-size: 22px; font-weight: 400; letter-spacing: .32em; margin-inline-end: -.32em; line-height: 1; color: var(--ink); }
.logo::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 26px; height: 1.5px; background: #A8865A; transform: translateX(calc(-50% - .16em)); }
.views { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.views button { border: 0; background: none; padding: 0 15px; min-height: 36px; border-radius: 999px; color: var(--muted); white-space: nowrap; }
.views button:hover { color: var(--ink); }
.views button[aria-selected="true"] { background: var(--ink); color: #fff; font-weight: 400; }
.views .n { margin-inline-start: 6px; font-size: 12px; opacity: .65; font-variant-numeric: tabular-nums; }

/* ---------- colour bar ---------- */
.colorbar {
  height: var(--colors); display: flex; align-items: center; gap: 6px;
  padding: 0 clamp(12px, 2.4vw, 28px); overflow-x: auto; scrollbar-width: none;
}
.colorbar::-webkit-scrollbar { display: none; }
.bar-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.bar-tools .toggle { flex: none; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 13.5px; }
.bar-tools .toggle:hover { border-color: var(--line-strong); }
.bar-tools .toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.bar-tools .toggle.icon { width: 38px; min-height: 38px; padding: 0; display: grid; place-items: center; }
.ico { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.weather { position: relative; flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--muted); }
.weather select { min-height: 36px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); padding: 0 12px; font: inherit; color: var(--ink); }
.colorbar button {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 13.5px;
}
.colorbar button i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); }
.colorbar button:hover { border-color: var(--line-strong); }
.colorbar button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 400; box-shadow: 0 0 0 1px var(--accent); }
.colorbar .all[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none; }


/* ---------- studio ---------- */
.studio {
  position: relative; display: grid; grid-template-columns: minmax(250px, 1fr) minmax(360px, 440px) minmax(250px, 1fr);
  gap: clamp(28px, 4vw, 64px); padding: 4px clamp(12px, 2.4vw, 28px) 0;
  height: calc(100vh - var(--bar) - var(--colors) - var(--stylebar));
}
.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; overflow: visible; }
.wires path { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 4 5; }
.wires path.chosen { stroke: var(--accent); stroke-width: 2; stroke-dasharray: none; }
.wires circle { fill: var(--line-strong); }
.wires circle.chosen { fill: var(--accent); }

.side { overflow-y: auto; padding: 2px 2px 20px; scrollbar-width: thin; }
.side h2 { font-size: 15px; padding: 10px 4px 8px; position: sticky; top: 0; z-index: 2; background: linear-gradient(#fff 70%, transparent); }
.side h2 .n { color: var(--muted); font-weight: 300; font-size: 13px; margin-inline-start: 4px; }
.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.list .none { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding: 4px; }
.item {
  position: relative; display: flex; flex-direction: column; text-align: start; padding: 4px 4px 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m);
}
.item:hover { border-color: var(--line-strong); }
.item .thumb { aspect-ratio: 4 / 5; border-radius: var(--r-s); overflow: hidden; }
.item img, .pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.item img { padding: 4px; }
.pic { min-width: 0; min-height: 0; overflow: hidden; }
.item .name { padding: 4px 4px 7px; font-size: 12px; line-height: 1.45; }
.item.in-outfit { border-color: var(--line-strong); border-style: dashed; }
.item[aria-pressed="true"] { border-color: var(--accent); border-style: solid; box-shadow: 0 0 0 2px var(--accent); }
.badge { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 1; font-size: 11px; font-weight: 400; padding: 0 8px; border-radius: 999px; background: var(--accent); color: #fff; }
.item.away { opacity: .45; }
.item.away .badge { background: var(--muted); }
.laundry-mode .item { cursor: cell; }
.swatch { width: 100%; height: 100%; display: flex; }
.swatch span { flex: 1; }

/* ---------- the outfit in the middle ---------- */
.stage {
  align-self: start; max-height: 100%; overflow-y: auto; z-index: 6;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 14px; display: grid; gap: 10px; box-shadow: 0 18px 50px -30px rgba(17, 19, 24, .35);
}
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.stage-head h2 { font-size: 18px; }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 0 12px; min-height: 32px; font-size: 13px; color: var(--muted); }
.seg button[aria-checked="true"] { background: #fff; color: var(--ink); font-weight: 400; box-shadow: 0 1px 2px rgba(17, 19, 24, .2); }

/* right column of tiles faces the tops and jackets, left column faces trousers and shoes */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { position: relative; border: 1px solid var(--line); border-radius: var(--r-m); background: #fff; display: flex; flex-direction: column; padding: 4px; }
.tile .pic { aspect-ratio: 1 / 0.7; padding: 4px; }
.tile .cap { padding: 2px 6px 0; display: grid; }
.tile .label { font-size: 11.5px; color: var(--muted); }
.tile .name { font-size: 12.5px; font-weight: 400; line-height: 1.4; min-height: 2.8em; }
.tile .tools { display: flex; gap: 4px; padding: 4px 2px 2px; margin-top: auto; }
.tile .tools button { flex: 1; min-height: 32px; border: 1px solid var(--line); background: none; border-radius: 999px; font-size: 12.5px; padding: 0 4px; }
.tile .tools button:hover { border-color: var(--line-strong); }
.tile .tools button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tile.chosen { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tile.none { border-style: dashed; background: none; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 12.5px; min-height: 150px; text-align: center; padding: 10px; }
.tile.none strong { font-weight: 400; color: var(--ink); font-size: 14px; }

.options { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.options button { flex: none; border: 1px solid var(--line); background: none; border-radius: 999px; min-height: 34px; padding: 0 12px; font-size: 13px; }
.options button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.why { margin: 0; padding: 0 18px 0 0; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.note { font-size: 13px; color: var(--muted); }

.keep { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.keep button { border: 1px solid var(--line); background: none; border-radius: 999px; min-height: 34px; font-size: 12.5px; padding: 0 4px; }
.keep button:hover { border-color: var(--line-strong); }
.keep button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pose-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
/* front / angled switch, under a ready card's image so it covers nothing */
.ready .poses { justify-self: center; }
.ready .poses button { min-height: 28px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
/* stays in reach when the outfit panel is taller than the window */
.actions {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px;
  position: sticky; bottom: -14px; z-index: 2; margin: 0 -14px; padding: 8px 14px 14px; background: var(--panel);
}
.btn { min-height: 48px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-weight: 500; padding: 0 18px; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; font-size: 16px; }
.btn.primary:hover { background: #2a2e37; }
.btn:disabled { opacity: .4; cursor: default; }

.status { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.status.err { color: var(--danger); }
.status small { display: block; }
.spinner { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.render { display: grid; gap: 8px; }
.progress { height: 3px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width 1s linear; }
.render-thumb { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-m); background: #fff; text-align: start; font-size: 13.5px; }
.render-thumb img { width: 48px; height: 72px; object-fit: cover; border-radius: 8px; }

/* ---------- style bar at the bottom ---------- */
.stylebar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 25; min-height: var(--stylebar);
  display: grid; align-content: end; gap: 6px; justify-items: center; padding: 8px 14px 16px; pointer-events: none;
}
.stylebar > * { pointer-events: auto; }
.stylebar .status { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; }
.stylebar-row {
  width: min(720px, 100%); display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 999px;
  box-shadow: 0 14px 40px -18px rgba(17, 19, 24, .45);
}
.stylebar-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 14px 40px -18px rgba(11, 87, 208, .5); }
.stylebar input { flex: 1; min-width: 0; border: 0; outline: none; background: none; min-height: 44px; padding: 0 14px; font-size: 16px; }
.stylebar input::placeholder { color: var(--muted); }
.send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; }
.send:hover { background: var(--accent); }
.send:disabled { background: var(--soft); color: var(--muted); cursor: default; }

/* ---------- other pages ---------- */
.page { padding: 22px clamp(12px, 2.4vw, 28px) 60px; max-width: 1280px; margin: 0 auto; }
.intro { margin-bottom: 18px; max-width: 62ch; }
.intro h2 { font-size: 22px; }
.intro p { color: var(--muted); }
.empty-note { color: var(--muted); padding: 28px 0; }
.set { margin-top: 26px; }
.set-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.set-head h3 { font-size: 16px; }
.set-head time { font-size: 12.5px; color: var(--muted); }
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.look { display: grid; gap: 8px; align-content: start; text-align: start; padding: 10px 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); }
.look:hover { border-color: var(--line-strong); }
.look .pieces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.look .pieces .pic { aspect-ratio: 4 / 5; padding: 2px; }
.look h3 { font-size: 15.5px; padding: 0 4px; }
.look .occasion { font-size: 12.5px; color: var(--accent); padding: 0 4px; }
.look ul { margin: 0; padding: 0 20px 0 4px; display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.look .tip { font-size: 13px; border-top: 1px solid var(--line); padding: 8px 4px 0; }
.intro.spaced { margin-top: 44px; }
.look .meta { font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.lookbook { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ready { display: grid; gap: 8px; align-content: start; padding: 8px 8px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); }
.ready .shot-btn { border: 0; padding: 0; background: var(--soft); border-radius: var(--r-s); overflow: hidden; aspect-ratio: 2 / 3; display: block; width: 100%; }
.ready .shot-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ready .pieces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; aspect-ratio: 2 / 3; align-content: center; }
.ready .pieces .pic { aspect-ratio: 1; padding: 4px; }
.ready .shot-wrap { position: relative; }
.ready .score { --size: 58px; position: relative; display: grid; place-items: center; width: var(--size); height: var(--size); border-radius: 50%; cursor: text;
  background: rgb(255 255 255 / .9); -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: 0 0 0 1px rgb(17 19 24 / .06), 0 1px 2px rgb(17 19 24 / .1), 0 8px 20px rgb(17 19 24 / .16);
  transition: transform .15s ease, box-shadow .15s ease; }
.ready .score:hover { transform: scale(1.06); }
.ready .shot-wrap .score { position: absolute; inset-block-start: 12px; inset-inline-start: 12px; }
.ready .score svg { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); transform: rotate(-90deg); }
.ready .score circle { fill: none; stroke-width: 2.4; }
.ready .score .track { stroke: rgb(17 19 24 / .1); }
.ready .score .prog { stroke: var(--ink); stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.ready .score:not(.set) .track { stroke: var(--line-strong); stroke-dasharray: 2 3.2; }
.ready .score:not(.set) .prog { stroke: none; }
.ready .score input { position: relative; width: 100%; height: 100%; border: 0; padding: 0; border-radius: 50%; background: none; font: inherit; font-size: 19px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); text-align: center; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; }
.ready .score input::-webkit-outer-spin-button, .ready .score input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ready .score input::placeholder { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.ready .score input:focus { outline: none; }
.ready .score:focus-within { transform: scale(1.06); background: #fff; box-shadow: 0 0 0 2px var(--accent), 0 8px 20px rgb(17 19 24 / .2); }
.ready .score:focus-within .prog { stroke: var(--accent); }
@media (prefers-reduced-motion: reduce) { .ready .score, .ready .score .prog { transition: none; } }
.hidden-box { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 16px; }
.hidden-box summary { cursor: pointer; font-size: 18px; font-weight: 600; }
.hidden-box > p { color: var(--muted); margin: 6px 0 14px; }
.ready .linked { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 0 2px; }
.ready .piece { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 2px; min-width: 0; }
.ready .piece:hover, .ready .piece:focus-visible { border-color: var(--accent); }
.ready .piece .pic { aspect-ratio: 1; }
.ready .pending { font-size: 12px; color: var(--muted); text-align: center; }
.ready h3 { font-size: 16px; padding: 0 4px; }
.ready .occasion { font-size: 12.5px; color: var(--accent); padding: 0 4px; }
.ready .trend { font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.ready .btn { min-height: 40px; font-size: 14px; }
.field input[type="file"] { padding: 10px 14px; height: auto; max-width: 260px; }
.field select, .field textarea { min-height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 14px; background: #fff; font: inherit; color: var(--ink); }
.field textarea { padding: 10px 14px; resize: vertical; }
.draft { display: grid; gap: 14px; max-width: 820px; margin: 14px 0; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); }
.draft .shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.shot-pick { display: grid; gap: 6px; padding: 6px 6px 10px; border: 2px solid var(--line); border-radius: var(--r-s); background: #fff; font-size: 13.5px; color: var(--muted); }
.shot-pick img { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; background: var(--soft); border-radius: 8px; display: block; }
.shot-pick[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.draft .fields { display: flex; flex-wrap: wrap; gap: 10px; }
.draft .fields .field { flex: 1 1 150px; }
.draft .fields .field.grow { flex-basis: 260px; }
.draft .field input { border-radius: 14px; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; }
.chips i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgb(17 19 24 / .15); }
.chips b { font-size: 11px; font-weight: 600; color: var(--accent); }
.chips button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.draft .redo { display: flex; flex-wrap: wrap; gap: 10px; }
.draft .redo input { flex: 1 1 240px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 14px; }
.draft-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.tool-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.field { display: grid; gap: 4px; }
.field.grow { flex: 1 1 260px; }
.field label { font-size: 13px; color: var(--muted); }
.field input { min-height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; }
#trip-days { width: 110px; }
.page .status { margin: 10px 0; }
.summary { margin: 14px 0 10px; max-width: 70ch; }
.pack { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 18px; }
.pack .item { cursor: default; }
.gap-list { display: grid; gap: 10px; margin-top: 10px; }
.gap { display: grid; gap: 6px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); }
.gap h3 { font-size: 15.5px; }
.gap .prio { font-size: 12px; color: var(--accent); }
.gap p { color: var(--muted); font-size: 13.5px; max-width: 75ch; }
.gap .pairs { display: flex; gap: 4px; flex-wrap: wrap; }
.gap .pairs .pic { width: 56px; height: 68px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.shot { border: 1px solid var(--line); border-radius: var(--r-m); background: #fff; padding: 6px 6px 0; text-align: start; }
.shot:hover { border-color: var(--line-strong); }
.shot img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; border-radius: var(--r-s); }
.shot span { display: block; padding: 6px 6px 8px; font-size: 12.5px; color: var(--muted); }

dialog { border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px; max-width: min(520px, 92vw); background: #fff; color: var(--ink); }
dialog::backdrop { background: rgba(17, 19, 24, .55); }
dialog img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--r-m); display: block; }
dialog p { font-size: 13.5px; color: var(--muted); margin: 10px 0; }
dialog .btn { width: 100%; }
dialog .close { position: absolute; top: 20px; inset-inline-end: 20px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); font-size: 22px; }

/* ---------- small screens: outfit first, then the four lists; no connecting lines ---------- */
.mcats, .mtools { display: none; }

/* ---------- phones and tablets ----------
   The outfit stays pinned at the top as one row of four tiles, the wardrobe
   shows one section at a time under it, and the pages are on a bar at the
   bottom where the thumb reaches. */
@media (max-width: 980px) {
  :root { --nav: calc(58px + env(safe-area-inset-bottom, 0px)); }
  body { padding-bottom: var(--nav); }

  /* top bar: name and filters; pages move to the bottom */
  .bar { position: static; height: auto; min-height: 0; gap: 10px; padding: 8px 12px; backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
  .logo { font-size: 17px; flex: none; }
  .bar-tools { margin-inline-start: 0; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .bar-tools::-webkit-scrollbar { display: none; }
  .weather { gap: 2px; }
  .weather select { font-size: 13.5px; }
  .views { position: fixed; inset: auto 0 0 0; z-index: 40; height: var(--nav); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    border: 0; border-top: 1px solid var(--line); border-radius: 0; background: #fff; gap: 4px; max-width: none; }
  .views button { flex: 1; min-height: 46px; padding: 0 4px; font-size: 14px; border-radius: 14px; }
  .views .n { display: none; }

  /* studio: outfit on top (pinned), then the style box, section tabs, colours, pieces */
  #view-studio { display: flex; flex-direction: column; }
  .studio { display: contents; }
  .wires { display: none; }
  .stage { order: -4; position: sticky; top: 0; z-index: 20; max-height: none; overflow: visible; align-self: stretch;
    border: 0; border-bottom: 1px solid var(--line); border-radius: 0 0 20px 20px; padding: 8px 10px 10px; gap: 8px;
    box-shadow: 0 10px 24px -18px rgb(17 19 24 / .5); }
  .stage-head { display: none; }
  .studio[data-mcat="outerwear"] .stage-head { display: flex; justify-content: center; }
  .stage-head h2 { display: none; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .tile[data-slot="outer"] { order: 1; } .tile[data-slot="top"] { order: 2; }
  .tile[data-slot="bottom"] { order: 3; } .tile[data-slot="shoes"] { order: 4; }
  .tile { padding: 3px; border-radius: 12px; cursor: pointer; }
  .tile .pic { aspect-ratio: 1; padding: 2px; }
  .tile .cap { padding: 0 2px 2px; }
  .tile .label { font-size: 10.5px; text-align: center; }
  .tile .name, .tile .tools, .tile.none .hint { display: none; }
  .tile.none { min-height: 0; aspect-ratio: 1 / 1.22; padding: 4px; font-size: 11px; }
  .tile.none strong { font-size: 12.5px; }
  .tile.none::before { content: "+"; font-size: 22px; line-height: 1; color: var(--line-strong); }
  .tile.open { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
  .mtools:not([hidden]) { display: flex; align-items: center; gap: 6px; }
  .mtools .name { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mtools button { flex: none; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; }
  .mtools button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
  .mtools:not([hidden]) ~ .keep { display: none; }
  .keep { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .keep::-webkit-scrollbar { display: none; }
  .keep button { flex: 1 0 auto; min-height: 36px; padding: 0 12px; font-size: 13px; }
  .actions { position: static; margin: 0; padding: 0; }
  .actions .btn { min-height: 46px; }
  .why, #clear { display: none; }
  .options button { min-height: 36px; }

  .stylebar { order: -3; position: static; min-height: 0; padding: 10px 12px 0; pointer-events: auto; justify-items: stretch; }
  .stylebar-row { width: 100%; box-shadow: none; border-color: var(--line); padding: 4px 4px 4px 6px; }
  .stylebar input { min-height: 40px; padding: 0 12px; }
  .send { width: 40px; height: 40px; }

  .mcats { order: -2; display: flex; gap: 4px; margin: 10px 12px 0; padding: 3px; background: var(--soft); border-radius: 999px; }
  .mcats button { flex: 1; min-height: 40px; border: 0; background: none; border-radius: 999px; font-size: 13.5px; color: var(--muted); white-space: nowrap; padding: 0 4px; }
  .mcats button[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgb(17 19 24 / .2); }
  .mcats .n { margin-inline-start: 4px; font-size: 11px; opacity: .6; }
  .colorbar { order: -1; height: auto; padding: 10px 12px 2px; }

  .side { display: contents; }
  .side h2, .list { display: none; }
  .studio[data-mcat="outerwear"] #list-outerwear, .studio[data-mcat="top"] #list-top,
  .studio[data-mcat="bottom"] #list-bottom, .studio[data-mcat="shoes"] #list-shoes {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px 12px 24px; }
  .item .name { font-size: 11.5px; padding: 3px 3px 6px; }

  /* other pages */
  .page { padding: 16px 12px 28px; }
  .intro h2 { font-size: 19px; }
  .intro.spaced { margin-top: 32px; }
  .lookbook { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ready { padding: 5px 5px 10px; gap: 6px; border-radius: 14px; }
  .ready h3 { font-size: 13.5px; line-height: 1.4; }
  .ready .occasion, .ready .trend { font-size: 11.5px; }
  .ready .btn { min-height: 40px; font-size: 13px; padding: 0 8px; }
  .ready .link { font-size: 12.5px; min-height: 32px; }
  .ready .score { --size: 46px; }
  .ready .shot-wrap .score { inset-block-start: 6px; inset-inline-start: 6px; }
  .ready .score input { font-size: 15px; }
  .ready .score input::placeholder { font-size: 11px; }
  .looks { grid-template-columns: 1fr; }
  .tool-form { align-items: stretch; }
  .tool-form .field, .tool-form .btn { flex: 1 1 100%; }
  .field input[type="file"] { max-width: none; width: 100%; }
  .field input, .field select, .field textarea, .draft .redo input { font-size: 16px; } /* no zoom on focus in iOS */
  .draft { padding: 10px; }
  .draft-actions .btn { flex: 1 1 100%; }
  dialog { max-width: 96vw; padding: 10px; }
  dialog img { max-height: 66vh; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
  .progress i { transition: none; }
}
