/* ============================================================
   Portor Marketing Command Center — styles.css
   Plain CSS, no framework. LinkedIn-style preview card.
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary: #0f172a;
  --color-primary-soft: #1e293b;
  --color-accent: #0369a1;
  --color-accent-soft: #e0f2fe;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-muted: #f1f5f9;
  --color-text: #0f172a;
  --color-muted-text: #64748b;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .04);
  --shadow-menu: 0 16px 36px rgba(15, 23, 42, .14);
  --radius-card: 8px;
  --radius-control: 6px;
}

html { font-size: 15px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: "Consolas", "Menlo", monospace;
  font-size: 0.85em;
  background: #eef2f7;
  padding: 1px 5px;
  border-radius: 3px;
}

/* ── Site header ───────────────────────────────────────────── */
.site-header {
  background: rgba(255, 255, 255, .96);
  color: var(--color-text);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
  backdrop-filter: blur(12px);
}
.site-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-logo { display: flex; align-items: center; gap: 10px; color: inherit; }
.site-logo:hover { text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .16);
}
.site-title { font-weight: 700; font-size: .98rem; letter-spacing: 0; white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.logout-form { margin-left: auto; }
.logout-button {
  appearance: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted-text);
  padding: 8px 11px;
  border-radius: var(--radius-control);
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.logout-button:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}
.nav-group { position: relative; }
.nav-trigger {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-muted-text);
  padding: 8px 12px;
  border-radius: var(--radius-control);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.nav-trigger::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.nav-group:hover .nav-trigger,
.nav-group:focus-within .nav-trigger,
.nav-group-active .nav-trigger {
  color: var(--color-text);
  background: var(--color-surface-muted);
  border-color: var(--color-border);
}
.nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  padding: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-menu);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.nav-menu-right { left: auto; right: 0; }
.nav-group:hover .nav-menu,
.nav-group:focus-within .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-menu-link {
  display: block;
  color: var(--color-text);
  padding: 9px 10px;
  border-radius: var(--radius-control);
  font-size: .88rem;
  font-weight: 650;
  transition: background .16s ease, color .16s ease;
}
.nav-menu-link:hover,
.nav-menu-link-active {
  background: var(--color-accent-soft);
  color: #075985;
  text-decoration: none;
}
.nav-menu-link-danger { color: #b91c1c; }
.mobile-nav { display: none; border-top: 1px solid var(--color-border); }
.mobile-nav summary {
  cursor: pointer;
  padding: 12px 20px;
  font-weight: 800;
  color: var(--color-text);
  list-style: none;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav-panel {
  display: grid;
  gap: 12px;
  padding: 0 20px 18px;
}
.mobile-nav-section {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}
.mobile-nav-section span {
  color: var(--color-muted-text);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mobile-nav-section a {
  color: var(--color-text);
  font-weight: 650;
  padding: 7px 0;
}

/* ── Main / footer ────────────────────────────────────────── */
.site-main { flex: 1; padding: 30px 24px 44px; }
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 12px 20px;
  font-size: .8rem;
  color: #888;
  text-align: center;
}
.site-footer-inner { max-width: 1320px; margin: 0 auto; }

/* Login */
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(3, 105, 161, .10), transparent 28rem),
    var(--color-bg);
}
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.auth-card {
  width: min(100%, 430px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 28px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.auth-brand h1 {
  font-size: 1.25rem;
  line-height: 1.2;
}
.auth-brand p {
  color: var(--color-muted-text);
  font-size: .9rem;
  margin-top: 2px;
}
.auth-form {
  display: grid;
  gap: 16px;
}
.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--color-text);
  font-weight: 700;
  font-size: .88rem;
}
.auth-form input {
  width: 100%;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  padding: 10px 11px;
  font: inherit;
  color: var(--color-text);
  background: #fff;
}
.auth-form input:focus {
  outline: 2px solid rgba(3, 105, 161, .18);
  border-color: var(--color-accent);
}
.alert {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: .9rem;
}
.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

/* ── Page container ───────────────────────────────────────── */
.page-container { max-width: 1320px; margin: 0 auto; }

