/* Base reset (the page used to get this from its host) */
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; }
img { max-width: 100%; }
/* Layout: Academy-style shell. Thin top bar with wordmark, fixed left sidebar of tabs on desktop (bottom bar on phones), content column up to 1120px. Cards: tinted illustration band on top, white body below. */
:root {
  --bg: #FAF9F5;
  --surface: #FFFFFF;
  --surface-2: #F3F1EA;
  --ink: #141413;
  --ink-2: #5E5D59;
  --line: #E6E3DA;
  --accent: #C6613F;
  --accent-ink: #FFFFFF;
  --accent-soft: #F7E7DE;
  --peach: #EBCAB7;
  --sage-band: #BDD1C9;
  --sage: #4F7A6A;
  --warn: #B4532A;
  --pill: #EDEAE2;
  --shadow: 0 1px 2px rgba(20,20,19,.04);
  --f-display: "Source Serif 4", "Tiempos Headline", Georgia, "Songti TC", "Noto Serif TC", serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --r: 16px;
  --side: 232px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #262624; --surface: #30302E; --surface-2: #2B2B29; --ink: #F5F4EE; --ink-2: #B7B5A9; --line: #3E3D39;
    --accent: #D97757; --accent-ink: #1F1E1D; --accent-soft: #43302A; --peach: #5A4034; --sage-band: #3A4B45; --sage: #8DBBA9;
    --warn: #E59570; --pill: #3A3936; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #262624; --surface: #30302E; --surface-2: #2B2B29; --ink: #F5F4EE; --ink-2: #B7B5A9; --line: #3E3D39;
  --accent: #D97757; --accent-ink: #1F1E1D; --accent-soft: #43302A; --peach: #5A4034; --sage-band: #3A4B45; --sage: #8DBBA9;
  --warn: #E59570; --pill: #3A3936; --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--bg); }
body { color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
header.top .topbar { display: flex; align-items: center; gap: 16px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 8px; }
.brand svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.brand h1 { white-space: nowrap; font-family: var(--f-display); font-weight: 500; font-size: 22px; margin: 0; letter-spacing: -.01em; }
.brand .cm { white-space: nowrap; font: inherit; font-size: 13px; color: var(--ink-2); background: var(--pill); border: 0; border-radius: 8px; padding: 4px 10px 4px 8px; margin-left: 6px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.brand .cm svg { width: 14px; height: 14px; color: currentColor; }
.brand .cm:hover { color: var(--ink); background: var(--line); }
@media (max-width: 440px) { .sync { display: none; } }
.sync { margin-left: auto; font-size: 13px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 5px 12px; background: var(--surface); white-space: nowrap; }

nav.tabs { display: flex; gap: 2px; }
nav.tabs button { border: 0; background: none; padding: 8px 12px; border-radius: 8px; font-size: 15px; color: var(--ink); text-align: left; }
@media (hover: hover) { nav.tabs button:hover { background: var(--pill); } }
nav.tabs button[aria-selected="true"] { background: var(--pill); font-weight: 500; }
.navlabel { font-size: 12px; color: var(--ink-2); padding: 18px 12px 6px; }
@media (max-width: 860px) {
  .navlabel { display: none; }
  nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); justify-content: space-around; }
  nav.tabs button { flex: 1; padding: 10px 2px; font-size: 13px; text-align: center; }
  nav.tabs button[aria-selected="true"] { color: var(--accent); background: var(--accent-soft); }
}
@media (min-width: 861px) {
  body { padding-bottom: 48px; padding-left: var(--side); }
  nav.tabs { position: fixed; left: 0; top: calc(57px + env(safe-area-inset-top, 0px)); bottom: 0; width: var(--side); flex-direction: column;
    padding: 24px 12px; padding-left: max(12px, env(safe-area-inset-left, 0px)); border-right: 1px solid var(--line); background: var(--bg); z-index: 4; }
  header.top { margin-left: calc(-1 * var(--side)); }
}

main { padding-block: 32px 40px; display: grid; gap: 28px; }
section[hidden] { display: none; }
h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(30px, 5vw, 40px); line-height: 1.12; margin: 0; letter-spacing: -.015em; text-wrap: balance; }
h3 { font-family: var(--f-display); font-size: 20px; margin: 0; font-weight: 400; line-height: 1.25; }
.subhead { font-family: var(--f-display); font-size: 26px; font-weight: 400; margin: 0; }
.lede { color: var(--ink-2); font-size: 17px; margin: 6px 0 0; max-width: 62ch; }
.eyebrow { font-size: 13px; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.banner { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 22px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.banner svg { width: 44px; height: 44px; flex: none; color: var(--ink); }
.banner .txt { flex: 1; min-width: 200px; }
.banner .txt b { font-family: var(--f-display); font-weight: 400; font-size: 19px; display: block; }
.banner .txt span { color: var(--ink-2); font-size: 14px; }
.linkbtn { border: 0; background: none; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; padding: 6px 0; }

.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-size: 13.5px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 15px; font-weight: 500; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.danger { color: var(--warn); }

/* Today */
.today-head { display: grid; gap: 16px; }
.controls { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ctl label, .ctl .lbl { display: block; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.temp { display: flex; align-items: center; gap: 10px; }
.temp input[type=range] { flex: 1; accent-color: var(--accent); }
.temp output { font-family: var(--f-display); font-size: 22px; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.outfits { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.outfit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); min-width: 0; }
.outfit .board { background: var(--peach); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px;
  background-image: radial-gradient(circle, rgba(20,20,19,.10) 1px, transparent 1.2px); background-size: 14px 14px; }
.outfit:nth-child(3n+2) .board { background-color: var(--sage-band); }
.outfit .board .pc { aspect-ratio: 1; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--ink); display: grid; place-items: center; overflow: hidden; position: relative; }
.outfit .board .pc img, .thumb img { width: 100%; height: 100%; object-fit: cover; }
.outfit .board .pc svg { width: 68%; height: 68%; }
.outfit .board .pc .tag { position: absolute; left: 6px; bottom: 6px; font-size: 10px; letter-spacing: .04em; background: var(--surface); padding: 1px 6px; border-radius: 6px; color: var(--ink-2); border: 1px solid var(--line); }
.outfit .body { padding: 18px 20px 8px; display: grid; gap: 10px; flex: 1; align-content: start; }
.score { display: flex; align-items: center; gap: 8px; }
.meter { flex: 1; height: 5px; background: var(--pill); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.score b { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
ul.why { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
ul.why li { display: grid; grid-template-columns: 16px 1fr; gap: 6px; }
ul.why li::before { content: "+"; color: var(--sage); font-weight: 600; }
ul.why li.warn::before { content: "!"; color: var(--warn); }
ul.why li.tip::before { content: "→"; color: var(--accent); }
.outfit .foot { padding: 12px 20px 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.worn { font-size: 13px; color: var(--sage); font-weight: 500; }
.empty { text-align: center; padding: 36px 16px; display: grid; gap: 10px; justify-items: center; }

.cityrow { display: flex; gap: 8px; }
.cityrow input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.wx { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.wx b { color: var(--ink); font-weight: 500; }
.row .wx { margin-top: 0; }
.trip-form { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.days { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.day .board { grid-template-columns: repeat(4, 1fr); padding: 12px; gap: 6px; }
.day .body h3 { font-size: 18px; }
.pack { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pack h4 { margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.pack ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.pack li { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.pack li span.n { margin-left: auto; color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.order .thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.order .more { width: 44px; aspect-ratio: 1; border-radius: 8px; background: var(--pill); display: grid; place-items: center; font-size: 12px; color: var(--ink-2); }
.order .thumbs .thumb { width: 44px; border-radius: 8px; background: var(--surface-2); }
.order .acts { display: flex; gap: 8px; flex-wrap: wrap; }

.triplist { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tripcard { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 4px; align-content: start; box-shadow: var(--shadow); min-width: 0; }
.tripcard:hover { border-color: var(--ink-2); }
.tripcard.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.tripcard b { font-family: var(--f-display); font-weight: 400; font-size: 22px; line-height: 1.2; }
.tripcard .when { font-size: 12px; color: var(--accent); font-weight: 500; }
.tripcard .bar { display: block; margin-top: 8px; }
.tripcard.new { border-style: dashed; background: transparent; box-shadow: none; place-content: center; justify-items: start; }
.tripcard.new .plus { font-size: 24px; line-height: 1; color: var(--accent); }
.tripcard.new b { font-size: 18px; }
details.past { grid-column: 1 / -1; }
details.past summary { cursor: pointer; padding: 4px 0; }
details.past .triplist { margin-top: 10px; opacity: .8; }
.day .field select { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 7px 10px; font-size: 14px; }
.day.kept { border-color: var(--ink); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chk { display: flex; gap: 8px; align-items: center; cursor: pointer; min-width: 0; }
.chk input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.chk input:checked + span { color: var(--ink-2); text-decoration: line-through; }

.moodctl { grid-column: 1 / -1; }
.moods { display: grid; gap: 10px; }
.moodgroup { display: grid; grid-template-columns: 130px 1fr; gap: 8px; align-items: start; }
.moodgroup > span { font-size: 12px; color: var(--ink-2); padding-top: 7px; }
@media (max-width: 560px) { .moodgroup { grid-template-columns: 1fr; gap: 6px; } .moodgroup > span { padding-top: 0; } }
.chip .zh { font-weight: 500; margin-right: 4px; }
.chip.add { border-style: dashed; color: var(--accent); }
.chip .x { margin-left: 6px; color: var(--ink-2); }
.chip[aria-pressed="true"] .x { color: inherit; opacity: .7; }
.moodnote { font-size: 13px; color: var(--ink-2); margin: 2px 0 0; }
.shots { display: flex; gap: 8px; flex-wrap: wrap; }
.shots img { width: 72px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.swatches { display: flex; gap: 4px; }
.swatches i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); }

.method { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .method { grid-template-columns: 1fr; } }
.methodbtn { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 2px; }
.methodbtn b { font-family: var(--f-display); font-weight: 400; font-size: 18px; }
.methodbtn span { font-size: 13px; color: var(--ink-2); }
.methodbtn[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.methodbtn[aria-checked="true"] b::after { content: " ✓"; color: var(--accent); }
.sudoku { display: grid; grid-template-columns: repeat(3, minmax(0, 120px)); gap: 6px; background: var(--ink); padding: 6px; border-radius: 14px; width: max-content; max-width: 100%; }
.sudoku .cell { position: relative; aspect-ratio: 1; background: var(--surface); border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.sudoku .cell .thumb { width: 100%; height: 100%; background: var(--surface); }
.sudoku .cell .tag { position: absolute; left: 4px; bottom: 4px; font-size: 9.5px; letter-spacing: .04em; background: var(--surface); padding: 1px 5px; border-radius: 5px; color: var(--ink-2); border: 1px solid var(--line); }
.sudoku .cell:nth-child(3n+1), .sudoku .cell:nth-child(3n+2) { }
.sudokuwrap { display: grid; gap: 16px; grid-template-columns: auto 1fr; align-items: start; }
@media (max-width: 680px) { .sudokuwrap { grid-template-columns: 1fr; } .sudoku { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; } }
.sudokuwrap .extras { display: flex; gap: 6px; flex-wrap: wrap; }
.sudokuwrap .extras .thumb { width: 56px; border-radius: 8px; background: var(--peach); }

/* Shop */
.shoptop { align-items: start; }
.shoplist ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.shoplist li { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.shoplist .chk { align-items: flex-start; }
.shoplist .chk input { margin-top: 3px; }
.shoplist .chk b { font-weight: 500; }
.li-acts { display: flex; gap: 10px; flex: none; }
.gaps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.gaps li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; }
.gaps li.need::before { content: "!"; color: var(--accent); font-weight: 700; }
.gaps li.tip::before { content: "→"; color: var(--sage); }
.enough { margin: 0; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.sizes { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); font-size: 14px; }
.sizes h4 { margin: 0; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.ideas { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.idea { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; align-content: start; box-shadow: var(--shadow); min-width: 0; }
.ideahead { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center; }
.ideahead .thumb { border-radius: 12px; background: var(--peach); }
.idea:nth-child(3n+2) .ideahead .thumb { background: var(--sage-band); }
.ideahead .t { min-width: 0; display: grid; gap: 4px; }
.ideahead h3 { font-size: 19px; }
.gain { font-size: 13px; color: var(--ink-2); }
.gain b { font-family: var(--f-display); font-weight: 400; font-size: 22px; color: var(--accent); margin-right: 2px; }
.gain .bar { margin-top: 4px; }
.idea .fit { margin: 0; font-size: 14px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.idea .fit b { font-weight: 500; }
.pairs { display: grid; gap: 6px; }
.pair .thumb { width: 44px; border-radius: 8px; }
.idea .ok { color: var(--sage); font-weight: 500; }
@media (max-width: 860px) { nav.tabs .d { display: none; } nav.tabs button { font-size: 12.5px; } }

/* Closet */
.selbar { position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); z-index: 3; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--ink); border-radius: var(--r); padding: 10px 12px 10px 16px; font-size: 14px; }
.btn.danger-solid { background: var(--warn); border-color: var(--warn); color: #fff; }
.item .pick { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); background: var(--surface); display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff; }
.item.sel { border-color: var(--warn); box-shadow: 0 0 0 2px var(--warn); }
.item.sel .pick { background: var(--warn); border-color: var(--warn); }
.item.sel .thumb { opacity: .7; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0; overflow: hidden; text-align: left; display: flex; flex-direction: column; min-width: 0; box-shadow: var(--shadow); }
.item:hover { border-color: var(--ink-2); }
.thumb { aspect-ratio: 1; background: var(--surface-2); display: grid; place-items: center; position: relative; overflow: hidden; }
.item .thumb { background: var(--peach); }
.grid .item:nth-child(3n+2) .thumb { background: var(--sage-band); }
.thumb svg { width: 62%; height: 62%; }
.thumb .ex { position: absolute; top: 8px; left: 8px; font-size: 10px; letter-spacing: .05em; background: var(--surface); color: var(--ink-2); padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); }
.item .meta { padding: 10px 12px 12px; display: grid; gap: 2px; }
.item .meta b { font-family: var(--f-display); font-weight: 400; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta span { font-size: 12.5px; color: var(--ink-2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line); vertical-align: -1px; margin-right: 4px; }

/* Add */
.drop { border: 1.5px dashed var(--ink-2); border-radius: var(--r); padding: 32px 16px; text-align: center; background: var(--accent-soft); display: grid; gap: 8px; justify-items: center; cursor: pointer; }
.drop b { font-family: var(--f-display); font-weight: 400; font-size: 20px; }
.drop.over { border-color: var(--accent); background: var(--peach); }
.pending { display: grid; gap: 14px; }
.edit { display: grid; gap: 18px; grid-template-columns: 170px 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
@media (max-width: 560px) { .edit { grid-template-columns: 1fr; } .edit .thumb { max-width: 220px; } }
.edit .thumb { border-radius: 12px; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); min-width: 0; }
.fields .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
.field input, .field select { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.field input[type=color] { padding: 2px; height: 38px; }
.status { font-size: 13px; color: var(--ink-2); }
.status.ai { color: var(--accent); }

.snap { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .snap { grid-template-columns: 1fr; } }
.snapbtn { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 18px 20px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); cursor: pointer; box-shadow: var(--shadow); }
.snapbtn svg { grid-row: 1 / 3; width: 40px; height: 40px; }
.snapbtn b { font-family: var(--f-display); font-weight: 400; font-size: 20px; line-height: 1.2; }
.snapbtn span { font-size: 13px; color: var(--ink-2); }
.snapbtn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.snapbtn.primary span { color: inherit; opacity: .85; }
.snapbtn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 860px) { .drop { display: none; } }
.tips ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 2px; }
.savebar { position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); z-index: 3; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--ink); border-radius: var(--r); padding: 10px 12px 10px 16px; font-size: 14px; }
.savebar label.btn { cursor: pointer; }
.fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 7; width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(20,20,19,.25); cursor: pointer; }
.fab svg { width: 26px; height: 26px; }
@media (min-width: 861px) { .fab { display: none; } }

/* Insights */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); }
.stat .n { font-family: var(--f-display); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.list { display: grid; gap: 8px; }
.li { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px 8px 8px; min-width: 0; }
.li .thumb { width: 48px; border-radius: 8px; background: var(--peach); }
.li .t { min-width: 0; }
.li .t b { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .t span { font-size: 12.5px; color: var(--ink-2); }
.li .v { font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink-2); }
.bar { height: 4px; background: var(--pill); border-radius: 99px; margin-top: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.two { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* Guide */
.rules { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.rule { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.rule .m { background: var(--peach); padding: 18px 20px; font-family: var(--f-display); font-size: 18px; }
.rule:nth-child(3n+2) .m { background: var(--sage-band); }
.rule .rb { padding: 16px 20px 20px; display: grid; gap: 6px; }
.rule p { margin: 0; font-size: 14px; }

/* Sheet */
.sheet { position: fixed; inset: 0; z-index: 20; display: grid; place-items: end center; background: rgba(20,20,19,.4); padding-top: env(safe-area-inset-top, 0px); }
.sheet .card { background: var(--bg); width: min(640px, 100%); max-height: 90vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; }
@media (min-width: 861px) { .sheet { place-items: center; } .sheet .card { border-radius: 18px; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 30; }
.ai-out { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; font-size: 14px; white-space: pre-wrap; }
@media (prefers-reduced-motion: no-preference) { .outfit { animation: rise .35s ease both; } @keyframes rise { from { transform: translateY(6px); } to { transform: none; } } }
