/* Outfit Picker. Same system as the Training site: flat solid colour, very large rounded cards set
   close together, big numbers, one sans family, a floating pill nav and Material 3 motion.
   Its own colours: orange and yellow lead, pink supports. The fun comes from early-2000s dress-up
   games: sparkle stickers, tilted polaroids, chunky press-down buttons. No glass, no soft shadows. */
:root {
  --orange: #FF6B1A;   /* key colour; text on it is always black (6.6:1) */
  --yellow: #FFD23F;   /* key colour; black text */
  --pink:   #FF8FD1;   /* support; black text */
  --black:  #121212;
  --white:  #FFFFFF;

  --ink:    #121212;   /* page text, flips in dark */
  --paper:  #F7F1E5;
  --card:   #FFFFFF;
  --muted:  #5E5A52;
  --line:   rgba(18, 18, 18, .16);
  --soft:   #ECE4D3;
  --nav-bg: #121212;
  --nav-fg: #FFFFFF;
  --hl:     #B84300;   /* orange that reads as text on paper */

  --radius-card: 32px;
  --radius-inner: 24px;
  --radius-pill: 999px;
  --gutter: 12px;
  --font: "Inter Tight", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  /* Material 3 motion tokens, as on the Training site */
  --ease-emph: cubic-bezier(.2, 0, 0, 1);
  --ease-emph-decel: cubic-bezier(.05, .7, .1, 1);
  --ease-emph-accel: cubic-bezier(.3, 0, .8, .15);
  --ease-std: cubic-bezier(.2, 0, 0, 1);
  --ease-std-decel: cubic-bezier(0, 0, 0, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --dur-short: 150ms; --dur-medium: 300ms; --dur-enter: 400ms; --dur-exit: 200ms; --dur-long: 500ms;
  --state-hover: .08; --state-focus: .10; --state-pressed: .12;

  /* older names still used further down this file, mapped onto the flat system */
  --bg: var(--paper); --glass: var(--card); --glass-strong: var(--card); --field: var(--card);
  --stroke: var(--line); --shine: transparent; --shadow: none; --blur: none;
  --link: var(--hl); --star: var(--orange); --peach: var(--yellow); --blue: var(--pink); --taupe: var(--soft);
  --on-accent: var(--black);
  --edge: none; --fill-yellow: var(--yellow); --fill-pink: var(--pink); color-scheme: light;
}
/* dark follows the phone unless the moon/sun button has picked one (saved, set before paint) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #FFFFFF; --paper: #0E0E0F; --card: #1C1C1E; --muted: #A9A8A5;
    --line: rgba(255, 255, 255, .18); --soft: #2C2C2F; --nav-bg: #FFFFFF; --nav-fg: #121212; --hl: var(--yellow);
    --edge: inset 0 0 0 1.5px var(--line); --fill-yellow: rgba(255, 210, 63, .3); --fill-pink: rgba(255, 143, 209, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #FFFFFF; --paper: #0E0E0F; --card: #1C1C1E; --muted: #A9A8A5;
    --line: rgba(255, 255, 255, .18); --soft: #2C2C2F; --nav-bg: #FFFFFF; --nav-fg: #121212; --hl: var(--yellow);
    --edge: inset 0 0 0 1.5px var(--line); --fill-yellow: rgba(255, 210, 63, .3); --fill-pink: rgba(255, 143, 209, .3); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--paper);
  font: 400 16px/1.45 var(--font); font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a, button, [role="button"], summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
h1, h2, h3 { font-weight: 500; line-height: 1.05; }
h1 { font-size: clamp(40px, 11vw, 56px); letter-spacing: -.035em; margin: 0 0 6px; }
h2 { font-size: 28px; letter-spacing: -.02em; margin: 32px 0 12px; }
h3 { font-size: 20px; letter-spacing: -.015em; margin: 0 0 6px; font-weight: 600; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* big numbers are the hero, as on the Training site */
.hero-num { display: block; font-size: clamp(72px, 22vw, 128px); line-height: .82; letter-spacing: -.055em; font-weight: 400; font-variant-numeric: tabular-nums; }
.big-num { display: block; font-size: 56px; line-height: .9; letter-spacing: -.045em; font-weight: 400; font-variant-numeric: tabular-nums; }
.label { font-size: 14px; color: var(--muted); }
.on-colour .label, .bg-orange .label, .bg-yellow .label, .bg-pink .label, .bg-black .label { color: inherit; opacity: .72; }

/* ------------------------------------------------ header and floating nav */
.top { display: flex; align-items: center; justify-content: space-between; max-width: 480px; margin: 0 auto; padding: 18px 16px 6px; }
/* pages with the big header do not need the brand row */
body:has(main > .header) .brand, body:has(main > .detail-head) .brand { display: none; }
body:has(main > .header) .top, body:has(main > .detail-head) .top { padding: 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.brand i { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--yellow); color: var(--black); }
.brand i svg { width: 20px; height: 20px; fill: var(--orange); }
@media (prefers-reduced-motion: no-preference) {
  .brand:hover i svg { animation: twirl var(--dur-long) var(--ease-bounce); }
}
@keyframes twirl { from { transform: rotate(-90deg) scale(.6); } }

#nav {
  position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(448px, calc(100% - 32px)); display: flex; gap: 4px; padding: 6px;
  background: var(--nav-bg); color: var(--nav-fg); border-radius: var(--radius-pill);
}
#nav a {
  flex: 1 1 0; height: 52px; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-pill); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden;
  /* the selected pill grows and slides across rather than jumping */
  transition: flex-grow var(--dur-medium) var(--ease-emph), background-color var(--dur-medium) var(--ease-emph),
    color var(--dur-medium) var(--ease-emph), padding var(--dur-medium) var(--ease-emph);
}
#nav svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#nav .tab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#nav a.on { background: var(--yellow); color: var(--black); flex-grow: 2.4; padding: 0 14px; }
#nav a.on .tab-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; animation: label-in var(--dur-medium) var(--ease-std-decel) 80ms both; }
@keyframes label-in { from { opacity: 0; } }
main { max-width: 480px; margin: 0 auto; padding: 8px 16px calc(120px + env(safe-area-inset-bottom)); }

