:root {
  --bg: #161719;
  --card: #1e1f22;
  --border: #2e2f33;
  --text: #ece9e4;
  --muted: #8e8b86;
  --accent: #c9ad7f;
  --danger: #d97070;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", -apple-system, Segoe UI, sans-serif;
  line-height: 1.5;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 28px;
  background: rgba(22, 23, 25, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.brand span { color: var(--muted); font-weight: 400; }

.tabs { display: flex; gap: 6px; }

.tab {
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.tab.active {
  color: var(--accent);
  border-color: rgba(201, 173, 127, 0.35);
  background: rgba(201, 173, 127, 0.1);
}

.status {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.status.bad { color: var(--danger); }

.panel {
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

h2 { margin: 0; font-size: 17px; font-weight: 600; }

.hint { margin: 0; font-size: 12px; color: var(--muted); }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

input, select, textarea {
  background: #17181a;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-transform: none;
  letter-spacing: normal;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; }
.mono { font-family: "JetBrains Mono", Consolas, monospace; font-size: 13px; }

.row { display: flex; gap: 14px; }
.row > label { flex: 1; }
.row.spread { justify-content: space-between; align-items: center; }
.grow { flex: 1; }

button {
  border-radius: 999px;
  padding: 13px 24px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border: 1px solid transparent;
}
button:disabled { opacity: 0.5; cursor: default; }

.primary { background: var(--accent); color: #171410; }
.secondary { background: none; border-color: rgba(201, 173, 127, 0.4); color: var(--accent); }
.danger { background: none; border-color: rgba(217, 112, 112, 0.4); color: var(--danger); }
.small { padding: 8px 16px; font-size: 11px; }

/* Ask for changes without starting over. */
.feedback {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* Image options — click one to choose it. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.option {
  margin: 0;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  line-height: 0;
}
.option img { width: 100%; display: block; }
.option:hover { border-color: rgba(201, 173, 127, 0.5); }
.option.chosen { border-color: var(--accent); }
.option.branding { opacity: 0.5; }
.option.branding::after {
  content: "Adding logo…";
  background: var(--card);
  color: var(--accent);
}
.dim { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: normal; }
.option.chosen::after {
  content: "Chosen";
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #171410;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.4;
}

.warn {
  font-size: 12px;
  color: var(--muted);
  background: rgba(201, 173, 127, 0.08);
  border: 1px solid rgba(201, 173, 127, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
}

/* The preview: the post as a reader will meet it. */
.preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-height: 620px;
  overflow-y: auto;
}
.preview .cover {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 22px;
}
.preview .kicker {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.preview h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 600;
}
.preview .byline {
  margin: 0 0 26px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.preview h2 { font-size: 21px; margin: 26px 0 10px; font-weight: 600; }
.preview h3 { font-size: 17px; margin: 20px 0 8px; font-weight: 600; }
.preview p { margin: 0 0 14px; font-size: 15px; color: #d8d4cd; }
.preview ul, .preview ol { margin: 0 0 14px; padding-left: 20px; color: #d8d4cd; font-size: 15px; }
.preview li { margin-bottom: 6px; }
.preview a { color: var(--accent); }
.preview blockquote {
  margin: 0 0 14px;
  padding-left: 14px;
  border-left: 2px solid rgba(201, 173, 127, 0.5);
  color: var(--muted);
  font-style: italic;
}
.preview .tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.preview .tags span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

.result { font-size: 13px; color: var(--accent); margin: 0; }
.result a { color: var(--accent); }

.list { display: flex; flex-direction: column; gap: 8px; }

.post {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.post-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.post-main a { color: var(--text); text-decoration: none; font-size: 14px; }
.post-main a:hover { color: var(--accent); }
.meta {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Login */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.login { width: 100%; max-width: 380px; }
.login .brand { font-size: 20px; margin-bottom: 2px; }
.error { color: var(--danger); font-size: 13px; margin: 0; }
code {
  background: #17181a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12px;
}

/* Tab badge for the review queue */
.badge {
  display: inline-block;
  margin-left: 6px;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #171410;
  font-size: 10px;
  font-weight: 700;
}

/* Automation */
.switch {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: normal;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }

.quotas { display: flex; flex-direction: column; gap: 8px; }
.quota {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-transform: none;
  letter-spacing: normal;
  font-size: 14px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.quota input { width: 80px; text-align: center; }
.quota.off { opacity: 0.4; }

/* Pinterest */
.pin-image { max-width: 260px; width: 100%; border-radius: 12px; display: block; margin: 12px 0; }
.pin-account {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.pin-account-id { font-weight: 600; min-width: 150px; }
.pin-board { width: 220px; }

.failed { color: var(--danger); font-size: 13px; }

/* Review queue */
.queued {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  flex-wrap: wrap;
}
.queued > img {
  width: 130px;
  height: 86px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}
.queued-main { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 220px; }
.queued-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.queued .preview { flex-basis: 100%; margin-top: 12px; max-height: 380px; }

.hidden { display: none; }
