﻿:root {
  --col1: #15363d;
  --col2: #a37652;
  --borbis: #b0cb1f;
  --text: #303030;
  --muted: #766f69;
  --danger: #a83225;
  --ok: #326b44;
  --panel: #ffffff;
  --soft: #fbfaf8;
  --cream: #faf5f1;
  --border: rgba(21, 54, 61, .10);
  --shadow: 0 18px 54px rgba(21, 54, 61, .08);
  --soft-shadow: 0 10px 28px rgba(21, 54, 61, .06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  background: radial-gradient(circle at 14% 0, rgba(53, 117, 184, .18), transparent 28%),
    radial-gradient(circle at 88% 0, rgba(176, 203, 31, .18), transparent 30%),
    linear-gradient(180deg, #fff, #f6f9fb 52%, #fff);
  background-attachment: fixed;
}

body.help-bg {
  background: radial-gradient(circle at 14% 0, rgba(53, 117, 184, .18), transparent 28%),
    radial-gradient(circle at 88% 0, rgba(176, 203, 31, .18), transparent 30%),
    linear-gradient(180deg, #fff, #f6f9fb 52%, #fff);
  background-attachment: fixed;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--col1), #24525b);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(21, 54, 61, .12);
}

button:hover {
  filter: brightness(1.04);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(21, 54, 61, .14);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
}

textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(176, 203, 31, .20);
  border-color: var(--borbis);
}

label {
  display: grid;
  gap: 7px;
  color: #504740;
  font-weight: 800;
}

label small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

code {
  border: 1px solid rgba(21, 54, 61, .10);
  border-radius: 6px;
  padding: 2px 5px;
  background: #f6eee8;
}

.shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100vh;
  padding: 28px;
  color: var(--text);
  background: rgba(255, 255, 255, .86);
  border-right: 1px solid rgba(21, 54, 61, .10);
  box-shadow: 14px 0 42px rgba(21, 54, 61, .05);
  backdrop-filter: blur(18px);
}

.brand {
  display: block;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
}

.brand-fallback {
  display: none;
  color: var(--col1);
  font-size: 25px;
  font-weight: 900;
}

.brand-fallback span {
  color: var(--borbis);
}

.sidebar nav {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.sidebar a:not(.brand) {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(21, 54, 61, .10);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--col1);
  background: #fff;
  font-weight: 900;
  text-decoration: none;
}

.nav-icon {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar a:not(.brand):hover {
  background: var(--col1);
  color: #fff;
}

.main {
  width: 100%;
  max-width: 1640px;
  padding: 34px;
}

.token-model-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px;
  border-radius: 8px;
  background: var(--soft);
}

.settings-token-panel {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.settings-token-total {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.settings-token-total span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-token-total strong {
  display: block;
  margin-top: 8px;
  color: var(--col1);
  font-size: 30px;
  line-height: 1;
}

.settings-token-models {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.settings-token-models p {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fff;
}

.token-model-row span {
  overflow: hidden;
  color: var(--col1);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-model-row strong {
  color: var(--col2);
}

.token-model-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.msg {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 13px 15px;
  background: #eee;
}

.msg.success {
  border-color: #d9eda2;
  color: #3d5513;
  background: #edf7d4;
}

.msg.warning {
  color: #765500;
  background: #fff4d8;
}

.msg.danger {
  color: var(--danger);
  background: #fde6e3;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  background: rgba(21, 54, 61, .48);
  backdrop-filter: blur(6px);
  transition: .18s opacity;
}

.loading-screen.visible {
  opacity: 1;
  pointer-events: auto;
}

.loader-card {
  display: grid;
  place-items: center;
  gap: 12px;
  width: min(350px, 90vw);
  border-radius: 24px;
  padding: 28px;
  color: var(--col1);
  text-align: center;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .24);
}

.loader-card span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 5px solid #edf1d8;
  border-top-color: var(--borbis);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--col2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--borbis);
  box-shadow: 0 0 0 6px rgba(176, 203, 31, .14);
}

.muted {
  color: var(--muted);
}

.row,
.two,
.form-grid-2,
.compact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.secondary-btn,
.small-secondary,
.articles-secondary-link,
.back-pill,
.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid rgba(21, 54, 61, .14);
  border-radius: 8px;
  padding: 10px 13px;
  color: var(--col1);
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: var(--soft-shadow);
}