/* ------------------------------------------------ cards */
.card { background: var(--card); color: var(--ink); border-radius: var(--radius-card); padding: 22px; position: relative; overflow: hidden; }
.bg-orange { background: var(--orange); color: var(--black); }
.bg-yellow { background: var(--yellow); color: var(--black); }
.bg-pink { background: var(--pink); color: var(--black); }
.bg-black { background: var(--black); color: var(--white); }
.bg-black { box-shadow: var(--edge); }
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.span-2 { grid-column: span 2; }

/* sparkle stickers: decorative, Barbie-sidebar energy */
.sparkle { position: absolute; pointer-events: none; fill: currentColor; }
@media (prefers-reduced-motion: no-preference) {
  .sparkle.spin { animation: sparkle 6s var(--ease-std) infinite; }
}
@keyframes sparkle { 0%, 80%, 100% { transform: rotate(0) scale(1); } 88% { transform: rotate(45deg) scale(1.15); } }

/* ------------------------------------------------ controls */
button, .btn {
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; color: var(--ink); background: transparent;
  border: 1.5px solid var(--line); padding: 0 20px; border-radius: var(--radius-pill); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
}
/* primary buttons are chunky game buttons: a solid ink base that they press down into */
button.primary, .btn.primary {
  background: var(--orange); color: var(--black); border: 2px solid var(--black);
  box-shadow: 0 4px 0 var(--black); margin-bottom: 4px;
}
button.quiet, .btn.quiet { border-color: transparent; color: var(--muted); padding: 0 12px; }
button.quiet:hover, .btn.quiet:hover { color: var(--ink); }
button.danger { color: var(--hl); }
button.armed { background: var(--orange); color: var(--black); border-color: var(--orange); }
button:disabled { opacity: .45; cursor: default; }
@media (prefers-reduced-motion: no-preference) {
  button, .btn, .tile, .section, .chip { transition: transform var(--dur-short) var(--ease-std), box-shadow var(--dur-short) var(--ease-std); }
  button:active:not(:disabled), .btn:active, .tile:active, .chip:active { transform: scale(.97); }
  button.primary:active:not(:disabled), .btn.primary:active { transform: translateY(4px); box-shadow: 0 0 0 var(--black); }
}

input, select, textarea {
  font: inherit; font-size: 17px; color: var(--ink); background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius-inner); padding: 0 18px; max-width: 100%; min-height: 52px;
}
select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF6B1A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { width: 100%; min-height: 96px; resize: vertical; padding: 14px 18px; line-height: 1.4; }
label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 6px 4px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* ------------------------------------------------ Material 3 state layers and ripple */
@property --ripple-r { syntax: '<length>'; inherits: false; initial-value: 0px; }
button:not(.stars button), .btn, .tile, #nav a, .chip { position: relative; isolation: isolate; }
button:not(.stars button)::after, .btn::after, .tile::after, #nav a::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: currentColor; opacity: 0; transition: opacity var(--dur-short) linear;
}
.tile::after { background: var(--black); }
@media (hover: hover) {
  button:not(.stars button):hover:not(:disabled)::after, .btn:hover::after, .tile:hover::after, #nav a:hover::after { opacity: var(--state-hover); }
}
button:focus-visible::after, .btn:focus-visible::after, .tile:focus-visible::after { opacity: var(--state-focus); }
.rippling::after {
  background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), currentColor var(--ripple-r), transparent calc(var(--ripple-r) + 1px));
  opacity: var(--state-pressed) !important; transition: none;
  animation: ripple var(--dur-enter) var(--ease-std-decel) forwards;
}
.tile.rippling::after { background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), var(--white) var(--ripple-r), transparent calc(var(--ripple-r) + 1px)); opacity: .3 !important; }
.rippling.ripple-out::after { opacity: 0 !important; transition: opacity var(--dur-medium) linear; }
@keyframes ripple { from { --ripple-r: 0px; } to { --ripple-r: var(--ripple-max, 300px); } }
@media (prefers-reduced-motion: reduce) { .rippling::after { animation: none; --ripple-r: 2000px; } }

/* ------------------------------------------------ Outfits tab */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.page-head h1 { margin: 0; }
.page-head .label { padding-bottom: 6px; text-align: right; }

/* the "still to rate" hero card */
.rate-hero {
  display: grid; justify-content: stretch; align-items: start; gap: 14px; min-height: 0; padding: 22px; text-align: left;
  border: 0; border-radius: var(--radius-card); background: var(--yellow); color: var(--black); overflow: hidden; width: 100%; font-weight: 400;
}
.rate-hero > :not(.sparkle) { position: relative; z-index: 1; }
.rate-hero .hero-num { margin-top: 4px; }
.rate-hero .label, .section .label { color: inherit; opacity: .72; }
.rate-hero .go { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.rate-hero .go span { width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--black); color: var(--yellow); display: grid; place-items: center; }
.rate-hero .go svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rate-hero .sparkle { z-index: 0; color: var(--orange); }
.rate-hero .sparkle.a { width: 150px; height: 150px; right: -30px; top: -34px; }
.rate-hero .sparkle.b { width: 40px; height: 40px; right: 128px; top: 26px; color: var(--white); }
.rate-hero.all-done { background: var(--orange); }
.stat-tile { min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }

