:root {
  color-scheme: light;
  --paper: #f6f5ef;
  --surface: #fffefa;
  --ink: #303c36;
  --muted: #68736b;
  --green: #426651;
  --pale: #e6ecdf;
  --line: #dedfd5;
  --peach: #f3e6d8;
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  background: var(--paper);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, input[type='color'], input[type='checkbox'] { cursor: pointer; }
button { min-height: 44px; border: 0; border-radius: 14px; padding: 10px 16px; background: transparent; font-weight: 600; touch-action: manipulation; }
button:hover { filter: brightness(.96); }
button:disabled { opacity: .5; cursor: wait; }
button svg { width: 21px; height: 21px; flex: 0 0 auto; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #a55e33; outline-offset: 3px; }
a { color: var(--green); text-underline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 27px; letter-spacing: .02em; line-height: 1.4; margin-bottom: 0; }
h2 { font-size: 16px; line-height: 1.6; margin-bottom: 12px; }
p { margin-bottom: 12px; }
svg { width: 24px; height: 24px; }
.test-banner { font-size: 11px; text-align: center; background: #e8e9de; padding: max(5px, env(safe-area-inset-top)) 8px 5px; letter-spacing: .05em; }
.app-header { max-width: 1040px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; }
.brand { color: var(--ink); font-size: 18px; letter-spacing: .08em; font-weight: 700; text-decoration: none; min-height: 44px; display: flex; align-items: center; }
.local-note { font-size: 10px; color: var(--muted); }
main { max-width: 1040px; margin: 0 auto; padding: 18px 24px calc(180px + env(safe-area-inset-bottom)); min-height: 75vh; }
main:focus { outline: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 0 25px; }
.page-heading > svg { width: 40px; height: 40px; color: #82927a; }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: .13em; font-weight: 600; margin: 0 0 6px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; margin: 0 0 20px; }
.panel > :last-child { margin-bottom: 0; }
.weather { background: #edf0e5; border-color: #e1e6d8; padding: 8px 12px; margin-bottom: 16px; }
.weather-summary { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; font-size: 12px; }
.weather-summary > span { white-space: nowrap; }
.weather-place { font-weight: 700; }
.text-button { font-size: 12px; padding: 6px 8px; color: var(--green); text-decoration: underline; text-underline-offset: 4px; flex-shrink: 0; }
.weather-temperatures { font-weight: 600; }
.weather-footer { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.attribution { display: inline-flex; align-items: center; min-height: 44px; font-size: 10px; color: #57664f; }
.offline, .hint { font-size: 12px; padding: 12px 14px; background: var(--peach); border-radius: 12px; }
.place-picker label { display: block; font-weight: 600; margin-bottom: 8px; }
.place-row { display: flex; gap: 8px; margin-bottom: 8px; }
.place-row select { min-width: 0; flex: 1; min-height: 48px; background: var(--surface); border: 1px solid #bfc8b9; border-radius: 12px; padding: 8px 10px; font-size: 16px; }
.place-row button { display: inline-flex; align-items: center; gap: 4px; padding: 8px 10px; font-size: 12px; }
.selectors { margin: 16px 0; min-width: 0; }
.selectors h2 { margin-bottom: 4px; font-size: 14px; }
.chip-scroll { position: relative; min-width: 0; margin-bottom: 10px; }
.chip-scroll::after { content: ''; position: absolute; inset: 0 0 0 auto; width: 20px; background: linear-gradient(to right, transparent, var(--paper)); pointer-events: none; }
.chip-scroll.at-end::after { display: none; }
.chips { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding: 4px; scroll-padding-inline: 4px 20px; }
.chip { flex: 0 0 auto; white-space: nowrap; background: var(--surface); border: 1px solid var(--line); border-radius: 30px; font-size: 13px; padding: 9px 13px; }
.chip[aria-pressed='true'] { background: var(--green); border-color: var(--green); color: #fff; }
.oshi-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.toggle { display: flex; align-items: center; min-height: 44px; gap: 10px; font-size: 13px; cursor: pointer; }
.toggle input { appearance: none; width: 44px; height: 26px; border-radius: 24px; margin: 0; padding: 3px; background: #c5cbbf; transition: background .15s; }
.toggle input::before { content: ''; display: block; width: 20px; height: 20px; background: white; border-radius: 50%; box-shadow: 0 1px 3px #0002; transition: transform .15s; }
.toggle input:checked { background: var(--green); }
.toggle input:checked::before { transform: translateX(18px); }
.color-input { width: 48px; height: 48px; }
input[type='color'] { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 14px; padding: 5px; background: var(--surface); }
input[type='color']::-webkit-color-swatch { border: none; border-radius: 8px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 15px; }
#decide-timer { font-size: 10px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.outfits { display: grid; gap: 20px; }
.outfit-card { min-width: 0; border: 1px solid var(--line); border-radius: 22px; padding: 10px; background: var(--surface); }
.card-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-heading .eyebrow { margin: 0; }
.card-dot { background: #d4d9c5; width: 7px; height: 7px; border-radius: 50%; }
.chosen { font-size: 11px; background: var(--pale); border-radius: 20px; padding: 2px 10px; }
.outfit-stack { display: grid; gap: 6px; padding: 4px; background: #f3f1eb; border-radius: 12px; }
.outfit-core { display: flex; justify-content: center; gap: 4px; }
.outfit-core .outfit-item { flex: 0 1 120px; }
.outfit-extras { display: flex; justify-content: center; gap: 8px; }
.outfit-extras .outfit-item { flex: 0 1 60px; }
.outfit-item { text-align: center; min-width: 0; }
.outfit-item img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.outfit-item span { font-size: 9px; color: var(--muted); display: block; padding: 2px 0; }
.reason-details { margin: 8px 0; }
.reason { position: relative; display: grid; align-content: center; min-height: 44px; padding-right: 14px; font-size: 12px; line-height: 1.7; cursor: pointer; list-style: none; }
.reason::after { content: '⌄'; position: absolute; right: 0; top: 10px; color: var(--muted); }
.reason-details[open] .reason::after { transform: rotate(180deg); }
.reason::-webkit-details-marker { display: none; }
.reason span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reason-details[open] .reason span { white-space: normal; overflow-wrap: anywhere; }
.reason:focus-visible { outline: 3px solid #a55e33; outline-offset: 2px; border-radius: 4px; }
.card-actions { display: grid; grid-template-columns: 1fr 1.15fr; gap: 10px; }
.primary, .outline { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; }
.primary { color: #fff; background: var(--green); }
.outline { border-color: #bdc7b9; background: var(--surface); color: var(--green); }
.full { width: 100%; margin-bottom: 10px; }
.other-button { display: block; margin: 22px auto 8px; border-bottom: 1px solid #9ba791; border-radius: 0; }
.small { font-size: 11px; color: var(--muted); font-weight: 400; }
.centered { text-align: center; }
.recorded { background: var(--pale); border-radius: 12px; padding: 12px; font-size: 12px; }
.first-run { text-align: center; padding: 26px 18px; background: #f0ebdf; }
.first-run h2 { font-size: 16px; }
.first-run > p { font-size: 13px; }
.first-run > p.small { font-size: 11px; }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; background: #e2e4d5; color: var(--green); border-radius: 50%; margin: 0 auto 16px; }
.empty-icon svg { width: 31px; height: 31px; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: #fffefa; border-top: 1px solid var(--line); z-index: 5; }
.tabs button { width: min(25%, 150px); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); font-weight: 500; padding: 6px 2px; border-radius: 0; }
.tabs svg { width: 23px; height: 23px; }
.tabs [aria-current='page'] { color: var(--green); font-weight: 700; }
.tabs [aria-current='page'] svg { background: var(--pale); outline: 5px solid var(--pale); border-radius: 6px; }
.fab { position: fixed; right: max(24px, calc((100vw - 992px) / 2), env(safe-area-inset-right)); bottom: calc(92px + env(safe-area-inset-bottom)); width: 60px; height: 60px; border-radius: 50%; background: var(--green); color: white; box-shadow: 0 5px 18px #30483633; z-index: 4; display: grid; place-items: center; padding: 0; }
.fab svg { width: 26px; height: 26px; }
.fab.highlight { outline: 6px solid #d7ddc6; box-shadow: 0 0 0 11px #e8ebdf; }
.category-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.icon-choice { min-width: 64px; min-height: 68px; padding: 8px 7px; border: 1px solid var(--line); border-radius: 13px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--surface); font-size: 11px; }
.icon-choice svg { width: 25px; height: 25px; }
.icon-choice[aria-pressed='true'] { color: #304f38; border: 2px solid var(--green); background: var(--pale); padding: 7px 6px; }
.closet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.garment { padding: 0; text-align: left; overflow: hidden; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.garment img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.garment span { display: block; font-size: 9px; padding: 7px 5px; font-weight: 400; }
.count { background: var(--pale); color: var(--green); font-size: 12px; border-radius: 20px; padding: 4px 12px; }
.intro { color: var(--muted); font-size: 12px; margin-bottom: 24px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { border: 1px solid var(--line); border-radius: 18px; padding: 18px 14px; background: var(--surface); }
.stat > span { display: block; font-size: 10px; color: var(--muted); }
.stat > strong { display: block; font-size: 33px; font-weight: 500; margin-top: 6px; }
.stat > strong.smaller { font-size: 25px; }
.stat strong small { font-size: 12px; color: var(--muted); }
.stat.wide { grid-column: 1 / -1; }
.stat-split { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; font-size: 11px; color: var(--muted); }
.stat-split b { display: block; color: var(--ink); font-size: 19px; font-weight: 500; margin-top: 4px; }
.history-title { margin-top: 30px; }
.history { list-style: none; padding: 0; }
.history li { display: flex; align-items: start; gap: 15px; padding: 18px 0; border-top: 1px solid var(--line); }
.history time { font-size: 11px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.history strong { font-size: 12px; display: block; }
.history li span { font-size: 10px; color: var(--muted); display: block; margin-top: 4px; }
.privacy p { font-size: 12px; line-height: 1.9; }
.danger { color: #974835; background: #f7e9e1; border: 1px solid #e6c9bc; }
.demo-note { color: #79512f; background: var(--peach); padding: 12px; border-radius: 10px; font-size: 12px; }
textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; background: white; font-size: 16px; }
dialog { width: min(100%, 540px); max-height: calc(100dvh - 24px); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 20px; overscroll-behavior: contain; }
dialog::backdrop { background: #28392e77; }
body:has(dialog[open]) { overflow: hidden; }
.editor-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.editor-header h1 { font-size: 22px; }
.icon-button { width: 44px; height: 44px; padding: 10px; flex-shrink: 0; background: #e7e9df; }
.editor-summary { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }
.editor-summary img { width: 100px; height: 100px; object-fit: cover; border-radius: 14px; }
.editor-summary strong { font-size: 13px; }
.editor-summary p { margin: 5px 0; }
fieldset { padding: 0; border: 0; margin: 0 0 22px; min-width: 0; }
legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 10px; }
.tag-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.tag-options .icon-choice { min-width: 0; }
.swatch { width: 27px; height: 27px; background: var(--swatch); border: 1px solid #0002; border-radius: 50%; display: grid; place-items: center; }
.palette { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.palette .icon-choice { min-height: 52px; padding: 4px 2px; gap: 2px; font-size: 10px; }
.palette .icon-choice[aria-pressed='true'] { padding: 3px 1px; }
.palette .swatch { width: 22px; height: 22px; }
.swatch svg { background: #fff; color: #303c36; width: 18px; height: 18px; border-radius: 50%; }
.editor-actions { position: sticky; bottom: -20px; background: var(--paper); padding: 12px 0 max(0px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.saved-state { text-align: center; padding: 20px 0; }
.notice { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(166px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); background: #303c36; color: #fff; padding: 13px 20px; border-radius: 14px; font-size: 12px; z-index: 20; box-shadow: 0 3px 16px #0002; }
/* A modal is in the top layer; keep feedback inside it when it is open. */
dialog .editor-feedback { font-size: 12px; color: #974835; }
.loading { padding: 50px 16px; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 699px) {
  .app-header { padding: 8px 16px; }
  main { padding: 10px 12px calc(180px + env(safe-area-inset-bottom)); }
  .page-heading { margin-bottom: 14px; }
}
@media (max-width: 339px) {
  .closet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 700px) {
  main { padding-top: 26px; }
  .outfits { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .outfit-card { padding: 15px; }
  .card-actions { grid-template-columns: 1fr; }
  .closet-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .weather, main > .panel { max-width: 650px; }
  .stats-grid { max-width: 650px; }
  .select-row { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
