/* ── Design tokens ── */
:root {
  /* Surfaces */
  --bg:         #F1F5F9;
  --surface:    #FFFFFF;
  --surface-2:  #F8FAFC;

  /* Sidebar & header (light) */
  --chrome:       #FFFFFF;
  --chrome-2:     #F8FAFC;
  --chrome-3:     #CBD5E1;
  --chrome-text:  #1E293B;
  --chrome-muted: #94A3B8;
  --chrome-line:  #E2E8F0;

  /* Text */
  --ink:   #0F172A;
  --ink-2: #475569;
  --ink-3: #94A3B8;

  /* Borders */
  --line:   #E2E8F0;
  --line-2: #F8FAFC;

  /* Accent — ClickUp purple */
  --accent:     #7C3AED;
  --accent-dim: #F5F3FF;
  --accent-inv: #7C3AED;

  /* Status */
  --green:     #16A34A;
  --green-dim: #DCFCE7;
  --amber:     #D97706;
  --amber-dim: #FEF3C7;
  --red:       #DC2626;

  /* Brand dots */
  --b-smart:   #F59E0B;
  --b-nbs:     #3B82F6;
  --b-cmi:     #10B981;
  --b-lattira: #8B5CF6;
  --b-default: #64748B;

  /* LinkedIn warmth */
  --li-strip: #F3F2EF;
  --li-bg:    #F4F2EE;
  --li-blue:  #0A66C2;

  /* Radius */
  --r-sm:  4px;
  --r:     8px;
  --r-lg:  12px;
  --r-xl:  16px;
  --r-pill:999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);

  --t: 150ms cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ── */
.header {
  flex: 0 0 auto;
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 54px;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  z-index: 50;
  box-shadow: var(--shadow-xs);
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-img { height: 22px; width: auto; display: block; }
.logo-sep { width: 1px; height: 16px; background: var(--line); margin: 0 4px; }
.logo-tool { font-size: 13px; color: var(--ink-3); font-weight: 500; }

.header-tabs {
  margin-left: auto;
  display: flex;
  gap: 2px;
  background: var(--bg);
  padding: 3px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
}
.header-tab {
  background: none;
  border: none;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 16px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}
.header-tab:hover { background: var(--surface); color: var(--ink-2); }
.header-tab.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* ── Tab panels ── */
.tab-panel { display: none; flex: 1; min-height: 0; }
.tab-panel.active { display: flex; flex-direction: column; }

/* ── Review layout ── */
.review-layout { display: flex; flex: 1; min-height: 0; }

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: var(--r-pill); }

.sidebar-section { padding: 16px 0 8px; }
.sidebar-section + .sidebar-section { border-top: 1px solid var(--line); }

.sidebar-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 14px 8px;
}

/* ── Market flag switcher (replaces sidebar-market text section) ── */
.flag-switcher {
  display: flex; gap: 4px; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.flag-btn {
  font-size: 22px; line-height: 1; padding: 5px 6px;
  border-radius: var(--r); border: 1.5px solid transparent;
  background: none; cursor: pointer; flex: 1;
  transition: background var(--t), border-color var(--t), transform var(--t);
}
.flag-btn:hover { background: var(--accent-dim); transform: scale(1.08); }
.flag-btn.active { border-color: var(--accent); background: var(--accent-dim); }
.flag-img { display: block; width: 28px; height: 20px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); pointer-events: none; }
.market-flag-img { width: 40px; height: auto; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }

/* Campaign items */
.campaign-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background var(--t), border-color var(--t);
}
.campaign-item:hover { background: var(--accent-dim); }
.campaign-item.active { background: var(--accent-dim); border-left-color: var(--accent); }
.campaign-item-name { font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.35; }
.campaign-item.active .campaign-item-name { color: var(--accent); font-weight: 600; }
.campaign-item-meta { font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.campaign-item-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sidebar-empty { padding: 8px 14px; font-size: 12px; color: var(--ink-3); line-height: 1.5; }

/* ── Main ── */
.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ── Campaign view ── */
.campaign-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.campaign-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}
.campaign-header-meta { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.campaign-header-title {
  font-size: 14px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--line-2);
  color: var(--ink-2);
  flex-shrink: 0;
  white-space: nowrap;
  border: 1px solid var(--line);
}
.badge.brand { background: var(--accent); color: #fff; border-color: transparent; }

.reviewer-row { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.reviewer-label { font-size: 12px; color: var(--ink-3); }
.reviewer-input {
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  width: 148px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
}
.reviewer-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,58,237,.1); }

