/* Theme: edit these variables to re-skin the whole app. */
:root {
  --color-bg: #0f1218;
  --color-surface: #181d27;
  --color-surface-2: #222a38;
  --color-border: #2f394b;
  --color-text: #e8ecf3;
  --color-muted: #9aa6bb;
  --color-accent: #7c6cff;
  --color-accent-contrast: #ffffff;
  --color-danger: #ff6b6b;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--color-bg); color: var(--color-text); font-family: var(--font); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
a { color: inherit; }
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .75rem 1.25rem; background: var(--color-surface); border-bottom: 1px solid var(--color-border); flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.4rem; text-decoration: none; letter-spacing: .02em; }
.logo span { color: var(--color-accent); }
nav { display: flex; gap: 1rem; flex: 1; }
nav a { text-decoration: none; color: var(--color-muted); padding: .25rem .5rem; border-bottom: 2px solid transparent; }
nav a.active { color: var(--color-text); border-color: var(--color-accent); }
select, textarea, button { font: inherit; color: inherit; }
select, textarea { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 8px; padding: .5rem .75rem; }
textarea { width: 100%; resize: vertical; min-height: 5rem; }
main { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 1.5rem 1.25rem; }
h1 { margin-top: 0; }
.muted { color: var(--color-muted); }
.panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.avatars { display: flex; gap: .75rem; flex-wrap: wrap; margin: .5rem 0 1rem; border: 0; padding: 0; }
.avatar-opt { position: relative; cursor: pointer; }
.avatar-opt input { position: absolute; opacity: 0; }
.avatar-opt img { width: 96px; height: 96px; border-radius: 10px; border: 3px solid transparent; display: block; object-fit: cover; }
.avatar-opt input:checked + img { border-color: var(--color-accent); }
.avatar-opt input:focus-visible + img { outline: 2px solid var(--color-text); }
.avatar-opt small { display: block; text-align: center; font-size: .75rem; color: var(--color-muted); }
.btn { background: var(--color-accent); color: var(--color-accent-contrast); border: 0; border-radius: 8px; padding: .6rem 1.2rem; cursor: pointer; font-weight: 600; }
.btn.secondary { background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text); }
.btn:disabled { opacity: .6; cursor: progress; }
.error { color: var(--color-danger); margin: .5rem 0 0; min-height: 1.5em; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.compare { position: relative; width: 100%; max-width: 480px; aspect-ratio: 1; margin: .5rem auto; border-radius: var(--radius); overflow: hidden; background: #000; user-select: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.compare .after { clip-path: inset(0 0 0 50%); }
.compare .divider { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; left: 50%; pointer-events: none; }
.compare .tag { position: absolute; top: .5rem; padding: .1rem .5rem; background: rgba(0,0,0,.6); border-radius: 6px; font-size: .8rem; }
.compare .tag.l { left: .5rem; } .compare .tag.r { right: .5rem; }
.compare input[type=range] { position: absolute; left: 0; right: 0; bottom: .5rem; width: calc(100% - 2rem); margin: 0 1rem; }
.sbs { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; max-width: 760px; margin: .75rem auto; }
.sbs figure { margin: 0; text-align: center; }
.sbs img { width: 100%; border-radius: var(--radius); background: #000; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer; }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #000; }
.card div { padding: .6rem .75rem; }
.card p { margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card time { font-size: .8rem; color: var(--color-muted); }
dialog { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--radius); max-width: 640px; width: calc(100% - 2rem); }
dialog::backdrop { background: rgba(0,0,0,.7); }
.footer { text-align: center; padding: 1rem; color: var(--color-muted); font-size: .85rem; border-top: 1px solid var(--color-border); }
@media (max-width: 600px) { .topbar { gap: .75rem; } .sbs { grid-template-columns: 1fr; } }
