:root {
  --bg: #121214; --panel: #1b1b1f; --panel2: #25252b; --line: #33333b;
  --text: #ececf0; --muted: #9a9aa6; --accent: #d6b27a; --danger: #e06c6c;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .center { text-align: center; } .pad { padding: 24px 16px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 12px 12px 0; }

header.top { position: sticky; top: 0; z-index: 5; background: var(--bg);
  padding: 12px 12px 8px; border-bottom: 1px solid var(--line); }
header.top h1 { margin: 0 0 8px; font-size: 20px; }
.search { width: 100%; padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); white-space: nowrap; font-size: 14px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #1a1408; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-align: left; padding: 0; cursor: pointer; position: relative; }
.card .ph { aspect-ratio: 1; background: var(--panel2); display: grid; place-items: center;
  color: var(--muted); font-size: 13px; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .meta { padding: 8px 10px 10px; }
.card .nm { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.sel { outline: 3px solid var(--accent); }
.badge { position: absolute; top: 6px; left: 6px; background: #000a; padding: 2px 8px;
  border-radius: 999px; font-size: 11px; }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex;
  background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
nav.tabs button { flex: 1; background: none; border: 0; padding: 14px 4px; color: var(--muted); font-size: 13px; }
nav.tabs button.on { color: var(--accent); font-weight: 600; }
.fab { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 6;
  width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent);
  color: #1a1408; font-size: 30px; line-height: 1; box-shadow: 0 6px 18px #0008; }

.sheet { position: fixed; inset: 0; z-index: 10; background: var(--bg); overflow-y: auto; }
.sheet .bar { position: sticky; top: 0; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 1; }
.sheet .bar h2 { flex: 1; margin: 0; font-size: 17px; }
.sheet .body { max-width: 640px; margin: 0 auto; padding: 14px 14px 40px; }

label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
textarea { min-height: 70px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1408; font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; margin-top: 16px; }
.btn:disabled { opacity: .5; }

.photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.photos .p { width: 92px; height: 92px; border-radius: 10px; overflow: hidden; position: relative; background: var(--panel2); }
.photos .p img { width: 100%; height: 100%; object-fit: cover; }
.photos .p button { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 50%;
  border: 0; background: #000b; color: #fff; }
.photos .p .mv { right: auto; left: 2px; }
.photos .p .tag { position: absolute; left: 0; right: 0; bottom: 0; background: #000a; color: #fff;
  font-size: 11px; text-align: center; padding: 2px 0; }
.photos .add { display: grid; place-items: center; border: 1px dashed var(--line); color: var(--muted);
  font-size: 28px; cursor: pointer; }

.list { display: grid; gap: 10px; }
.outfit { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; text-align: left; width: 100%; cursor: pointer; }
.outfit .thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.outfit .thumbs div { flex: none; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--panel2); }
.outfit .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.catrow { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.catrow span { flex: 1; }

.auth { max-width: 380px; margin: 12vh auto 0; padding: 0 20px; }
.auth h1 { margin: 0 0 4px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 20; background: #000d; border: 1px solid var(--line); padding: 10px 16px; border-radius: 999px;
  font-size: 14px; max-width: 90vw; }
@media (min-width: 800px) { .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
.chip.tagchip { font-size: 13px; padding: 4px 10px; color: var(--muted); }
.chip.tagchip.on { color: #1a1408; }
#tagsuggest { padding-top: 6px; }