.export-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity var(--t), transform var(--t);
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(124,58,237,.3);
}
.export-btn:hover { opacity: .9; transform: translateY(-1px); }
.export-btn:active { transform: none; }

/* ── Back button ── */
.back-btn {
  background: none; border: none; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-3); cursor: pointer; padding: 0; transition: color var(--t); flex-shrink: 0;
}
.back-btn:hover { color: var(--accent); }

/* ── Ad grid ── */
.ad-grid-scroll { flex: 1; overflow-y: auto; padding: 24px; }
.ad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  align-items: start;
}

.seg-header {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.seg-header::before {
  content: '';
  display: inline-block;
  width: 3px; height: 12px;
  background: var(--accent);
  border-radius: var(--r-pill);
  flex-shrink: 0;
}

/* Dual-panel ads (non-source-market review) always span full width */
.ad-col { min-width: 0; }
.ad-col:has(.review-pair:not(.single)) { grid-column: 1 / -1; }

.review-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.review-pair.single { grid-template-columns: 1fr; }
@media (max-width: 760px) { .review-pair { grid-template-columns: 1fr; } }

.ad-label {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 8px;
  font-family: 'ui-monospace', 'Cascadia Code', monospace;
}
.pane-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-3); margin-bottom: 8px;
  display: flex; gap: 5px; align-items: center;
}
.pane-label .pl-flag { font-size: 14px; }
/* Hide pane label in single-column (source-market) review */
.review-pair.single .pane-label { display: none; }

/* ── Post card ── */
.post {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t);
}
.post:focus-within { box-shadow: var(--shadow); }
.post-ro { background: var(--surface-2); }
.post-ro .ro-field { font-size: 14px; color: var(--ink); line-height: 1.55; white-space: pre-wrap; }
.post-ro .ro-intro { padding: 10px 14px; }
.post-ro .ro-hl { font-weight: 700; flex: 1; }
.post-ro .ro-cta {
  border: 1.5px solid var(--li-blue); color: var(--li-blue);
  font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: var(--r-pill); white-space: nowrap;
}
.ro-empty { color: var(--ink-3); font-style: italic; }

