:root {
  --bg: #000;
  --ink: #fff;
  --muted: #a8a8a8;
  --line: #262626;
  --panel: #111;
  --gold: #ffab47;
  --gold-ink: #1a1200;
  --warn: #ff6b6b;
  --ok: #7ed491;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 2rem; font-weight: 600; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 600; margin: 2.5rem 0 .75rem; }
h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .4rem; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.15rem; color: #ddd; margin-bottom: 1.5rem; }
.muted { color: var(--muted); }
.gold-text { color: var(--gold); }
.small { font-size: .85rem; }
b { font-weight: 600; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--panel); padding: .75rem; border-radius: 6px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.25rem 2rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { color: var(--ink); font-weight: 600; letter-spacing: .02em; }
.brand span { color: var(--muted); font-weight: 400; margin-left: .5rem; }
.brand:hover { text-decoration: none; }
.top nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.top nav a { color: #ccc; padding: .25rem 0; border-bottom: 2px solid transparent; }
.top nav a.on, .top nav a:hover { color: var(--ink); border-bottom-color: var(--gold); text-decoration: none; }
.top nav a.admin { color: var(--gold); }
.top nav b { color: var(--gold); }

.wrap { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 2.5rem 2rem 4rem; }
.narrow { max-width: 640px; }
.foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.25rem 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

.flash { padding: .85rem 1.1rem; border-radius: 8px; margin-bottom: 1.5rem; border: 1px solid var(--line); background: var(--panel); }
.flash.ok { border-color: #2b4a33; }
.flash.warn { border-color: #5a2a2a; color: #ffd0d0; }
.flash a { color: var(--gold); }

.stack { display: flex; flex-direction: column; gap: 1.1rem; }
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; }
input[type=text], input[type=email], textarea, select { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid #333; border-radius: 8px; padding: .7rem .85rem; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
input:disabled { color: var(--muted); }
input.code { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
input[type=file] { color: #ddd; }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; color: var(--ink); background: transparent; border: 1px solid #555; border-radius: 999px; padding: .5rem 1.1rem; margin-right: .75rem; cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--gold); }
.stack > .btn, .stack > button { align-self: flex-start; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem 1.5rem 1.5rem; margin: 0; }
legend { padding: 0 .5rem; font-weight: 600; color: var(--gold); }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.row-form { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.row-form label { flex: 1 1 200px; }
form.inline { display: inline; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }

.btn { display: inline-block; font: inherit; font-weight: 500; color: var(--ink); background: transparent; border: 1px solid #555; border-radius: 999px; padding: .65rem 1.4rem; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn.gold:hover { background: #ffbd6b; }
.btn.small { padding: .35rem .9rem; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: default; }
button.link { font: inherit; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
button.link:hover { color: var(--warn); }

.table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.table th, .table td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .note { max-width: 320px; white-space: pre-wrap; }
.plus { color: var(--ok); }
.minus { color: var(--ink); }

.status { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .85rem; border: 1px solid #444; }
.status.big { font-size: 1rem; padding: .3rem .9rem; }
.status.queued { color: var(--muted); }
.status.running { color: var(--gold); border-color: var(--gold); }
.status.done { color: var(--ok); border-color: #2b4a33; }
.status.failed { color: var(--warn); border-color: #5a2a2a; }
.status.sent_to_studio { color: #9ec5ff; border-color: #2a3a5a; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; color: var(--ink); }
.card.tool img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin-bottom: 1rem; }
a.card:hover { border-color: var(--gold); text-decoration: none; }
.card.soon { color: var(--muted); border-style: dashed; }
.card p { margin-bottom: .4rem; }

.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.preset { position: relative; display: block; cursor: pointer; border: 2px solid var(--line); border-radius: 12px; padding: .75rem; background: var(--panel); font-weight: 400; }
.preset input { position: absolute; opacity: 0; }
.preset img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; display: block; margin-bottom: .6rem; }
.preset b { display: block; }
.preset span { color: var(--muted); font-size: .9rem; }
.preset:has(input:checked) { border-color: var(--gold); }
.preset:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.brand-fields { display: none; gap: 1rem; margin-top: 1rem; }
.brand-fields.show { display: flex; }
.brand-fields label { flex: 1; }
.swatch { display: inline-block; padding: 0 .5rem; border-radius: 4px; font-size: .85rem; font-weight: 600; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; margin: 0 0 1.5rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts dd.big { font-size: 1.5rem; font-weight: 600; color: var(--gold); }

.progress { margin-top: 1rem; background: var(--panel); border-radius: 999px; height: 1.5rem; position: relative; overflow: hidden; border: 1px solid var(--line); }
.progress .bar { height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.progress span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .85rem; color: var(--ink); }

details.studio { margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: 1.25rem; }
details.studio summary { cursor: pointer; color: var(--gold); font-weight: 500; margin-bottom: 1rem; }
.quote { background: var(--panel); padding: 1rem; border-radius: 8px; white-space: pre-wrap; }

@media (max-width: 760px) {
  .top { padding: 1rem; }
  .wrap { padding: 1.5rem 1rem 3rem; }
  .cols { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; }
  h1 { font-size: 1.6rem; }
}
