* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --line: #ececea;
  --line-strong: #dcdcd7;
  --ink: #0e0a1f;
  --ink-2: #4a4258;
  --ink-3: #88829a;
  --ink-4: #b5b0c2;
  --accent: #0066FF;
  --accent-2: #0066FF;
  --accent-3: #0066FF;
  --accent-soft: #e8f0ff;
  --hover: #f5f5f3;
  --green: #1f9d55;
  --green-soft: #e6f3ec;
  --amber: #c47700;
  --red: #c43d3d;
  --blue: #1968c4;
  --purple: #6b3ec4;
  --grad-cta: linear-gradient(180deg, #0066FF 0%, #0052cc 100%);
  --grad-hero: radial-gradient(900px 380px at 12% 0%, #e8f0ff 0%, #f8f5ff 40%, #ffffff 70%),
               linear-gradient(180deg, #f7faff 0%, #ffffff 100%);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}
html, body, #root { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: #fbfbf9;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  gap: 2px;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 14px;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #dce8f5;
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark-img { width: 26px; height: 26px; object-fit: contain; display: block; }
.brand-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--ink-3); margin-top: 0; line-height: 1.2; }

.new-article-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--grad-cta); color: #fff; border: none;
  padding: 11px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  letter-spacing: -0.005em;
  margin: 4px 4px 14px;
  box-shadow: 0 6px 18px -6px rgba(0,102,255,0.55), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.new-article-btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 10px 22px -6px rgba(0,102,255,0.6), inset 0 1px 0 rgba(255,255,255,0.3); }
.new-article-btn:active { transform: scale(0.97) translateY(0); }