.secondary-btn:hover,
.small-secondary:hover,
.articles-secondary-link:hover,
.back-pill:hover,
.mini-btn:hover {
  color: #fff;
  background: var(--col1);
}

.danger-mini {
  color: #a01818 !important;
  border-color: #f1b5b5 !important;
  background: #fff0f0 !important;
}

.status,
.category-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--col1);
  background: rgba(176, 203, 31, .22);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.category-chip {
  color: var(--col2);
  background: rgba(163, 118, 82, .14);
}

.status.rewritten {
  background: rgba(53, 117, 184, .15);
}

.status.approved {
  background: rgba(138, 109, 186, .16);
}

.status.published {
  background: rgba(95, 140, 49, .20);
}

.hero-card,
.panel,
.table-card,
.mini-action,
.modern-settings {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
  padding: 22px;
}

.hero-card h1 {
  margin: 0 0 8px;
  color: var(--col1);
  font-size: 34px;
  line-height: 1.08;
}

.hero-card p {
  margin: 0;
  color: var(--muted);
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.mini-action {
  padding: 12px;
}

.panel {
  padding: 18px;
}

.settings-form,
.inline-form,
.edit-form {
  display: grid;
  gap: 16px;
}

.settings-section {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px solid rgba(21, 54, 61, .08);
}

.settings-section:last-of-type {
  border-bottom: 0;
}

.section-heading {
  display: grid;
  gap: 5px;
}

.section-heading h2 {
  margin: 0;
  color: var(--col1);
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.instruction-box,
.subtle-box,
.mass-action-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(21, 54, 61, .10);
  border-radius: 8px;
  padding: 16px;
  background: var(--soft);
}

.instruction-box h3,
.mass-action-card h3 {
  margin: 0;
  color: var(--col1);
}

.instruction-box p,
.mass-action-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.instruction-box ol {
  margin: 0;
  padding-left: 20px;
  line-height: 1.7;
}

.mass-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sticky-save {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(21, 54, 61, .08);
  padding: 16px 22px;
  background: rgba(255, 255, 255, .90);
  backdrop-filter: blur(12px);
}

.articles-page {
  display: grid;
  gap: 18px;
  max-width: 1380px;
  margin: 0 auto;
}

.reels-page {
  display: grid;
  gap: 18px;
  max-width: 1380px;
  margin: 0 auto;
}

.reels-form {
  overflow: hidden;
}

.reels-list-section {
  display: grid;
  gap: 12px;
}

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

.reel-list-row {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-left: 4px solid var(--col1);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.reel-list-player {
  display: grid;
  place-items: center;
  width: 94px;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 8px;
  background: #101010;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.link-list-thumb {
  display: grid;
  place-items: center;
  width: 94px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--soft);
  color: var(--col1);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
}

.link-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-play-button {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  padding: 0;
  color: #fff;
  background: radial-gradient(circle at center, rgba(176, 203, 31, .28), transparent 34%),
    linear-gradient(180deg, #1b1b1b, #050505);
  box-shadow: none;
  font-size: 11px;
}

.reel-play-button::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto 7px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid currentColor;
}

.reel-list-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.reel-list-main h3 {
  overflow: hidden;
  margin: 0;
  color: var(--col1);
  font-size: 17px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reel-list-main p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.reel-list-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.reel-list-actions form {
  display: inline-flex;
}

.reel-modal[hidden] {
  display: none;
}

.reel-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.reel-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 24, 27, .72);
}

.reel-modal-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(460px, 100%);
  max-height: calc(100vh - 48px);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 24px 90px rgba(0, 0, 0, .26);
}

