:root {
  --bg: #f5f5f7; --panel: #ffffff; --line: #e3e3e8; --ink: #16171a; --mute: #6b6e76;
  --accent: #16171a; --accent-ink: #ffffff; --good: #1f8a4c; --good-bg: #e3f4ea;
  --bad: #c2382f; --bad-bg: #fbe7e5; --tag-bg: #ececf0; --input: #fafafb;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0d10; --panel: #17181c; --line: #2a2c33; --ink: #f2f2f4; --mute: #9b9ea7;
    --accent: #ececf0; --accent-ink: #0c0d10; --good: #5cc98a; --good-bg: #173324;
    --bad: #ee7a73; --bad-bg: #3a1a18; --tag-bg: #25272d; --input: #101114;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif; }
a { color: inherit; }
main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; }
h2, h3, h4 { margin: 0 0 12px; } h2 { font-size: 20px; } h3 { font-size: 15px; } h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.muted { color: var(--mute); } .small { font-size: 12px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.top nav { display: flex; gap: 6px; align-items: center; }
.top nav a { text-decoration: none; padding: 6px 12px; border-radius: 8px; color: var(--mute); }
.top nav a.on, .top nav a:hover { background: var(--tag-bg); color: var(--ink); }
.brand { font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand.big { font-size: 22px; margin-bottom: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, #fff, #9aa0ab); box-shadow: 0 0 0 1px var(--line); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.bar h2, .bar h3 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-decoration: none; }
.stat span { display: block; color: var(--mute); font-size: 12px; } .stat b { font-size: 26px; font-variant-numeric: tabular-nums; }
.good-t { color: var(--good); } .bad-t, .danger-t { color: var(--bad) !important; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row.tight { align-items: center; gap: 8px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--mute); flex: 1 1 180px; }
label.narrow { flex: 0 1 110px; }
input, select { font: inherit; color: var(--ink); background: var(--input); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 10px; min-width: 0; }
.row.tight input { width: 260px; max-width: 100%; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button { font: inherit; font-weight: 600; cursor: pointer; border-radius: 9px; padding: 8px 16px; border: 1px solid var(--line);
  background: var(--tag-bg); color: var(--ink); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.ghost { background: transparent; } button.sm { padding: 3px 9px; font-size: 12px; }
button.link { background: none; border: 0; color: var(--mute); padding: 6px 10px; font-weight: 400; }
button.wide { width: 100%; margin-top: 8px; }
form { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--tag-bg); }
td a { text-decoration: none; }
.empty { text-align: center; color: var(--mute); padding: 28px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--tag-bg); font-size: 12px; white-space: nowrap; }
.tag.good { background: var(--good-bg); color: var(--good); } .tag.bad { background: var(--bad-bg); color: var(--bad); }
.pill { text-decoration: none; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--mute); }
.pill.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.notice { border-color: var(--good); }
.keys { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.keys code { font-size: 14px; padding: 6px 10px; border-radius: 8px; background: var(--tag-bg); user-select: all; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
dt { color: var(--mute); } dd { margin: 0; word-break: break-all; }
.back { display: inline-block; margin-bottom: 12px; color: var(--mute); text-decoration: none; }
.login { min-height: 80vh; display: grid; place-items: center; }
.login .panel { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.error { color: var(--bad); background: var(--bad-bg); padding: 8px 10px; border-radius: 8px; margin: 0; }
@media (max-width: 640px) { .top { padding: 12px 16px; } .top nav a { padding: 6px 8px; } }
.ok { color: var(--good); background: var(--good-bg); padding: 8px 10px; border-radius: 8px; margin: 0 0 12px; }
.versions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
/* Designs */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 130px; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--input); cursor: pointer; text-align: center; padding: 18px; }
.drop.hot { border-color: var(--accent); background: var(--tag-bg); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-t { color: var(--ink); font-size: 14px; }
label.check { flex-direction: row; align-items: center; gap: 6px; flex: 0 0 auto; color: var(--ink); font-size: 13px; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; background: var(--input); }
.bulk .hint { margin-left: auto; }
.sm-input { width: 130px; padding: 4px 8px; font-size: 12px; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.dcard { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.dcard[draggable="true"] { cursor: grab; }
.dcard.dragging { opacity: .4; }
.dcard.sel { outline: 2px solid var(--accent); outline-offset: -1px; }
.dcard.off .dthumb img { opacity: .35; filter: grayscale(.6); }
.dthumb { position: relative; aspect-ratio: 1.586; border-radius: 9px; overflow: hidden; background: var(--tag-bg); }
.dthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dthumb .pick { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; }
.badges { position: absolute; top: 7px; right: 7px; display: flex; gap: 4px; }
.badges .tag { font-size: 11px; padding: 1px 7px; backdrop-filter: blur(6px); }
.dedit { display: flex; flex-direction: column; gap: 6px; }
.dedit input { padding: 6px 8px; font-size: 13px; }
.dedit input[name=name] { font-weight: 600; }
.dactions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sm-btn { display: inline-flex; flex: 0 0 auto; padding: 3px 9px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: 9px; background: var(--tag-bg); color: var(--ink); cursor: pointer; }