.nav-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-4); font-weight: 600;
  padding: 6px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s, color 0.15s, transform 0.1s var(--ease-out);
  border: none; background: transparent; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item:active { transform: scale(0.98); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active svg { color: var(--accent); }
.nav-item .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.nav-item.active .count { color: var(--ink-2); }
.nav-item svg { color: var(--ink-3); flex-shrink: 0; }
.nav-item.active svg.legacy-active-rule { color: var(--ink); }

.nav-divider { height: 1px; background: var(--line); margin: 3px 4px; }

.nav-parent-row {
  display: flex;
  align-items: center;
  border-radius: 7px;
  transition: background 0.12s;
}
.nav-parent-row:hover { background: var(--hover); }
.nav-parent-row.active { background: var(--accent-soft); }
.nav-parent-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 7px 4px 7px 10px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  min-width: 0;
}
.nav-parent-row.active .nav-parent-label { color: var(--accent); font-weight: 600; }
.nav-parent-label svg { color: var(--ink-3); flex-shrink: 0; }
.nav-parent-row.active .nav-parent-label svg { color: var(--accent); }
.nav-parent-label .count { margin-left: auto; font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.nav-parent-row.active .nav-parent-label .count { color: var(--ink-2); }
.nav-chev-btn {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex-shrink: 0; margin-right: 3px;
  border: none; background: transparent; cursor: pointer;
  color: var(--ink-4); border-radius: 5px;
  transition: color 0.12s, background 0.12s;
}
.nav-chev-btn:hover { color: var(--ink-2); background: rgba(0,0,0,0.04); }
.nav-chev-btn svg { transition: transform 0.15s; }
.nav-chev-closed svg { transform: rotate(-90deg); }

.nav-subitems { display: flex; flex-direction: column; padding-left: 28px; gap: 1px; margin-bottom: 2px; }
.nav-subitem {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 6px;
  font-size: 12.5px; color: var(--ink-3);
  border: none; background: transparent; cursor: pointer;
  text-align: left; width: 100%;
  transition: background 0.1s, color 0.1s;
}
.nav-subitem:hover { background: var(--hover); }
.nav-subitem.active { background: var(--accent-soft); font-weight: 600; }
.nav-subitem .count { margin-left: auto; font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.nav-subitem.active .count { color: var(--ink-2); }

/* Colored dot */
.nav-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; flex-shrink: 0; background: var(--ink-4);
}

/* Article sub-item colors */
.nav-si-drafts { color: var(--ink-3); }
.nav-si-drafts .nav-dot { background: #bbb9c4; }
.nav-si-drafts:hover { color: var(--ink-2); }
.nav-si-drafts.active { color: var(--ink-2); }
.nav-si-drafts.active .nav-dot { background: #888; }

.nav-si-ready { color: var(--green); }
.nav-si-ready .nav-dot { background: var(--green); }
.nav-si-ready:hover { color: var(--green); }
.nav-si-ready.active { color: var(--green); }

.nav-si-inprod { color: var(--blue); }
.nav-si-inprod .nav-dot { background: var(--blue); }
.nav-si-inprod:hover { color: var(--blue); }
.nav-si-inprod.active { color: var(--blue); }

/* Creative sub-item colors */
.nav-si-c-ready { color: var(--blue); }
.nav-si-c-ready .nav-dot { background: var(--blue); }
.nav-si-c-ready:hover { color: var(--blue); }
.nav-si-c-ready.active { color: var(--blue); }

.nav-si-c-in_test { color: var(--amber); }
.nav-si-c-in_test .nav-dot { background: #e8a330; }
.nav-si-c-in_test:hover { color: var(--amber); }
.nav-si-c-in_test.active { color: var(--amber); }

.nav-si-c-tested { color: var(--purple); }
.nav-si-c-tested .nav-dot { background: var(--purple); }
.nav-si-c-tested:hover { color: var(--purple); }
.nav-si-c-tested.active { color: var(--purple); }

.nav-si-c-winner { color: #8B6914; }
.nav-si-c-winner .nav-dot { background: #d4a017; }
.nav-si-c-winner:hover { color: #8B6914; }
.nav-si-c-winner.active { color: #8B6914; }

.nav-new-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 10px; margin: 3px 0 2px;
  border-radius: 8px; font-size: 12.5px;
  color: var(--accent); font-weight: 600;
  border: 1px solid rgba(0,102,255,0.4); background: transparent; cursor: pointer;
  text-align: center; width: 100%;
  transition: background 0.12s, color 0.12s;
}
.nav-new-btn:hover { background: var(--accent-soft); }
.nav-new-btn:active { opacity: 0.85; }
.nav-new-btn svg { color: var(--accent); flex-shrink: 0; }

.sidebar-spacer { flex: 1; }

.quota-card {
  margin: 8px 6px 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.quota-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.quota-label { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.quota-val { font-size: 11px; color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.quota-bar {
  height: 4px; background: #efefec; border-radius: 99px; overflow: hidden;
}
.quota-bar-fill {
  height: 100%; background: var(--ink); border-radius: 99px;
  transition: width 0.3s;
}
.quota-note { font-size: 10.5px; color: var(--ink-3); margin-top: 7px; }

.user-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px;
  margin-top: 6px;
  border-radius: 8px;
  cursor: pointer;
}
.user-row:hover { background: var(--hover); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #d8c3ff, #f7c6c6);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: #4a3478;
}
.user-name { font-size: 12px; font-weight: 500; }
.user-role { font-size: 10.5px; color: var(--ink-3); }

/* ---------- Main ---------- */
.main {
  overflow-y: auto;
  position: relative;
}
.main-inner { padding: 28px 36px 120px; max-width: 1400px; margin-left: auto; margin-right: auto; }

/* ---------- Gradient hero panel ---------- */
.hero-panel {
  position: relative;
  background: var(--grad-hero);
  border: 1px solid #d6e4ff;
  border-radius: 22px;
  padding: 40px 44px 44px;
  margin: 4px 0 26px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 12px 40px -22px rgba(0,102,255,0.25);
}
.hero-panel::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 70%; height: 60%;
  background: radial-gradient(closest-side, rgba(0,102,255,0.06), transparent 70%);
  pointer-events: none; border-top-right-radius: inherit;
}
.hero-panel::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 60%; height: 70%;
  background: radial-gradient(closest-side, rgba(0,102,255,0.05), transparent 70%);
  pointer-events: none; border-bottom-left-radius: inherit;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid #d6e4ff;
  padding: 4px 10px 4px 6px; border-radius: 99px;
  font-size: 11px; color: var(--accent); font-weight: 600;
  letter-spacing: 0.02em; text-transform: uppercase;
  margin-bottom: 14px; position: relative; z-index: 1;
}
.hero-eyebrow .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--grad-cta);
}
.hero-headline {
  font-size: 34px; font-weight: 700; letter-spacing: -0.028em;
  line-height: 1.08; max-width: 720px; position: relative; z-index: 1;
}
.hero-headline .grad-text {
  color: var(--accent);
}
.hero-sub {
  font-size: 14px; color: var(--ink-2); margin-top: 10px; max-width: 640px;
  position: relative; z-index: 1;
}
.hero-prompt-row {
  margin-top: 22px; display: flex; gap: 10px; align-items: stretch;
  position: relative; z-index: 5;
}
.hero-prompt-input {
  flex: 1; background: #fff; border: 1px solid #c7d8ff;
  border-radius: 12px; padding: 14px 18px;
  font-size: 14px; outline: none; color: var(--ink);
  box-shadow: 0 4px 14px -8px rgba(0,102,255,0.18);
}
.hero-prompt-input::placeholder { color: var(--ink-3); }
.hero-prompt-input:focus { border-color: var(--accent); box-shadow: 0 4px 14px -6px rgba(0,102,255,0.3); }
.hero-prompt-btn {
  background: var(--grad-cta); color: #fff; border: none;
  padding: 0 22px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 8px 22px -8px rgba(0,102,255,0.55), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.15s, filter 0.15s;
}
.hero-prompt-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.hero-prompt-btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .hero-prompt-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
}
.hero-suggestions {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-top: 14px; position: relative; z-index: 1;
}
.hero-suggestion {
  background: rgba(255,255,255,0.7); backdrop-filter: blur(10px);
  border: 1px solid #d6e4ff; border-radius: 12px;
  padding: 12px 14px; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  text-align: left;
}
.hero-suggestion:hover { transform: translateY(-2px); border-color: #a9c2ff; background: #fff; }
.hero-suggestion .sg-title {
  font-size: 13px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.hero-suggestion .sg-cat-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.hero-suggestion .sg-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

/* ---------- Stat strip ---------- */
.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 22px;
}
.stat-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px;
  position: relative; overflow: hidden;
}
.stat-card .sc-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-3); font-weight: 600;
}
.stat-card .sc-value {
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em;
  margin-top: 6px; line-height: 1;
}
.stat-card .sc-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.stat-card.sc-ready { background: linear-gradient(135deg, #ecf9f1, #ffffff 60%); border-color: #cce8d8; }
.stat-card.sc-ready .sc-value { color: #16703b; }
.stat-card.sc-draft { background: linear-gradient(135deg, #fff6e0, #ffffff 60%); border-color: #f0dfb4; }
.stat-card.sc-draft .sc-value { color: #8a5708; }
.stat-card.sc-prod  { background: linear-gradient(135deg, #e9f1fc, #ffffff 60%); border-color: #c8dcf6; }
.stat-card.sc-prod .sc-value { color: #1a5fa5; }
.stat-card.sc-grad {
  background: linear-gradient(135deg, #e8f0ff, #ffffff 60%);
  border-color: #bdd0ff;
}
.stat-card.sc-grad .sc-value { color: var(--accent); }

body.no-hero .hero-panel { display: none; }
body.no-stat-strip .stat-strip { display: none; }

/* ---------- Home screen ---------- */
.home-inner { padding-top: 36px; }
.topic-search-wrap { flex: 1; position: relative; }

.topic-select-trigger {
  width: 100%; background: #fff; border: 1px solid #c7d8ff;
  border-radius: 12px; padding: 14px 18px;
  font-size: 14px; color: var(--ink-3);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; text-align: left;
  box-shadow: 0 4px 14px -8px rgba(0,102,255,0.18);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.topic-select-trigger:hover { border-color: var(--accent); }
.topic-select-trigger.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.topic-select-trigger .tst-placeholder { color: var(--ink-2); font-weight: 500; }
.topic-select-trigger svg { color: var(--ink-3); }

.topic-picked {
  width: 100%; background: #fff; border: 1px solid var(--accent);
  border-radius: 12px; padding: 12px 14px 12px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; text-align: left;
  box-shadow: 0 4px 14px -8px rgba(0,102,255,0.25);
  transition: filter 0.15s;
}
.topic-picked:hover { filter: brightness(0.99); }
.tp-title { font-size: 14px; font-weight: 600; color: var(--ink); flex: 1; }
.tp-meta { display: inline-flex; align-items: center; gap: 8px; }
.tp-ads { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tp-clear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  color: var(--ink-3); cursor: pointer;
}
.tp-clear:hover { background: var(--hover); color: var(--ink); }

.topic-search-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 16px 40px -14px rgba(0,0,0,0.18);
  z-index: 100; overflow: hidden;
}
.topic-search-wrap { z-index: 50; }
.topic-search-input-row {
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line); padding: 4px 10px;
}
.topic-search-input {
  flex: 1; border: none; outline: none; padding: 10px 4px;
  font-size: 13.5px; background: transparent; color: var(--ink);
}
.topic-search-input::placeholder { color: var(--ink-3); }
.tsi-clear {
  background: none; border: none; padding: 4px;
  color: var(--ink-3); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
}
.tsi-clear:hover { background: var(--hover); color: var(--ink); }
.topic-search-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.topic-search-item {
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
}
.topic-search-item.active, .topic-search-item:hover { background: var(--accent-soft); }
.ts-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ts-title { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.ts-count { display: inline-flex; align-items: baseline; gap: 4px; flex-shrink: 0; }
.ts-count-num { font-size: 14px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.ts-count-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); }
.ts-meta { display: flex; gap: 8px; align-items: center; }
.ts-meta-text { font-size: 11.5px; color: var(--ink-3); }
.topic-search-empty { padding: 20px; text-align: center; color: var(--ink-3); font-size: 12.5px; }

.hero-helper {
  margin-top: 14px; font-size: 12.5px; color: var(--ink-3);
  position: relative; z-index: 1;
}
.link-btn {
  background: none; border: none; padding: 0;
  color: var(--accent); font-weight: 500; font-size: inherit;
  text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { filter: brightness(0.9); }

.home-section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin: 36px 0 16px;
}
.home-section-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.home-section-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

.home-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.home-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px 14px;
  text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px; min-height: 150px;
  transition: transform 0.2s var(--ease-out), border-color 0.15s, box-shadow 0.2s var(--ease-out);
  animation: cardEnter 0.4s var(--ease-out) backwards;
}
.home-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px -16px rgba(var(--accent-rgb, 0,102,255), 0.35);
}
.home-card:active { transform: translateY(0) scale(0.98); }
.home-cards .home-card:nth-child(1) { animation-delay: 0ms; }
.home-cards .home-card:nth-child(2) { animation-delay: 55ms; }
.home-cards .home-card:nth-child(3) { animation-delay: 110ms; }
.home-cards .home-card:nth-child(4) { animation-delay: 165ms; }
.home-cards .home-card:nth-child(5) { animation-delay: 220ms; }
.home-cards .home-card:nth-child(6) { animation-delay: 275ms; }
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hc-top { display: flex; align-items: center; justify-content: space-between; }
.hc-count {
  display: inline-flex; align-items: baseline; gap: 4px;
  color: var(--ink-2);
}
.hc-count-num { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--accent); }
.hc-count-label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.hc-title {
  font-size: 14.5px; font-weight: 600; line-height: 1.3;
  color: var(--ink); flex: 1;
}
.hc-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 4px; border-top: 1px solid var(--line);
  margin-top: auto;
}
.hc-meta { font-size: 11.5px; color: var(--ink-3); }
.hc-cta { font-size: 12px; color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.home-empty {
  grid-column: 1 / -1; padding: 40px; text-align: center;
  color: var(--ink-3); font-size: 13px;
  background: #fff; border: 1px dashed var(--line-strong); border-radius: 12px;
}

/* Pipeline stats strip */
/* Hero two-card layout */
.hero-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 22px; position: relative; z-index: 5;
}
.hero-card {
  background: #fff; border: 1px solid #c7d8ff;
  border-radius: 14px; padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 4px 14px -8px rgba(0,102,255,0.12);
}
.hero-card-type {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--ink);
}
.hero-card-type svg { color: var(--accent); }
.hero-card-desc { font-size: 12px; color: var(--ink-3); margin-top: -4px; }
.hero-card-btn {
  width: 100%; justify-content: center; margin-top: 2px;
}

.home-pipeline {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 24px;
  margin-bottom: 4px;
  display: flex; gap: 0; align-items: stretch;
}
.hp-group { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.hp-group-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-4);
}
.hp-stats-row { display: flex; align-items: center; gap: 0; flex: 1; }
.hp-section-divider { width: 1px; background: var(--line); flex-shrink: 0; margin: 0 24px; }
.hp-stat { flex: 1; text-align: center; }
.hp-num { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); line-height: 1.1; }
.hp-label { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.hp-divider { width: 1px; height: 40px; background: var(--line); flex-shrink: 0; }

/* Category breakdown grid */
.home-cat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.home-cat-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px 14px;
  display: flex; flex-direction: column; gap: 10px;
  animation: cardEnter 0.4s var(--ease-out) backwards;
}
.home-cat-grid .home-cat-card:nth-child(1) { animation-delay: 0ms; }
.home-cat-grid .home-cat-card:nth-child(2) { animation-delay: 40ms; }
.home-cat-grid .home-cat-card:nth-child(3) { animation-delay: 80ms; }
.home-cat-grid .home-cat-card:nth-child(4) { animation-delay: 120ms; }
.home-cat-grid .home-cat-card:nth-child(5) { animation-delay: 160ms; }
.home-cat-grid .home-cat-card:nth-child(6) { animation-delay: 200ms; }
.home-cat-grid .home-cat-card:nth-child(7) { animation-delay: 240ms; }
.home-cat-grid .home-cat-card:nth-child(8) { animation-delay: 280ms; }
.hcc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hcc-campaign-name {
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  line-height: 1.3;
  flex: 1; min-width: 0;
}
.hcc-ads { display: inline-flex; align-items: baseline; gap: 2px; }
.hcc-ads-num { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--accent); }
.hcc-ads-label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.hcc-bar-wrap {
  height: 4px; background: var(--line); border-radius: 99px; overflow: hidden;
}
.hcc-bar { height: 100%; background: var(--green); border-radius: 99px; transition: width 0.6s var(--ease-out); min-width: 2px; }
.hcc-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hcc-stat { font-size: 11.5px; color: var(--ink-3); }
.hcc-sep { font-size: 11px; color: var(--ink-4); }

/* Top bar of main */
.main-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px;
}
.page-title { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.page-sub { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; }
.main-top-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  font-size: 12.5px;
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.12s, border-color 0.12s, transform 0.1s var(--ease-out);
}
.btn:hover { background: var(--hover); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary {
  background: var(--grad-cta); color: #fff; border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px -4px rgba(0,102,255,0.5), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-primary:hover { filter: brightness(1.06); background: var(--grad-cta); }
.btn-ghost { background: transparent; border: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--hover); color: var(--ink); }
.btn-danger { color: var(--red); border-color: #ecd0d0; }
.btn-danger:hover { background: #fdf2f2; }
.btn-sm {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-weight: 500;
  transition: background 0.12s, color 0.12s, transform 0.1s var(--ease-out);
}
.btn-sm:hover { background: var(--hover); color: var(--ink); }
.btn-sm:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled, .btn-sm:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 14px; flex-wrap: wrap; width: 100%;
}
.pill {
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid transparent;
  background: #efefec;
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 5px;
  transition: background 0.12s, color 0.12s, transform 0.1s var(--ease-out);
}
.pill:hover { background: #e7e7e3; }
.pill:active { transform: scale(0.96); }
.pill.active { background: var(--ink); color: #fff; }
.pill .pill-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 11px;
  opacity: 0.7;
}
.pill.active .pill-count { opacity: 0.8; }

.filter-sep { color: var(--ink-4); margin: 0 6px; font-size: 11px; }

.dropdown {
  position: relative;
}
.dropdown-trigger {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-weight: 500;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%;
}
.dropdown-trigger:hover { background: var(--hover); }
.dropdown-menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  min-width: 180px;
  padding: 4px;
}
.dropdown-item {
  padding: 7px 10px;
  font-size: 12.5px;
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
}
.dropdown-item:hover { background: var(--hover); }
.dropdown-item.checked { font-weight: 500; }

.search-input {
  font-size: 12px;
  padding: 5px 12px 5px 30px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>") no-repeat 10px center;
  flex: 1;
  min-width: 0;
  outline: none;
  color: var(--ink);
}
.search-input:focus { border-color: var(--ink-3); }

/* ---------- View toggle ---------- */
.view-toggle { display: flex; gap: 2px; margin-left: 4px; }
.view-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: 7px;
  background: transparent; color: var(--ink-3);
  cursor: pointer; transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.view-toggle-btn:hover:not(.active) { color: var(--ink-2); background: var(--bg-2, #f3f3f0); }
.view-toggle-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Articles grid ---------- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 12px;
}
.article-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow 0.12s;
}
.article-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.article-card-thumb {
  aspect-ratio: 1;
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.article-card-cb {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.12s;
}
.article-card:hover .article-card-cb,
.article-card.selected .article-card-cb {
  opacity: 1;
}
.article-card.selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.article-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-card-thumb .mock-image { height: 100%; border-radius: 0; }
.article-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.article-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-tags { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.article-card-meta {
  font-size: 11px; color: var(--ink-4);
  display: flex; align-items: center; gap: 4px;
  margin-top: auto; padding-top: 2px;
}
.article-card-dot { opacity: 0.4; }
.compliance-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  color: #7a4b0c;
  background: #faeeda;
  border: 1px solid #f0d090;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 5px;
}

.disclaimer-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
  vertical-align: middle;
  cursor: default;
  position: relative;
  outline: none;
  margin-left: 8px;
}
.disclaimer-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: normal;
  width: 280px;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.disclaimer-badge:hover::after,
.disclaimer-badge:focus::after {
  opacity: 1;
}

/* ---------- Table ---------- */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.table-grid {
  display: grid;
  grid-template-columns: 38px 36px minmax(240px, 2.5fr) 130px 70px 110px 90px;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
}
.table-header {
  background: #fafaf8;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  font-weight: 600;
}
.table-header .sortable { cursor: pointer; user-select: none; }
.cb-cell {
  display: flex; align-items: center; justify-content: center;
  margin: -10px -7px; padding: 10px 7px;
  cursor: pointer;
  align-self: stretch;
}
.table-header .sortable:hover { color: var(--ink-2); }
.table-row {
  border-top: 1px solid var(--line);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.table-row:hover { background: #fafaf8; }
.row-archived .row-title { color: var(--text-muted); }
.row-archived { opacity: 0.75; }
.row-thumb {
  width: 36px; height: 36px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-thumb .mock-image { height: 100%; border-radius: 0; }
.table-row .row-title-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.table-row .row-title { font-weight: 500; color: var(--ink); }
.table-row .row-meta {
  font-size: 11px; color: var(--ink-4);
  font-family: 'JetBrains Mono', monospace;
}

/* row state accents — box-shadow set via inline style in JSX */

.table-empty {
  padding: 60px 24px; text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}

/* category tags */
.cat {
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.005em;
  width: fit-content;
  white-space: nowrap;
}
.cat-screen_time { background: #FEF0EB; color: #B84318; }
.cat-safety { background: #FDEBEB; color: #A32D2D; }
.cat-social_media { background: #EEEDFE; color: #534AB7; }
.cat-health_dev { background: #FAEEDA; color: #7A4B0C; }
.cat-behavior { background: #FDE8EE; color: #B5295A; }
.cat-first_phone { background: #E4F6EE; color: #176B47; }
.cat-age_guides { background: #FFF4D6; color: #8B6914; }
.cat-parenting_tips { background: #E6F1FB; color: #1A5FA5; }
.cat-health_development { background: #FAEEDA; color: #7A4B0C; }
.cat-behavior_changes { background: #FDE8EE; color: #B5295A; }

/* image progress */
.imgs { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.imgs.done { color: var(--green); font-weight: 500; }
.imgs.partial { color: #c47700; font-weight: 500; }
.imgs.none { color: var(--ink-4); }

/* status */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.s-new       { color: var(--ink-4); }
.s-new       .status-dot { background: #c8c8c4; }
.s-draft     { color: #b56e00; }
.s-draft     .status-dot { background: #e8a330; }
.s-reviewed  { color: var(--green); }
.s-reviewed  .status-dot { background: var(--green); }
.s-images_done { color: var(--purple); }
.s-images_done .status-dot { background: var(--purple); }
.s-ready     { color: var(--green); font-weight: 600; }
.s-ready     .status-dot { background: var(--green); }
.s-in_prod   { color: var(--blue); }
.s-in_prod   .status-dot { background: var(--blue); }

.ads-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.updated { font-size: 11.5px; color: var(--ink-4); white-space: nowrap; }

/* inline table selects */
.inline-sel-wrap { position: relative; display: inline-flex; }
.inline-sel-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none;
  border-radius: 6px;
  padding: 2px 4px 2px 3px;
  cursor: pointer;
  transition: background 0.1s;
}
.inline-sel-trigger:hover { background: var(--hover); }
.inline-sel-trigger > svg { color: var(--ink-4); opacity: 0; transition: opacity 0.1s; }
.inline-sel-trigger:hover > svg { opacity: 1; }
.creative-info .inline-sel-trigger { padding-left: 0; }
.inline-fixed-menu {
  position: fixed;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 8px 24px -4px rgba(0,0,0,0.13), 0 2px 6px -2px rgba(0,0,0,0.07);
  min-width: 145px;
  padding: 4px;
  z-index: 9999;
  animation: inlineSelIn 130ms var(--ease-out);
}
@keyframes inlineSelIn {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.inline-sel-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.1s;
  white-space: nowrap;
}
.inline-sel-item:hover { background: var(--hover); }
.inline-sel-item.active { background: var(--accent-soft); }

/* checkbox */
.cb {
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.12s;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
}
.cb:hover { border-color: var(--ink-3); }
.cb:checked {
  background: var(--ink);
  border-color: var(--ink);
}
.cb:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/10px no-repeat;
}
.cb.indet {
  background: var(--ink);
  border-color: var(--ink);
}
.cb.indet::after {
  content: "";
  position: absolute;
  left: 3px; right: 3px; top: 50%;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transform: translateY(-50%);
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0 4px;
}
.pagination-btn {
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms;
}
.pagination-btn:hover:not(:disabled) { background: var(--bg); }
.pagination-btn:disabled { opacity: 0.38; cursor: default; }
.pagination-info {
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- Floating action bar ---------- */
.float-bar {
  position: fixed;
  bottom: 22px;
  left: calc(240px + (100% - 240px) / 2);
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px 10px 18px;
  display: flex; align-items: center; gap: 14px;
  font-size: 12.5px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
  z-index: 50;
  animation: floatIn 0.18s ease-out;
}
@keyframes floatIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.float-bar-count { font-weight: 500; }
.float-bar .btn-floatghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
}
.float-bar .btn-floatghost:hover { background: rgba(255,255,255,0.08); }
.float-bar .btn-floatfilled {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
}
.float-bar .btn-floatfilled:hover { background: rgba(255,255,255,0.22); }
.float-bar .clear-link {
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  margin-left: 4px;
}
.float-bar .clear-link:hover { color: #fff; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20,20,20,0.4);
  z-index: 100;
  display: grid; place-items: center;
  animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: 14px;
  width: 440px;
  max-width: calc(100vw - 32px);
  padding: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.18);
  animation: modalEnter 0.24s var(--ease-out);
}
@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-wide { width: 580px; }
.modal h2 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.modal p { font-size: 12.5px; color: var(--ink-3); margin-bottom: 18px; }
.field { margin-bottom: 14px; }
.field-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); margin-bottom: 6px; display: block; }
.field-input, .field-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 13.5px;
  outline: none;
  background: #fff;
  color: var(--ink);
}
.field-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2388829a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.field-input:focus, .field-select:focus { border-color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.new-article-mode-toggle { display: flex; gap: 6px; margin-bottom: 14px; }
.namt-btn { flex: 1; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; transition: background 120ms, color 120ms, border-color 120ms; }
.namt-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Article detail ---------- */
.detail-wrap {
  max-width: 880px; padding: 22px 36px 80px; margin: 0 auto;
  animation: detailEnter 0.3s var(--ease-out) backwards;
}
@keyframes detailEnter {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.detail-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px;
  color: var(--ink-3);
  background: transparent;
  border: none;
  padding: 6px 8px;
  margin-left: -8px;
  border-radius: 6px;
}
.back-link:hover { background: var(--hover); color: var(--ink); }

.detail-actions { display: flex; align-items: center; gap: 8px; }

.save-indicator {
  font-size: 11.5px;
  color: var(--green);
  display: inline-flex; align-items: center; gap: 4px;
}
.save-indicator.saving { color: var(--ink-3); }

.status-select-wrap { position: relative; }
.status-trigger {
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: #fff;
  display: inline-flex; align-items: center; gap: 6px;
}
.status-trigger:hover { background: var(--hover); }

/* article header */
.article-header { margin-bottom: 28px; }
.title-edit-wrap {
  display: flex; align-items: center; gap: 10px;
  margin-left: -8px;
}
.title-input {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  border: none;
  background: transparent;
  width: 100%;
  outline: none;
  color: var(--ink);
  padding: 4px 8px;
  border-radius: 7px;
  font-family: inherit;
}
.title-input:hover, .title-input:focus { background: var(--hover); }
.title-input::placeholder { color: var(--ink-4); }
.edit-pencil {
  flex-shrink: 0;
  color: var(--ink-4);
  opacity: 0;
  transition: opacity 0.15s;
}
.title-edit-wrap:hover .edit-pencil { opacity: 1; }

.article-meta {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
  margin-left: 0;
}
.cat-pill-select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  cursor: pointer;
  padding: 4px 22px 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 7px center;
  font-family: inherit;
  outline: none;
}
.meta-text { font-size: 12.5px; color: var(--ink-3); }
.meta-sep { color: var(--ink-4); }
.meta-spacer { flex: 1; }
.prompt-restore-btn {
  font-size: 11px;
  color: var(--ink-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.prompt-restore-btn:hover { background: var(--hover); color: var(--ink-1); }

/* empty state */
.empty-state {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 70px 40px;
  text-align: center;
  margin: 24px 0;
}
.empty-state .glyph {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
}
.empty-state h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.empty-state p { font-size: 13px; color: var(--ink-3); margin-bottom: 22px; max-width: 360px; margin-inline: auto; line-height: 1.55; }
.empty-state .glyph {
  background: var(--grad-cta);
  color: #fff;
  box-shadow: 0 8px 22px -8px rgba(0,102,255,0.5);
}
.btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  border: none !important;
  cursor: pointer;
  background: var(--grad-cta) !important;
  color: #fff !important;
  box-shadow: 0 8px 22px -8px rgba(0,102,255,0.55), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: filter 0.15s, transform 0.15s;
}
.btn-generate:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-generate:active:not(:disabled) { transform: scale(0.97) !important; }
.btn-generate:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-generate-legacy {
  font-size: 13.5px;
  padding: 11px 22px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  border: none;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
}

/* thumbnail card */
.section-h {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600; color: var(--ink-3);
  margin: 8px 0 10px;
}
.thumb-card, .step-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.thumb-grid {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 22px;
  align-items: start;
}
.thumb-actions {
  display: flex; flex-direction: row; gap: 5px;
  margin-top: 8px;
}
.thumb-actions .btn-sm { flex: 1; justify-content: center; }
.thumb-preview {
  width: 160px; height: 160px;
  border-radius: 12px;
  background: #fafaf8;
  border: 1px dashed var(--line-strong);
  display: grid; place-items: center;
  color: var(--ink-4);
  font-size: 11.5px;
  position: relative;
  overflow: hidden;
}
.thumb-preview.filled { border: none; padding: 0; }

/* image placeholders (mock generated illustrations) */
.mock-image {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.mock-img-label {
  position: absolute; bottom: 8px; left: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: rgba(0,0,0,0.45);
  background: rgba(255,255,255,0.7);
  padding: 2px 7px;
  border-radius: 4px;
}
.illust-blob {
  width: 60%; height: 60%;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.7;
}
.bg-soft-blue   { background: linear-gradient(135deg, #dde7f5, #e8eef9); }
.bg-soft-coral  { background: linear-gradient(135deg, #f9e0d6, #fbe8df); }
.bg-soft-sage   { background: linear-gradient(135deg, #dde9dd, #e6efe1); }
.bg-soft-lav    { background: linear-gradient(135deg, #e1ddef, #ece7f5); }
.bg-soft-yellow { background: linear-gradient(135deg, #f5e9c9, #f8efd5); }
.bg-soft-peach  { background: linear-gradient(135deg, #f7d9c6, #fbe6d6); }
.bg-soft-teal   { background: linear-gradient(135deg, #cfe5e3, #dceeec); }
.bg-soft-pink   { background: linear-gradient(135deg, #f5d8db, #f8e1e3); }
.blob-blue   { background: #b8caec; }
.blob-coral  { background: #f0b59a; }
.blob-sage   { background: #b2c8a9; }
.blob-lav    { background: #b9aedb; }
.blob-yellow { background: #ddc685; }
.blob-peach  { background: #efb591; }
.blob-teal   { background: #a4cfca; }
.blob-pink   { background: #e8aab0; }

/* prompt collapsible (thumbnail card) */
details.prompt-block { margin-top: 4px; }
details.prompt-block summary {
  list-style: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px;
  border-radius: 5px;
  margin-left: -8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
details.prompt-block summary:hover { background: var(--hover); color: var(--ink-2); }
details.prompt-block summary::-webkit-details-marker { display: none; }
details.prompt-block summary .chev { transition: transform 0.15s; }
details.prompt-block[open] summary .chev { transform: rotate(90deg); }

/* prompt always-visible (step cards) */
div.prompt-block { margin-top: 4px; }
.prompt-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.prompt-label {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.prompt-copy-btn {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border: none; background: none;
  color: var(--ink-4);
  border-radius: 5px;
  padding: 0;
  transition: background 0.12s, color 0.12s;
}
.prompt-copy-btn:hover { background: var(--hover); color: var(--ink-2); }
.prompt-copy-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.prompt-header-actions { display: flex; align-items: center; gap: 6px; }
.prompt-gen-text-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line-strong);
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s, transform 0.1s var(--ease-out);
}
.prompt-gen-text-btn:hover { background: var(--hover); color: var(--ink); }
.prompt-gen-text-btn:active:not(:disabled) { transform: scale(0.97); }
.prompt-gen-text-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.prompt-text {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.55;
  background: #faf9f6;
  padding: 12px 14px;
  border-radius: 8px;
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  white-space: pre-wrap;
}

/* step card */
.step-card { padding: 20px 22px; }
.step-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.step-num {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  text-transform: uppercase;
}
.step-num .num { color: var(--ink-2); }

.step-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-type-select { position: relative; }

.step-type-trigger {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 8px 4px 10px;
  border-radius: 99px;
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: background 0.12s;
}
.step-type-trigger:hover { filter: brightness(0.94); }

.step-type-menu {
  position: absolute;
  z-index: 40;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  min-width: 130px;
  padding: 4px;
  top: calc(100% + 4px);
  right: 0;
}

.step-type-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
  color: var(--ink-3);
}
.step-type-item:hover { background: var(--hover); color: var(--ink); }
.step-type-item.active { color: var(--accent); background: var(--accent-soft); }

.step-title-wrap {
  display: flex; align-items: center; gap: 8px;
  margin: 4px -8px 4px;
}
.step-title-input {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: none;
  background: transparent;
  width: 100%;
  outline: none;
  color: var(--ink);
  padding: 5px 8px;
  border-radius: 6px;
  font-family: inherit;
}
.step-title-input:hover, .step-title-input:focus { background: var(--hover); }
.step-title-wrap .edit-pencil { opacity: 0; }
.step-title-wrap:hover .edit-pencil { opacity: 1; }

.step-body-input {
  width: calc(100% + 16px);
  margin-left: -8px;
  border: none;
  background: transparent;
  resize: none;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.6;
  outline: none;
  color: var(--ink-2);
  font-family: inherit;
  padding: 8px;
  border-radius: 7px;
  display: block;
  margin-top: 2px;
}
.step-body-input:hover, .step-body-input:focus { background: var(--hover); }

.step-body-rendered {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  padding: 8px;
  margin-left: -8px;
  border-radius: 7px;
  cursor: text;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 2px;
}
.step-body-rendered:hover { background: var(--hover); color: var(--ink); }

.step-image-row {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 22px;
  margin-top: 14px;
  align-items: start;
}
.step-image {
  width: 240px;
  height: 160px;
  border-radius: 10px;
  background: #fafaf8;
  border: 1px dashed var(--line-strong);
  display: grid; place-items: center;
  color: var(--ink-4);
  font-size: 11.5px;
  text-align: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.step-image.filled { border: none; padding: 0; }
.step-image .upload-hint { line-height: 1.5; }
.step-img-actions {
  display: flex; flex-direction: row; gap: 5px;
  margin-top: 8px;
}
.step-img-actions .btn-sm {
  flex: 1; justify-content: center;
}
.step-img-pair {
  display: flex; width: 100%; gap: 5px;
}
.step-img-pair .btn-sm { flex: 1; justify-content: center; }

.step-prompt-section { padding-top: 4px; }

.preview-cta-wrap {
  display: flex; justify-content: center; margin-top: 28px;
}
.btn-preview {
  font-size: 13.5px;
  padding: 12px 26px;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
}
.btn-preview:hover { background: var(--hover); border-color: var(--ink-3); }

/* ---------- Phone preview ---------- */
.preview-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px 60px;
  min-height: 100%;
  background: #efeeea;
}
.preview-topbar {
  width: 100%;
  max-width: 880px;
  display: flex; align-items: center;
  margin-bottom: 28px;
  position: relative;
}
.preview-topbar-title {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
  pointer-events: none;
}
.phone {
  width: 390px;
  height: 720px;
  background: #f0f3ff;
  border-radius: 38px;
  padding: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.12), 0 0 0 8px #1a1a1a;
  position: relative;
  overflow: hidden;
}
.phone-notch {
  position: absolute;
  top: 14px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 28px;
  background: #1a1a1a; border-radius: 99px;
  z-index: 5;
}
.phone-screen {
  width: 100%; height: 100%;
  border-radius: 26px;
  background: #f0f3ff;
  position: relative;
}
.phone-screen-inner {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  overflow: hidden;
  display: flex; flex-direction: column;
  background: #f0f3ff;
}
.phone-statusbar {
  display: flex; justify-content: space-between;
  padding: 14px 26px 4px;
  font-size: 13px;
  font-weight: 600;
  color: #020617;
}
.phone-nav {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 10px;
  background: #f0f3ff;
}
.phone-progress {
  flex: 1;
  height: 12px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.phone-progress-fill {
  position: absolute; top: 0; left: 0;
  height: 100%;
  background: #2d7eff;
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.phone-content {
  flex: 1;
  padding: 8px 12px 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.phone-content::-webkit-scrollbar { display: none; }
.phone-image {
  width: 100%;
  aspect-ratio: 3/2;
  border-radius: 16px;
  margin-top: 16px;
  overflow: hidden;
}
.phone-step-block {
  animation: phoneStepIn 0.45s cubic-bezier(0.23, 1, 0.32, 1) both;
}
@keyframes phoneStepIn {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}
.phone-step-block + .phone-step-block { margin-top: 24px; }
.phone-step-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin-top: 4px;
  margin-bottom: 10px;
  color: #020617;
}
.phone-step-body {
  font-size: 16px;
  line-height: 1.25;
  color: #020617;
}
.phone-cta-wrap {
  padding: 12px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(to bottom, rgba(240,243,255,0) 0%, #f0f3ff 28%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.phone-cta {
  width: 100%;
  background: linear-gradient(172deg, #2b7cfe 0%, #035af1 100%);
  color: #fff;
  border: none;
  border-radius: 16px;
  height: 48px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0px 4px 16px 1px rgba(0,30,199,0.15), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: opacity 0.15s;
}
.phone-cta:hover { opacity: 0.92; }
.phone-feedback-row {
  display: flex;
  gap: 8px;
}
.phone-feedback-btn {
  flex: 1;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  height: 48px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #020617;
  transition: background 0.15s;
}
.phone-feedback-btn:hover { background: #f0f3ff; }
.phone-feedback-btn.active { border-color: #2755ff; }
.phone-star-rating-block {
  background: #fff;
  border-radius: 20px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.phone-star-rating-title {
  font-size: 16px;
  font-weight: 700;
  color: #020617;
  text-align: center;
}
.phone-star-rating-subtitle {
  font-size: 13px;
  color: #64748b;
  text-align: center;
  margin-bottom: 4px;
}
.phone-star-rating-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.phone-back-arrow {
  background: transparent; border: none;
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #020617;
  cursor: pointer;
}
.phone-back-arrow:hover { background: rgba(2,6,23,0.06); }
.phone-kidden-card {
  background: #e5ebff;
  border: 1px solid #fff;
  border-radius: 32px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.phone-kidden-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #ff4800;
  letter-spacing: -0.36px;
  line-height: 1.2;
}
.phone-kidden-card-body {
  font-size: 16px;
  color: #020617;
  line-height: 1.25;
}
.phone-kidden-card-body strong { font-weight: 700; }
.phone-kidden-discover-btn {
  background: none;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 16px;
  font-weight: 600;
  color: #2755ff;
  cursor: pointer;
  line-height: 1;
}
.phone-kidden-discover-btn:hover { opacity: 0.75; }
.phone-kidden-image {
  border-radius: 14px;
  overflow: hidden;
  margin-top: 4px;
}

/* misc */
.toast {
  position: fixed;
  top: 32px; right: 24px;
  background: var(--ink);
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  animation: floatIn 0.2s;
}
.muted { color: var(--ink-3); }
.row-action-cell { display: flex; justify-content: flex-end; }

/* status menu (popover) */
.status-menu {
  position: absolute;
  z-index: 40;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  min-width: 170px;
  padding: 4px;
  top: calc(100% + 4px);
  right: 0;
}
.status-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 6px;
}

/* Toast fade-out (progress indicator) */
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }
.toast-out { animation: toastOut 0.28s ease-in forwards; }

/* Rich dismissable toast stack */
.toast-stack {
  position: fixed;
  top: 32px;
  right: 24px;
  z-index: 210;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
  width: 300px;
  max-width: calc(100vw - 32px);
}
.toast-item {
  border-radius: 9px;
  border-left: 3px solid transparent;
  box-shadow: 0 4px 16px rgba(0,0,0,0.09), 0 1px 4px rgba(0,0,0,0.04);
  padding: 9px 10px 9px 12px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  pointer-events: all;
  animation: toastSlideIn 0.22s cubic-bezier(0.23, 1, 0.32, 1);
}
.toast-error   { border-left-color: var(--red);    background: #fff5f5; }
.toast-warning { border-left-color: var(--amber);  background: #fffbeb; }
.toast-success { border-left-color: var(--green);  background: #f0fdf4; }
.toast-info    { border-left-color: var(--accent); background: #eff6ff; }
.toast-body { display: flex; align-items: flex-start; gap: 8px; flex: 1; min-width: 0; }
.toast-emoji { font-size: 14px; line-height: 1.35; flex-shrink: 0; margin-top: 1px; }
.toast-text { flex: 1; min-width: 0; }
.toast-msg  { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.toast-sub  { font-size: 11px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.toast-close {
  background: none; border: none; padding: 2px 3px;
  color: var(--ink-4); cursor: pointer; flex-shrink: 0;
  border-radius: 4px; margin-top: -1px; line-height: 1;
}
.toast-close:hover { color: var(--ink-2); background: rgba(0,0,0,0.06); }
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-item.toast-out { animation: toastSlideOut 0.26s ease-in forwards; }
@keyframes toastSlideOut { to { opacity: 0; transform: translateX(14px); } }

/* ---------- Password gate ---------- */
.pw-gate { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.pw-card { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 320px; padding: 40px 32px 36px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 28px rgba(0,0,0,0.07); }
.pw-logo { width: 52px; height: 52px; border-radius: 13px; background: var(--bg); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.pw-logo-img { width: 34px; height: 34px; object-fit: contain; }
.pw-title { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; color: var(--ink); }
.pw-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.pw-form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.pw-input-wrap { position: relative; width: 100%; }
.pw-input { width: 100%; padding-right: 38px; }
.pw-eye-btn { position: absolute; right: 0; top: 0; height: 100%; width: 36px; display: flex; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; color: var(--ink-3); padding: 0; }
.pw-eye-btn:hover { color: var(--ink-2); }
.pw-btn { width: 100%; justify-content: center; }
.pw-error { font-size: 12px; color: var(--red); text-align: center; margin-top: -2px; }
@keyframes pwShake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
.pw-shake { animation: pwShake 0.42s ease; }

/* Responsive — large screens (above MacBook 14" ~1512px CSS viewport) */
@media (min-width: 1600px) {
  .main-inner { max-width: 1700px; }
  .articles-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .home-cat-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 2000px) {
  .main-inner { max-width: 2000px; }
  .articles-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* Responsive — narrow sidebar below 1200px */
@media (max-width: 1200px) {
  .sidebar {
    width: 60px;
    padding: 12px 8px;
    overflow: hidden;
    flex-shrink: 0;
  }
  .sidebar .brand-name,
  .sidebar .brand-sub,
  .sidebar .nav-section-label,
  .sidebar .new-article-btn span,
  .sidebar .quota-card,
  .sidebar .user-name,
  .sidebar .user-role {
    display: none;
  }
  .sidebar .nav-item span:first-of-type { display: none; }
  .sidebar .nav-item .count { display: none; }
  .sidebar .nav-item { justify-content: center; padding: 10px 0; }
  .sidebar .new-article-btn { justify-content: center; padding: 0; width: 40px; height: 40px; border-radius: 50%; min-width: unset; }
  .sidebar .brand { justify-content: center; }
  .sidebar .brand-mark { margin: 0 auto; }
  .sidebar .user-row { justify-content: center; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-grid { min-width: 720px; }
  .float-bar { left: calc(60px + (100% - 60px) / 2); }
}
.status-menu-item:hover { background: var(--hover); }

/* ---------- Generation loader overlay ---------- */
.gen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 10, 31, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 150;
  display: grid;
  place-items: center;
  animation: fadeIn 0.2s ease-out;
}
.gen-card {
  background: #fff;
  border-radius: 20px;
  padding: 36px 44px 40px;
  width: 420px;
  max-width: calc(100vw - 48px);
  text-align: center;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.2);
  animation: genCardIn 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes genCardIn {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.gen-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--grad-cta);
  color: #fff;
  display: grid; place-items: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 22px -8px rgba(0, 102, 255, 0.55);
}
.gen-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 6px;
}
.gen-topic {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 28px;
  max-width: 320px;
  margin-inline: auto;
  line-height: 1.4;
}
.gen-progress-wrap {
  height: 4px;
  background: #ececea;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 16px;
}
.gen-progress-bar {
  height: 100%;
  background: var(--grad-cta);
  border-radius: 99px;
  transition: width 0.16s linear;
}
.gen-stage {
  font-size: 12.5px;
  color: var(--ink-3);
  min-height: 20px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.gen-stage.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Image generation shimmer ---------- */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.img-generating {
  width: 100%; height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #eeeee9 0%, #e2e2dc 40%, #eeeee9 80%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  display: grid; place-items: center;
}
.img-gen-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

/* ---------- Image version navigator ---------- */
.img-version-pill {
  position: absolute;
  top: 7px;
  left: 7px;
  display: flex;
  align-items: center;
  gap: 1px;
  background: rgba(10, 10, 20, 0.60);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 20px;
  padding: 2px 4px;
  z-index: 2;
}
.ivp-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  min-width: 24px;
  text-align: center;
  letter-spacing: 0.01em;
  padding: 0 2px;
}
.ivp-arrow {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  border-radius: 99px;
  padding: 0;
  transition: background 0.1s;
  flex-shrink: 0;
}
.ivp-arrow:not(:disabled):hover { background: rgba(255,255,255,0.18); }
.ivp-arrow:disabled { opacity: 0.28; cursor: default; }
.img-remove-btn {
  position: absolute;
  top: 7px; right: 7px;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(196, 61, 61, 0.85);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
  z-index: 2;
}
.img-remove-btn:hover { background: #c43d3d; transform: scale(1.08); }
.img-use-version-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
  font-family: inherit;
}
.img-use-version-btn:hover { background: #bbf7d0; }

/* ---------- Image lightbox ---------- */
.clickable-img { cursor: zoom-in; }
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 20, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: grid;
  place-items: center;
  animation: fadeIn 0.18s ease-out;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  animation: genCardIn 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 201;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(10, 8, 20, 0.5);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 202;
}
.lightbox-delete:hover { background: rgba(200, 40, 40, 0.7); }
.lightbox-content {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.lightbox-img-wrap {
  position: relative; display: inline-block;
}
.lightbox-img-wrap .lightbox-img { display: block; }
.lightbox-version-pill {
  position: absolute;
  top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(10, 8, 20, 0.62);
  backdrop-filter: blur(6px);
  border-radius: 99px;
  padding: 5px 10px;
  color: #fff;
  font-size: 13px; font-weight: 600;
}
.lvp-arrow {
  background: none; border: none; color: #fff;
  font-size: 16px; line-height: 1; padding: 0 4px;
  cursor: pointer; opacity: 0.8;
  transition: opacity 0.12s;
}
.lvp-arrow:hover:not(:disabled) { opacity: 1; }
.lvp-arrow:disabled { opacity: 0.28; cursor: default; }
.lvp-label { min-width: 32px; text-align: center; }
.lightbox-use-btn {
  background: #e6f3ec;
  color: #1f9d55;
  border: 1px solid #b6dfc6;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
}
.lightbox-use-btn:hover { background: #d2ecdf; }

/* Prevent SVG spin on generate button and empty state icon */
.btn-generate > svg,
.empty-state .glyph > svg { animation: none !important; }

/* ---------- Mobile top bar (hidden on desktop) ---------- */
.mobile-top { display: none; }

/* ========== Mobile adaptive (≤ 640px) ========== */
@media (max-width: 640px) {

  /* App shell */
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }

  /* Mobile top bar */
  .mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: #fbfbf9;
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .mobile-brand-btn {
    display: flex; align-items: center; gap: 8px;
    background: none; border: none; padding: 4px 6px;
    border-radius: 8px; cursor: pointer;
  }
  .mobile-brand-btn span {
    font-size: 13px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink);
  }
  .mobile-top-right { display: flex; align-items: center; gap: 6px; }
  .mobile-icon-btn {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    background: #fff;
    display: grid; place-items: center;
    color: var(--ink-2);
    cursor: pointer;
  }
  .mobile-icon-btn:active { transform: scale(0.95); }
  .mobile-new-btn {
    background: var(--grad-cta); color: #fff; border-color: transparent;
    box-shadow: 0 3px 10px -3px rgba(0,102,255,0.5);
  }

  /* Main content */
  .main-inner { padding: 16px 16px 80px; }
  .home-inner { padding-top: 10px; }

  /* Hero panel */
  .hero-panel { padding: 22px 18px 26px; border-radius: 16px; margin-bottom: 16px; }
  .hero-eyebrow { font-size: 10px; }
  .hero-headline { font-size: 22px; }
  .hero-sub { font-size: 12.5px; margin-top: 8px; }
  .hero-prompt-row { flex-direction: column; gap: 8px; }
  .hero-prompt-btn { width: 100%; padding: 14px; border-radius: 10px; justify-content: center; }
  .hero-helper { font-size: 12px; margin-top: 10px; }
  .hero-suggestions { grid-template-columns: 1fr; gap: 8px; }

  /* Hero cards: stack vertically */
  .hero-cards { grid-template-columns: 1fr; gap: 10px; }
  .hero-card { padding: 16px 16px 14px; gap: 10px; }

  /* Topic search dropdown */
  .topic-select-trigger, .topic-picked { width: 100%; }
  .topic-search-menu { min-width: unset; width: calc(100vw - 48px); }

  /* Pipeline stats strip */
  .home-pipeline { flex-wrap: wrap; padding: 14px 16px; row-gap: 10px; margin-bottom: 14px; }
  .hp-stat { flex: 0 0 33.33%; }
  .hp-num { font-size: 20px; }
  .hp-divider { display: none; }

  /* Category grid: 2 columns */
  .home-cat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .home-cat-card { padding: 12px 14px 10px; }
  .hcc-ads-num { font-size: 16px; }
  .home-section-head { margin-top: 20px; margin-bottom: 12px; }
  .home-section-title { font-size: 15px; }

  /* Dashboard page header */
  .main-top { flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .page-title { font-size: 22px; }
  .main-top-actions { gap: 6px; }
  .main-top-actions .btn span { display: none; } /* hide button labels on very small screens */

  /* Filter bar: horizontal scroll */
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-sep { display: none; }

  /* Table: horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-grid { min-width: 600px; }

  /* Detail page */
  .detail-wrap { padding: 12px 16px 80px; }
  .detail-top { flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
  .detail-actions { flex-wrap: wrap; gap: 6px; }
  .detail-actions .btn span { display: none; }
  .title-input { font-size: 19px; }
  .article-meta { flex-wrap: wrap; gap: 6px; }

  /* Thumbnail card: stack image below text */
  .thumb-grid { grid-template-columns: 1fr; }
  .thumb-preview { width: 100%; height: 180px; }

  /* Step card: image stacks below text */
  .step-image-row { grid-template-columns: 1fr; }
  .step-image { width: 100%; height: 150px; }
  .step-title-input { font-size: 15px; }
  .step-img-actions { justify-content: flex-start; }

  /* Modals: slide up from bottom */
  .modal-overlay { align-items: flex-end; }
  .modal {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 36px;
  }
  .modal-wide { width: 100%; }

  /* Creatives generator: reference row stacks vertically */
  .cg-reference-row { flex-direction: column; gap: 10px; }
  .cg-ref-upload-field { width: 100%; }
  .cg-upload-area { height: 100px; }
  .cg-ref-preview { height: 100px; }
  .cg-ref-comment { min-height: 100px; }

  /* Preview page */
  .preview-wrap { padding: 12px 16px 60px; }

  /* Export page */
  .export-grid { grid-template-columns: 1fr; }

  /* Float bar — sidebar is hidden on mobile so recenter to full width */
  .float-bar {
    left: 50%;
    right: auto;
    bottom: 16px;
    max-width: calc(100vw - 32px);
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 14px;
  }
  .float-bar-count { width: 100%; font-size: 12px; }

  /* Archive page */
  .archive-head { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Settings page */
  .settings-inner { padding-top: 16px; }
  .settings-page-head { margin-bottom: 20px; }
  .settings-card { padding: 16px; }
  .settings-length-toggle { flex-direction: column; }
  .settings-length-btn { max-width: 100%; }
  .settings-info-grid { grid-template-columns: 1fr; }
  .settings-ref-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .settings-ref-actions { display: flex; gap: 8px; }
  .settings-ref-grid { gap: 8px; }
  .settings-ref-thumb { width: 72px; height: 72px; }
  .settings-textarea { font-size: 11px; }
  .settings-select { max-width: 100%; }
}

/* ---------- Content block editor ---------- */
.content-block-editor {
  margin: 6px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.block-card {
  background: #faf9f6;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px 10px;
}

.block-card-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.block-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
}

.block-para-input {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.6;
  outline: none;
  color: var(--ink);
  font-family: inherit;
  padding: 2px 0;
  display: block;
  min-height: 52px;
}
.block-para-input:focus { color: var(--ink); }

.block-para-rendered {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  padding: 2px 0;
  min-height: 52px;
  cursor: text;
  white-space: pre-wrap;
  word-break: break-word;
}
.block-para-rendered:hover { color: var(--ink); }

.block-list-rendered {
  padding: 2px 0;
  cursor: text;
  min-height: 36px;
}
.block-list-rendered:hover .block-list-preview,
.block-list-rendered:hover .block-checklist-preview { opacity: 0.85; }

.block-list-preview {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.block-list-preview li { margin-bottom: 2px; }

.block-checklist-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.block-checklist-item-preview {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
}
.block-check-icon {
  font-size: 14px;
  flex-shrink: 0;
  color: var(--ink-3);
}

.block-placeholder {
  color: var(--ink-4);
  font-style: italic;
}

.block-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* stat block */
.block-stat-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px 0;
}
.stat-display-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.stat-display-desc {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.stat-display-source {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.stat-display-link {
  color: var(--accent);
  text-decoration: none;
}
.stat-display-link:hover { text-decoration: underline; }

.stat-mode-toggle {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}
.stat-mode-btn {
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 100ms, color 100ms, border-color 100ms;
}
.stat-mode-btn:hover { background: var(--bg); color: var(--ink-2); }
.stat-mode-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* quote block */
/* quote block */
.block-quote-display {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.quote-display-text {
  font-size: 13px;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-2);
}
.quote-display-attr {
  font-size: 12px;
  color: var(--ink-3);
}
.quote-display-link {
  color: var(--accent);
  text-decoration: none;
  font-style: normal;
}
.quote-display-link:hover { text-decoration: underline; }

/* source block */
.block-source-display {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.source-display-chip {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 99px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 500;
}
.source-display-link {
  color: inherit;
  text-decoration: none;
}
.source-display-link:hover { text-decoration: underline; }
.source-display-desc {
  color: var(--ink-3);
}

/* list / checklist block */
.block-list-fields {}
.list-items-input {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
  font-family: inherit;
  outline: none;
  padding: 2px 0;
}
.list-items-input:focus { color: var(--ink); }


/* ---------- Preview block styles ---------- */
.phone-step-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.preview-block-para {
  font-size: 16px;
  line-height: 1.25;
  color: #020617;
}
.preview-block-para strong { color: #020617; font-weight: 700; }

.preview-block-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preview-stat-text { display: flex; flex-direction: column; gap: 8px; }
.preview-stat-value {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -2.24px;
  color: #ff4800;
  line-height: 1;
}
.preview-stat-desc { font-size: 16px; font-weight: 600; color: #020617; line-height: 1.25; }
.preview-stat-image {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  display: block;
  object-fit: cover;
}
.preview-stat-source { font-size: 12px; color: #2d7eff; font-weight: 500; line-height: 1.25; }

.preview-block-quote {
  border-left: 3px solid var(--accent);
  padding: 8px 0 8px 14px;
}
.preview-quote-text {
  font-size: 14px;
  font-style: italic;
  color: var(--ink-2);
  line-height: 1.5;
}
.preview-quote-author {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 6px;
}

.preview-block-source {
  font-size: 12.5px;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.preview-source-chip {
  display: inline-flex;
  align-items: center;
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 500;
}
.preview-source-link { color: #2d7eff; text-decoration: underline; }
.preview-source-link:hover { opacity: 0.8; }
.preview-source-desc { color: var(--ink-3); font-size: 11.5px; }

.preview-block-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.preview-block-list li { font-size: 16px; color: #020617; line-height: 1.25; }
.preview-block-list li strong { color: #020617; font-weight: 700; }

.preview-block-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.preview-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 16px;
  color: #020617;
  cursor: pointer;
  line-height: 1.25;
}
.preview-checklist-item input[type="checkbox"] {
  width: 24px;
  height: 24px;
  min-width: 24px;
  margin-top: 0;
  flex-shrink: 0;
  accent-color: #2d7eff;
  cursor: pointer;
  border-radius: 4px;
}
.preview-checklist-done {
  text-decoration: line-through;
  color: var(--ink-4);
}

/* ---------- Settings page ---------- */
.settings-inner { padding-top: 32px; }
.settings-page-head { margin-bottom: 32px; }

.settings-section { margin-bottom: 36px; }
.settings-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  font-weight: 700; color: var(--ink-3);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.settings-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
}

.settings-field { display: flex; flex-direction: column; gap: 6px; }
.settings-field-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.settings-field-desc { font-size: 12px; color: var(--ink-3); }

.settings-select {
  margin-top: 4px;
  font-size: 13px;
  padding: 9px 12px 9px 12px;
  padding-right: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  max-width: 480px;
  cursor: pointer;
  transition: border-color 0.12s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2388829a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.settings-select:focus { border-color: var(--accent); }

.settings-tone-preview {
  display: inline-flex; align-items: flex-start; gap: 7px;
  margin-top: 8px;
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--accent);
  max-width: 540px;
  line-height: 1.5;
}
.settings-tone-preview svg { flex-shrink: 0; margin-top: 1px; }

.settings-length-toggle {
  display: flex; gap: 10px; margin-top: 4px;
  flex-wrap: wrap;
}
.settings-length-btn {
  flex: 1; min-width: 140px; max-width: 200px;
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  text-align: left; cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.settings-length-btn:hover { border-color: var(--ink-3); }
.settings-length-btn.active { border-color: var(--accent); background: var(--accent-soft); }
.slb-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.slb-desc { font-size: 11.5px; color: var(--ink-3); }
.settings-length-btn.active .slb-label { color: var(--accent); }
.settings-length-btn.active .slb-desc { color: var(--accent); opacity: 0.7; }

.settings-save-row { margin-top: 20px; display: flex; gap: 10px; align-items: center; }

.settings-textarea {
  margin-top: 4px;
  width: 100%;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.6;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color 0.12s;
}
.settings-textarea:focus { border-color: var(--accent); }

.settings-ref-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
.settings-ref-actions { display: flex; gap: 8px; flex-shrink: 0; }

.settings-ref-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 4px;
}
.settings-ref-thumb {
  position: relative;
  width: 90px; height: 90px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.settings-ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.settings-ref-del {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.settings-ref-thumb:hover .settings-ref-del { opacity: 1; }

.settings-ref-empty {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
}

.settings-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.settings-info-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}
.sic-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; }
.sic-value { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); font-family: 'JetBrains Mono', monospace; }

/* ---------- Skeleton screen ---------- */
@keyframes sk-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
#sk {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--bg);
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.sk {
  background: linear-gradient(90deg, #eceae5 25%, #f3f1ec 50%, #eceae5 75%);
  background-size: 600px 100%;
  animation: sk-shimmer 1.5s ease-in-out infinite;
  border-radius: 5px;
  flex-shrink: 0;
}
.sk-sidebar {
  background: #fbfbf9;
  border-right: 1px solid #ececea;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  gap: 4px;
  overflow: hidden;
}
.sk-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 14px;
}
.sk-nav-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
}
.sk-main-content {
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.sk-table {
  background: #fff;
  border: 1px solid #ececea;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.sk-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid #ececea;
}
.sk-row:last-child { border-bottom: none; }
@media (max-width: 640px) {
  #sk { grid-template-columns: 1fr; }
  #sk .sk-sidebar { display: none; }
}

/* ---------- Text version pill ---------- */
.txt-version-pill {
  display: flex;
  align-items: center;
  gap: 1px;
  background: var(--hover);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 1px 2px 1px 4px;
}
.tvp-arrow {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  color: var(--ink-2); font-size: 13px; line-height: 1;
  cursor: pointer; border-radius: 99px; padding: 0;
  transition: background 0.1s; flex-shrink: 0;
}
.tvp-arrow:not(:disabled):hover { background: var(--line); }
.tvp-arrow:disabled { opacity: 0.28; cursor: default; }
.tvp-label {
  font-size: 10px; font-weight: 600; color: var(--ink-2);
  letter-spacing: 0.01em; padding: 0 2px; white-space: nowrap;
}
.tvp-delete {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--red);
  cursor: pointer; border-radius: 99px; padding: 0;
  transition: background 0.1s; flex-shrink: 0; margin-left: 1px;
}
.tvp-delete:hover { background: #fde8e8; }
.txt-use-version-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 10px; padding: 6px 12px;
  font-size: 12px; font-weight: 600;
  color: #166534; background: #dcfce7;
  border: 1px solid #bbf7d0; border-radius: 7px;
  cursor: pointer; transition: background 0.12s;
  font-family: inherit; width: 100%;
}
.txt-use-version-btn:hover { background: #bbf7d0; }
.sic-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }

/* ---------- Error / not-found screen ---------- */
.not-found-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 32px;
  padding: 40px;
  text-align: center;
}
.not-found-heading {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
  max-width: 420px;
}

/* ---------- Creatives ---------- */
.creatives-generator {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 24px;
}
.cg-form {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.cg-form .field { margin-bottom: 0; }
.cg-form .field-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2388829a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.cg-custom-row {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.field-required { color: #e05252; font-weight: 600; text-transform: none; letter-spacing: 0; }
.field-error { font-size: 11px; color: #e53e3e; margin-top: 4px; font-weight: 500; }
.cg-optional {
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-4);
}
.cg-reference-row {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  align-items: stretch;
  flex-wrap: wrap;
}
.cg-ref-upload-field { width: 200px; flex-shrink: 0; margin-bottom: 0; display: flex; flex-direction: column; }
.cg-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 120px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
  padding: 12px;
  transition: border-color 0.15s, background 0.15s;
}
.cg-upload-area:hover { border-color: var(--ink-3); background: var(--hover); }
.cg-ref-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 120px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--ink-4);
  font-size: 12px;
}
.cg-ref-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ink-3);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cg-ref-preview {
  position: relative;
  width: 100%;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
}
.cg-ref-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-ref-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cg-ref-comment {
  width: 100%;
  resize: none;
  flex: 1;
  min-height: 120px;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  outline: none;
  background: #fff;
}
.cg-ref-comment:focus { border-color: var(--ink); }
.cg-ref-counter {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 10px;
  color: var(--ink-4);
  pointer-events: none;
}
.cg-foreplay-or {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 8px;
  font-size: 11px;
  color: var(--ink-4);
}
.cg-foreplay-or::before,
.cg-foreplay-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}
.cg-foreplay-input {
  width: 100%;
  box-sizing: border-box;
  height: 32px;
  font-size: 12px;
  font-family: inherit;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.cg-foreplay-input:focus { border-color: var(--ink); }
.cg-foreplay-input::placeholder { color: var(--ink-4); }
.cg-generate-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  white-space: nowrap;
  flex-shrink: 0;
}
@keyframes cg-spin { to { transform: rotate(360deg); } }
.cg-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cg-spin 0.7s linear infinite;
}
.btn-spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1.5px solid rgba(0,0,0,0.15);
  border-top-color: var(--ink-2);
  border-radius: 50%;
  animation: cg-spin 0.7s linear infinite;
  flex-shrink: 0;
}
.cg-logo-toggle-row {
  display: flex;
  align-items: center;
  margin-top: 12px;
}
.cg-logo-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-2);
  user-select: none;
}
.cg-toggle {
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--line-strong);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
  cursor: pointer;
}
.cg-toggle.on { background: var(--accent, #5b6af0); }
.cg-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: left 0.2s;
}
.cg-toggle.on .cg-toggle-thumb { left: 16px; }
.cg-logo-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.cg-logo-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--surface-2, #f5f5f7);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  width: 80px;
}
.cg-logo-option:hover { background: var(--hover); }
.cg-logo-option.selected { border-color: var(--accent, #5b6af0); background: #f0f1ff; }
.cg-logo-option img {
  width: 68px;
  height: 40px;
  object-fit: contain;
  background: #1a1a2e;
  border-radius: 4px;
  display: block;
}
.cg-logo-text-preview {
  width: 68px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.cg-logo-option-label {
  font-size: 9px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.2;
  max-width: 68px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cg-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  background: #fff0f0;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.5;
}
.cg-error svg {
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.85;
}
.cg-naming-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.cg-naming-row .field { margin-bottom: 0; }
.cg-naming-preview {
  padding: 5px 10px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-4);
  background: var(--surface-2);
  border-radius: 6px;
  letter-spacing: 0.03em;
  align-self: flex-end;
  margin-bottom: 1px;
  transition: color 0.15s, background 0.15s;
}
.cg-naming-preview.ready {
  color: var(--ink-1);
  background: #eef6ee;
}
.hero-naming-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding-top: 6px;
}
.hero-naming-preview {
  padding: 4px 9px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-4);
  background: var(--surface-2);
  border-radius: 5px;
  letter-spacing: 0.03em;
  margin-bottom: 1px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.hero-naming-preview.ready {
  color: var(--ink-1);
  background: #eef6ee;
}
.variant-inputs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.variant-sep {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-4);
  line-height: 1;
  user-select: none;
}
.variant-char-input {
  width: 30px;
  height: 34px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink);
  background: var(--surface-1);
  outline: none;
  padding: 0;
  transition: border-color 0.12s;
}
.variant-char-input:focus { border-color: var(--ink); }
.variant-char-input::placeholder { color: var(--ink-4); font-size: 12px; }
.cp-select-wrap { position: relative; display: inline-flex; }
.cp-select-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 6px;
  height: 34px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  font-size: 13px; font-family: 'JetBrains Mono', monospace; font-weight: 500;
  color: var(--ink); background: var(--surface-1); cursor: pointer;
  white-space: nowrap; min-width: 72px;
  transition: border-color 0.12s;
}
.cp-select-trigger:hover:not(:disabled) { border-color: var(--ink-3); }
.cp-select-trigger:focus { outline: none; border-color: var(--ink); }
.cp-select-trigger:disabled { opacity: 0.5; cursor: not-allowed; }
.cp-select-trigger .cp-placeholder { color: var(--ink-4); font-family: inherit; }
.cp-dropdown-menu {
  position: fixed; z-index: 9999;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px -4px rgba(0,0,0,0.13);
  overflow: hidden; min-width: 220px;
}
.cp-search-wrap { padding: 8px; border-bottom: 1px solid var(--line); }
.cp-search-input {
  width: 100%; height: 28px; padding: 0 8px;
  border: 1.5px solid var(--line); border-radius: 6px;
  font-size: 12px; outline: none; box-sizing: border-box; background: var(--surface-1);
}
.cp-search-input:focus { border-color: var(--ink); }
.cp-options { max-height: 200px; overflow-y: auto; padding: 4px; }
.cp-option {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
}
.cp-option:hover { background: var(--surface-2); }
.cp-option.active { background: var(--surface-2); }
.cp-option-clear { color: var(--ink-3); font-size: 12px; }
.cp-abbr { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--ink); font-size: 12px; min-width: 32px; }
.cp-name { color: var(--ink-2); font-size: 12px; }
.cg-result {
  margin-top: 24px;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
}
.cg-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cg-result-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cg-result-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 5px;
}
.cg-result-topic {
  font-size: 12.5px;
  color: var(--ink-3);
}
.cg-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.cg-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cg-card-frame {
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
  background: var(--line);
}
.cg-card-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.cg-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cg-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
}
.cg-prompt-row {
  margin-top: 28px;
}
.cg-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cg-prompt-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}
.cg-prompt-text {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 5px;
  line-height: 1.55;
}
.cg-prompt-textarea {
  width: 100%;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.55;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  resize: none;
  overflow-y: hidden;
  min-height: 72px;
  font-family: inherit;
  box-sizing: border-box;
}
.cg-prompt-textarea:focus { outline: none; border-color: var(--ink-3); }
.cg-prompt-textarea:disabled { opacity: 0.6; }
.cg-prompt-ref-used {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.cg-prompt-ref-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.cg-prompt-ref-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: center;
  min-width: 0;
}
.cg-prompt-ref-link {
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
  opacity: 0.8;
}
.cg-prompt-ref-link:hover { opacity: 1; text-decoration: underline; }
.cg-prompt-ref-comment-used {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
}
.cg-result-version {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
}
.cv-versions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.cv-versions-title {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.cv-versions-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cv-version-card {
  width: 96px;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  transition: border-color 0.12s;
  background: var(--panel);
}
.cv-version-card:hover { border-color: var(--ink-3); }
.cv-version-thumb {
  aspect-ratio: 1;
  background: var(--bg);
  overflow: hidden;
}
.cv-version-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-version-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--ink-4);
}
.cv-version-info {
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cv-version-label { font-size: 11px; font-weight: 700; color: var(--ink); }
.cv-version-date { font-size: 10px; color: var(--ink-4); }
.creatives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 12px;
}
.creative-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.creative-thumb {
  aspect-ratio: 1;
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
}
.creative-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.creative-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--ink-4);
}
.creative-info {
  padding: 10px 12px 4px;
  flex: 1;
}
.creative-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}
.creative-topic {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.creative-meta {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 3px;
}
.creative-actions {
  padding: 6px 12px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.creative-archive-btn {
  opacity: 0;
  transition: opacity 0.12s;
  margin-left: auto;
}
.creative-card:hover .creative-archive-btn,
.creative-card.archived .creative-archive-btn {
  opacity: 1;
}
.creative-card.selected {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
}
.creative-card.archived {
  opacity: 0.5;
}
.creative-archived-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-4);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0 5px;
  margin-left: 4px;
  vertical-align: middle;
}
.cg-show-archived-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
}
.cg-show-archived-toggle input { cursor: pointer; }

/* Creative card editable metadata */
.cc-meta-row {
  display: flex;
  align-items: center;
  margin-top: 5px;
}
.cc-topic-select {
  width: 100%;
  font-size: 11px;
  color: var(--ink-3);
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 1px 0;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.12s;
  appearance: none;
  -webkit-appearance: none;
}
.cc-topic-select:hover, .cc-topic-select:focus {
  border-bottom-color: var(--line-strong);
  color: var(--ink-2);
}
.cc-angle {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Creative-specific status dot colors (reuses .status base class) */
.cs-draft    { color: var(--ink-3); }
.cs-draft    .status-dot { background: #bbb9c4; }
.cs-ready    { color: var(--green); font-weight: 600; }
.cs-ready    .status-dot { background: var(--green); }
.cs-in_test  { color: #c47700; }
.cs-in_test  .status-dot { background: #e8a330; }
.cs-tested   { color: var(--purple); }
.cs-tested   .status-dot { background: var(--purple); }
.cs-winner   { color: #8B6914; font-weight: 600; }
.cs-winner   .status-dot { background: #d4a017; }
.cs-archived { color: var(--red); }
.cs-archived .status-dot { background: var(--red); }
.cc-status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  border-radius: 99px;
  padding: 2px 20px 2px 8px;
  border: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  letter-spacing: 0.01em;
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 8px 5px;
}
.cc-s-draft    { background: #f0efed; color: #6b6680; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%236b6680' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
.cc-s-ready    { background: #ddeeff; color: #1968c4; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%231968c4' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
.cc-s-in_test  { background: #fff3e0; color: #c47700; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%23c47700' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
.cc-s-tested   { background: #f0e8ff; color: #6b3ec4; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%236b3ec4' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
.cc-s-winner   { background: #e6f3ec; color: #1f9d55; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%231f9d55' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
.cc-s-archived { background: #fce8e8; color: #c43d3d; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%23c43d3d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* Creatives table grid */
.ct-grid {
  grid-template-columns: 38px 36px minmax(130px, 2fr) minmax(110px, 1.5fr) minmax(80px, 1fr) 90px 55px 75px 60px;
}
.row-thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  background: var(--bg);
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: flex-end;
}
.row-action-btn {
  background: none;
  border: none;
  padding: 4px;
  border-radius: 4px;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.row-action-btn:hover { background: var(--hover); color: var(--ink); }
.row-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.row-selected { background: #f5f5ff !important; }

/* Archive page tabs */
.arch-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}
.arch-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
  font-family: inherit;
}
.arch-tab:hover { color: var(--ink-2); }
.arch-tab.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 600;
}
.creative-card-cb {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.12s;
}
.creative-card:hover .creative-card-cb,
.creative-card.selected .creative-card-cb {
  opacity: 1;
}

/* Creative image preview lightbox */
.cp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 10, 31, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cp-modal {
  background: var(--panel);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 90vw;
  max-height: 92vh;
  overflow: hidden;
  position: relative;
}
.cp-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(14,10,31,0.08);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  z-index: 2;
  transition: background 0.12s;
}
.cp-close:hover { background: rgba(14,10,31,0.15); }
.cp-stage {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 28px 16px 16px;
  flex: 1;
  min-height: 0;
}
.cp-arrow {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}
.cp-arrow:hover { background: var(--hover); border-color: var(--line-strong); }
.cp-frame-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  min-height: 0;
  min-width: 0;
}
.cp-frame {
  max-width: min(600px, 70vw);
  max-height: 70vh;
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.cp-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--line);
  gap: 16px;
}
.cp-tabs {
  display: flex;
  gap: 6px;
}
.cp-tab {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
  font-family: inherit;
}
.cp-tab:hover { background: var(--hover); color: var(--ink-2); }
.cp-tab.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); font-weight: 600; }

/* Hover zoom hint on clickable images */
.cg-card-frame, .creative-thumb { position: relative; cursor: pointer; }
.cg-card-zoom {
  position: absolute;
  inset: 0;
  background: rgba(14,10,31,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: inherit;
}
.cg-card-frame:hover .cg-card-zoom,
.creative-thumb:hover .cg-card-zoom { opacity: 1; }
.cg-card-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--ink-4);
  background: var(--bg);
}

/* ---------- Preview image lightbox (phone-scoped) ---------- */
.lbx { cursor: zoom-in; }
.phone-lbx-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  cursor: zoom-out;
  border-radius: 38px;
  animation: lbxIn 0.18s ease;
}
@keyframes lbxIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.phone-lbx-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  object-fit: contain;
  cursor: default;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.phone-lbx-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.15s;
}
.phone-lbx-close:hover { background: rgba(255,255,255,0.25); }

/* Feedback modals */
.phone-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(41, 41, 58, 0.33);
  z-index: 30;
  border-radius: 38px;
}

/* Rating modal (thumbs up) — centered card */
.phone-rating-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 88px);
  background: #fff;
  border-radius: 32px;
  padding: 24px 20px 32px;
  box-shadow: 0px 25px 50px -12px rgba(59, 130, 246, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.phone-rating-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #020617;
  padding: 0;
}
.phone-rating-mascot {
  width: 100px;
  height: 80px;
  object-fit: contain;
  display: block;
}
.phone-rating-title {
  font-size: 20px;
  font-weight: 700;
  color: #020617;
  letter-spacing: -0.4px;
  line-height: 1.2;
  text-align: center;
  width: 100%;
}
.phone-rating-subtitle {
  font-size: 16px;
  color: #475569;
  line-height: 1.25;
  text-align: center;
}
.phone-stars-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 4px 0;
}
.phone-not-now-btn {
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  padding: 8px 16px;
  width: 100%;
  text-align: center;
  font-family: inherit;
}

/* Feedback sheet (thumbs down) — bottom sheet */
.phone-feedback-sheet {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  background: #fff;
  border-radius: 38px 38px 0 0;
  box-shadow: 0px 15px 37.5px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 32px;
}
.phone-sheet-toolbar {
  width: 100%;
  padding: 12px 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.phone-sheet-grabber {
  width: 36px;
  height: 5px;
  background: #ccc;
  border-radius: 100px;
  margin-bottom: 4px;
}
.phone-sheet-back {
  align-self: flex-start;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #727272;
}
.phone-sheet-back:hover { background: rgba(0, 0, 0, 0.1); }
.phone-sheet-body {
  width: 100%;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.phone-feedback-mascot {
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: block;
}
.phone-feedback-title {
  font-size: 20px;
  font-weight: 700;
  color: #020617;
  letter-spacing: -0.4px;
  line-height: 1.2;
  text-align: center;
  white-space: pre-wrap;
  width: 100%;
}
.phone-feedback-subtitle {
  font-size: 16px;
  color: #475569;
  line-height: 1.25;
  text-align: center;
}
.phone-feedback-input-wrap {
  width: 100%;
  position: relative;
  margin-top: 12px;
}
.phone-feedback-textarea {
  width: 100%;
  height: 120px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 16px;
  font-size: 16px;
  font-style: italic;
  color: #020617;
  font-family: inherit;
  resize: none;
  box-shadow: 0px 1px 2px rgba(10, 13, 18, 0.05);
  box-sizing: border-box;
  display: block;
}
.phone-feedback-textarea::placeholder { color: #94a3b8; }
.phone-feedback-textarea:focus { outline: none; border-color: #2755ff; }
.phone-feedback-counter {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 12px;
  color: #94a3b8;
  pointer-events: none;
}
.phone-feedback-submit {
  width: 100%;
  height: 48px;
  background: #c4c4c4;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  color: #737373;
  cursor: not-allowed;
  margin-top: 8px;
  font-family: inherit;
}
.phone-feedback-submit.active {
  background: linear-gradient(172deg, #2b7cfe 0%, #035af1 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0px 4px 16px 1px rgba(0, 30, 199, 0.15);
}

/* You may also like section */
.phone-also-like {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 0 0;
}
.phone-also-like-heading {
  font-size: 20px;
  font-weight: 700;
  color: #020617;
  letter-spacing: -0.4px;
  line-height: 1.2;
  padding: 0 4px 8px;
}
.phone-also-like-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.phone-also-like-card:hover { opacity: 0.8; }
.phone-also-like-card.loading { opacity: 0.5; cursor: wait; pointer-events: none; }
.phone-also-like-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #e5ebff;
}
.phone-also-like-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.phone-also-like-label {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #475569;
  line-height: normal;
}
.phone-also-like-title {
  font-size: 14px;
  font-weight: 600;
  color: #020617;
  line-height: 1.25;
}
.phone-also-like-time {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
}
.phone-also-like-arrow {
  width: 24px;
  height: 24px;
  background: #020617;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Complete lesson CTA */
.phone-cta-complete {
  width: 100%;
  background: linear-gradient(180.94deg, #ff6d00 2.19%, #ff3800 94.51%);
  color: #fff;
  border: none;
  border-radius: 16px;
  height: 48px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  box-shadow: 0px 4px 16px 1px rgba(199, 47, 0, 0.15);
  transition: opacity 0.15s;
}
.phone-cta-complete:hover:not(:disabled) { opacity: 0.92; }
.phone-cta-complete:disabled {
  background: linear-gradient(180.94deg, #ff6d00 2.19%, #ff3800 94.51%);
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------- Language selector ---------- */
.lang-selector {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 16px 0 8px;
}
.lang-tab {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.lang-tab:hover { background: var(--surface); }
.lang-tab.active {
  background: #020617;
  color: #fff;
  border-color: #020617;
}

/* ---------- Translation actions ---------- */
.translation-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ---------- Stale translation badge ---------- */
.stale-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  color: #7a4b0c;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-left: 6px;
  white-space: nowrap;
}

/* ---------- Block retranslate button ---------- */
.block-retranslate-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-2);
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.12s;
}
.block-retranslate-btn:hover {
  background: var(--surface);
  color: var(--ink);
}