/* closet sections: one colour block each, with a tilted polaroid of the latest outfit */
.sections { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); margin-top: var(--gutter); }
.section {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 10px;
  min-height: 188px; padding: 18px; border: 0; border-radius: var(--radius-card); text-align: left; cursor: pointer; overflow: hidden;
  font-weight: 400;
}
.section.s0 { background: var(--black); color: var(--white); }
.section.s0 .big-num { color: var(--yellow); }
.section.s1 { background: var(--orange); color: var(--black); }
.section.s2 { background: var(--yellow); color: var(--black); }
.section.s3 { background: var(--pink); color: var(--black); }
.section.s0 { box-shadow: var(--edge); }
.section .name { font-size: 18px; font-weight: 600; letter-spacing: -.01em; position: relative; z-index: 1; max-width: 6ch; line-height: 1.1; }
.section .big-num { position: relative; z-index: 1; }
.section .big-num small { font-size: 14px; letter-spacing: 0; margin-left: 4px; opacity: .78; }
.polaroid {
  position: absolute; right: -8px; bottom: -18px; width: 70px; padding: 5px 5px 14px; background: var(--white); border-radius: 6px;
  transform: rotate(8deg); transition: transform var(--dur-medium) var(--ease-bounce);
}
.polaroid img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 3px; }
.section:nth-child(even) .polaroid { transform: rotate(-7deg); }
@media (hover: hover) { .section:hover .polaroid { transform: rotate(0deg) scale(1.06); } }
.section.on { outline: 3px solid var(--ink); outline-offset: 3px; }
.section.on .polaroid { transform: rotate(0deg) scale(1.06); }
@media (prefers-reduced-motion: no-preference) {
  .section:active { transform: scale(.97); }
}

/* filter pills */
.chips { display: flex; gap: 8px; margin: 20px -16px 16px; padding: 2px 16px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  height: 40px; min-height: 40px; padding: 0 16px; font-size: 15px; font-weight: 500; white-space: nowrap; flex: none;
  border: 1.5px solid var(--line); color: var(--ink);
}
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .count { margin-left: 6px; font-size: 13px; opacity: .7; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--soft); color: var(--ink); white-space: nowrap;
}
.badge.warn { background: var(--pink); color: var(--black); }
.badge.flagged { background: var(--orange); color: var(--black); }
.badge.good { background: var(--yellow); color: var(--black); }
.card.is-flagged { box-shadow: inset 0 0 0 3px var(--orange); }
.worn { display: grid; gap: 4px; }
.worn > button { justify-self: center; }

.banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.welcome { min-height: 62vh; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding-bottom: 12px; }
.welcome h1 { max-width: 12ch; }
.welcome p { max-width: 34ch; color: var(--muted); font-size: 17px; }
.welcome .btn { align-self: flex-start; margin-top: 10px; }

/* outfit grid: photo tiles with a rating sticker */
.grid { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { display: block; text-decoration: none; border-radius: 20px; overflow: hidden; background: var(--soft); }
.tile img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.tile .cap {
  position: absolute; left: 6px; bottom: 6px; padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500; background: var(--white); color: var(--black); white-space: nowrap; z-index: 2;
}
.sticker {
  position: absolute; top: 6px; left: 6px; z-index: 2; min-width: 34px; height: 34px; padding: 0 7px; border-radius: var(--radius-pill);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; letter-spacing: -.02em;
  background: var(--yellow); color: var(--black); transform: rotate(-10deg);
}
.sticker.top { background: var(--orange); }
.sticker.low { background: var(--white); }
.tile .flag { position: absolute; top: 6px; left: 6px; z-index: 2; }
.tile .flag .badge { background: var(--black); color: var(--white); }
.tile .count {
  position: absolute; top: 6px; right: 6px; z-index: 2; min-width: 26px; height: 26px; padding: 0 8px;
  display: grid; place-items: center; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600;
  color: var(--white); background: var(--black);
}
@media (prefers-reduced-motion: no-preference) {
  @media (hover: hover) { .tile:hover .sticker { transform: rotate(6deg) scale(1.1); } }
  .sticker { transition: transform var(--dur-medium) var(--ease-bounce); }
}

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; margin-top: 10px; }
.shot { display: grid; gap: 4px; justify-items: stretch; }
.shot img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; border-radius: 20px; background: var(--soft); }
.shot button { padding-left: 6px; padding-right: 6px; }

.stars { display: inline-flex; gap: 2px; }
.stars button {
  border: none; background: none; padding: 2px 3px; min-height: 0; font-size: 30px; font-weight: 400;
  line-height: 1; color: var(--soft);
}
.stars button.on { color: var(--orange); }
.stars button.half { color: transparent; background: linear-gradient(90deg, var(--orange) 50%, var(--soft) 50%); -webkit-background-clip: text; background-clip: text; }
@media (prefers-reduced-motion: no-preference) {
  .stars button { transition: transform var(--dur-medium) var(--ease-bounce), color var(--dur-short) linear; }
  .stars button:active { transform: scale(1.3) rotate(-12deg); }
}
.stars.sm button { font-size: 20px; }
.stars.ro { color: var(--orange); letter-spacing: 1px; }

/* ------------------------------------------------ outfit page and other tabs */
/* Outfit page. Phone: slim 9:16 photo with the key facts beside it, everything else below.
   Wider screens: photo on the left, key facts and the rest on the right. */
.outfit-top { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: var(--gutter); align-items: stretch; }
.portrait { position: relative; display: block; border-radius: var(--radius-card); overflow: hidden; background: var(--soft);
  aspect-ratio: 9 / 16; cursor: zoom-in; }
.portrait img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; max-width: none;
  display: block; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.portrait.cropping { cursor: grab; touch-action: none; outline: 2px solid var(--orange); outline-offset: 2px; }
