:root {
  --bg: #12110f; --surface: #1a1815; --field: #0e0d0b; --line: #2e2a24; --text: #efe9dd; --muted: #a8a093;
  --accent: #ff5a2a; --ok: #6fc2a6; --danger: #ff7a6b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Inter Tight", system-ui, sans-serif; }
::selection { background: var(--accent); color: #1a0b05; }
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line); }
.bar-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; }
.bar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.bar nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); }
.bar nav a:hover { color: var(--text); background: var(--surface); }
.bar nav a.on { color: var(--text); background: var(--surface); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 80px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.sub { margin: 56px 0 16px; font-size: 18px; }

.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--text); color: var(--bg); border: 0; border-radius: 10px; padding: 11px 18px; font: 600 15px/1 inherit; font-family: inherit; text-decoration: none; cursor: pointer; }
.btn:hover { background: #fff; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
.link.danger:hover { color: var(--danger); }
.icon { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; width: 32px; height: 32px; display: inline-grid; place-items: center; cursor: pointer; }
.icon:hover { color: var(--text); border-color: var(--muted); }
.inline { display: inline; margin: 0; }

.notice { background: color-mix(in oklab, var(--ok) 14%, var(--bg)); color: #bfe6d8; padding: 12px 16px; border-radius: 10px; margin: 0 0 20px; }
.alert { background: color-mix(in oklab, var(--danger) 14%, var(--bg)); color: #ffc6bd; padding: 12px 16px; border-radius: 10px; margin: 0 0 20px; }
.alert p { margin: 0; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); border: 1px solid transparent; }
.tabs a.on { border-color: var(--line); color: var(--text); }

.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tr:hover td { background: var(--surface); }
.r { text-align: right; } .nowrap { white-space: nowrap; }
.list td.r .inline + .inline, .list td.r .link + .inline { margin-left: 8px; }
.row-title { display: flex; align-items: center; gap: 12px; }
.row-title a { font-weight: 600; text-decoration: none; }
.row-title a:hover { text-decoration: underline; }
.thumb { width: 56px; height: 36px; border-radius: 6px; background: var(--surface); overflow: hidden; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--muted); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.warn { display: block; color: #e9c15c; font-size: 12.5px; }
.tag { font-size: 12.5px; padding: 3px 8px; border-radius: 6px; background: var(--surface); color: var(--muted); }
.tag.ok { color: var(--ok); }
.empty-state { padding: 48px 0; color: var(--muted); }

.form { display: grid; gap: 20px; max-width: 760px; }
.form.narrow { max-width: 420px; }
.form label, .upload { display: grid; gap: 7px; font-weight: 500; }
.form small, .lbl small { font-weight: 400; color: var(--muted); margin-left: 6px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea {
  width: 100%; background: var(--field); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; font: 15px/1.45 inherit; font-family: inherit;
}
input:hover, textarea:hover { border-color: #443e36; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent); }
textarea { resize: vertical; }
.mono-ta { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13.5px; }
input[type=file] { color: var(--muted); }
input[type=file]::file-selector-button { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-right: 12px; font: inherit; cursor: pointer; }
.check { display: flex !important; align-items: center; gap: 10px; font-weight: 400 !important; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 17px; height: 17px; }
.cols { display: flex; gap: 16px; } .grow { flex: 1; } .w-year { width: 110px; }
.cats { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cats legend { font-weight: 500; margin-bottom: 8px; padding: 0; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); cursor: pointer; font-weight: 500; }
.seg input:checked + span { background: var(--text); color: var(--bg); border-color: var(--text); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cover-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.cover-prev { width: 200px; aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; }
.gal { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gal li { display: grid; gap: 6px; font-weight: 400; }
.gal img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; }
.actions { display: flex; align-items: center; gap: 20px; margin-top: 4px; }

/* Campos por categoria */
.only-prompts { display: none !important; }
#f[data-cat=prompts] .only-prompts { display: grid !important; }
#f[data-cat=prompts] .not-prompts { display: none; }

/* Login / instalação */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-box { width: min(400px, 100%); }
.auth-box h1 { margin-bottom: 20px; }
.auth-box form { display: grid; gap: 16px; }
.auth-box label { display: grid; gap: 7px; font-weight: 500; }
.auth-box p { color: var(--muted); }

@media (max-width: 640px) {
  .list thead { display: none; }
  .list tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .list td { border: 0; padding: 0; }
  .list td:first-child { grid-column: 1 / -1; }
  .cols { flex-direction: column; } .w-year { width: 100%; }
}