.page-header { margin-bottom: 24px; }
.page-eyebrow {
  color: var(--color-accent);
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.page-title { font-size: 1.55rem; font-weight: 800; color: var(--color-text); margin-bottom: 5px; letter-spacing: 0; }
.page-subtitle { color: var(--color-muted-text); font-size: .92rem; max-width: 760px; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 750;
  white-space: nowrap;
  letter-spacing: 0;
  border: 1px solid transparent;
  line-height: 1.1;
}
.badge-approved,
.badge-online      { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.badge-not-approved,
.badge-pending     { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.badge-rejected,
.badge-failed,
.badge-offline     { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.badge-scheduled,
.badge-in-progress { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.badge-posted      { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.badge-generated   { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.badge-needed,
.badge-regenerate  { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.badge-muted,
.badge-not-scheduled { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

/* Readiness state badges */
.state-badge { font-size: .72rem; }
.state-draft-incomplete        { background: #e5e7eb; color: #374151; border-color: #d1d5db; }
.state-needs-visual            { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.state-ready-for-approval,
.state-ready-for-review        { background: #ecfeff; color: #155e75; border-color: #a5f3fc; }
.state-approved-not-scheduled  { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.state-scheduled               { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.state-needs-metrics           { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.state-posted                  { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }

/* ── Calendar table ───────────────────────────────────────── */
.calendar-table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.calendar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.calendar-table thead {
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
}
.calendar-table th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 800;
  color: var(--color-muted-text);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.calendar-table tbody tr {
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
  transition: background .16s ease;
}
.calendar-table tbody tr:last-child { border-bottom: none; }
.calendar-table tbody tr:hover { background: #f8fafc; }
.calendar-table td { padding: 12px 14px; vertical-align: middle; }

.col-date { font-weight: 600; white-space: nowrap; }
.col-day  { color: #666; white-space: nowrap; }
.col-title { max-width: 280px; }
.col-pillar { max-width: 200px; }

.post-link { color: var(--color-text); font-weight: 650; }
.post-link:hover { color: var(--color-accent); text-decoration: none; }
.post-title-link { color: var(--color-accent); }
.pillar-label { color: var(--color-muted-text); font-size: .82rem; }

.empty-state {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 48px 32px;
  text-align: center;
  color: var(--color-muted-text);
  box-shadow: var(--shadow-card);
}
.empty-state p { margin-bottom: 10px; }

/* ── Post detail layout ───────────────────────────────────── */
.detail-header {
  margin-bottom: 24px;
}
.back-link {
  display: inline-block;
  color: #0a66c2;
  font-size: .85rem;
  margin-bottom: 10px;
}
.back-link:hover { text-decoration: underline; }
.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  align-items: center;
}
.meta-chip {
  background: #e9e9e9;
  color: #444;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: .78rem;
  font-weight: 500;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(420px, 580px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 1040px) {
  .detail-layout { grid-template-columns: 1fr; }
}

/* ── LinkedIn card ────────────────────────────────────────── */
.linkedin-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  max-width: 552px;
}

/* Author row */
.lk-author-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px 8px;
}
.lk-logo {
  width: 48px; height: 48px;
  background: var(--color-primary);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 800; font-size: 22px;
  flex-shrink: 0;
}
.lk-author-info { line-height: 1.3; }
.lk-author-name  { font-weight: 700; font-size: .93rem; color: #1d2226; }
.lk-author-sub   { font-size: .78rem; color: #666; }
.lk-author-date  { font-size: .75rem; color: #888; margin-top: 1px; }

/* Post copy */
.lk-copy {
  padding: 4px 16px 10px;
  font-size: .93rem;
  line-height: 1.6;
  color: #1d2226;
  white-space: pre-wrap;   /* preserves newlines from the CSV */
  word-break: break-word;
}

/* CTA line */
.lk-cta {
  padding: 0 16px 10px;
  font-size: .88rem;
  color: var(--color-accent);
  font-style: italic;
}

/* ── Image area ───────────────────────────────────────────── */
.lk-image img {
  width: 100%;
  display: block;
  max-height: 400px;
  object-fit: cover;
}

.lk-image-placeholder {
  background: #e9e5df;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #777;
  padding: 32px 20px;
  text-align: center;
}
.placeholder-icon  { font-size: 2.4rem; }
.placeholder-label { font-weight: 600; font-size: .95rem; }
.placeholder-sub   { font-size: .82rem; color: #999; line-height: 1.5; }

.no-image-note {
  padding: 10px 16px;
  font-size: .8rem;
  color: #888;
  font-style: italic;
  border-top: 1px solid #f0efed;
}

/* Asset notes row */
.asset-notes-row {
  padding: 6px 16px;
  font-size: .8rem;
  color: #666;
  border-top: 1px solid #f0efed;
  background: #fafaf9;
}
.asset-notes-icon { margin-right: 4px; }

/* ── Poll card ────────────────────────────────────────────── */
.lk-poll-wrap { padding: 0 16px 10px; }

.lk-poll-card {
  border: 1.5px solid #d6d0c8;
  border-radius: 10px;
  padding: 14px 16px 10px;
  background: #fafaf8;
}
.poll-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: .82rem;
  color: #666;
  font-weight: 500;
}
.poll-icon { font-size: 1rem; }
.poll-question {
  font-weight: 700;
  font-size: .95rem;
  color: #1d2226;
  margin-bottom: 12px;
  line-height: 1.4;
}
.poll-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.poll-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1.5px solid #d6d0c8;
  border-radius: 20px;
  font-size: .88rem;
  background: #fff;
  cursor: default;
}
.poll-option:hover { border-color: #0a66c2; background: #f0f7ff; }
.poll-radio {
  width: 16px; height: 16px;
  border: 2px solid #aaa;
  border-radius: 50%;
  flex-shrink: 0;
}
.poll-option-text { color: #1d2226; }
.poll-option-placeholder .poll-option-text { color: #aaa; }
.poll-footer {
  font-size: .75rem;
  color: #888;
  padding-top: 4px;
  border-top: 1px solid #ece9e4;
  margin-top: 4px;
}

/* ── Engagement bar ───────────────────────────────────────── */
.lk-engagement-bar {
  display: flex;
  border-top: 1px solid #e0deda;
  padding: 2px 4px;
}
.lk-reaction {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  font-size: .82rem;
  color: #666;
  border-radius: 4px;
  cursor: default;
  transition: background .12s;
  white-space: nowrap;
}
.lk-reaction:hover { background: #f3f2ef; }

/* ── Warning banners ──────────────────────────────────────── */
.warning-banner {
  border-radius: var(--radius-card);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: .86rem;
  line-height: 1.5;
}
.warning-poll  { background: #fef9c3; border: 1px solid #f59e0b; color: #78350f; }
.warning-image { background: #fff7ed; border: 1px solid #fb923c; color: #9a3412; }

.approval-warning {
  margin-top: 10px;
  padding: 8px 12px;
  background: #fff7ed;
  border: 1px solid #fb923c;
  border-radius: 6px;
  font-size: .83rem;
  color: #9a3412;
}

/* ── Status row below card ────────────────────────────────── */
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.status-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #888;
  font-weight: 600;
}
.posted-url-link { font-size: .83rem; }

/* ── Readiness block ──────────────────────────────────────── */
.readiness-block {
  margin-top: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}
.readiness-title {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #888;
  font-weight: 600;
  margin-bottom: 8px;
}
.readiness-state-display { margin-bottom: 12px; }
.readiness-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.readiness-checklist li { font-size: .87rem; padding: 3px 0; }
.check-pass { color: #166534; }
.check-fail { color: #991b1b; }
.check-warn { color: #78350f; }

/* ── Action buttons ───────────────────────────────────────── */
.action-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.inline-form { display: inline; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: .88rem;
  font-weight: 750;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .1s ease;
  line-height: 1.15;
  text-align: center;
}
.btn:hover  { filter: none; text-decoration: none; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.btn:active { transform: scale(.97); }

.btn-approve { background: var(--color-accent); color: #fff; }
.btn-reject  { background: #dc2626; color: #fff; }
.btn-save    { background: var(--color-accent); color: #fff; width: 100%; padding: 10px; border-radius: var(--radius-control); font-size: .9rem; }

/* ── Edit card ────────────────────────────────────────────── */
.edit-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 20px 20px 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.edit-card-secondary { background: #f8fafc; }
.edit-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1d2226;
  margin-bottom: 2px;
}
.edit-card-sub {
  font-size: .8rem;
  color: #888;
  margin-bottom: 16px;
}

/* ── Form elements ────────────────────────────────────────── */
.edit-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group-half { /* inherits from grid */ }

.form-label {
  font-size: .78rem;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-textarea,
.form-input,
.form-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  font-family: inherit;
  font-size: .9rem;
  color: #1d2226;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
  resize: vertical;
}
.form-textarea:focus,
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(3, 105, 161, .12);
}
.form-textarea-tall { min-height: 260px; font-size: .88rem; line-height: 1.55; white-space: pre-wrap; }
.form-select { cursor: pointer; }

.form-actions { padding-top: 4px; }

/* ── Image prompt / talking point boxes ──────────────────── */
.image-prompt-box {
  background: #f1f5f9;
  border: 1px solid #dde3ea;
  border-radius: 6px;
  padding: 12px;
  font-size: .85rem;
  color: #334155;
  white-space: pre-wrap;
  line-height: 1.5;
  margin-bottom: 10px;
}
.suggested-visual-note {
  font-size: .82rem;
  color: #555;
  line-height: 1.5;
}
.talking-point-box {
  background: #f1f5f9;
  border-left: 3px solid #0a66c2;
  padding: 10px 14px;
  font-size: .88rem;
  color: #1d2226;
  line-height: 1.5;
  border-radius: 0 6px 6px 0;
}

/* ── Image Tasks ──────────────────────────────────────────── */
.col-task-link { white-space: nowrap; }

.task-file-link {
  font-size: .85rem;
  font-weight: 600;
  color: #0a66c2;
  text-decoration: none;
}
.task-file-link:hover { text-decoration: underline; }

.task-no-file {
  font-size: .82rem;
  color: #aaa;
}

.task-post-link-row {
  margin-top: 14px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}

/* ── Prompt box (image task detail) ─────────────────────── */
.prompt-box {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 4px;
}

/* ── Save path box ────────────────────────────────────────── */
.save-path-box {
  background: #f1f5f9;
  border: 1px solid #dde3ea;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: .83rem;
  color: #334155;
  word-break: break-all;
}
.save-path-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ── Form hint text ───────────────────────────────────────── */
.form-hint {
  font-size: .75rem;
  color: #888;
  margin-top: 2px;
}

/* ── Task Queue ───────────────────────────────────────────── */

/* Status badges */
.task-status-badge { text-transform: capitalize; }
.task-status-pending     { background: #fef3c7; color: #92400e; }
.task-status-in_progress { background: #dbeafe; color: #1e40af; }
.task-status-completed   { background: #dcfce7; color: #166534; }
.task-status-failed      { background: #fee2e2; color: #991b1b; }
.task-status-cancelled   { background: #f3f4f6; color: #6b7280; }

/* Task type label in table */
.task-type-label {
  font-size: .78rem;
  color: #555;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Action strip (create workflow / create scheduling) */
.task-action-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 680px) {
  .task-action-strip { grid-template-columns: 1fr; }
}

.task-action-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
}
.task-action-title {
  font-size: .9rem;
  font-weight: 700;
  color: #1d2226;
  margin-bottom: 3px;
}
.task-action-sub {
  font-size: .78rem;
  color: #888;
  margin-bottom: 12px;
}
.task-action-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.task-action-date {
  flex: 1;
  max-width: 160px;
  padding: 6px 8px;
  font-size: .85rem;
}
.btn-task-create {
  background: #0a66c2;
  color: #fff;
  padding: 7px 14px;
  font-size: .84rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* Filter bar */
.task-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.task-filter-label {
  font-size: .78rem;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-right: 2px;
}
.task-filter-link {
  font-size: .82rem;
  padding: 4px 12px;
  border-radius: 20px;
  color: #555;
  text-decoration: none;
  background: #f3f4f6;
  transition: background .15s, color .15s;
}
.task-filter-link:hover { background: #e5e7eb; color: #1d2226; }
.task-filter-active { background: #0a66c2; color: #fff; font-weight: 600; }
.task-filter-active:hover { background: #0957a8; color: #fff; }

/* Task detail — meta table */
.task-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: .87rem;
}
.task-meta-table tr + tr td { border-top: 1px solid #f0f0f0; }
.tmt-label {
  color: #888;
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 6px 12px 6px 0;
  width: 110px;
  white-space: nowrap;
  vertical-align: top;
}
.tmt-value { padding: 6px 0; color: #1d2226; }
.tmt-ts { font-size: .78rem; color: #666; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* Task description */
.task-description {
  font-size: .87rem;
  color: #444;
  line-height: 1.5;
  padding-top: 4px;
  border-top: 1px solid #f0f0f0;
}

/* Task actions panel */
.task-actions-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.task-action-inline { display: block; }
.task-action-block  { display: flex; flex-direction: column; gap: 8px; }

.btn-task-start    { background: #0a66c2; color: #fff; }
.btn-task-complete { background: #166534; color: #fff; }
.btn-task-fail     { background: #dc2626; color: #fff; }
.btn-task-cancel   { background: #6b7280; color: #fff; }
.btn-task-retry    { background: #d97706; color: #fff; }

/* Task error box */
.task-error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3px solid #dc2626;
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  font-size: .85rem;
  color: #991b1b;
  line-height: 1.5;
}

/* Terminal state note */
.task-terminal-note {
  font-size: .87rem;
  padding: 10px 14px;
  border-radius: 6px;
}
.task-terminal-done { background: #dcfce7; color: #166534; }

/* ── Weekly Prep ──────────────────────────────────────────── */

/* Section cards */
.prep-card {
  background: #fff;
  border-radius: 8px;
  padding: 22px 24px 26px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  margin-bottom: 18px;
  position: relative;
}
.prep-card-muted { background: #fafafa; }

.prep-step-badge {
  display: inline-block;
  background: #0a66c2;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.prep-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1d2226;
  margin-bottom: 4px;
}
.prep-card-sub {
  font-size: .82rem;
  color: #666;
  margin-bottom: 18px;
  line-height: 1.5;
}

/* Flash messages */
.prep-flash {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: .87rem;
  margin-bottom: 16px;
  line-height: 1.5;
}
.prep-flash-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.prep-flash-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Controls row (week selector + skeleton button) */
.prep-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.prep-inline-form { display: flex; gap: 8px; align-items: center; }
.prep-date-input  { max-width: 160px; padding: 7px 10px; font-size: .88rem; }
.btn-muted        { background: #f3f4f6; color: #374151; border: 1.5px solid #d1d5db; }
.btn-muted:hover  { background: #e5e7eb; }

/* Week row table */
.week-row-table { margin-top: 4px; }

/* Prompt output area */
.prep-prompt-section {
  margin-top: 20px;
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;
}
.prep-prompt-label {
  font-size: .85rem;
  color: #1d2226;
  margin-bottom: 10px;
  line-height: 1.5;
}
.prep-prompt-output {
  width: 100%;
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.6;
  color: #1d2226;
  background: #f8fafc;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  padding: 12px 14px;
  resize: vertical;
  box-sizing: border-box;
}
.prep-prompt-hint {
  font-size: .75rem;
  color: #888;
  margin-top: 6px;
}

/* Prep form layout */
.prep-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* JSON import section */
.prep-json-section { margin-top: 16px; }
.prep-json-textarea {
  width: 100%;
  min-height: 280px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.6;
  color: #1d2226;
  background: #f8fafc;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  padding: 12px 14px;
  resize: vertical;
  box-sizing: border-box;
  display: block;
  margin-bottom: 12px;
}
.prep-json-textarea:focus {
  outline: none;
  border-color: #0a66c2;
  box-shadow: 0 0 0 3px rgba(10,102,194,.10);
}
.prep-json-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Validation result boxes */
.prep-validation-box {
  border-radius: 6px;
  padding: 12px 16px;
  font-size: .87rem;
  line-height: 1.5;
  margin-bottom: 16px;
}
.prep-validation-ok {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  color: #166534;
}
.prep-validation-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.prep-error-list,
.prep-warning-list {
  margin: 8px 0 0 18px;
  padding: 0;
  font-size: .84rem;
  line-height: 1.7;
}
.prep-warning-list { color: #92400e; }

/* Image prep section links + worker note */
.prep-link-row {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.prep-worker-note {
  margin-top: 14px;
  background: #f1f5f9;
  border: 1px solid #dde3ea;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: .8rem;
  color: #334155;
  line-height: 1.6;
}
.prep-worker-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .78rem;
  background: #e2e8f0;
  padding: 1px 4px;
  border-radius: 3px;
}

/* ── Image Runs ───────────────────────────────────────────── */

/* Run status badges */
.run-status-pending     { background: #fef3c7; color: #92400e; }
.run-status-in_progress { background: #dbeafe; color: #1e40af; }
.run-status-paused      { background: #fce7f3; color: #9d174d; }
.run-status-completed   { background: #dcfce7; color: #166534; }
.run-status-failed      { background: #fef2f2; color: #991b1b; }
.run-status-cancelled   { background: #f3f4f6; color: #6b7280; }
.run-status-large { font-size: .9rem; padding: 5px 14px; }

/* Run summary row */
.run-summary-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.run-summary-counts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.run-count-chip {
  font-size: .8rem;
  padding: 3px 10px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
}
.run-count-done    { background: #dcfce7; color: #166534; }
.run-count-pending { background: #fef3c7; color: #92400e; }
.run-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.run-meta-row { font-size: .77rem; color: #888; display: flex; gap: 18px; flex-wrap: wrap; }

/* Run error box */
.run-error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3px solid #dc2626;
  border-radius: 0 6px 6px 0;
  padding: 9px 13px;
  font-size: .84rem;
  color: #991b1b;
  margin-bottom: 12px;
}

/* CLI command blocks */
.run-cmd-block { margin-bottom: 12px; }
.run-cmd-label {
  font-size: .74rem;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 3px;
}
.run-cmd {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .8rem;
  background: #1e293b;
  color: #e2e8f0;
  padding: 9px 14px;
  border-radius: 6px;
  word-break: break-all;
}

/* Safety warning */
.run-safety-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 3px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  font-size: .83rem;
  color: #78350f;
  margin-bottom: 18px;
  line-height: 1.5;
}

/* Item cards */
.run-item-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: #fff;
}
.run-item-verified { border-left: 3px solid #166534; }
.run-item-skipped  { border-left: 3px solid #9ca3af; opacity: .75; }
.run-item-failed   { border-left: 3px solid #dc2626; }
.run-item-pending  { border-left: 3px solid #f59e0b; }
.run-item-in_progress,
.run-item-generated_in_browser,
.run-item-saved,
.run-item-logged   { border-left: 3px solid #0a66c2; }

.run-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}
.run-item-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.run-item-date  { font-size: .82rem; color: #666; font-weight: 600; }
.run-item-title { font-size: .88rem; color: #1d2226; font-weight: 500; }
.run-item-id    { font-size: .74rem; color: #aaa; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* Item status badges */
.run-item-status-badge { font-size: .7rem; }
.run-item-status-pending              { background: #fef3c7; color: #92400e; }
.run-item-status-in_progress          { background: #dbeafe; color: #1e40af; }
.run-item-status-generated_in_browser { background: #e0e7ff; color: #3730a3; }
.run-item-status-saved                { background: #f0fdf4; color: #166534; }
.run-item-status-logged               { background: #ecfdf5; color: #065f46; }
.run-item-status-verified             { background: #dcfce7; color: #166534; }
.run-item-status-skipped              { background: #f3f4f6; color: #6b7280; }
.run-item-status-failed               { background: #fef2f2; color: #991b1b; }

.run-item-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 5px;
  padding: 7px 11px;
  font-size: .82rem;
  color: #991b1b;
  margin-bottom: 10px;
}

/* Prompt textarea inside item card */
.run-item-prompt-wrap { margin-bottom: 10px; }
.run-item-prompt-label {
  font-size: .72rem;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.run-item-prompt-text {
  width: 100%;
  min-height: 140px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .76rem;
  line-height: 1.55;
  color: #1d2226;
  background: #f8fafc;
  border: 1.5px solid #d1d5db;
  border-radius: 5px;
  padding: 9px 11px;
  resize: vertical;
  box-sizing: border-box;
  display: block;
}

.run-item-paths  { margin-bottom: 10px; }
.run-item-path   { font-size: .8rem; color: #444; margin-bottom: 3px; }
.run-item-path-label { color: #888; margin-right: 4px; font-weight: 600; }
.run-item-path code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .76rem;
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 3px;
}

.run-item-links { display: flex; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.run-item-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.btn-sm { padding: 4px 12px; font-size: .79rem; }

.run-item-timestamps {
  font-size: .74rem;
  color: #aaa;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ── Content Review ───────────────────────────────────────── */

/* Summary chips */
.cr-summary-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cr-summary-chip {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 12px 20px;
  text-align: center;
  min-width: 80px;
}
.cr-summary-num  { font-size: 1.6rem; font-weight: 700; color: #1d2226; }
.cr-summary-label { font-size: .73rem; color: #888; text-transform: uppercase; letter-spacing: .04em; }
.cr-chip-pass    { background: #dcfce7; }
.cr-chip-pass .cr-summary-num { color: #166534; }
.cr-chip-polish  { background: #fef3c7; }
.cr-chip-polish .cr-summary-num { color: #92400e; }
.cr-chip-rewrite { background: #fef2f2; }
.cr-chip-rewrite .cr-summary-num { color: #991b1b; }
.cr-rewrite-link-row { margin-top: 6px; }

/* Score display */
.cr-score {
  display: inline-block;
  font-weight: 700;
  font-size: .9rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #374151;
}
.cr-score-pass           { background: #dcfce7; color: #166534; }
.cr-score-needs-polish   { background: #fef3c7; color: #92400e; }
.cr-score-needs-rewrite  { background: #fef2f2; color: #991b1b; }
.cr-score-large { font-size: 1.05rem; padding: 4px 12px; }

/* Grade badges */
.cr-grade-badge { font-size: .72rem; }
.cr-grade-pass          { background: #dcfce7; color: #166534; }
.cr-grade-needs-polish  { background: #fef3c7; color: #92400e; }
.cr-grade-needs-rewrite { background: #fef2f2; color: #991b1b; }

/* Table row highlights */
.cr-row-needs-rewrite td { background: #fff8f8; }
.cr-row-needs-polish  td { background: #fffdf0; }

/* Issue chip in table */
.cr-issue-chip {
  font-size: .75rem;
  color: #7c3aed;
  background: #f5f3ff;
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.cr-issue-cell { max-width: 260px; }

/* Recommended action box */
.cr-action-box {
  border-radius: 6px;
  padding: 12px 16px;
  font-size: .88rem;
  line-height: 1.5;
  margin-bottom: 16px;
}
.cr-action-pass          { background: #dcfce7; border: 1px solid #bbf7d0; color: #166534; }
.cr-action-needs-polish  { background: #fef3c7; border: 1px solid #fde68a; color: #92400e; }
.cr-action-needs-rewrite { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* Issues and strengths lists */
.cr-issue-list, .cr-strength-list {
  margin: 0; padding: 0; list-style: none;
}
.cr-issue-item {
  font-size: .86rem;
  color: #7c3aed;
  padding: 5px 0;
  border-bottom: 1px solid #f5f3ff;
  line-height: 1.45;
}
.cr-issue-item:last-child { border-bottom: none; }
.cr-strength-item {
  font-size: .86rem;
  color: #166534;
  padding: 5px 0;
  border-bottom: 1px solid #f0fdf4;
  line-height: 1.45;
}
.cr-strength-item:last-child { border-bottom: none; }

/* Poll preview in review detail */
.cr-poll-question {
  font-size: .95rem;
  font-weight: 600;
  color: #1d2226;
  margin-bottom: 10px;
}
.cr-poll-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.cr-poll-option {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  padding: 6px 12px;
  font-size: .86rem;
  color: #374151;
}

/* Poll angle suggestions */
.cr-poll-angle {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}
.cr-poll-angle:last-child { border-bottom: none; }
.cr-poll-angle-q {
  font-size: .88rem;
  font-weight: 600;
  color: #1d2226;
  margin-bottom: 6px;
}
.cr-poll-angle-opts { display: flex; flex-wrap: wrap; gap: 5px; }
.cr-poll-opt-chip {
  font-size: .74rem;
  background: #f3f4f6;
  color: #374151;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Asset warning */
.cr-asset-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 3px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  padding: 10px 13px;
  font-size: .84rem;
  color: #78350f;
  margin-bottom: 12px;
  line-height: 1.5;
}
.cr-asset-path {
  font-size: .8rem;
  color: #444;
  margin-bottom: 6px;
}
.cr-asset-preview img { border: 1px solid #e5e7eb; }

/* Current copy display */
.cr-copy-display {
  font-size: .87rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: #1d2226;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.cr-cta-row, .cr-stp-row {
  font-size: .83rem;
  color: #444;
  padding: 6px 0;
  border-top: 1px solid #f0f0f0;
  line-height: 1.5;
}
.cr-cta-label { color: #888; font-weight: 600; margin-right: 4px; }

/* Rewrite prompt textarea */
.cr-rewrite-prompt {
  width: 100%;
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .76rem;
  line-height: 1.6;
  color: #1d2226;
  background: #f8fafc;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  padding: 12px 14px;
  resize: vertical;
  box-sizing: border-box;
  display: block;
  margin-bottom: 8px;
}

/* Reject asset collapsible */
.reject-asset-details { margin-top: 4px; }
.reject-asset-summary {
  font-size: .83rem;
  color: #991b1b;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}
.reject-asset-summary:hover { text-decoration: underline; }

/* ChatGPT browser content generation */
.cg-notice {
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  color: #17456f;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: .9rem;
  margin: 0 0 16px;
  line-height: 1.45;
}
.cg-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.cg-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.cg-inline-card { border-color: #bfdbfe; background: #fbfdff; }
.cg-form { display: grid; gap: 12px; }
.cg-list-panel { margin-top: 16px; }
.cg-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.cg-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .85rem;
}
.cg-table td { vertical-align: top; }
.cg-empty {
  color: #6b7280;
  font-size: .9rem;
  margin: 8px 0 0;
}
.cg-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.cg-status-pending { color: #92400e; background: #fef3c7; }
.cg-status-in-progress { color: #1d4ed8; background: #dbeafe; }
.cg-status-generated { color: #6d28d9; background: #ede9fe; }
.cg-status-validated { color: #047857; background: #d1fae5; }
.cg-status-imported { color: #065f46; background: #a7f3d0; }
.cg-status-failed { color: #991b1b; background: #fee2e2; }
.cg-status-cancelled { color: #475569; background: #e2e8f0; }
.cg-command-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .78rem;
  color: #111827;
  background: #f8fafc;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 9px 10px;
  margin: 8px 0;
  overflow-x: auto;
  white-space: nowrap;
}
.cg-prompt-block,
.cg-raw-block {
  width: 100%;
  min-height: 520px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .76rem;
  line-height: 1.55;
  color: #1d2226;
  background: #f8fafc;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  padding: 12px 14px;
  resize: vertical;
  box-sizing: border-box;
}
.cg-raw-block { min-height: 320px; }
.cg-validation-box {
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
  font-size: .86rem;
  line-height: 1.45;
}
.cg-validation-ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.cg-validation-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
}
.cg-validation-box ul { margin: 8px 0 0 18px; padding: 0; }
.cg-validation-box pre {
  white-space: pre-wrap;
  margin: 8px 0 0;
  font-size: .78rem;
}
.cg-summary {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 12px;
  font-size: .86rem;
  margin: 0 0 12px;
}
.cg-summary dt {
  color: #64748b;
  font-weight: 700;
}
.cg-summary dd {
  margin: 0;
  color: #1f2937;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .cg-form-grid { grid-template-columns: 1fr; }
  .cg-list-header { align-items: flex-start; flex-direction: column; }
  .cg-summary { grid-template-columns: 1fr; }
}

/* Weekly automation orchestrator */
.wa-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.wa-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: .9rem;
  line-height: 1.45;
  margin-bottom: 16px;
}
.wa-form { display: grid; gap: 12px; }
.wa-checkbox-row {
  display: flex;
  align-items: flex-end;
  min-height: 63px;
}
.wa-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  color: #374151;
  font-weight: 700;
}
.wa-list-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.wa-muted { color: #64748b; font-size: .78rem; }
.wa-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
}
.wa-status-pending { background: #fef3c7; color: #92400e; }
.wa-status-in-progress { background: #dbeafe; color: #1d4ed8; }
.wa-status-paused { background: #ede9fe; color: #6d28d9; }
.wa-status-ready-for-review { background: #d1fae5; color: #047857; }
.wa-status-completed { background: #ccfbf1; color: #0f766e; }
.wa-status-failed { background: #fee2e2; color: #991b1b; }
.wa-status-cancelled { background: #e2e8f0; color: #475569; }
.wa-status-skipped { background: #f1f5f9; color: #475569; }
.wa-status-running-logged-in { background: #d1fae5; color: #047857; }
.wa-status-running-login-needed { background: #fef3c7; color: #92400e; }
.wa-status-running-unchecked { background: #dbeafe; color: #1d4ed8; }
.wa-status-not-running { background: #e2e8f0; color: #475569; }
.wa-status-unclear { background: #ede9fe; color: #6d28d9; }
.wa-command {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .78rem;
  color: #111827;
  background: #f8fafc;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 9px 10px;
  margin: 8px 0;
  overflow-x: auto;
  white-space: nowrap;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.product-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: #fff;
}
.product-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.product-detail-image {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.product-image-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f7;
}
.product-image-row img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.cleanup-week-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.cleanup-preview-week {
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
}
.reject-workflow-card details {
  border-top: 1px solid #e5e7eb;
  padding: 10px 0;
}
.reject-workflow-card summary {
  cursor: pointer;
  font-weight: 700;
}
.wa-steps {
  display: grid;
  gap: 12px;
}
.wa-step {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
}
.wa-step-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 4px;
  background: #cbd5e1;
}
.wa-step-completed .wa-step-dot { background: #10b981; }
.wa-step-in-progress .wa-step-dot { background: #3b82f6; }
.wa-step-active .wa-step-dot { background: #3b82f6; }
.wa-step-failed .wa-step-dot { background: #ef4444; }
.wa-step-skipped .wa-step-dot { background: #94a3b8; }
.wa-step-body {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fcfcfd;
}
.wa-step-title {
  font-weight: 800;
  color: #111827;
  font-size: .9rem;
  margin-bottom: 6px;
}
.wa-step-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #64748b;
  font-size: .78rem;
}
.wa-step-notes {
  margin: 8px 0 0;
  white-space: pre-wrap;
  color: #334155;
  font-size: .72rem;
  background: #f8fafc;
  border-radius: 6px;
  padding: 8px;
  max-height: 150px;
  overflow: auto;
}
.wa-step-error {
  margin-top: 8px;
  color: #991b1b;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  padding: 8px;
  font-size: .8rem;
}
.wa-ready-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .88rem;
  margin-bottom: 12px;
}
.wa-readiness-errors {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .86rem;
  margin-bottom: 12px;
}
.wa-readiness-errors ul { margin: 8px 0 0 18px; padding: 0; }
.wa-post-list {
  display: grid;
  gap: 8px;
}
.wa-post-row {
  display: grid;
  gap: 3px;
  text-decoration: none;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  background: #fcfcfd;
}
.wa-post-row:hover { border-color: #93c5fd; background: #f8fbff; }
.wa-post-row span { color: #64748b; font-size: .78rem; }
.wa-post-row strong { font-size: .9rem; }
.wa-post-row small { color: #64748b; font-size: .75rem; }

@media (max-width: 900px) {
  .wa-list-header { align-items: flex-start; flex-direction: column; }
}

/* Structured CTA / hashtag / spec-button preview additions */
.lk-cta-strong {
  margin: 14px 0 10px;
  padding: 10px 12px;
  border-left: 3px solid #0a66c2;
  background: #eef6ff;
  color: #123b63;
  font-weight: 700;
  border-radius: 6px;
}
.lk-cta-strong a { color: #0a66c2; text-decoration: none; }
.lk-spec-row { margin: 10px 0; }
.lk-spec-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #0a66c2;
  border-radius: 6px;
  color: #0a66c2;
  background: #fff;
  font-weight: 700;
  text-decoration: none;
}
.lk-spec-missing {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #6b7280;
  background: #f9fafb;
  font-size: .86rem;
}
.lk-hashtags {
  margin-top: 12px;
  color: #0a66c2;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-word;
}
.repetition-review-block { border-left: 3px solid #f59e0b; }

/* LinkedIn scheduling MVP */
.schedule-reasons {
  margin: 6px 0 0;
  padding-left: 16px;
  color: #7f1d1d;
  font-size: .8rem;
}
.schedule-time-input {
  min-width: 190px;
  font-size: .82rem;
}

.worker-mini-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.worker-status-card .cg-summary dd {
  overflow-wrap: anywhere;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.service-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}

.service-card-online {
  border-color: #bbf7d0;
}

.service-card-offline {
  border-color: #fecaca;
}

.service-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.service-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.service-log-tail {
  max-height: 220px;
  overflow: auto;
}

.service-task-list {
  display: grid;
  gap: 8px;
}

.service-task-row {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8fafc;
}

.service-task-row .prep-card-sub {
  margin: 0;
  overflow-wrap: anywhere;
}
.col-scheduled small,
.status-item small {
  display: block;
  margin-top: 4px;
  color: #64748b;
}

.public-compose-block,
.generation-details-block {
  margin-top: 14px;
}

.public-compose-block summary,
.generation-details-block summary {
  cursor: pointer;
}

.public-post-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 12px;
  font-family: inherit;
  font-size: .9rem;
  line-height: 1.5;
  color: #111827;
}

.internal-metadata-pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: .76rem;
}

.regen-task-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.regen-task-row {
  display: grid;
  gap: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
  background: #fcfcfd;
  font-size: .82rem;
}

.form-help {
  margin-top: 5px;
  color: #64748b;
  font-size: .76rem;
}

/* Command Center refresh */
.dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
}
.dashboard-hero-actions,
.panel-header,
.quick-action-list,
.service-summary-list,
.recent-run-list {
  display: flex;
  gap: 10px;
}
.dashboard-hero-actions { flex-wrap: wrap; justify-content: flex-end; }
.dashboard-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.dashboard-metric-card {
  display: grid;
  gap: 7px;
  min-height: 140px;
  padding: 18px;
  color: inherit;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.dashboard-metric-card:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: #bae6fd;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}
.metric-attention { border-left: 3px solid #f97316; }
.metric-label {
  color: var(--color-muted-text);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.metric-value {
  color: var(--color-text);
  font-size: 2rem;
  line-height: 1.1;
}
.metric-status-text { font-size: 1.25rem; }
.metric-note {
  color: var(--color-muted-text);
  font-size: .82rem;
  line-height: 1.45;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 16px;
  margin-bottom: 16px;
}
.dashboard-panel { margin-bottom: 0; }
.wa-card,
.cg-panel,
.task-action-card,
.cr-summary-chip,
.service-card,
.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.wa-card {
  padding: 18px;
}
.wa-warning,
.cg-notice,
.wa-ready-box,
.wa-readiness-errors,
.cr-action-box,
.approval-warning {
  border-radius: var(--radius-card);
}
.wa-status,
.cg-status,
.cr-score {
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  line-height: 1.1;
}
.wa-status-pending,
.wa-status-running-login-needed,
.wa-status-running-unchecked,
.cg-status-pending,
.task-status-pending { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.wa-status-in-progress,
.cg-status-in-progress,
.task-status-in_progress { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.wa-status-ready-for-review,
.wa-status-completed,
.wa-status-running-logged-in,
.cg-status-generated,
.cg-status-validated,
.cg-status-imported,
.task-status-completed { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.wa-status-failed,
.cg-status-failed,
.task-status-failed { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.wa-status-cancelled,
.wa-status-skipped,
.wa-status-not-running,
.badge-offline,
.cg-status-cancelled,
.task-status-cancelled { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.wa-status-paused,
.wa-status-unclear { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.btn-task-create {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-task-create:hover,
.btn-approve:hover,
.btn-save:hover { background: #075985; border-color: #075985; }
.btn-muted {
  background: #fff;
  color: #334155;
  border: 1px solid var(--color-border-strong);
}
.btn-muted:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
.btn-sm {
  min-height: 30px;
  padding: 5px 10px;
  font-size: .78rem;
}
.prep-card-title,
.edit-card-title,
.task-action-title {
  color: var(--color-text);
  font-weight: 800;
}
.prep-card-sub,
.edit-card-sub,
.task-action-sub,
.wa-muted,
.cg-empty {
  color: var(--color-muted-text);
}
.service-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.service-card-online { border-color: #bbf7d0; }
.service-card-offline { border-color: #fecaca; }
.service-card-starting { border-color: #fde68a; }
.service-actions { margin: 4px 0 0; }
.service-log-tail,
.wa-step-notes,
.wa-command,
.cg-command-block {
  border: 1px solid var(--color-border);
  background: #f8fafc;
  border-radius: var(--radius-control);
}
.service-log-tail {
  max-height: none;
}
.service-log-details {
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
}
.service-log-details summary {
  cursor: pointer;
  color: var(--color-muted-text);
  font-weight: 800;
  font-size: .82rem;
}
.workflow-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.workflow-step {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.workflow-step span {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--color-primary);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
}
.workflow-step strong { color: var(--color-text); }
.workflow-step small { color: var(--color-muted-text); line-height: 1.35; }
.run-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.run-summary-card {
  display: grid;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 14px;
}
.run-summary-card strong { color: var(--color-text); }
.collapsed-log-card summary {
  cursor: pointer;
  list-style: none;
}
.collapsed-log-card summary::-webkit-details-marker { display: none; }
.collapsed-log-card summary::after {
  content: "Open";
  float: right;
  color: var(--color-muted-text);
  font-size: .75rem;
  font-weight: 800;
}
.collapsed-log-card[open] summary::after { content: "Hide"; }
.section-kicker {
  color: var(--color-muted-text);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 0 10px;
}
.review-controls-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}
.panel-header {
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.week-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.week-status-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 14px;
  background: #f8fafc;
}
.week-status-title {
  color: var(--color-text);
  font-weight: 800;
  margin-bottom: 2px;
}
.week-status-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  margin-top: 12px;
  font-size: .88rem;
}
.week-status-list dt { color: var(--color-muted-text); }
.week-status-list dd { color: var(--color-text); font-weight: 800; }
.quick-action-list,
.service-summary-list,
.recent-run-list {
  flex-direction: column;
}
.quick-action,
.service-summary-row,
.recent-run-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #f8fafc;
  padding: 11px 12px;
  transition: background .16s ease, border-color .16s ease;
}
.quick-action {
  align-items: flex-start;
  flex-direction: column;
}
.quick-action:hover,
.service-summary-row:hover,
.recent-run-row:hover {
  text-decoration: none;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.quick-action strong,
.service-summary-row span:first-child,
.recent-run-row span:first-child {
  color: var(--color-text);
  font-weight: 800;
}
.quick-action span {
  color: var(--color-muted-text);
  font-size: .82rem;
}

.inline-action-form {
  margin: 0;
}

.quick-action-button {
  width: 100%;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.quick-action-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.quick-action-danger strong {
  color: #991b1b;
}

.linkedin-read-row {
  align-items: flex-start;
}

.linkedin-read-row > div:first-child {
  min-width: 0;
}

.linkedin-read-meta {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 190px;
  text-align: right;
}

/* Responsive navigation and tables */
@media (max-width: 1040px) {
  .site-header-inner { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .site-nav { width: 100%; justify-content: flex-start; }
  .dashboard-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .workflow-stepper,
  .run-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  html { font-size: 14px; }
  .site-header-inner { min-height: 58px; }
  .site-nav { display: none; }
  .mobile-nav { display: block; }
  .site-main { padding: 22px 14px 36px; }
  .site-title { white-space: normal; }
  .dashboard-hero { align-items: flex-start; flex-direction: column; }
  .dashboard-hero-actions { justify-content: flex-start; width: 100%; }
  .dashboard-hero-actions .btn { flex: 1 1 150px; }
  .dashboard-metric-grid,
  .week-status-grid,
  .workflow-stepper,
  .run-summary-grid { grid-template-columns: 1fr; }
  .calendar-table-wrap { overflow-x: auto; }
  .calendar-table { min-width: 760px; }
  .form-row { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .action-row,
  .service-actions,
  .prep-link-row { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