.portrait.cropping .photo-tools { display: none; }
.photo-tools { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 8px; }
.tool {
  width: 40px; height: 40px; min-height: 0; padding: 0; display: grid; place-items: center; border-radius: 50%;
  color: #fff; background: rgba(18, 18, 22, .5); border: 1px solid rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
}
.tool:hover { background: rgba(18, 18, 22, .7); }
.tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cropbar { margin-top: 14px; display: grid; gap: 12px; }
.cropbar[hidden] { display: none; }
.cropbar p { margin: 0; }
.cropbar input[type=range] { width: 100%; padding: 0; min-height: 28px; accent-color: var(--orange); background: none; border: none; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; }
.viewer { position: fixed; inset: 0; z-index: 100; background: rgba(8, 8, 10, .93); }
.viewer .pan { position: absolute; inset: 0; overflow: auto; display: grid; place-items: center; cursor: zoom-out;
  overscroll-behavior: contain; }
.viewer .pan.zoomed { place-items: start; cursor: grab; }
.viewer img { display: block; max-width: none; height: auto; user-select: none; -webkit-user-select: none; cursor: inherit; }
.viewer.compare-view { overflow-y: auto; padding: calc(70px + env(safe-area-inset-top)) 12px 24px;
  background: #0b0b0d; }
.compare-view .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 1000px; margin: 0 auto; }
.compare-view figure { margin: 0; min-width: 0; }
.compare-view .frame { position: relative; border-radius: 18px; overflow: hidden; cursor: zoom-in; background: #111; }
.compare-view .frame img { display: block; width: 100%; height: auto; }
.compare-view .mark { position: absolute; border: 2px solid var(--orange); border-radius: 10px;
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, .28); pointer-events: none; }
.compare-view figcaption { color: #f4eee9; font-size: .82rem; margin-top: 8px; display: grid; gap: 3px; }
.compare-view figcaption span { opacity: .8; }
.compare-view figcaption a { color: #f6b99d; text-decoration: none; }
.compare-view .hint { color: rgba(255, 255, 255, .6); text-align: center; font-size: .78rem; margin: 18px 0 0; }
.compare[data-action] { cursor: zoom-in; }
.viewer-tools { position: absolute; right: 14px; top: calc(14px + env(safe-area-inset-top)); display: flex; gap: 10px; }
.viewer-tools .tool { width: 44px; height: 44px; }
/* toast: the Training site's snackbar, above the nav */
#toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px);
  width: min(448px, calc(100% - 32px)); padding: 15px 18px; border-radius: 18px; z-index: 20;
  background: var(--ink); color: var(--paper); font-size: 15px; opacity: 0; pointer-events: none;
  transition: opacity var(--dur-exit) var(--ease-emph-accel), transform var(--dur-exit) var(--ease-emph-accel);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); transition-duration: var(--dur-enter); transition-timing-function: var(--ease-emph-decel); }

/* ------------------------------------------------ header (Training site) */
.header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 16px; }
.header .title { margin: 0 0 6px; }
.header .label { margin: 0; }
.title { font-size: clamp(40px, 11vw, 56px); line-height: .95; letter-spacing: -.035em; font-weight: 500; }
.header-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.avatar { width: 52px; height: 52px; border-radius: 18px; background: var(--orange); color: var(--black);
  display: grid; place-items: center; font-size: 22px; font-weight: 600; text-decoration: none; }
.icon-btn { width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 50%; border: 1.5px solid var(--line);
  background: transparent; color: var(--ink); display: grid; place-items: center; text-decoration: none; position: relative; isolation: isolate; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a.icon-btn::after, a.avatar::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity var(--dur-short) linear; }
@media (hover: hover) { a.icon-btn:hover::after, a.avatar:hover::after { opacity: var(--state-hover); } }
@media (prefers-reduced-motion: no-preference) {
  .icon-btn, .avatar { transition: transform var(--dur-short) var(--ease-std); }
  .icon-btn:active, .avatar:active { transform: scale(.94); }
  [data-action="theme"] svg { animation: twirl var(--dur-long) var(--ease-bounce); }
}

