/* content.css — Content tab styles.

   Layout reuses the analytics classes (.an-wrap, .an-header, .an-section,
   .an-table, .an-empty, .an-error, .an-table-meta) so visuals stay
   consistent with the Analytics tab. This file only adds Content-specific
   bits: sub-tab nav, status pills, and the nav-bar pending badge. */

#view-seo { flex: 1; overflow-y: auto; background: var(--bg); }

/* Orders-style page header: title + subtitle (left), folder tabs (right), docked
   on the header's 1px baseline. The pagehead carries the rail; tabs dip -1px. */
#view-seo .pv2-pagehead { border-bottom: 1px solid var(--line-strong); padding-bottom: 0; }
#view-seo .pv2-pagehead > div:first-child { padding-bottom: 14px; }
#view-seo .pv2-pagehead .pv2-sub { max-width: 620px; }

/* Control row beneath the header (Generate ideas / + New Topic), right-aligned. */
.co-controls-row { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

/* Folder page-tabs (Topics / Drafts / Published) — Orders io-subnav mechanic,
   class-named separately so click handlers don't cross-fire. The header owns the
   1px baseline; each tab dips -1px over it with no bottom border. Active =
   --green-bg fill, which paints over the rail so the line is "cut" under the tab. */
.co-subtabs {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  margin-bottom: -1px;
}
.co-subtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-bottom: 0;
  background: transparent;
  padding: 10px 18px 12px;
  border-radius: 11px 11px 0 0;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: background .14s, color .14s, border-color .14s;
}
.co-subtab svg { width: 16px; height: 16px; flex: none; }
.co-subtab:hover { color: var(--ink); }
.co-subtab.active { background: var(--green-bg); color: var(--green-2); border-color: var(--line-strong); }

/* Nested switcher inside the Content pane (Ideas / Drafts / Published).
   Deliberately lighter than the outer folder tabs so the hierarchy reads at a
   glance — pill-shaped and inline rather than docked to the header baseline. */
.co-subtabs-inner { display: flex; gap: 6px; margin: 0 0 14px; border: 0; padding: 0; }
.co-subtab2 {
  padding: 5px 13px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim); border-radius: 999px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; user-select: none; transition: background .12s, border-color .12s, color .12s;
}
.co-subtab2:hover { border-color: var(--green); color: var(--ink); }
.co-subtab2.active { background: var(--green-bg); color: var(--green-2); border-color: var(--green); }

/* Status pills */
.co-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.co-pill-proposed       { background: rgba(120,120,120,0.12); color: #7d7d7d; }
.co-pill-approved       { background: rgba(92,168,92,0.18);  color: #2e7a2e; }
.co-pill-drafting       { background: rgba(184,134,11,0.16); color: #9b7211; }
.co-pill-pending_review { background: rgba(255,140,0,0.18);  color: #b8650b; }
.co-pill-published      { background: rgba(46,125,50,0.20);  color: #1b5e20; }
.co-pill-killed         { background: rgba(192,57,43,0.18);  color: #c0392b; }

/* Status strip — shown above sub-tab content. Pause toggle + last-cycle
   info + manual "Run now" button. */
.co-status-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  font-size: 12px;
  flex-wrap: wrap;
}
.co-status-strip:empty { display: none; }
.co-status-active {
  background: rgba(92,168,92,0.08);
  border: 1px solid rgba(92,168,92,0.20);
}
.co-status-paused {
  background: rgba(184,134,11,0.10);
  border: 1px solid rgba(184,134,11,0.25);
}
.co-status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
}
.co-status-pill-active { background: var(--accent); color: #fff; }
.co-status-pill-paused { background: var(--yellow); color: #fff; }
.co-status-meta {
  flex: 1 1 auto;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
}
.co-status-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* "AI" tag next to suggestion titles */
.co-source {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  vertical-align: middle;
  font-family: var(--font);
}

/* Pending-review drafts badge on the Content nav tab.
   Empty by default; Phase 4 sets text content when there are reviewable drafts. */
#content-pending-badge:empty { display: none; }
#content-pending-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 100px;
  background: var(--yellow);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font);
  letter-spacing: .2px;
}

/* Drafts / Published placeholders */
.co-placeholder {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}
.co-placeholder strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 6px; }
.co-placeholder code {
  font-family: var(--font);
  background: var(--surface2);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--text);
  border: 1px solid var(--border);
}

/* Draft cards (pending review list) */
.co-draft-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  padding: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.co-draft-thumb {
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--border);
  display: block;
}
/* Held drafts: failed the score gate, never auto-publish. Loud on purpose —
   this is the one card state that needs a human before anything happens. */
.co-draft-held { border-left: 3px solid var(--mm-warn, #b45309); }
.co-draft-hold {
  margin: 4px 0 8px; padding: 6px 10px; border-radius: 4px;
  background: rgba(180, 83, 9, .10); color: var(--mm-warn, #b45309);
  font-size: 12px; font-weight: 600; line-height: 1.4;
}
.co-draft-issues { margin: 8px 0; font-size: 12px; }
.co-draft-issues > summary { cursor: pointer; color: var(--mm-ink-2, #666); user-select: none; }
.co-draft-issues > summary:hover { color: var(--mm-ink, #222); }
.co-draft-issues ul { margin: 8px 0 0; padding-left: 18px; }
.co-issue { margin-bottom: 8px; line-height: 1.45; }
.co-issue strong { text-transform: uppercase; font-size: 10px; letter-spacing: .4px; }
.co-issue-blocker strong { color: #b91c1c; }
.co-issue-warning strong { color: #b45309; }
.co-issue em { color: var(--mm-ink-2, #666); }

.co-draft-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-faint);
  background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 8px, var(--surface2) 8px, var(--surface2) 16px);
}
.co-draft-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.co-draft-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}
.co-draft-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font);
}
.co-draft-stat { white-space: nowrap; }
.co-draft-score {
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  font-size: 10px;
  white-space: nowrap;
}
.co-score-good { background: rgba(92,168,92,0.18); color: #2e7a2e; }
.co-score-mid  { background: rgba(184,134,11,0.16); color: #9b7211; }
.co-score-low  { background: rgba(192,57,43,0.18); color: #c0392b; }
.co-draft-countdown {
  font-weight: 700;
  color: var(--accent);
}
.co-draft-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .co-draft-card { grid-template-columns: 1fr; }
  .co-draft-thumb { width: 100%; height: 160px; }
}