.phead { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px; }
.avatar {
  width: 40px; height: 40px;
  border-radius: var(--r);
  background: var(--accent);
  color: #fff;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; letter-spacing: .03em;
  font-family: 'ui-monospace', monospace;
}
.avatar.avatar-logo { background: #fff; padding: 5px; }
.avatar.avatar-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pmeta { display: flex; flex-direction: column; line-height: 1.3; }
.pname { font-weight: 700; font-size: 14px; color: var(--ink); }
.pmeta small { color: var(--ink-3); font-size: 11.5px; }

/* Edit fields */
.intro-edit {
  display: block; width: 100%;
  padding: 8px 14px;
  font-size: 14px; font-family: inherit;
  color: var(--ink); line-height: 1.55;
  -webkit-text-fill-color: var(--ink);
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  resize: vertical; min-height: 66px;
  transition: background var(--t), border-color var(--t);
  outline: none;
}
.intro-edit:focus { background: #FFFBEB; border-bottom-color: var(--amber); }
.intro-edit.saving { border-bottom-color: var(--accent); background: var(--accent-dim); }
.intro-edit.saved  { border-bottom-color: var(--green); background: var(--green-dim); }
.intro-edit.error  { border-bottom-color: var(--red); }

.creative-img { width: 100%; display: block; }
.img-placeholder {
  height: 156px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500; color: var(--ink-3); letter-spacing: .03em;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.img-wrap { position: relative; }
.img-wrap .btn-replace-img {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 20px;
  font-size: 11px; font-weight: 600; padding: 4px 12px; cursor: pointer;
  opacity: 0; transition: opacity .15s; white-space: nowrap;
}
.img-wrap:hover .btn-replace-img { opacity: 1; }

.strip {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--line);
  padding: 10px 14px;
}
.hl-edit {
  flex: 1; min-width: 0;
  border: none; background: transparent;
  font-size: 14px; font-weight: 700; font-family: inherit; color: var(--ink);
  padding: 3px 4px;
  border-bottom: 2px solid transparent;
  transition: border-color var(--t);
  outline: none; border-radius: 3px;
}
.hl-edit:focus { border-bottom-color: var(--amber); }
.hl-edit.saving { border-bottom-color: var(--accent); }
.hl-edit.saved  { border-bottom-color: var(--green); }
.hl-edit.error  { border-bottom-color: var(--red); }

.cta-select {
  flex: 0 0 auto;
  border: 1.5px solid var(--li-blue); background: transparent; color: var(--li-blue);
  font-weight: 700; font-size: 13px; font-family: inherit;
  padding: 5px 10px; border-radius: var(--r-pill);
  outline: none; cursor: pointer;
  -webkit-appearance: none; appearance: none; text-align: center;
  transition: border-color var(--t), color var(--t);
}
.cta-select:focus { border-color: var(--amber); color: var(--amber); }
.cta-select.saving { border-color: var(--accent); color: var(--accent); }
.cta-select.saved  { border-color: var(--green); color: var(--green); }
.cta-select.error  { border-color: var(--red); }

.strip-counters { display: flex; justify-content: space-between; padding: 2px 14px 6px; }

.actionbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 13px; font-weight: 500;
  background: var(--surface-2);
}
.actionbar span { padding: 4px 8px; border-radius: var(--r-sm); transition: background var(--t); }
.like-btn { cursor: pointer; user-select: none; }
.like-btn:hover { background: #EFF6FF; color: var(--li-blue); }
.like-btn.liked { color: var(--li-blue); }

/* ── Approve ── */
.approve-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 14px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-3);
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  border-radius: var(--r-pill); cursor: pointer; transition: all var(--t); white-space: nowrap;
}
.approve-btn:hover { border-color: var(--green); color: var(--green); background: var(--green-dim); }
.approve-btn.approved { border-color: var(--green); background: var(--green-dim); color: var(--green); }

/* ── Char counters ── */
.char-counter {
  font-size: 11px; color: var(--ink-3);
  font-variant-numeric: tabular-nums; transition: color var(--t);
}
.char-counter.warn { color: var(--amber); font-weight: 600; }
.char-counter.over { color: var(--red); font-weight: 700; }

/* ── Ad note + glossary ── */
.ad-note { display: none; }
.glossary-warn { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.glossary-warn:empty { display: none; }
.gw-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; line-height: 1.4; padding: 8px 11px;
  background: var(--amber-dim); border: 1px solid rgba(217,119,6,.2);
  border-radius: var(--r); color: #92400E;
}
.gw-item .gw-icon { flex: none; }
.gw-item code { background: rgba(0,0,0,.06); padding: 0 4px; border-radius: 3px; font-size: 11px; }
.gw-item strong { font-weight: 600; }

/* ── Comments ── */
.comments { border-top: 1px solid var(--line); padding: 12px 14px 14px; background: var(--surface-2); }
.c-list { font-size: 13px; margin-bottom: 10px; }
.c-empty { color: var(--ink-3); font-size: 12px; margin: 4px 0; }
.c-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.c-item:last-child { border-bottom: none; }
.c-meta { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.c-meta strong { color: var(--ink); }
.c-text { font-size: 13px; color: var(--ink); white-space: pre-wrap; }
.c-form { display: flex; flex-direction: column; gap: 6px; }
.c-form input, .c-form textarea {
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 7px 10px; font-family: inherit; font-size: 13px; width: 100%;
  background: var(--surface); color: var(--ink); outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.c-form input:focus, .c-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,58,237,.08); }
