:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --text: #e7ecf1;
  --muted: #8b9aab;
  --accent: #3d9cfd;
  --ok: #3ecf8e;
  --bad: #f07178;
  --line: #2a3542;
  --font: "Segoe UI", system-ui, sans-serif;
  --mono: Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, #1b2838, var(--bg));
  color: var(--text);
  min-height: 100vh;
}
.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}
.brand {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.8rem;
}
h1 {
  margin: 0.35rem 0 0.4rem;
  font-size: 1.8rem;
  font-weight: 650;
}
.sub { margin: 0; color: var(--muted); }
.panel {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  background: color-mix(in srgb, var(--panel) 92%, black);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mono {
  font-family: var(--mono);
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}
.muted { color: var(--muted); font-size: 0.85rem; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
button {
  margin-top: 0.75rem;
  background: var(--accent);
  color: #041018;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
textarea {
  width: 100%;
  background: #10161d;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem;
  font: inherit;
  resize: vertical;
}
input[type="password"],
input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  background: #10161d;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem;
  font: inherit;
}
a.muted { color: var(--muted); }
.row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.links {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.6;
}
code {
  font-family: var(--mono);
  font-size: 0.86em;
}
.draft-topic { margin: 0.4rem 0 0.75rem; }
.variant {
  margin-top: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10161d;
  height: 100%;
  box-sizing: border-box;
}
.variant-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
@media (min-width: 900px) {
  .variant-pair {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}
.variant.recommended {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}
.variant-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.variant-head strong { font-size: 0.92rem; }
.badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.btn-copy {
  margin-top: 0;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
}
.variant-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}
.images-title {
  margin: 1rem 0 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.image-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10161d;
  padding: 0.65rem;
}
.image-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.image-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #0a0e12;
}
.image-card .row { margin-top: 0.5rem; }
a.linkish {
  display: inline-block;
  text-decoration: none;
  background: #243040;
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.score-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.35rem 0 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: #0c1218;
  border: 1px solid var(--line);
}
.score-num {
  font-size: 0.88rem;
  font-weight: 700;
}
.score-note {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}
.score-hi .score-num { color: #6dcaa0; }
.score-mid .score-num { color: #d4b56a; }
.score-lo .score-num { color: #d4886a; }
.badge.pending {
  background: color-mix(in srgb, #d4b56a 30%, transparent);
  color: #d4b56a;
}
.regen-box {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.regen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.regen-note {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0a0e12;
  color: var(--text);
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.86rem;
  resize: vertical;
  min-height: 2.6rem;
}
.btn-regen {
  align-self: flex-start;
  background: #2a3544;
}
.btn-cancel {
  background: #3a2a2a;
  color: #e8b4b4;
}
.draft-block {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c1218;
}
.draft-block-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.draft-block-title {
  margin: 0;
  font-size: 1.05rem;
}
.draft-block-meta {
  font-size: 0.82rem;
  line-height: 1.4;
}
.draft-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.draft-block-body {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.draft-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  margin: 0.75rem 0;
}
.btn-publish {
  background: #243a2a;
  color: #b6e0c4;
}
.draft-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.mode-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mode-badge.mode-qt {
  background: #2a3a55;
  color: #9ec1ff;
}
.mode-badge.mode-post {
  background: #2a4436;
  color: #9ed9b4;
}
.draft-type-line {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.92rem;
}
.variant-edit {
  width: 100%;
  box-sizing: border-box;
  margin: 0.35rem 0 0.45rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0a0e12;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  resize: vertical;
  min-height: 8rem;
}
.btn-save {
  background: #2a4050;
}