/* ------------------------------------------------ outfit page */
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 12px; }
.keyinfo { display: grid; grid-template-rows: auto 1fr; gap: var(--gutter); min-width: 0; }
.keyinfo .card { padding: 16px; border-radius: var(--radius-inner); display: flex; flex-direction: column; gap: 4px; }
.keyinfo .label { font-size: 13px; }
.when .big-num { margin-top: 6px; }
.when-month { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.when .pills { margin-top: 8px; }
.pill.warn { background: var(--pink); color: var(--black); border: 0; }
.pill { border: 0; background: var(--soft); color: var(--ink); font-size: 12px; font-weight: 500; }
.rating-card { justify-content: space-between; }
.rating-card .sparkle { width: 64px; height: 64px; right: -14px; top: -14px; color: var(--orange); }
.rating-card .label { color: inherit; opacity: .72; position: relative; }
.rating-card .big-num { font-size: 64px; position: relative; }
.rating-card .big-num small { font-size: 18px; letter-spacing: 0; margin-left: 2px; opacity: .6; }
.rating-card .stars { display: flex; gap: 0; margin: 0 -2px; position: relative; min-width: 0; }
.rating-card .stars button { font-size: clamp(20px, 6.4vw, 28px); padding: 2px 0; flex: 1 1 0; min-width: 0; color: rgba(18, 18, 18, .2); }
.rating-card .stars button.on { color: var(--black); }
.rating-card .stars button.half { background: linear-gradient(90deg, var(--black) 50%, rgba(18, 18, 18, .2) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* category: a colour block that takes the colour of the category picked, with pills to pick from */
.occasion-card { margin-top: var(--gutter); padding: 18px; border-radius: var(--radius-card); background: var(--card); color: var(--ink);
  display: grid; gap: 12px; transition: background-color var(--dur-medium) var(--ease-emph), color var(--dur-medium) var(--ease-emph); }
.occasion-card.s0 { background: var(--black); color: var(--white); box-shadow: var(--edge); }
.occasion-card.s1 { background: var(--orange); color: var(--black); }
.occasion-card.s2 { background: var(--yellow); color: var(--black); }
.occasion-card.s3 { background: var(--pink); color: var(--black); }
.occasion-card .label { color: inherit; opacity: .72; }
.occ-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.occ { min-height: 40px; height: 40px; padding: 0 16px; font-size: 15px; font-weight: 500; color: inherit; border-color: currentColor; border-color: color-mix(in srgb, currentColor 35%, transparent); }
.occ.on { border-color: transparent; font-weight: 600; }
.occ.on.s0 { background: var(--yellow); color: var(--black); }
.occ.on.s1, .occ.on.s2, .occ.on.s3, .occ.on.so { background: var(--black); color: var(--white); }
.occasion-card:not([class*=" s"]) .occ.on { background: var(--ink); color: var(--paper); }
@media (prefers-reduced-motion: no-preference) {
  .occ.on { animation: pop var(--dur-medium) var(--ease-bounce); }
}
@keyframes pop { from { transform: scale(.85); } }

.next-up { width: 100%; margin-top: var(--gutter); height: 60px; font-size: 17px; justify-content: space-between; padding: 0 22px; }
.next-up .left { font-size: 14px; font-weight: 500; background: var(--black); color: var(--orange); border-radius: var(--radius-pill); padding: 4px 12px; }
.outfit-rest { margin-top: var(--gutter); }
.note { border-radius: var(--radius-inner); padding: 14px 18px; background: var(--pink); color: var(--black); font-size: 15px; }
.summary { padding: 18px 20px; border-radius: var(--radius-card); }
.summary p { margin: 6px 0 0; font-size: 17px; line-height: 1.4; }
.h-count { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--yellow); color: var(--black); font-size: 17px; font-weight: 600; vertical-align: 4px; margin-left: 4px; letter-spacing: 0; }

/* item rows */
.list { display: grid; gap: 8px; }
.line { display: grid; grid-template-columns: 72px 1fr; gap: 4px 14px; align-items: center; padding: 10px; border-radius: var(--radius-inner); background: var(--card); }
.line.is-flagged { box-shadow: inset 0 0 0 3px var(--orange); }
.line img, .line .noimg { width: 72px; height: 72px; object-fit: cover; border-radius: 18px; background: var(--soft); display: block; }
.line a { text-decoration: none; }
.line-txt { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.line-name { font-size: 17px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.line-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
button.mini { min-height: 34px; height: 34px; padding: 0 12px; font-size: 13px; font-weight: 500; }

/* more shots / same day: a strip of tilted polaroids */
.film { display: flex; gap: 14px; overflow-x: auto; margin: 4px -16px 0; padding: 12px 16px 8px; scrollbar-width: none; }
.film::-webkit-scrollbar { display: none; }
.snap { flex: none; width: 128px; display: grid; gap: 6px; }
.polaroid-lg { display: block; padding: 6px 6px 20px; background: var(--white); border-radius: 8px; transform: rotate(-3deg); margin-bottom: 6px;
  box-shadow: var(--edge); transition: transform var(--dur-medium) var(--ease-bounce); }
.snap:nth-child(even) .polaroid-lg { transform: rotate(3deg); }
@media (hover: hover) { .polaroid-lg:hover { transform: rotate(0) scale(1.04) !important; } }
.polaroid-lg img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; }

.details { display: grid; gap: 16px; border-radius: var(--radius-card); }
.details input { width: 100%; }
.details .danger { justify-self: start; }

/* ------------------------------------------------ Insights */
.hero-num small, .big-num small { font-size: 18px; letter-spacing: 0; margin-left: 4px; opacity: .6; }
.big-num.yellow { color: var(--yellow); }
.avg-card { display: grid; gap: 8px; }
.avg-card > :not(.sparkle) { position: relative; }
.avg-card .sparkle { width: 120px; height: 120px; right: -24px; top: -28px; color: var(--yellow); }
.avg-card .hero-num { margin: 6px 0 4px; }
.stat-tile .small { margin-top: -8px; }

/* standing pill bars */
.freq { display: grid; gap: 14px; }
.vbars { display: flex; align-items: stretch; gap: 8px; height: 200px; margin-top: 8px; }
.vcol { flex: 1 1 0; min-width: 0; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); gap: 6px; justify-items: stretch; text-align: center; height: 100%;
  padding: 0; min-height: 0; border: 0; background: none; color: var(--ink); font-weight: 400; border-radius: 18px; align-items: stretch; align-content: stretch; }
.vtrack { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; min-height: 0; }
.vbar { display: block; width: 100%; border-radius: 18px; background: var(--orange); min-height: 12px; }
.vcol.hl .vbar { background: var(--ink); }
.vval { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vlabel { font-size: 13px; color: var(--muted); }
.vcol.hl .vlabel { color: var(--ink); font-weight: 600; }
button.vcol::after { border-radius: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .vbar { transform-origin: bottom; animation: grow var(--dur-long) var(--ease-emph-decel) both; }
  .vcol:nth-child(2) .vbar { animation-delay: 40ms; } .vcol:nth-child(3) .vbar { animation-delay: 80ms; }
  .vcol:nth-child(4) .vbar { animation-delay: 120ms; } .vcol:nth-child(5) .vbar { animation-delay: 160ms; }
  .vbar { transition: background-color var(--dur-medium) var(--ease-emph); }
}
@keyframes grow { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }

.bucket-title { margin: 10px 0 12px; font-size: 20px; }
.bucket-title .h-count { font-size: 15px; min-width: 30px; height: 30px; vertical-align: 2px; }
.item-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; max-height: 460px; overflow-y: auto; margin: 0 -4px; padding: 6px 4px 4px; }
.mini-item { display: grid; gap: 6px; text-decoration: none; min-width: 0; }
.mini-item .thumb { position: relative; display: block; }
.mini-item img, .mini-item .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; display: block; background: var(--soft); }
.mini-item .sticker { top: -6px; left: -4px; min-width: 30px; height: 30px; font-size: 12px; }
.mi-name { font-size: 12px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* number one most worn */
.champ { display: grid; grid-template-columns: 42% 1fr; gap: 16px; align-items: end; text-decoration: none; margin-bottom: 8px; padding: 14px; }
.champ img, .champ .noimg { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 22px; display: block; background: rgba(255, 255, 255, .5); }
.champ-txt { display: grid; gap: 6px; padding: 0 4px 6px 0; }
.champ b { font-size: 20px; line-height: 1.15; letter-spacing: -.01em; }
.champ .hero-num { font-size: clamp(64px, 18vw, 96px); }

/* rows that fill from the left */
.list { display: grid; gap: 8px; }
.meter { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: auto 52px 1fr auto; align-items: center; gap: 12px;
  padding: 8px 16px 8px 8px; border-radius: var(--radius-inner); background: var(--card); text-decoration: none; }
.meter:not(:has(.num)) { grid-template-columns: 52px 1fr auto; }
.meter .fill { position: absolute; inset: 0 auto 0 0; width: var(--w); z-index: -1; border-radius: inherit; }
.meter .fill.yellow { background: var(--fill-yellow); }
.meter .fill.pink { background: var(--fill-pink); }
.meter img, .meter .noimg { width: 52px; height: 52px; border-radius: 16px; object-fit: cover; display: block; }
.meter .num { width: 22px; text-align: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.meter .txt { display: grid; gap: 2px; min-width: 0; }
.meter b { font-size: 16px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.meter .txt span { font-size: 13px; opacity: .75; }
.meter .val { font-size: 24px; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter .val small { font-size: 13px; margin-left: 2px; opacity: .7; letter-spacing: 0; }
/* in dark mode the fills are tints, so white text stays readable over them */
@media (prefers-reduced-motion: no-preference) {
  .meter .fill { transform-origin: left; animation: grow-x var(--dur-long) var(--ease-emph-decel) both; }
  .meter { transition: transform var(--dur-short) var(--ease-std); }
  .meter:active { transform: scale(.98); }
}

.patterns-card { display: grid; gap: 14px; }
.patterns-card p { margin: 0; }
.patterns-card button { justify-self: start; }

/* pairings */
.pairings { display: grid; gap: var(--gutter); }
.pairing { border-radius: var(--radius-card); padding: 14px; display: grid; gap: 14px; }
.duo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; }
.duo a { text-decoration: none; display: grid; gap: 8px; font-size: 14px; font-weight: 600; line-height: 1.2; min-width: 0; color: var(--black); }
.duo img, .duo .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 20px; background: rgba(255, 255, 255, .5); }
.duo i { font-style: normal; align-self: center; margin-top: -30px; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; background: var(--black); color: var(--white); font-size: 18px; font-weight: 600; }
.pair-foot { display: flex; align-items: baseline; gap: 12px; padding: 0 4px 4px; }
.pair-foot span:last-child { font-size: 14px; opacity: .78; }

/* lying-down pill bars */
.hbars { display: grid; gap: 12px; margin-top: 14px; }
.hrow { display: grid; grid-template-columns: 104px 1fr 34px; gap: 10px; align-items: center; }
.hlabel { font-size: 14px; font-weight: 500; line-height: 1.15; display: grid; }
.hlabel small { font-size: 12px; color: var(--muted); font-weight: 400; }
.htrack { height: 28px; border-radius: var(--radius-pill); background: var(--soft); overflow: hidden; }
.hbar { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--orange); }
.hbar.hl { background: var(--ink); }
.hval { text-align: right; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) {
  .hbar { transform-origin: left; animation: grow-x var(--dur-long) var(--ease-emph-decel) both; }
}

/* ------------------------------------------------ shared bits for the other pages */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500;
  background: var(--soft); color: var(--ink); white-space: nowrap; }
.pill.hot { background: var(--orange); color: var(--black); }
.pill.warm, .pill.good { background: var(--yellow); color: var(--black); }
.pill.warn { background: var(--pink); color: var(--black); }
.cols { display: grid; gap: var(--gutter); }
.note.soft { background: var(--card); color: var(--ink); margin-top: var(--gutter); }
code { background: var(--soft); padding: 2px 8px; border-radius: 8px; font-size: .86em; word-break: break-all; }
.pattern { padding: 12px 0; border-top: 1.5px solid var(--line); display: grid; gap: 4px; }
.pattern:first-of-type { border-top: none; padding-top: 4px; }
.worn { display: grid; gap: 6px; }
.worn > button { justify-self: stretch; }
.intro { margin-top: 4px; }
h1 .h-count { font-size: 20px; vertical-align: 12px; }

/* item cards: square crop with a wear-count sticker */
.item { display: grid; gap: 4px; text-decoration: none; min-width: 0; }
.item .thumb { position: relative; display: block; margin-bottom: 4px; }
.item img, .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 20px; display: block; background: var(--soft); }
.noimg { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.item .sticker { top: -6px; left: -4px; min-width: 32px; height: 32px; font-size: 12px; }
.item .name { font-size: 14px; font-weight: 600; line-height: 1.2; letter-spacing: -.005em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .meta { font-size: 12px; color: var(--muted); }
.items-grid { gap: 16px 10px; padding-top: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .item .thumb { transition: transform var(--dur-short) var(--ease-std); }
  .item:active .thumb { transform: scale(.96); }
  @media (hover: hover) { .item:hover .sticker { transform: rotate(6deg) scale(1.1); } }
}

/* ------------------------------------------------ Wardrobe */
.add-form { display: grid; gap: 10px; margin-bottom: var(--gutter); }
.add-form[hidden] { display: none; }
.add-form button { justify-self: start; }
.check-hero { position: relative; overflow: hidden; display: grid; gap: 10px; padding: 22px; border-radius: var(--radius-card);
  background: var(--orange); color: var(--black); text-decoration: none; margin-bottom: var(--gutter); }
.check-hero > :not(.sparkle) { position: relative; }
.check-hero .label { color: inherit; opacity: .72; }
.check-hero .sparkle { width: 120px; height: 120px; right: -24px; top: -28px; color: var(--yellow); }
.check-hero .go { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 16px; font-weight: 600; }
.check-hero .go span { width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--black); color: var(--orange); display: grid; place-items: center; }
.check-hero .go svg, .searchbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) { .check-hero { transition: transform var(--dur-short) var(--ease-std); } .check-hero:active { transform: scale(.98); } }
.searchbar { position: relative; }
.searchbar svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); stroke-width: 2; pointer-events: none; }
.searchbar input { width: 100%; padding-left: 50px; border-radius: var(--radius-pill); }
.toolbar { display: flex; gap: 8px; align-items: center; margin: -4px 0 16px; }
.toolbar select { min-height: 40px; height: 40px; border-radius: var(--radius-pill); font-size: 15px; font-weight: 500; padding: 0 38px 0 16px; }
.tidy-link { margin-top: 24px; text-align: center; }