.c-form textarea { min-height: 54px; resize: vertical; }
.c-form button {
  align-self: flex-start; background: var(--ink); color: #fff; border: none;
  border-radius: var(--r-pill); font-family: inherit; font-weight: 600; font-size: 13px;
  padding: 6px 16px; cursor: pointer; transition: opacity var(--t);
}
.c-form button:hover { opacity: .8; }
.c-form button:disabled { opacity: .4; cursor: default; }
.c-count { font-size: 12px; font-weight: 600; color: var(--ink-3); margin: 0 0 8px; }
.c-del {
  margin-left: 6px; background: none; border: none; color: var(--red);
  font-size: 11px; font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; opacity: .7;
}
.c-del:hover { opacity: 1; }
.c-del:disabled { opacity: .35; cursor: default; }

/* ── Market picker ── */
.market-pick {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 32px; padding: 48px 24px;
  background: var(--bg); text-align: center;
}
.market-pick-title { font-size: 24px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); margin-bottom: 4px; }
.market-pick-sub { font-size: 15px; color: var(--ink-2); }
.market-grid { display: grid; grid-template-columns: repeat(2, 200px); gap: 12px; }
.market-card {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-xl); padding: 22px 20px; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  text-align: left; box-shadow: var(--shadow-xs);
}
.market-card:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(124,58,237,.1); transform: translateY(-2px); }
.market-flag { margin-bottom: 10px; display: block; }
.market-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.market-lang { font-size: 12px; color: var(--ink-3); }
.market-count { font-size: 11px; color: var(--ink-3); margin-top: 6px; font-weight: 500; }

/* ── Dashboard ── */
#view-dashboard { flex: 1; overflow-y: auto; }
.dashboard { padding: 28px; max-width: 1080px; }
.dashboard-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.dashboard-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.dashboard-switch {
  font-size: 12px; color: var(--accent); cursor: pointer;
  background: none; border: none; font-family: inherit; font-weight: 600; padding: 0;
  transition: opacity var(--t);
}
.dashboard-switch:hover { opacity: .65; }
.dashboard-empty { color: var(--ink-3); font-size: 14px; padding: 48px 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.campaign-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 20px; cursor: pointer;
  display: flex; flex-direction: column; gap: 12px; min-height: 168px;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  box-shadow: var(--shadow-xs);
}
.campaign-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(124,58,237,.1), 0 2px 6px rgba(0,0,0,.04);
  transform: translateY(-2px);
}
.cc-top { display: flex; align-items: center; justify-content: space-between; }
.prog-ring {
  width: 44px; height: 44px; border-radius: 50%; flex: none; position: relative;
  background: conic-gradient(var(--ring-c, var(--green)) calc(var(--pct, 0) * 1%), var(--line) 0);
}
.prog-ring::before { content: ''; position: absolute; inset: 5px; background: var(--surface); border-radius: 50%; }
.prog-ring span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.status-pill { font-size: 10.5px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-pill); }
.status-pill.todo  { background: var(--line-2); color: var(--ink-3); }
.status-pill.doing { background: var(--amber-dim); color: var(--amber); }
.status-pill.done  { background: var(--green-dim); color: var(--green); }
.campaign-card-meta { display: flex; align-items: center; gap: 7px; }
.campaign-card-title { font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.cc-count { font-size: 12px; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.flag-badge { font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); background: var(--amber-dim); color: var(--amber); }
.flag-badge.ok { background: var(--green-dim); color: var(--green); }

/* ── Add Campaign tab ── */
#tab-intake.active { overflow-y: auto; }
.intake-wrap { max-width: 680px; margin: 0 auto; padding: 40px 24px 80px; width: 100%; }
.intake-heading { font-size: 22px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 4px; }
.intake-sub { font-size: 14px; color: var(--ink-2); margin-bottom: 32px; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.form-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 160px; }
.form-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.form-field select, .form-field input[type="text"] {
  border: 1.5px solid var(--line); border-radius: var(--r);
  padding: 8px 12px; font-family: inherit; font-size: 14px;
  background: var(--surface); color: var(--ink); outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  appearance: none; -webkit-appearance: none;
}
.form-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.form-field select:focus, .form-field input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,58,237,.1); }

