:root {
  color-scheme: light;
  --bg: #f8f6f2;
  --surface: #fffdfa;
  --panel: #f0eae2;
  --line: #e4dcd1;
  --ink: #27211c;
  --muted: #6c6056;
  --accent: #624431;
  --button-text: #fffaf3;
  --nav: #fbf9f5;
  --shadow: 0 16px 55px #3a281516;
  --serif: Georgia, 'Times New Roman', serif;
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { color-scheme: dark; --bg:#201c19; --surface:#292421; --panel:#352e28; --line:#504237; --ink:#f7ede1; --muted:#c9b9a7; --accent:#d7aa8a; --button-text:#241911; --nav:#251f1b; --shadow:none; }
}
:root[data-theme="dark"] { color-scheme: dark; --bg:#201c19; --surface:#292421; --panel:#352e28; --line:#504237; --ink:#f7ede1; --muted:#c9b9a7; --accent:#d7aa8a; --button-text:#241911; --nav:#251f1b; --shadow:none; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); }
a { color: var(--accent); }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; }
button, .button { display: inline-flex; gap: .45rem; align-items: center; justify-content: center; min-height: 44px; padding: .59rem 1rem; border: 1px solid var(--line); border-radius: .62rem; color: var(--ink); background: var(--surface); cursor: pointer; text-decoration: none; }
button:hover, .button:hover { border-color: var(--accent); }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary { background: var(--accent); color: var(--button-text); border-color: transparent; font-weight: 620; }
.quiet { background: transparent; border-color: transparent; color: var(--muted); justify-content: flex-start; }
.skip { position: absolute; transform: translateY(-150%); z-index: 20; background: var(--surface); padding: 1rem; }
.skip:focus { transform: none; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.08; letter-spacing: -.038em; }
h1 { font-size: clamp(2.55rem, 5vw, 4.65rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.45rem); }
h3 { font-size: 1rem; }
p { color: var(--muted); }
small { color: var(--muted); font-size: .83rem; }
img { display: block; max-width: 100%; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 224px; background: var(--nav); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 2.4rem 1.15rem 1.3rem; z-index: 2; }
.brand { display: flex; align-items: center; gap: .75rem; padding-left: .5rem; text-decoration: none; color: var(--ink); font: 1.36rem/.96 var(--serif); }
.brand img, .mobile img { border-radius: 10px; }
.sidebar nav { display: grid; gap: .35rem; margin-top: 3.2rem; }
.sidebar nav button { justify-content: flex-start; border: 0; background: transparent; color: var(--muted); text-align: left; }
.sidebar nav span { width: 1.3rem; text-align: center; font-size: 1.3rem; line-height: 1; }
.sidebar nav [aria-current="page"] { color: var(--ink); background: var(--panel); font-weight: 620; }
.sidebar-foot { margin-top: auto; display: grid; }
.mobile { display: none; }
main { max-width: 1520px; margin: auto; padding: clamp(1.15rem, 4vw, 4rem); }
body.active main { margin-left: 224px; }
.pagehead { display: flex; align-items: end; justify-content: space-between; gap: 1.15rem; margin-bottom: 2rem; }
.pagehead p { margin-top: .55rem; }
.section-head { display:flex; justify-content:space-between; align-items: center; gap: 1rem; margin: 1.1rem 0; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; margin-bottom: .85rem; }
label { display: grid; gap: .3rem; font-size: .9rem; color: var(--muted); }
input:not([type="checkbox"]), select, textarea { width: 100%; min-width: 0; min-height: 44px; padding: .6rem .75rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: .55rem; }
textarea { min-height: 90px; resize: vertical; }
select { padding-right: 1.8rem; }
.chips { display: flex; gap: .45rem; overflow-x: auto; padding: 3px 3px .8rem; margin: 0 -3px .4rem; }
.chips button { border-radius: 999px; white-space: nowrap; padding: .4rem .8rem; min-height: 38px; font-size: .89rem; }
.chips [aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.empty-feature { display: grid; grid-template-columns: 1fr 1.15fr; align-items: stretch; background: var(--panel); border: 1px solid var(--line); border-radius: 1.05rem; overflow: hidden; min-height: 320px; }
.empty-feature div { align-self: center; padding: clamp(1.2rem,4vw,3rem); }
.empty-feature p { margin-top: .65rem; max-width: 31ch; }
.empty-feature button { margin-top: 1.1rem; }
.empty-feature img { width: 100%; height: 100%; min-height: 310px; object-fit: cover; }
.empty { padding: 1.25rem; border: 1px dashed var(--line); border-radius: .7rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 181px), 1fr)); gap: .85rem; }
.card { min-width: 0; overflow: hidden; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: .85rem; }
.card > a { display: block; color: inherit; text-decoration: none; }
.cover { background: var(--panel); width: 100%; aspect-ratio: 4 / 4.65; object-fit: cover; }
.card-copy { display: grid; gap: .15rem; padding: .66rem .8rem .75rem; overflow-wrap: anywhere; }
.heart { position: absolute; top: .48rem; right: .48rem; width: 42px; min-height: 42px; padding: 0; border-radius: 50%; background: var(--surface); font-size: 1.28rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: .9rem; padding: clamp(.85rem, 3vw, 1.4rem); }
.panel + .panel { margin-top: 1rem; }
.panel h2 { margin-bottom: .7rem; }
.panel p + * { margin-top: .75rem; }
.row { display:flex; align-items:center; flex-wrap:wrap; gap:.55rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px),1fr)); gap:.65rem; }
.stack { display: grid; gap: .8rem; }
.spaced { margin-top: 1rem; }
.login { margin: clamp(0rem, 7vh, 5rem) auto; max-width: 940px; display: grid; grid-template-columns: .92fr 1fr; overflow: hidden; border: 1px solid var(--line); background: var(--surface); border-radius: 1.25rem; box-shadow: var(--shadow); }
.login-copy { padding: clamp(1.2rem,5vw,3.8rem); align-self: center; }
.login p { margin-top:.7rem; }
.login form { display:grid; gap:.8rem; margin-top:1.55rem; }
.login img { width:100%; height:100%; min-height:440px; object-fit:cover; }
dialog { width: min(760px, calc(100vw - 1.4rem)); max-height: 91dvh; padding: 0; border: 1px solid var(--line); border-radius: .95rem; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
dialog::backdrop { background: #211a15a0; }
#modal { padding: clamp(.9rem, 4vw, 1.8rem); }
.modal-head { display:flex; justify-content:space-between; gap:.6rem; align-items:start; margin-bottom:1rem; }
.modal-head h2 { overflow-wrap:anywhere; }
.detail-photos { display:flex; gap:.55rem; overflow:auto; padding-bottom:.5rem; }
.detail-photos img { width:150px; height:165px; object-fit:cover; border-radius:.5rem; }
.outfit { display:grid; grid-template-columns: minmax(120px, 250px) 1fr; gap:1rem; }
.outfit img, .result-image { background:var(--panel); border-radius:.6rem; max-height: 420px; object-fit:contain; }
.outfit-links { margin: .55rem 0; padding-left:1.25rem; }
.checks { display:grid; gap:.25rem; max-height:42vh; overflow:auto; }
.checks label { display:flex; align-items:center; min-height:40px; }
input[type="checkbox"] { width:1.1rem; height:1.1rem; accent-color:var(--accent); }
#toast { position:fixed; z-index:5; bottom:1rem; right:1rem; max-width:min(90vw,430px); padding:.75rem 1rem; border:1px solid var(--line); border-radius:.65rem; background:var(--ink); color:var(--bg); box-shadow:var(--shadow); }
@media (max-width: 800px) {
  body.active main { margin-left:0; padding-bottom:calc(6rem + env(safe-area-inset-bottom)); }
  .mobile { display:flex; align-items:center; gap:.55rem; padding: .75rem 1.1rem; border-bottom:1px solid var(--line); font:1.3rem var(--serif); }
  .sidebar { inset:auto 0 0; width:auto; padding:.25rem .4rem calc(.25rem + env(safe-area-inset-bottom)); border:0; border-top:1px solid var(--line); }
  .sidebar .brand, .sidebar-foot { display:none; }
  .sidebar nav { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.13rem; margin:0; }
  .sidebar nav button { flex-direction:column; gap:.15rem; justify-content:center; padding:.32rem .05rem; font-size:clamp(.65rem,2.4vw,.83rem); }
  #toast { bottom:calc(4.5rem + env(safe-area-inset-bottom)); }
}
@media (max-width: 540px) {
  .pagehead { align-items:start; flex-direction:column; margin-bottom:1.2rem; gap:.7rem; }
  .empty-feature, .login { grid-template-columns:1fr; }
  .empty-feature img, .login img { min-height:0; height:190px; object-position:50% 40%; }
  .toolbar { grid-template-columns: minmax(0,1fr) auto; }
  .grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; }
  .outfit { grid-template-columns:1fr; }
  .outfit img { max-height:220px; }
}