/* ------------------------------------------------ item page */
.item-hero { position: relative; }
.item-hero img, .item-hero .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-card); display: block; background: var(--soft); }
.item-hero .pills { position: absolute; left: 12px; bottom: 12px; }
.item-hero .pill { background: var(--white); color: var(--black); height: 30px; font-size: 13px; }
.item-hero .pill.warn { background: var(--pink); }
.item-title { font-size: clamp(32px, 9vw, 44px); line-height: 1; letter-spacing: -.03em; margin: 18px 0 8px; }
.item-rating { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.last-worn { min-height: 0; }
.lw { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 32px; letter-spacing: -.03em; line-height: 1; }
.lw small { font-size: 15px; letter-spacing: 0; opacity: .78; }
.year-pills { margin-top: 16px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; }
.fields input, .fields select { width: 100%; }
.fields .span-all { grid-column: 1 / -1; }
.tidy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.tidy label { margin-bottom: -4px; }
.merge-row { display: flex; gap: 8px; min-width: 0; }
.merge-row select { flex: 1; min-width: 0; }

/* ------------------------------------------------ Check matches */
.match { display: grid; gap: 14px; }
.match .badge { justify-self: start; }
.match select { width: 100%; font-size: 15px; }
.duo > span, .duo a { display: grid; gap: 8px; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.2; }
.duo > span img, .duo > span .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 20px; background: var(--soft); display: block; }
.duo small { display: block; font-size: 12px; font-weight: 500; opacity: .65; }
.duo a small { display: inline; }
.duo.vs { cursor: zoom-in; }
.card:not(.bg-yellow):not(.bg-pink) .duo a { color: var(--ink); }
.duo.vs i { background: var(--orange); color: var(--black); }