.format-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 16px; }
.format-box-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.btn-copy-template { font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--accent); background: none; border: 1px solid var(--accent); border-radius: 20px; padding: 2px 10px; cursor: pointer; }
.btn-copy-template:hover { background: var(--accent); color: #fff; }
.format-box pre { font-size: 12px; font-family: 'ui-monospace', 'Cascadia Code', monospace; color: var(--ink-2); line-height: 1.7; white-space: pre-wrap; }
.format-box pre em { color: var(--accent); font-style: normal; font-weight: 600; }

.intake-paste {
  width: 100%; min-height: 220px;
  border: 1.5px solid var(--line); border-radius: var(--r);
  padding: 14px 16px;
  font-family: 'ui-monospace', 'Cascadia Code', monospace;
  font-size: 13px; line-height: 1.7; resize: vertical;
  background: var(--surface); color: var(--ink); margin-bottom: 14px;
  outline: none; transition: border-color var(--t), box-shadow var(--t);
}
.intake-paste:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,58,237,.1); }

.intake-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.btn-secondary {
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink-2);
  font-family: inherit; font-weight: 600; font-size: 13px; padding: 7px 16px;
  border-radius: var(--r); cursor: pointer; transition: border-color var(--t), background var(--t);
}
.btn-secondary:hover { border-color: var(--ink-3); background: var(--surface-2); }
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  font-family: inherit; font-weight: 600; font-size: 13px; padding: 7px 18px;
  border-radius: var(--r); cursor: pointer; display: none;
  transition: opacity var(--t), transform var(--t);
  box-shadow: 0 1px 3px rgba(124,58,237,.3);
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn-primary:disabled { opacity: .5; cursor: default; transform: none; }

.intake-status { font-size: 13px; color: var(--ink-3); }
.intake-status.ok  { color: var(--green); font-weight: 500; }
.intake-status.err { color: var(--red); }

.intake-instructions {
  background: var(--accent-dim); border: 1px solid rgba(124,58,237,.15);
  border-radius: var(--r); padding: 12px 14px; font-size: 13px; color: #5B21B6;
  margin-bottom: 16px; display: none; line-height: 1.6;
}
.intake-preview-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; display: none; }
.intake-preview { display: flex; flex-wrap: wrap; gap: 20px; }

/* ── Settings tab ── */
#tab-settings.active { overflow-y: auto; }
.settings-section { margin-bottom: 32px; }
.settings-section-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.settings-section-desc { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; line-height: 1.6; }
.settings-section-desc code {
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 3px; font-size: 12px;
  font-family: 'ui-monospace', monospace; color: var(--accent);
}
.settings-textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; font-family: 'ui-monospace', 'Cascadia Code', monospace;
  font-size: 13px; line-height: 1.7; resize: vertical;
  background: var(--surface); color: var(--ink); outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.settings-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
.settings-glossary-box {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; font-size: 13px; color: var(--ink-2); line-height: 1.6;
}
.settings-glossary-box code { font-family: 'ui-monospace', monospace; font-size: 12px; color: var(--accent); }
.settings-glossary-box strong { color: var(--ink); font-weight: 600; }

/* ── Variations button ── */
.variations-btn {
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink-2);
  font-family: inherit; font-weight: 600; font-size: 13px; padding: 7px 14px;
  border-radius: var(--r); cursor: pointer; transition: border-color var(--t), color var(--t), background var(--t);
  white-space: nowrap;
}
.variations-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── Translation modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: 0 24px 48px rgba(0,0,0,.18); width: 100%; max-width: 720px;
  display: flex; flex-direction: column; gap: 14px; padding: 24px; max-height: 90vh;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.modal-close {
  background: none; border: none; font-size: 16px; color: var(--ink-3);
  cursor: pointer; padding: 4px 8px; border-radius: var(--r-sm);
  transition: background var(--t), color var(--t); line-height: 1;
}
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-desc { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.modal-textarea {
  flex: 1; min-height: 320px; max-height: 55vh;
  border: 1.5px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; font-family: 'ui-monospace', 'Cascadia Code', monospace;
  font-size: 12px; line-height: 1.7; resize: none;
  background: var(--surface-2); color: var(--ink); outline: none; overflow-y: auto;
}
.modal-actions { display: flex; gap: 10px; align-items: center; }

/* ── Util ── */
.hidden { display: none !important; }