.reel-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.reel-modal-head strong {
  overflow: hidden;
  color: var(--col1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reel-modal video {
  display: block;
  width: 100%;
  max-height: calc(100vh - 140px);
  border-radius: 8px;
  background: #101010;
}

body.modal-open {
  overflow: hidden;
}

.reels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.reel-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.reel-player {
  display: grid;
  place-items: center;
  min-height: 360px;
  background: #101010;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.reel-player video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 560px;
  object-fit: contain;
}

.reel-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.reel-card-body h3 {
  margin: 0;
  color: var(--col1);
  font-size: 18px;
  line-height: 1.25;
}

.reel-card-body p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.reel-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.reel-card-actions form {
  display: inline-flex;
}

.articles-command-panel,
.articles-list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
}

.articles-title-block h1 {
  margin: 0;
  color: var(--col1);
  font-size: 34px;
  line-height: 1.08;
}

.articles-title-block p,
.articles-list-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.articles-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--col2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.articles-primary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.articles-primary-actions form,
.article-row-actions form,
.article-bar-actions form,
.publish-form {
  margin: 0;
}

.articles-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.article-metric {
  min-height: 82px;
  border: 1px solid var(--border);
  border-top: 4px solid #748389;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.article-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.article-metric strong {
  display: block;
  margin-top: 8px;
  color: var(--col1);
  font-size: 27px;
  line-height: 1;
}

.metric-warning { border-top-color: #c77b25; }
.metric-info { border-top-color: #3575b8; }
.metric-ready { border-top-color: #8a6dba; }
.metric-done { border-top-color: #5f8c31; }

.articles-filterbar {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow: auto;
  padding: 3px 0 2px;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid rgba(21, 54, 61, .12);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--muted);
  background: #fff;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.filter-tab strong {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  padding: 0 7px;
  color: var(--col1);
  background: #f1f3f1;
  font-size: 12px;
}

.filter-tab.active,
.filter-tab:hover,
.filter-tab.filter-all.active,
.filter-tab.filter-scraped.active,
.filter-tab.filter-rewritten.active {
  color: #fff;
  border-color: #3575b8;
  background: #3575b8;
}

.filter-tab.active strong,
.filter-tab:hover strong,
.filter-tab.filter-all.active strong,
.filter-tab.filter-scraped.active strong,
.filter-tab.filter-rewritten.active strong {
  color: #fff;
  background: rgba(255, 255, 255, .18);
}

.articles-list-head h2 {
  margin: 0;
  color: var(--col1);
  font-size: 22px;
}

.articles-list {
  display: grid;
  gap: 10px;
}

.article-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-left: 4px solid #879196;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.status-row-scraped   { border-left-color: #c77b25; background: linear-gradient(90deg, #fff9f4 0px, #fff 180px); }
.status-row-rewritten { border-left-color: #3575b8; background: linear-gradient(90deg, #f3f7ff 0px, #fff 180px); }
.status-row-approved  { border-left-color: #8a6dba; background: linear-gradient(90deg, #f8f4ff 0px, #fff 180px); }
.status-row-published { border-left-color: #5f8c31; background: linear-gradient(90deg, #f4faed 0px, #fff 180px); }

.article-row-main {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  padding: 14px;
  text-decoration: none;
}

.article-row-main:hover {
  background: #fbfcf7;
}

.article-thumb {
  display: grid;
  place-items: center;
  width: 138px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid rgba(21, 54, 61, .09);
  border-radius: 8px;
  color: var(--muted);
  background: #f2f3ef;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.article-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-copy {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.article-meta-line,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 999px;
  padding: 4px 8px;
  color: #5f5a55;
  background: #f2f3ef;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.article-copy h2 {
  margin: 0;
  color: var(--col1);
  font-size: 19px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.source-title,
.article-source-title {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.source-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.article-row-side {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  border-left: 1px solid rgba(21, 54, 61, .09);
  padding: 14px;
  background: var(--soft);
}

.workflow-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.workflow-rail span {
  display: grid;
  place-items: center;
  min-height: 28px;
  border-radius: 6px;
  color: #6d726f;
  background: #ecefeb;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.workflow-rail span.done {
  color: var(--col1);
  background: rgba(176, 203, 31, .28);
}

.article-next-step {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.article-next-step span,
.article-facts dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.article-next-step strong,
.article-facts dd {
  color: var(--col1);
  font-size: 13px;
  font-weight: 900;
}

.article-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.article-facts dd {
  overflow: hidden;
  margin: 3px 0 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-links,
.article-row-actions,
.article-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.article-links a,
.article-links span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(21, 54, 61, .10);
  border-radius: 8px;
  padding: 6px 9px;
  color: var(--col1);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.articles-empty,
.empty-panel {
  display: grid;
  justify-items: start;
  gap: 10px;
  border: 1px solid var(--border);
  border-left: 4px solid #c77b25;
  border-radius: 8px;
  padding: 18px;
  background: #fffaf7;
}

.articles-empty h2,
.empty-panel h3 {
  margin: 0;
  color: var(--col1);
}

.articles-empty p,
.empty-panel p {
  margin: 0;
  color: var(--muted);
}

.article-page {
  display: grid;
  gap: 14px;
  max-width: 1380px;
  margin: 0 auto;
}

.article-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.article-hero {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 230px;
  gap: 16px;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.article-hero-image {
  display: grid;
  place-items: center;
  min-height: 170px;
  overflow: hidden;
  border: 1px solid rgba(21, 54, 61, .09);
  border-radius: 8px;
  color: var(--muted);
  background: #f2f3ef;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.article-hero-image img,
.image-preview img,
.source-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-hero-video {
  min-height: 320px;
  background: #101010;
}

.article-hero-video video,
.source-card video {
  display: block;
  width: 100%;
  max-height: 420px;
  border-radius: 8px;
  background: #101010;
}

.article-hero-video video {
  height: 100%;
  object-fit: contain;
}

.source-card video {
  margin-top: 10px;
}

.article-hero-copy {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
}

.article-meta > span:not(.status):not(.category-chip) {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #5f5a55;
  background: #f2f3ef;
  font-size: 11px;
  font-weight: 900;
}

.article-hero-copy h1 {
  margin: 0;
  color: var(--col1);
  font-size: clamp(25px, 2.4vw, 36px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.article-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.article-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(21, 54, 61, .08);
  border-radius: 8px;
  padding: 8px 9px;
  color: #68706d;
  background: #f2f3ef;
}

.article-step strong {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: inherit;
  background: #fff;
  font-size: 12px;
}

.article-step span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-step.done {
  color: var(--col1);
  border-color: rgba(176, 203, 31, .34);
  background: rgba(176, 203, 31, .22);
}

.article-step.current {
  box-shadow: inset 0 0 0 2px rgba(21, 54, 61, .16);
}

.article-summary {
  display: grid;
  align-content: center;
  gap: 8px;
}

.article-summary div {
  border: 1px solid rgba(21, 54, 61, .08);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
}

.article-summary span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.article-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--col1);
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.article-workbench {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.article-control {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
}

.control-card,
.article-tabs {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.control-card {
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 14px;
}

.control-card h3 {
  margin: 0;
  color: var(--col1);
  font-size: 17px;
}

.control-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.next-card {
  border-left: 4px solid var(--borbis);
}

.next-card button,
.publish-form button,
.control-card .secondary-btn {
  width: 100%;
}

.publish-form {
  display: grid;
  gap: 10px;
}

.published-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(176, 203, 31, .38);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--col1);
  background: #f2f7df;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.image-preview {
  display: grid;
  gap: 7px;
  margin: 0;
}

.image-preview img,
.source-card img {
  max-height: 180px;
  border: 1px solid rgba(21, 54, 61, .09);
  border-radius: 8px;
}

.image-preview figcaption {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.source-card strong {
  color: var(--col1);
  font-size: 13px;
  line-height: 1.35;
}

.article-tabs {
  min-width: 0;
  overflow: hidden;
}

.tabs-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid rgba(21, 54, 61, .08);
  padding: 8px;
  background: var(--soft);
}

.tabs-nav button,
.nested-tabs-nav button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  line-height: 1.2;
  white-space: normal;
}

.tabs-nav button.active,
.nested-tabs-nav button.active {
  color: var(--col1);
  border-color: rgba(21, 54, 61, .10);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.tab-panel,
.nested-tab-panel {
  display: none;
}

.tab-panel.active,
.nested-tab-panel.active {
  display: block;
}

.article-panel,
.tab-panel {
  min-width: 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.panel-head span {
  display: block;
  margin-bottom: 5px;
  color: var(--col2);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-head h2 {
  margin: 0;
  color: var(--col1);
  font-size: 24px;
  line-height: 1.18;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.rewrite-form,
.editor-card {
  display: grid;
  gap: 14px;
}

.form-section {
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(21, 54, 61, .08);
  padding: 14px 0;
}

.form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.form-section h3 {
  margin: 0;
  color: var(--col1);
  font-size: 17px;
}

.switch-row {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  cursor: pointer;
}

.switch-row input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: var(--borbis);
}

.switch-row strong {
  display: block;
  color: var(--col1);
}

.switch-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.source-image-choice,
.product-help-box {
  border: 1px solid rgba(21, 54, 61, .10);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.product-help-box {
  margin-bottom: 12px;
}

.product-help-box p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.nested-tabs {
  overflow: hidden;
  border: 1px solid rgba(21, 54, 61, .09);
  border-radius: 8px;
  background: #fff;
}

.nested-tabs-nav {
  display: flex;
  gap: 6px;
  overflow: auto;
  border-bottom: 1px solid rgba(21, 54, 61, .08);
  padding: 8px;
  background: #fffaf7;
}

.nested-tab-panel {
  padding: 14px;
}

.related-tools-row,
.compact-related-tools {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.related-picker,
.related-picker-compact {
  display: grid;
  gap: 6px;
  max-height: 330px;
  overflow: auto;
  border: 1px solid rgba(21, 54, 61, .10);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.related-option {
  display: flex !important;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px;
  cursor: pointer;
}

.related-option:hover {
  border-color: rgba(21, 54, 61, .08);
  background: var(--cream);
}

.related-option input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--borbis);
}

.related-option strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.related-option small,
.empty-related-list {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.empty-related-list {
  border-radius: 8px;
  padding: 14px;
  background: var(--cream);
}

.product-destination-list {
  display: grid;
  gap: 8px;
}

.product-destination-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 10px;
  align-items: end;
  border: 1px solid rgba(21, 54, 61, .10);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
}

.product-destination-row > a {
  overflow: hidden;
  color: var(--col1);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-destination-row > a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-destination-select {
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.product-destination-select select {
  min-height: 36px;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: none;
}

.product-extra-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-url-editor textarea,
.product-extra-grid textarea,
textarea[name="extra_prompt"] {
  min-height: 160px;
}

.sticky-actions,
.sticky-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sticky-actions button {
  min-width: 190px;
}

.preview,
.wp-preview,
.preview,
.source-preview {
  overflow: auto;
  border: 1px solid rgba(21, 54, 61, .10);
  border-radius: 8px;
  padding: 22px;
  background: #fff;
  line-height: 1.7;
}

.preview > img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 8px;
}

.preview h1,
.source-preview h1 {
  color: var(--col1);
  line-height: 1.15;
}

.reel-source video {
  display: block;
  width: min(360px, 100%);
  max-height: 640px;
  border-radius: 8px;
  background: #101010;
}

.reel-source blockquote {
  border-left: 4px solid var(--borbis);
  margin: 14px 0 0;
  padding: 10px 0 10px 14px;
  color: var(--muted);
  background: var(--soft);
}

.wysiwyg {
  overflow: hidden;
  border: 1px solid rgba(21, 54, 61, .12);
  border-radius: 8px;
  background: #fff;
}

.wysiwyg-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border-bottom: 1px solid rgba(21, 54, 61, .10);
  padding: 10px;
  background: var(--cream);
}

.wysiwyg-toolbar button {
  min-width: 38px;
  min-height: 36px;
  border: 1px solid rgba(21, 54, 61, .12);
  padding: 8px 10px;
  color: var(--col1);
  background: #fff;
  box-shadow: none;
  font-size: 12px;
}

.wysiwyg-toolbar button.active,
.wysiwyg-toolbar button:hover {
  color: #fff;
  background: var(--col1);
}

.wysiwyg-area {
  min-height: 460px;
  max-height: 700px;
  overflow: auto;
  padding: 22px;
  background: #fff;
  line-height: 1.78;
  outline: none;
  overflow-wrap: anywhere;
}

.wysiwyg-area img,
.preview img,
.wp-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.wysiwyg-area iframe,
.preview iframe,
.wp-preview iframe {
  width: 100%;
  max-width: 760px;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 8px;
}

.wysiwyg-source {
  min-height: 520px;
  border: 0;
  border-radius: 0;
  color: #f6f6f6;
  background: #101820;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.product-recommendations {
  clear: both;
  margin: 30px 0;
  border: 1px solid rgba(21, 54, 61, .10);
  border-radius: 8px;
  padding: 20px;
  background: var(--cream);
}

.product-recommendations h2 {
  margin: 0 0 16px;
  color: var(--col1);
  font-size: 22px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.product-grid.product-count-1 {
  grid-template-columns: minmax(0, 520px);
}

.product-card {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(21, 54, 61, .10);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.product-card-image {
  display: grid;
  place-items: center;
  min-height: 156px;
  background: #f6f1ed;
  text-decoration: none;
}

.product-card-image img {
  display: block;
  width: 100%;
  height: 178px;
  object-fit: cover;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
}

.product-card-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 156px;
  color: var(--muted);
  font-weight: 900;
}

.product-card-body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.product-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.product-card h3 a {
  color: var(--col1);
  text-decoration: none;
}

.product-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.product-price {
  color: var(--col2);
  font-weight: 1000;
}

.product-button,
.inline-product-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 38px;
  border-radius: 8px;
  padding: 9px 13px;
  color: #fff !important;
  background: var(--col1);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.inline-products-group {
  display: grid;
  gap: 14px;
  margin: 26px 0;
}

.inline-product-embed {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(21, 54, 61, .10);
  border-left: 4px solid var(--borbis);
  border-radius: 8px;
  padding: 14px;
  background: #fffaf7;
  box-shadow: var(--soft-shadow);
}

.inline-product-image {
  display: grid;
  place-items: center;
  min-height: 126px;
  overflow: hidden;
  border-radius: 8px;
  background: #f2f3ef;
  text-decoration: none;
}

.inline-product-image img {
  display: block;
  width: 100%;
  height: 126px;
  object-fit: cover;
}

.inline-product-body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.inline-product-body span:first-child {
  color: var(--col2);
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.inline-product-body h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.22;
}

.inline-product-body h3 a {
  color: var(--col1);
  text-decoration: none;
}

.inline-product-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.source-embedded-image,
.source-linked-image {
  margin: 24px 0;
}

.source-embedded-image img,
.source-linked-image img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(21, 54, 61, .10);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.source-linked-image a {
  display: block;
  text-decoration: none;
}

.source-shop-link {
  margin: 22px 0;
}

.source-shop-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(176, 203, 31, .45);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--col1);
  background: #f2f7df;
  font-weight: 900;
  text-decoration: none;
}

.source-shop-banner {
  border: 1px solid rgba(21, 54, 61, .10);
  border-radius: 8px;
  padding: 12px;
  background: #fffaf7;
}

.source-shop-banner img {
  width: 100%;
  object-fit: cover;
}

.read-also {
  margin: 24px 0;
  border: 1px solid rgba(21, 54, 61, .09);
  border-radius: 8px;
  padding: 16px 18px;
  background: #fffaf7;
}

.read-also strong {
  color: var(--col1);
}

.read-also ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.read-also li + li {
  margin-top: 6px;
}

.help-page {
  display: grid;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.help-hero {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.help-hero h1 {
  margin: 0 0 8px;
  color: var(--col1);
  font-size: 34px;
  line-height: 1.1;
}

.help-hero p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.help-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.help-card h2 {
  margin: 0 0 10px;
  color: var(--col1);
  font-size: 18px;
  line-height: 1.25;
}

.help-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(176, 203, 31, .14), transparent 35%),
    linear-gradient(180deg, #fff, #faf7f4);
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(450px, 92vw);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-logo {
  max-width: 190px;
  max-height: 110px;
  object-fit: contain;
}

.login-card h1 {
  margin: 0;
  color: var(--col1);
  font-size: 34px;
}

.login-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

@media (max-width: 1280px) {
  .articles-metrics,
  .help-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .article-row,
  .article-workbench {
    grid-template-columns: 1fr;
  }

  .article-row-side {
    border-left: 0;
    border-top: 1px solid rgba(21, 54, 61, .09);
    grid-template-columns: 1.2fr .8fr 1fr;
  }

  .article-control {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .next-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .sidebar nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-top: 0;
  }

  .main {
    padding: 20px;
  }

  .article-hero {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .article-summary {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .row,
  .two,
  .form-grid-2,
  .compact-form-grid,
  .settings-token-panel,
  .mass-actions-grid,
  .articles-command-panel,
  .articles-list-head,
  .article-bar,
  .article-bar-actions,
  .article-hero,
  .article-control,
  .related-tools-row,
  .compact-related-tools,
  .product-extra-grid,
  .help-grid,
  .sticky-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .articles-primary-actions,
  .settings-actions {
    display: grid;
    justify-content: stretch;
  }

  .articles-primary-actions button,
  .articles-secondary-link,
  .article-bar-actions .secondary-btn,
  .article-bar-actions button,
  .sticky-actions button {
    width: 100%;
  }

  .articles-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-row-main {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .article-thumb {
    width: 96px;
  }

  .article-row-side {
    grid-template-columns: 1fr;
  }

  .article-steps,
  .tabs-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-hero-image {
    min-height: 220px;
  }

  .article-summary {
    grid-template-columns: 1fr;
  }

  .product-destination-row,
  .inline-product-embed,
  .reel-list-row {
    grid-template-columns: 1fr;
  }

  .reel-list-player {
    width: 100%;
    max-height: 280px;
    aspect-ratio: 16 / 9;
  }

  .link-list-thumb {
    width: 100%;
    max-height: 220px;
    aspect-ratio: 16 / 9;
  }

  .reel-list-actions {
    justify-content: stretch;
  }

  .reel-list-actions a,
  .reel-list-actions form,
  .reel-list-actions button {
    width: 100%;
  }

  .product-destination-row > a {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 520px) {
  .sidebar nav,
  .articles-metrics,
  .article-row-main,
  .article-steps,
  .tabs-nav,
  .articles-filterbar {
    grid-template-columns: 1fr;
  }

  .articles-filterbar {
    display: grid;
  }

  .filter-tab {
    justify-content: space-between;
  }

  .article-thumb {
    width: 100%;
    max-height: 210px;
  }
}

/* ── Backup & cookies sections ── */
.backup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.backup-card {
  background: var(--surface, #f8f8f8);
  border: 1px solid var(--border, #e2e2e2);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.backup-card h3 {
  margin: 0;
  font-size: 1rem;
}

.backup-card p {
  margin: 0;
  font-size: .875rem;
  color: var(--text-muted, #666);
  flex: 1;
}

.btn-export {
  display: inline-block;
  padding: .5rem 1.1rem;
  background: var(--accent, #3a7bd5);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: .875rem;
  align-self: flex-start;
}

.btn-export:hover {
  opacity: .88;
}

.inline-upload-form {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.inline-upload-form input[type="file"] {
  font-size: .875rem;
}

@media (max-width: 640px) {
  .backup-actions {
    grid-template-columns: 1fr;
  }
}
