:root {
  --ivory: #f7f3ec; --paper: #fffdf9; --ink: #1d1b18; --muted: #6f6a62; --line: #e4ddd1; --gold: #a8843f; --gold-soft: #efe4cc;
  --green: #2f6b45; --green-soft: #e1efe4; --amber: #9a6a12; --amber-soft: #f6ead0; --red: #9b2f2f; --red-soft: #f5dede;
  --radius: 12px; --serif: 'Cormorant Garamond', Georgia, serif; --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ivory); color: var(--ink); font: 15px/1.45 var(--sans); }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: 30px; } h2 { font-size: 23px; } h3 { font-size: 18px; }
small, .muted { color: var(--muted); }
button, .btn { font: 500 14px var(--sans); border: 1px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 8px 15px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button.gold { background: var(--gold); border-color: var(--gold); }
button.danger { background: transparent; color: var(--red); border-color: var(--red-soft); }
button.small { padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: 15px var(--sans); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--paper); color: var(--ink); width: 100%; }
textarea { min-height: 90px; resize: vertical; }
textarea.code { font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace; min-height: 220px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 3px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 14px; margin: 4px 12px 4px 0; }
label.inline input { width: auto; }

header.top { position: sticky; top: 0; z-index: 10; background: rgba(247, 243, 236, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
header.top .bar { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.brand { font: 600 24px var(--serif); text-decoration: none; letter-spacing: .02em; }
nav.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
nav.tabs a { text-decoration: none; padding: 6px 11px; border-radius: 999px; color: var(--muted); white-space: nowrap; font-size: 14px; }
nav.tabs a.on { background: var(--ink); color: var(--paper); }
main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 80px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.cols2 { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.cols3 { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .cols2, .cols3 { grid-template-columns: 1fr; } h1 { font-size: 26px; } }
.stack > * + * { margin-top: 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.chip { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--gold-soft); color: var(--ink); white-space: nowrap; }
.chip.filled, .chip.yes, .chip.keep, .chip.pass, .chip.ok, .chip.green { background: var(--green-soft); color: var(--green); }
.chip.shopping, .chip.maybe, .chip.tailor, .chip.after_tailoring, .chip.amber, .chip.fixable, .chip.unknown, .chip.running { background: var(--amber-soft); color: var(--amber); }
.chip.empty { background: #eee9e0; color: var(--muted); }
.chip.no, .chip.go, .chip.fail, .chip.red, .chip.error { background: var(--red-soft); color: var(--red); }
.progress { height: 12px; border-radius: 999px; background: #eee9e0; overflow: hidden; display: flex; }
.progress span { display: block; height: 100%; }
.progress .f { background: var(--green); } .progress .s { background: var(--gold); }
.big { font: 600 34px var(--serif); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr.click { cursor: pointer; } tr.click:hover td { background: #fbf7ef; }
.table-wrap { overflow-x: auto; }

.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs img, img.thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #eee9e0; cursor: zoom-in; }
.cover { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 8px; background: #eee9e0; display: block; }
.cover.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.swatch { display: inline-flex; align-items: center; gap: 6px; margin: 3px 8px 3px 0; font-size: 13px; }
.swatch i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); display: inline-block; }
.verdict { border-left: 3px solid var(--gold); padding: 6px 0 6px 10px; margin-top: 8px; font-size: 14px; }
.verdict ul { margin: 4px 0; padding-left: 18px; }
.verdict .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-top: 6px; }
pre.json { background: #f3eee5; border-radius: 8px; padding: 10px; font-size: 12px; overflow: auto; max-height: 360px; }
.md { font-size: 15px; } .md h1, .md h2 { margin-top: 1em; } .md table { margin: 10px 0; } .md code { background: #f3eee5; padding: 1px 4px; border-radius: 4px; }
.subtabs { display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap; }
.subtabs button { background: transparent; color: var(--muted); border-color: var(--line); }
.subtabs button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.timeline { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 16px; }
.timeline .ev { position: relative; margin-bottom: 16px; }
.timeline .ev::before { content: ''; position: absolute; left: -23px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--ivory); }
.timeline .ev.today::before { background: var(--ink); } .timeline .ev.move::before { background: var(--red); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; z-index: 50; font-size: 14px; max-width: 92vw; }
.toast.err { background: var(--red); }
.modal { position: fixed; inset: 0; background: rgba(20, 18, 15, .55); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 30px 10px; overflow: auto; }
.modal > .card { width: 100%; max-width: 760px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 60; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 94vh; }
.login { max-width: 380px; margin: 12vh auto; }
.compare { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.empty-note { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