/* ------------------------------------------------ Ideas */
.dress-me { position: relative; overflow: hidden; display: grid; gap: 14px; padding: 22px; border-radius: var(--radius-card); background: var(--yellow); color: var(--black); }
.dress-me > :not(.sparkle) { position: relative; }
.dress-me h2 { margin: 0; font-size: 36px; letter-spacing: -.03em; }
.dress-me p { margin: -6px 0 0; max-width: 30ch; }
.dress-me .label, .dress-me label { color: inherit; opacity: .72; display: block; margin: 0 0 8px 2px; font-size: 14px; }
.dress-me input:not([type=hidden]) { width: 100%; background: var(--white); color: var(--black); border-color: transparent; }
.dress-me input::placeholder { color: #6b6658; }
.dress-me .occ { color: var(--black); border-color: rgba(18, 18, 18, .3); }
.dress-me .occ.on { background: var(--black); color: var(--yellow); }
.dress-me .sparkle.a { width: 130px; height: 130px; right: -30px; top: -30px; color: var(--orange); }
.dress-me .sparkle.b { width: 36px; height: 36px; right: 104px; top: 22px; color: var(--white); }
.dress-me button.primary { justify-self: start; }
.idea { display: grid; gap: 12px; }
.idea p { margin: 0; }
.idea-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.idea-head h3 { margin: 0; font-size: 22px; }
.idea .pieces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.idea.bg-yellow .item .meta, .idea.bg-yellow .muted { color: inherit; opacity: .72; }

/* ------------------------------------------------ Setup */
.steps { display: grid; gap: var(--gutter); margin-top: var(--gutter); }
.step { padding: 22px; }
.step h3 { font-size: 22px; margin: 4px 0 12px; padding-right: 56px; }
.step p { margin: 0 0 12px; }
.step-num { position: absolute; right: 18px; top: 18px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-size: 20px; font-weight: 700; background: var(--yellow); color: var(--black); transform: rotate(-8deg); }
.step.done .step-num { background: var(--orange); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 14px; }
.mini-stats > div { background: var(--soft); border-radius: var(--radius-inner); padding: 14px 16px; display: grid; gap: 4px; }
.mini-stats .big-num { font-size: 40px; }
.progress { height: 16px; border-radius: var(--radius-pill); background: var(--soft); overflow: hidden; margin: 16px 0 10px; }
.progress i { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--orange); transition: width var(--dur-long) var(--ease-emph); }

/* ------------------------------------------------ add new outfits (Outfits home) */
.upload-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius-card);
  background: var(--pink); color: var(--black); cursor: pointer; position: relative; isolation: isolate; }
.upload-card .up-icon { width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--black); color: var(--pink); transform: rotate(-8deg); }
.upload-card .up-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.upload-card .up-txt { display: grid; gap: 3px; flex: 1; min-width: 0; }
.upload-card b { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.upload-card .up-txt > span:not(.up-bar) { font-size: 14px; opacity: .75; }
.upload-card.over { outline: 3px dashed var(--ink); outline-offset: 3px; }
.upload-card.busy { cursor: progress; pointer-events: none; }
.upload-card:focus-within { outline: 3px solid var(--orange); outline-offset: 3px; }
.up-bar { display: block; height: 14px; border-radius: var(--radius-pill); background: rgba(18, 18, 18, .15); overflow: hidden; margin-top: 6px; }
.up-bar i { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--black); transition: width var(--dur-medium) var(--ease-emph); }
.upload-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--black); opacity: 0; transition: opacity var(--dur-short) linear; pointer-events: none; }
@media (hover: hover) { .upload-card:hover::after { opacity: var(--state-hover); } }
@media (prefers-reduced-motion: no-preference) {
  .upload-card { transition: transform var(--dur-short) var(--ease-std); }
  .upload-card:active { transform: scale(.98); }
  .upload-card:hover .up-icon { animation: twirl var(--dur-long) var(--ease-bounce); }
}

/* ================================================ Desktop (as on the Training site, from 900px)
   The bottom pill becomes a navigation rail on the left with labels showing, the page widens to
   1120px, headers and hero blocks run the full width and cards pair up or form a 4-wide grid. */
@media (min-width: 900px) {
  :root { --gutter: 16px; }
  body { padding-left: 232px; }
  .top { max-width: none; padding: 0; }
  .brand { position: fixed; left: 40px; top: 44px; z-index: 11; color: var(--nav-fg); }
  body:has(main > .header) .brand, body:has(main > .detail-head) .brand { display: inline-flex; }
  .brand i { background: var(--yellow); }
  main { max-width: 1120px; padding: 32px 32px 64px; }

  /* navigation rail */
  #nav {
    left: 24px; top: 32px; bottom: 32px; transform: none; width: 184px;
    flex-direction: column; justify-content: flex-start; border-radius: 34px; padding: 72px 8px 8px; gap: 4px;
  }
  #nav a, #nav a.on { flex: none; height: 52px; width: 100%; justify-content: flex-start; padding: 0 18px; gap: 12px; }
  #nav .tab-label, #nav a.on .tab-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; animation: none; }
  #toast { left: calc(50% + 116px); bottom: 32px; }

  /* type */
  .title, h1 { font-size: 56px; }
  .hero-num { font-size: clamp(72px, 8vw, 112px); }
  .header { padding-top: 0; }
  .detail-head { padding-top: 0; }
  .chips, .film { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }

  /* shared grids */
  .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bento > .span-2 { grid-column: span 2; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px 14px; }
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }

  /* Outfits home: rate and add side by side, then the four sections in one row */
  .rate-hero { min-height: 100%; align-content: space-between; }
  .upload-card { flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 22px; min-height: 100%; }
  .upload-card .up-icon { width: 72px; height: 72px; }
  .upload-card .up-icon svg { width: 32px; height: 32px; }
  .upload-card b { font-size: 28px; letter-spacing: -.02em; }
  .upload-card .up-txt { width: 100%; }
  .sections { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .section { min-height: 220px; }
  .polaroid { width: 84px; }

  /* outfit page: photo and key facts stay in view on the left, the rest scrolls on the right */
  .outfit { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0 var(--gutter); align-items: start; }
  .outfit-top { grid-column: 1; grid-row: 1 / span 6; position: sticky; top: 32px; }
  .outfit > :not(.outfit-top) { grid-column: 2; }
  .occasion-card { margin-top: 0; }
  .outfit-rest > h2:first-of-type, .outfit-rest > .summary:first-child { margin-top: 0; }

  /* item page: same split */
  .item-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--gutter) 32px; align-items: start; }
  .item-side { position: sticky; top: 32px; }
  .item-main > h2:first-child { margin-top: 0; }

  /* Insights: sections pair up; the frequency chart, ratings and seasons run full width */
  .sec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--gutter); align-items: start; }
  .sec.wide { grid-column: 1 / -1; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-height: 520px; }
  .vbars { height: 240px; }
  .pairings { grid-template-columns: 1fr; }

  /* Wardrobe */
  .check-hero { grid-template-columns: 1fr auto; align-items: end; }
  .check-hero .go { grid-column: 1 / -1; }
  .searchbar { max-width: 560px; }

  /* Ideas and Setup */
  .dress-me { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .dress-me > h2, .dress-me > p, .dress-me > button { grid-column: 1 / -1; }
  .idea .pieces { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fields .span-all { grid-column: 1 / -1; }
}
/* narrower desktops: the four outfit sections would squash their polaroids, so two per row */
@media (min-width: 900px) and (max-width: 1149px) {
  .sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------ sign-in page */
.login { max-width: 440px; min-height: 100dvh; margin: 0 auto; padding: 24px 16px; display: grid; align-content: center; gap: var(--gutter); }
.login-hero { position: relative; overflow: hidden; display: grid; gap: 10px; padding: 26px 22px 24px; border-radius: var(--radius-card);
  background: var(--yellow); color: var(--black); }
.login-hero > :not(.sparkle) { position: relative; }
.login-hero .label { color: inherit; opacity: .72; font-weight: 600; }
.login-hero .title { margin: 28px 0 0; }
.login-hero p { margin: 0; font-size: 17px; max-width: 26ch; }
.login-hero .sparkle.a { width: 140px; height: 140px; right: -30px; top: -34px; color: var(--orange); }
.login-hero .sparkle.b { width: 38px; height: 38px; right: 118px; top: 26px; color: var(--white); }
.login-card { display: grid; gap: 12px; }
.login-card[hidden], #password-form[hidden] { display: none; }
.login-card input { width: 100%; }
.login-card .primary { width: 100%; height: 60px; font-size: 17px; }
.login-card .primary svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-card p { margin: 0; }
#password-form { display: grid; gap: 10px; }
.login .note[hidden] { display: none; }
@media (min-width: 900px) { body.login-body { padding-left: 0; } }

/* Setup page: sign-in card */
.signin-card .row { margin-top: 4px; }
.storage-note { grid-column: 1 / -1; margin: 4px 0 0; text-align: center; }
