:root {
  --navy: #101827;
  --navy-soft: #172236;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --teal: #0d9488;
  --surface: #ffffff;
  --background: #f4f7fb;
  --border: #e2e8f0;
  --text: #162033;
  --muted: #69758a;
  --shadow: 0 8px 28px rgba(28, 43, 70, 0.07);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--blue); }

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 245px;
  padding: 25px 15px;
  overflow-y: auto;
  color: #fff;
  background: linear-gradient(180deg, var(--navy), #0b1220);
  box-shadow: 8px 0 30px rgba(10, 18, 33, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 9px 25px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.brand:hover { color: #fff; }

.brand span {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #14b8a6);
  box-shadow: 0 8px 18px rgba(20, 184, 166, 0.2);
  font-size: 13px;
}

.workspace-label {
  padding: 12px;
  color: #77849a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.side-nav { display: flex; flex-direction: column; gap: 4px; }

.side-nav a {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 9px;
  color: #aeb8c9;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.side-nav a i { width: 25px; font-size: 16px; }
.side-nav a:hover { color: #fff; background: #202c41; transform: translateX(2px); }

.side-nav a.active,
.side-nav a[aria-current="page"] {
  color: #fff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.96), rgba(13, 148, 136, 0.84));
  box-shadow: 0 7px 18px rgba(10, 26, 55, 0.28);
}

.user-panel {
  position: relative;
  margin-top: auto;
  padding: 18px 8px 0;
  border-top: 1px solid #293348;
}

.user-menu-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 4px; border: 0; background: transparent; color: #fff; text-align: left; }
.user-menu-toggle > i:first-child { flex: 0 0 auto; color: #cad3df; font-size: 27px; }
.user-menu-toggle > span { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.user-panel strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-panel small { color: #8390a3; font-size: 11px; }
.user-menu-chevron { color: #9aa6b9; font-size: 12px; }
.user-dropdown { width: 210px; padding: 7px; border: 1px solid #d9e1ec; border-radius: 10px; box-shadow: 0 16px 36px rgba(8, 15, 30, .28); }
.user-dropdown .dropdown-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 7px; font-size: 13px; }
.user-dropdown .dropdown-item i { width: 17px; }
.user-dropdown form { margin: 0; }

.main-content { display: flex; grid-column: 2; min-width: 0; min-height: 100vh; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 20px;
  padding: 10px 34px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.topbar-title { display: flex; flex: 0 1 auto; flex-direction: column; min-width: 150px; }
.topbar-controls { display: flex; flex: 1 1 auto; align-items: center; justify-content: flex-end; gap: 22px; min-width: 0; }
.topbar small { color: var(--muted); font-size: 11px; }
.live-dot { flex: 0 0 auto; color: #39766e; font-size: 12px; font-weight: 600; white-space: nowrap; }
.live-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px #dcfce7; }

.content-wrap { width: 100%; max-width: 1680px; flex: 1 0 auto; margin: 0 auto; padding: 32px; }
.app-footer { flex: 0 0 auto; padding: 16px 32px 20px; color: var(--muted); font-size: 12px; text-align: center; }
.app-footer a { color: #526074; font-weight: 600; text-decoration: none; }
.app-footer a:hover, .app-footer a:focus { color: var(--blue); text-decoration: underline; }

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.page-heading h1 { margin: 0 0 5px; font-size: 27px; font-weight: 800; letter-spacing: -0.5px; }
.page-heading p, .panel-head p { margin: 0; color: var(--muted); }
.actions, .row-actions { display: flex; align-items: center; gap: 8px; }
.actions form { margin: 0; }
.row-actions form { margin: 0; }

.btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 9px 15px;
  box-shadow: none;
}

.btn-primary { border-color: var(--blue); background: var(--blue); }
.btn-primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.btn-soft { border: 1px solid #dfe6ef; background: #edf2f8; color: #334155; }
.btn-soft:hover { border-color: #cbd6e4; background: #e2e8f0; color: #172033; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 11px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric i { grid-row: 1 / 3; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; background: #eef4ff; color: var(--blue); font-size: 17px; }
.metric i.teal { background: #e8f8f5; color: var(--teal); }
.metric i.amber { background: #fff6df; color: #d68b0b; }
.metric i.red { background: #feeeee; color: #dc3545; }
.metric span { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; }
.metric strong { overflow: hidden; font-size: 24px; line-height: 1.1; text-overflow: ellipsis; }
.metric .small-value { padding-top: 5px; font-size: 15px; }

.panel {
  min-width: 0;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 21px; border-bottom: 1px solid var(--border); }
.panel h2, .panel-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.panel-head a { color: var(--blue); font-weight: 600; text-decoration: none; }

.table-responsive { width: 100%; overflow-x: auto; }
.dashboard-news-table { min-width: 860px; }
.schedule-table { min-width: 850px; }
.news-results-table { width: 100%; min-width: 0; table-layout: fixed; }
.news-results-responsive { overflow-x: auto; }
.news-results-table.with-company .col-company { width: 7%; }
.news-results-table .col-select { width: 3%; }
.news-results-table.with-company .col-original { width: 22%; }
.news-results-table.without-company .col-original { width: 27%; }
.news-results-table.with-company .col-source { width: 11%; }
.news-results-table.without-company .col-source { width: 12%; }
.news-results-table.with-company .col-published { width: 12%; }
.news-results-table.without-company .col-published { width: 13%; }
.news-results-table .col-engagement { width: 8%; }
.news-results-table.with-company .col-collected { width: 12%; }
.news-results-table.without-company .col-collected { width: 13%; }
.news-results-table .col-verification { width: 9%; }
.news-results-table.with-company .col-ai { width: 10%; }
.news-results-table.without-company .col-ai { width: 10%; }
.news-results-table .col-actions { width: 9%; }
.run-history-table { width: 100%; min-width: 0; table-layout: fixed; }
.run-history-table th:nth-last-child(1), .run-history-table td:nth-last-child(1) { width: 145px; }
.run-history-table .run-detail-cell { width: 145px; min-width: 0; padding-right: 20px; vertical-align: middle; }
.run-identity-cell { width: 220px; }
.run-identity-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.run-identity-top strong { color: #253044; font-size: 13px; }
.run-value-grid { display: grid; grid-template-columns: repeat(2, minmax(62px, 1fr)); gap: 8px 12px; }
.run-value-grid span { color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.2; text-transform: uppercase; white-space: nowrap; }
.run-value-grid strong { display: block; margin-bottom: 2px; color: #334155; font-size: 16px; line-height: 1; }
.run-value-grid .run-value-good strong { color: #15803d; }
.run-value-grid .run-value-bad strong { color: #b45309; }
.run-detail-summary { display: flex; align-items: baseline; gap: 5px; margin-bottom: 9px; color: var(--muted); font-size: 12px; line-height: 1.35; white-space: nowrap; }
.run-detail-summary strong { color: #334155; font-size: 13px; }
.run-detail-summary em { color: #8792a5; font-size: 10px; font-style: normal; }
.run-detail-button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.run-detail-modal { border: 0; border-radius: 14px; box-shadow: 0 22px 55px rgba(15, 23, 42, 0.2); }
.run-detail-modal .modal-header { align-items: flex-start; padding: 20px 22px; }
.run-detail-modal .modal-title { font-size: 18px; }
.run-detail-modal .modal-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.run-detail-modal .modal-body { padding: 22px; }
.run-detail-modal .modal-body h3 { margin: 22px 0 9px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.run-detail-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.run-detail-metrics span { padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: #f8fafc; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.run-detail-metrics strong { display: block; margin-bottom: 2px; color: #172033; font-size: 18px; }
.run-detail-log { max-height: 360px; overflow: auto; padding: 15px; border: 1px solid var(--border); border-radius: 9px; background: #f8fafc; color: #334155; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; white-space: normal; }
@media (max-width: 575.98px) { .run-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .run-history-table { min-width: 760px; table-layout: auto; } }
.settings-list-table { min-width: 700px; }
.company-users-table { min-width: 1280px; }
.table { width: 100%; margin: 0; vertical-align: middle; }
.table > :not(caption) > * > * { padding: 14px 18px; border-color: #edf0f5; }
.table thead th { border-bottom-width: 1px; background: #f8fafc; color: #69758a; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; white-space: nowrap; }
.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:hover { background: #fbfdff; }
.table td { color: #3a4658; }
.table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.news-results-table > :not(caption) > * > * { min-width: 0; padding: 10px 7px; overflow-wrap: anywhere; }
.news-results-table thead th { white-space: normal; line-height: 1.2; }
.original-article-column { min-width: 0; }
.article-cell { display: flex; width: 100%; min-width: 0; max-width: none; align-items: center; gap: 8px; }
.article-cell img, .thumb-placeholder { display: grid; place-items: center; width: 48px; height: 42px; flex: 0 0 auto; border-radius: 8px; background: #eaf0f6; color: #8b98aa; object-fit: cover; }
.article-cell > div, .article-text-block { min-width: 0; }
.article-text-block { display: flex; flex-direction: column; justify-content: center; }
.article-cell strong { display: block; color: #253044; line-height: 1.4; overflow-wrap: anywhere; }
.original-article-text { display: -webkit-box !important; min-width: 0; overflow: hidden; text-overflow: ellipsis; word-break: normal; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.original-link { display: block; margin-top: 4px; font-size: 11px; text-decoration: none; }
.source-category-cell { min-width: 0; }
.source-name { display: block; font-weight: 600; line-height: 1.35; }
.platform-badge { display: inline-flex; align-items: center; width: fit-content; margin-top: 5px; padding: 2px 7px; border: 1px solid #cdddf8; border-radius: 999px; background: #f3f7ff; color: #315d9d; font-size: 10px; font-weight: 700; line-height: 1.35; }
.platform-facebook_page { border-color: #bcd8ff; background: #edf5ff; color: #2463a7; }
.platform-website { border-color: var(--border); background: #f8fafc; color: var(--muted); }
.news-table td:last-child { text-align: right; white-space: nowrap; }
.news-table td:last-child .btn { white-space: nowrap; }
.bulk-actions { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--border); background: #fbfcfe; border-radius: 0 0 14px 14px; }
.pagination-summary, .page-position { color: var(--muted); font-size: 12px; white-space: nowrap; }
.page-size-form, .pager { display: flex; align-items: center; gap: 7px; margin: 0; }
.page-size-form label { color: var(--muted); font-size: 12px; }
.page-size-form .form-select { width: 76px; min-height: 32px; }
.pager .disabled { pointer-events: none; opacity: .48; }
[data-ajax-grid] { position: relative; outline: none; }
[data-ajax-grid].grid-loading::after { content: "Updating…"; position: absolute; top: 10px; right: 12px; z-index: 5; padding: 5px 9px; border: 1px solid #bfdbfe; border-radius: 20px; background: #eff6ff; color: var(--blue); font-size: 11px; font-weight: 700; box-shadow: var(--shadow); }
[data-ajax-grid][aria-busy="true"] .pager, [data-ajax-grid][aria-busy="true"] .bulk-actions { pointer-events: none; opacity: .62; }
.select-column { width: 42px; min-width: 42px; text-align: center; }
.news-row-actions { align-items: stretch; flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; gap: 4px; }
.news-row-actions .btn { width: 100%; padding-right: 5px; padding-left: 5px; }
.news-results-table tbody td, .news-results-table .select-column, .news-results-table .company-name-cell, .news-results-table .ai-headline-preview { vertical-align: middle; }
.collected-time, .article-dates { min-width: 0; font-size: 11px; line-height: 1.4; }
.collected-time span, .collected-time small, .article-dates span, .article-dates small { display: block; white-space: normal; }
.ai-headline-text { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
.news-results-table td .status { max-width: 100%; align-items: flex-start; line-height: 1.25; overflow-wrap: normal; text-align: left; white-space: normal; }
.news-results-table .ai-headline-preview { overflow: hidden; }
.news-results-table .ai-headline-text { min-width: 0; line-height: 1.35; overflow-wrap: anywhere; }
@media (max-width: 1279px) {
  .news-results-table { min-width: 1080px; }
  .news-results-table > :not(caption) > * > * { padding-right: 5px; padding-left: 5px; font-size: 11px; }
  .article-cell img, .news-results-table .thumb-placeholder { width: 42px; height: 38px; flex-basis: 42px; }
}

.status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 20px; background: #edf1f6; color: #526074; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-verified, .status-success, .status-approved { background: #ddf7ef; color: #087669; }
.status-needs_review, .status-partial { background: #fff0d5; color: #a66208; }
.status-rejected, .status-failed { background: #fee8e8; color: #b4232d; }
.status-candidate, .status-running { background: #e7efff; color: #245ac8; }
.status-old_news { background: #fff0d5; color: #9a5a06; }
.status-duplicate, .status-date_not_found, .status-muted { background: #edf0f4; color: #657084; }
.empty { padding: 38px !important; color: var(--muted) !important; text-align: center !important; }

.filter-bar { margin-bottom: 17px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 4px 18px rgba(28, 43, 70, 0.04); }
.filter-bar form { display: grid; grid-template-columns: repeat(3, minmax(140px, 190px)) minmax(220px, 1fr) auto; gap: 9px; }
.filter-bar .management-filter-form { grid-template-columns: repeat(4, minmax(150px, 190px)) minmax(220px, 1fr) auto; }
.search-box { position: relative; }
.search-box i { position: absolute; top: 12px; left: 12px; z-index: 2; color: #8a96a8; }
.search-box input { padding-left: 35px; }

.form-control, .form-select { min-height: 41px; border-color: #d9e0ea; border-radius: 8px; background-color: #fff; color: var(--text); font-size: 14px; }
.form-control:focus, .form-select:focus { border-color: #7ba2f4; box-shadow: 0 0 0 3px #e7efff; }
textarea.form-control { min-height: 94px; resize: vertical; }
.form-check-input { border-color: #b8c4d3; }
.form-check-input:checked { border-color: var(--blue); background-color: var(--blue); }
.form-panel { padding: 23px; }
.form-panel > .panel-head { margin: -23px -23px 23px; border-radius: 14px 14px 0 0; }
.form-panel h2 { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid.one-col { grid-template-columns: 1fr; }
.ai-chain-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; margin-bottom: 22px; border: 1px solid #b9e5d8; border-radius: 12px; background: #effbf7; }
.ai-chain-intro > div, .ai-provider-card-head > div:not(.ai-enable-toggle) { display: grid; gap: 3px; }
.ai-chain-intro small, .ai-provider-card-head small { color: var(--muted); line-height: 1.4; }
.ai-settings-heading { margin: 0 0 13px; font-size: 16px; }
.ai-credentials-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 22px; }
.saved-key { color: #087f69; }
.ai-provider-chain { display: grid; gap: 14px; }
.ai-provider-card { padding: 17px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-soft, #f8fafc); }
.ai-provider-card.is-primary { border-color: #9fc2ff; box-shadow: inset 3px 0 0 var(--primary); }
.ai-provider-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.ai-chain-step { display: grid; flex: 0 0 31px; width: 31px; height: 31px; place-items: center; border-radius: 50%; background: var(--navy-soft); color: #fff; font-weight: 800; }
.ai-enable-toggle { display: flex; align-items: center; gap: 7px; margin-left: auto; white-space: nowrap; }
.ai-enable-toggle input { width: 18px; height: 18px; }
.ai-runtime-settings { margin-top: 18px; padding: 0 17px; border: 1px solid var(--border); border-radius: 12px; }
.ai-runtime-settings summary { padding: 15px 0; cursor: pointer; font-weight: 700; }
.ai-runtime-settings[open] .form-grid { padding: 2px 0 17px; }
.publish-destination-picker { min-width: 190px; max-width: 260px; }
.publish-destination-picker .form-select { min-height: 42px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #344054; font-size: 12px; font-weight: 700; }
.field small { color: var(--muted); }
.field-check { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-content: start; gap: 8px; }
.field-check label { grid-column: 2; }
.field-check input { grid-row: 1; grid-column: 1; }
.field ul.errorlist { margin: 0; padding: 0; color: #b4232d; font-size: 12px; list-style: none; }
.category-checklist { position: relative; width: 100%; }
.category-checklist-toggle { display: flex; width: 100%; height: 41px; align-items: center; justify-content: space-between; gap: 12px; padding-right: 12px; text-align: left; background-image: none; }
.category-checklist-toggle span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-checklist-toggle i { flex: 0 0 auto; color: #667085; font-size: 12px; transition: transform .15s ease; }
.category-checklist-toggle[aria-expanded="true"] { border-color: #7ba2f4; box-shadow: 0 0 0 3px #e7efff; }
.category-checklist-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.category-checklist-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 100%; min-width: 240px; overflow: hidden; border: 1px solid #d9e0ea; border-radius: 9px; background: #fff; box-shadow: 0 14px 30px rgba(28,43,70,.16); }
.category-checklist-actions { display: flex; gap: 8px; padding: 9px 11px; border-bottom: 1px solid #edf1f6; background: #f8fafc; }
.category-checklist-actions button { padding: 2px 0; border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 700; }
.category-checklist-actions button + button { margin-left: auto; }
.category-checklist-actions button:focus-visible, .category-checklist-option:focus-within { outline: 2px solid #7ba2f4; outline-offset: -2px; }
.category-checklist-options { max-height: 230px; overflow-y: auto; padding: 5px; }
.category-checklist-option { display: flex; align-items: center; gap: 9px; margin: 0; padding: 8px; border-radius: 6px; color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; }
.category-checklist-option:hover { background: #f3f6fb; }
.category-checklist-option input { flex: 0 0 auto; margin: 0; }
.form-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }

.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.run-result { padding: 22px; }
.run-result h2 { margin-bottom: 14px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.result-grid div { padding: 12px; border: 1px solid #edf1f6; border-radius: 9px; background: #f7f9fc; }
.result-grid span { display: block; color: var(--muted); font-size: 11px; }
.result-grid strong { font-size: 20px; }
.run-summary-timing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0 0 16px; }
.run-summary-timing > div { min-width: 0; }
.run-summary-timing dt { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.run-summary-timing dd { margin: 2px 0 0; color: var(--ink); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.run-source-warnings { margin-top: 12px; padding: 10px 12px; border: 1px solid #f0cf8d; border-radius: 9px; background: #fffaf0; color: #6f4707; font-size: 12px; line-height: 1.45; }
.run-source-warnings strong { display: block; margin-bottom: 4px; color: #744b08; }
.run-source-warnings ul { margin: 0; padding-left: 18px; }
.run-source-warnings li + li { margin-top: 3px; }
.run-source-warnings span { font-weight: 700; }

.grab-progress { margin-bottom: 20px; padding: 15px; overflow: hidden; border: 1px solid #bfdbfe; border-radius: 10px; background: linear-gradient(135deg, #eff6ff, #ecfdfb); color: #1e3a5f; }
.grab-progress-copy { display: flex; align-items: center; gap: 11px; }
.grab-progress-copy > div { display: flex; flex-direction: column; }
.grab-progress-copy span:not(.spinner-border) { color: var(--muted); font-size: 12px; }
.grab-timing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin: 14px 0 4px; }
.grab-timing-grid > div { min-width: 0; }
.grab-timing-grid dt { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.grab-timing-grid dd { margin: 2px 0 0; color: var(--ink); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.grab-progress .spinner-border, .run-in-progress .spinner-border { color: var(--blue); }
.indeterminate-track { position: relative; height: 5px; margin-top: 13px; overflow: hidden; border-radius: 20px; background: rgba(37, 99, 235, .13); }
.indeterminate-track span { position: absolute; inset: 0 auto 0 -35%; width: 35%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #14b8a6); animation: grab-progress-slide 1.25s ease-in-out infinite; }
@keyframes grab-progress-slide { from { left: -35%; } to { left: 100%; } }
.run-in-progress { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; min-height: 150px; padding: 20px; border-radius: 10px; background: linear-gradient(145deg, #f5f8ff, #f0fbfa); }
.run-in-progress .spinner-border { grid-row: 1 / 3; }
.run-in-progress strong { align-self: end; }
.run-in-progress small { align-self: start; color: var(--muted); }
.queue-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.queue-summary span { padding: 4px 8px; border-radius: 999px; background: #eef4ff; color: #31547d; font-size: 11px; font-weight: 700; }
.status-queued, .status-cancelling { background: #e0f2fe; color: #075985; }
.status-completed { background: #dcfce7; color: #166534; }
.status-partially_completed { background: #fef3c7; color: #92400e; }
.status-cancelled { background: #f1f5f9; color: #475569; }
#manualGrabSubmit:disabled { cursor: wait; opacity: .82; }

.review-form { padding-bottom: 105px; }
.review-tabs { display: flex; flex-wrap: nowrap; gap: 5px; margin: 0 0 18px; padding: 7px; overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: #fff; box-shadow: 0 4px 18px rgba(28, 43, 70, .04); }
.review-tabs .nav-link { flex: 1 1 0; min-width: 0; padding: 10px 16px; overflow: hidden; border: 0; border-radius: 8px; color: #526074; font-size: 14px; font-weight: 600; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.review-tabs .nav-link span { color: #8a96a8; }
.review-tabs .nav-link:hover { background: #f2f5f9; color: #1e293b; }
.review-tabs .nav-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.review-tabs .nav-link.active { background: var(--navy-soft); color: #fff; box-shadow: 0 5px 15px rgba(16, 24, 39, .18); }
.review-tabs .nav-link.active span { color: #fff; }
.review-tab-content { min-height: 340px; }
.review-tab-pane > .panel { padding: 23px; }
.review-tab-pane > .panel + .panel { margin-top: 18px; }
.review-tab-pane > .panel > .panel-head { margin: -23px -23px 20px; padding: 19px 21px; border-radius: 14px 14px 0 0; }
.review-tab-pane .form-grid { gap: 18px; }
.review-tab-pane .panel h2, .review-tab-pane .panel-head h2 { font-size: 16px; }
.image-review { display: flex; align-items: center; justify-content: center; }
.image-review img, .no-image { width: 100%; height: 160px; border: 1px solid #e3e9f1; border-radius: 10px; background: #fbfcfe; object-fit: contain; }
.no-image { border-style: dashed; background: linear-gradient(135deg, #fbfcfe, #f7fafc); }
.no-image { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #8390a3; text-align: center; }
.no-image i { font-size: 38px; }
.sticky-actions { position: sticky; bottom: 10px; z-index: 20; display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.98); box-shadow: 0 8px 26px rgba(71, 85, 105, .22); }
.ai-regeneration { margin: 0 0 20px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfe; }
.ai-regeneration-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.ai-regeneration-preview { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.ai-regeneration-preview h3 { margin: 0 0 12px; font-size: 15px; }
.ai-regeneration-preview .package-preview { margin-bottom: 12px; }
.ai-regeneration-preview dd { white-space: pre-wrap; }

.ai-regeneration-preview {
  margin-top: 16px;
  padding: 18px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  scroll-margin-top: 90px;
}

.ai-regeneration-preview h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.ai-preview-help {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.ai-full-article-preview dd {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.7;
  max-height: 620px;
  overflow-y: auto;
  padding-top: 8px;
}


.publishing-package { border-color: #cdddf8; }
.publishing-package .panel-head { background: linear-gradient(135deg, #f5f8ff, #f0fbfa); }
.publishing-package .panel-head p { margin-top: 4px; font-size: 12px; }
.package-body { min-width: 0; }
.package-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0 0 18px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.package-preview > div { min-width: 0; padding: 11px 13px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #fbfcfe; }
.package-preview > div:nth-child(even) { border-right: 0; }
.package-preview .package-wide { grid-column: 1 / -1; border-right: 0; }
.package-preview > div:last-child { border-bottom: 0; }
.package-preview dt { margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase; }
.package-preview dd { margin: 0; color: #2b374a; font-size: 13px; overflow-wrap: anywhere; }
.copy-source { position: fixed !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }
.package-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.package-actions .btn { white-space: nowrap; }
.package-actions .btn:disabled { cursor: not-allowed; opacity: .55; }
.copy-feedback { min-width: 48px; color: #087669; font-size: 12px; font-weight: 700; }
.package-note { display: block; margin-top: 9px; color: var(--muted); }

.settings-tabs { display: flex; gap: 5px; margin-bottom: 18px; padding: 7px; overflow-x: auto; border: 1px solid var(--border); border-radius: 11px; background: #fff; box-shadow: 0 4px 18px rgba(28, 43, 70, 0.04); }
.settings-tabs .nav-link { flex: 0 0 auto; padding: 10px 16px; border-radius: 8px; color: #526074; font-weight: 600; white-space: nowrap; }
.settings-tabs .nav-link:hover { background: #f2f5f9; color: #1e293b; }
.settings-tabs .nav-link.active { background: var(--navy-soft); color: #fff; box-shadow: 0 5px 15px rgba(16, 24, 39, 0.18); }
.settings-tabs.review-tabs { overflow: hidden; }
.tab-content > .tab-pane > .panel, .settings-grid > .panel { min-width: 0; }
.settings-grid { display: grid; grid-template-columns: minmax(300px, 0.8fr) minmax(480px, 1.5fr); gap: 20px; align-items: start; }
.settings-stack { display: grid; width: 100%; gap: 20px; }
.settings-stack > * { width: 100%; min-width: 0; }
.prompt-settings-stack { display: grid; gap: 20px; }
.prompt-info { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 16px 18px; border: 1px solid #bfdbfe; border-radius: 12px; background: linear-gradient(135deg,#eff6ff,#f0fdfa); color: #23415f; }
.prompt-info > i { margin-top: 2px; color: var(--blue); font-size: 20px; }
.prompt-info p { margin: 4px 0 0; color: #52657a; font-size: 13px; line-height: 1.55; }
.prompt-form-grid textarea { min-height: 260px; font-family: inherit; line-height: 1.55; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-label-row .btn { flex: 0 0 auto; }
.prompt-preview-card { min-width: 0; overflow: visible; }
.prompt-preview-card form, .prompt-preview-controls { display: grid; min-width: 0; gap: 18px; }
.prompt-preview-run-mode, .prompt-preview-search { width: 100%; }
.prompt-preview-scope-grid, .prompt-preview-parameters { display: grid; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.prompt-preview-choice-panel { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfe; }
.prompt-preview-choice-panel legend { float: none; width: auto; margin: 0 0 9px; padding: 0; color: #344054; font-size: 12px; font-weight: 700; line-height: 1.4; }
.prompt-preview-checklist { max-height: 220px; min-height: 90px; overflow-x: hidden; overflow-y: auto; padding: 4px; border: 1px solid #e5eaf1; border-radius: 8px; background: #fff; }
.prompt-preview-checklist > .form-check-input { display: grid; width: 100%; height: auto; margin: 0; padding: 0; gap: 2px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.prompt-preview-checklist > div { display: grid; gap: 2px; }
.prompt-preview-checklist label { display: flex; min-width: 0; align-items: flex-start; gap: 9px; margin: 0; padding: 8px; border-radius: 6px; color: var(--text); font-size: 13px; font-weight: 500; line-height: 1.35; cursor: pointer; overflow-wrap: anywhere; }
.prompt-preview-checklist label:hover { background: #f3f6fb; }
.prompt-preview-checklist label:focus-within { outline: 2px solid #7ba2f4; outline-offset: -2px; }
.prompt-preview-checklist input[type="checkbox"] { flex: 0 0 auto; margin: 2px 0 0; }
.prompt-preview-controls [data-preview-field].is-disabled { opacity: .55; }
.prompt-preview-controls [data-preview-field].is-disabled input, .prompt-preview-controls [data-preview-field].is-disabled select, .prompt-preview-controls [data-preview-field].is-disabled textarea { cursor: not-allowed; background: #f1f5f9; }
.prompt-preview-card .form-actions { display: flex; align-items: center; gap: 14px; }
.prompt-preview-action-row { flex-wrap: wrap; margin-top: 2px; }
.prompt-preview-card .form-actions small { color: var(--muted); }
.prompt-preview-saved-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 18px; padding: 10px 12px; border: 1px solid #dfe6ef; border-radius: 8px; background: #f8fafc; color: #526074; font-size: 12px; line-height: 1.5; }
.prompt-preview-saved-note i { margin-top: 1px; color: var(--blue); }
.prompt-preview-result { scroll-margin-top: 90px; }
.prompt-preview-output { display: grid; gap: 14px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.prompt-preview-status, .preview-zero-impact { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid #cdddf8; border-radius: 10px; background: #f5f8ff; }
.prompt-preview-output details { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.prompt-preview-output summary { padding: 13px 15px; background: #f8fafc; color: var(--navy); font-weight: 700; cursor: pointer; }
.prompt-preview-output details[open] summary { border-bottom: 1px solid var(--border); }
.prompt-preview-output details > :not(summary) { margin-right: 15px; margin-left: 15px; }
.prompt-preview-output pre { max-height: 430px; margin-top: 10px; margin-bottom: 15px; padding: 15px; overflow: auto; border: 1px solid #dfe6ef; border-radius: 8px; background: #101827; color: #e5edf8; font: 12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt-preview-output h3 { margin: 16px 15px 4px; font-size: 13px; }
.preview-label { margin-top: 12px !important; margin-bottom: 0; color: var(--muted); font-size: 12px; }
.preview-heading-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.runtime-records { display: grid; gap: 9px; padding: 14px 0; }
.runtime-records article { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid #e5eaf1; border-radius: 8px; background: #fbfcfe; }
.runtime-records span, .runtime-records small { color: var(--muted); }
.verification-status { padding: 14px 0; }
.verification-status ul { margin: 10px 0; padding-left: 20px; }
.prompt-warning { display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; border: 1px solid #f2d39a; border-radius: 9px; background: #fffaf0; color: #8b5608; }
.preview-zero-impact { justify-content: flex-start; background: #f0fdf8; border-color: #bce9d8; color: #087669; font-size: 12px; font-weight: 700; }
.preview-zero-impact span + span::before { content: "•"; margin-right: 10px; color: #73ad9f; }

.mobile-nav { display: none; background: var(--navy); }

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: radial-gradient(circle at top right, #dff3f5, transparent 40%), var(--background); }
.login-card { width: min(420px, 100%); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 60px rgba(75, 92, 117, 0.2); }
.login-card input { display: block; width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.auth-card-footer { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--border); text-align: center; }
.account-card { max-width: 760px; }
.account-card input { display: block; width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.account-card ul { margin: 7px 0 0; padding-left: 20px; color: var(--muted); font-size: 12px; }
.account-identity { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; margin-bottom: 22px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.account-identity small { display: block; color: var(--muted); }
.mobile-account-links { display: grid; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #293348; }
.mobile-account-links a, .mobile-account-links button { display: block; width: 100%; padding: 10px 14px; border: 0; border-radius: 8px; background: transparent; color: #aeb8c9; text-align: left; text-decoration: none; }

@media (max-width: 1200px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-bar form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-box { grid-column: 1 / 3; }
  .review-tabs .nav-link { padding: 10px 12px; font-size: 13px; }
  .settings-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 7px; }
  .topbar-controls { width: 100%; }
}

@media (max-width: 991px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .mobile-nav { position: sticky; top: 0; z-index: 50; display: flex; padding: 10px 16px; box-shadow: 0 4px 18px rgba(10, 18, 33, 0.22); }
  .mobile-nav .brand { padding: 0; }
  .mobile-nav .navbar-collapse { width: 100%; }
  .mobile-nav .side-nav { padding: 4px 0 12px; }
  .mobile-nav .side-nav a { display: flex; }
  .main-content { width: 100%; }
  .topbar { display: none; }
  .content-wrap { padding: 22px 16px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .filter-bar form { display: flex; flex-direction: column; }
  .search-box { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .ai-credentials-grid { grid-template-columns: 1fr; }
  .prompt-preview-scope-grid, .prompt-preview-parameters { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .settings-tabs { flex-wrap: nowrap; }
  .review-tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .review-tabs::-webkit-scrollbar { display: none; }
  .review-tabs .nav-link { flex: 1 1 0; min-width: 0; padding: 10px 9px; }
  .table-responsive { border-radius: 0 0 14px 14px; }
}

@media (max-width: 575px) {
  .ai-chain-intro, .ai-provider-card-head { align-items: flex-start; }
  .ai-chain-intro { flex-direction: column; }
  .ai-provider-card-head { flex-wrap: wrap; }
  .ai-enable-toggle { width: 100%; margin-left: 43px; }
  .grab-timing-grid { grid-template-columns: 1fr; }
  .content-wrap { padding: 17px 11px; }
  .page-heading h1 { font-size: 23px; }
  .page-heading .actions { width: 100%; flex-direction: column; }
  .page-heading .actions form { width: 100%; }
  .page-heading .actions .btn { width: 100%; }
  .metric-grid { grid-template-columns: 1fr; }
  .panel { border-radius: 10px; }
  .form-panel, .review-tab-pane > .panel { padding: 17px; }
  .form-panel > .panel-head, .review-tab-pane > .panel > .panel-head { margin: -17px -17px 17px; }
  .row-actions { align-items: stretch; flex-direction: column; }
  .row-actions .btn, .row-actions form, .row-actions form button { width: 100%; }
  .review-form { padding-bottom: 0; }
  .sticky-actions { position: static; flex-wrap: wrap; margin-top: 8px; }
  .sticky-actions .btn { flex: 1 1 calc(50% - 8px); }
  .ai-regeneration-actions { align-items: stretch; flex-direction: column; }
  .ai-regeneration-actions .btn { width: 100%; }
  .image-review img, .no-image { height: 160px; }
  .grab-progress-copy { align-items: flex-start; }
  #manualGrabSubmit { width: 100%; }
  .package-preview { grid-template-columns: 1fr; }
  .package-preview .package-wide { grid-column: auto; }
  .package-preview > div { border-right: 0; }
  .package-actions { align-items: stretch; flex-direction: column; }
  .package-actions .btn { width: 100%; }
  .pagination-bar { align-items: stretch; flex-direction: column; }
  .page-size-form, .pager { flex-wrap: wrap; }
  .copy-feedback { min-height: 18px; text-align: center; }
  .review-tabs { gap: 3px; padding: 5px; }
  .review-tabs .nav-link { padding: 8px 5px; font-size: 11px; }
  .field-label-row, .prompt-preview-card .form-actions, .preview-heading-actions { align-items: stretch; flex-direction: column; }
  .field-label-row .btn, .prompt-preview-card .form-actions .btn, .preview-heading-actions .btn { width: 100%; }
  .prompt-form-grid textarea { min-height: 230px; }
}

.source-body-meta { display:flex; flex-wrap:wrap; gap:10px 22px; align-items:center; margin-bottom:14px; color:var(--muted); font-size:.88rem; }
.source-body-meta a { margin-left:auto; }
.source-body-content { padding:18px; border:1px solid var(--border); border-radius:10px; background:#f8fafc; line-height:1.72; }
.source-body-content p { margin:0 0 1em; }
.source-body-content p:last-child { margin-bottom:0; }
@media (max-width:767px) { .source-body-meta { align-items:flex-start; flex-direction:column; } .source-body-meta a { margin-left:0; } .source-body-content { padding:14px; } }
.company-switcher{display:flex;align-items:center;gap:.5rem;margin-left:auto}.company-switcher label{font-size:.75rem;font-weight:700;white-space:nowrap}.company-switcher select{min-width:180px}.company-name-cell{font-weight:600;white-space:nowrap}@media(max-width:767px){.company-switcher{width:100%;margin:.5rem 0;align-items:flex-start;flex-direction:column}.company-switcher select{width:100%}}
.company-switcher { min-width: 0; }
.company-switcher select { max-width: min(310px, 36vw); }
.quota-status { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; padding: 14px 18px; }
.quota-status > div { display: grid; gap: 2px; min-width: 0; }
.quota-status span, .quota-status small { color: var(--muted); font-size: 11px; }
.quota-status strong { color: var(--navy); font-size: 14px; }
.quota-admin-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin-bottom: 18px; padding: 13px 15px; border: 1px solid #cdddf8; border-radius: 10px; background: #f5f8ff; font-size: 12px; }
.quota-admin-summary strong, .quota-admin-summary small { grid-column: 1 / -1; }
.quota-admin-summary small { color: var(--muted); }
@media (max-width: 767px) { .quota-status { grid-template-columns: 1fr; } .quota-admin-summary { grid-template-columns: 1fr; } .quota-admin-summary strong, .quota-admin-summary small { grid-column: auto; } }

.toast-region { position: fixed; top: 78px; right: 18px; z-index: 1090; display: flex; width: min(440px, calc(100vw - 36px)); max-height: calc(100vh - 96px); flex-direction: column; gap: 10px; overflow-y: auto; pointer-events: none; }
.ep-toast { --toast-accent: #3178dc; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 11px; padding: 13px 13px 13px 14px; border: 1px solid color-mix(in srgb, var(--toast-accent) 28%, #dbe3ee); border-left: 4px solid var(--toast-accent); border-radius: 11px; background: rgba(255,255,255,.98); box-shadow: 0 14px 38px rgba(15,23,42,.2); color: #1f2937; opacity: 0; overflow-wrap: anywhere; pointer-events: auto; transform: translateY(-8px); transition: opacity .18s ease, transform .18s ease; }
.ep-toast.is-visible { opacity: 1; transform: translateY(0); }
.ep-toast.is-leaving { opacity: 0; transform: translateX(12px); }
.ep-toast-success { --toast-accent: #07866f; background: #f5fffc; }
.ep-toast-info { --toast-accent: #2563eb; background: #f7faff; }
.ep-toast-warning { --toast-accent: #b96b08; background: #fffaf0; }
.ep-toast-error { --toast-accent: #c9364b; background: #fff7f8; }
.ep-toast-icon { margin-top: 2px; color: var(--toast-accent); font-size: 18px; line-height: 1; }
.ep-toast-body { min-width: 0; font-size: 13px; line-height: 1.5; white-space: normal; }
.ep-toast-close { display: inline-grid; width: 28px; height: 28px; margin: -5px -5px 0 0; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #64748b; }
.ep-toast-close:hover, .ep-toast-close:focus-visible { background: rgba(15,23,42,.07); color: #0f172a; outline: none; }
@media (max-width: 991px) { .toast-region { top: 68px; right: 12px; width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 82px); } }
@media (max-width: 575px) { .toast-region { top: 64px; gap: 8px; } .ep-toast { padding: 12px; } }
@media (prefers-reduced-motion: reduce) { .ep-toast { transition: none; transform: none; } }

/* Platform content and engagement */
.source-media-grid { display:flex; flex-direction:column; align-items:center; gap:1rem; margin-top:1rem; }
.source-media-grid figure,.source-video { width:min(100%,760px); margin:0; border:1px solid var(--border,#dbe3ef); border-radius:12px; overflow:hidden; background:#f8fafc; }
.source-media-grid img { display:block; width:100%; max-height:360px; object-fit:contain; background:#eef2f7; }
.source-media-grid figcaption { padding:.65rem .8rem; color:#5d6b82; font-size:.85rem; }
.source-video { padding-bottom:.75rem; text-align:center; }
.source-video-frame { width:100%; aspect-ratio:16/9; }
.source-video iframe { width:100%; height:100%; border:0; }
.source-video > a { display:inline-block; margin-top:.7rem; font-weight:600; text-decoration:none; }
.video-fallback { display:flex; width:min(100%,760px); flex-wrap:wrap; align-items:center; justify-content:space-between; gap:1rem; padding:.85rem 1rem; border:1px solid var(--border,#dbe3ef); border-radius:10px; background:#f8fafc; }
.video-fallback div { display:flex; flex-direction:column; }
.video-fallback small { color:var(--muted); }
.video-evidence { width:100%; margin-top:0; border-top:1px solid var(--border); }
.video-evidence summary { padding:8px 0 0; color:var(--muted); font-size:11px; cursor:pointer; }
.video-evidence dl { display:grid; gap:5px; margin:8px 0 0; font-size:11px; }
.video-evidence dl div { display:grid; grid-template-columns:80px minmax(0,1fr); }
.video-evidence dt { color:var(--muted); }
.video-evidence dd { margin:0; overflow-wrap:anywhere; }
.engagement-grid { display:grid; grid-template-columns:repeat(3,minmax(120px,1fr)); gap:.75rem; }
.engagement-grid > div { padding:.8rem; border:1px solid var(--border,#dbe3ef); border-radius:10px; background:#f8fafc; }
.engagement-grid span { display:block; color:#64748b; font-size:.78rem; }
.engagement-grid strong { font-size:1rem; }
.engagement-grid small { display:block; margin-top:3px; color:var(--muted); font-size:.68rem; }
.engagement-checked { margin:.85rem 0 0; color:#64748b; font-size:.85rem; }
.public-comments { margin-top:1.15rem; }
.public-comments h3 { margin:0; font-size:.92rem; }
.comment-summary { margin:.3rem 0 .65rem; color:var(--muted); font-size:.8rem; }
.engagement-comments { display:grid; gap:.55rem; margin:0; }
.engagement-comment { padding:.7rem .8rem; border:1px solid var(--border,#dbe3ef); border-radius:9px; background:#fbfcfe; }
.engagement-comment header,.engagement-comment footer { display:flex; align-items:center; justify-content:space-between; gap:.75rem; }
.engagement-comment header strong { font-size:.82rem; }
.engagement-comment header time,.engagement-comment footer { color:var(--muted); font-size:.72rem; }
.engagement-comment p { margin:.35rem 0 0; color:var(--navy); font-size:.82rem; line-height:1.5; white-space:normal; }
.engagement-comment footer { justify-content:flex-start; margin-top:.4rem; }
.comment-empty-state { display:flex; align-items:center; gap:.55rem; padding:.65rem .75rem; border:1px solid var(--border); border-radius:8px; background:#f8fafc; color:var(--muted); font-size:.78rem; }
.engagement-history { margin-top:.85rem; }
.engagement-refresh-failure { display:grid; grid-template-columns:auto 1fr; gap:2px 10px; align-items:center; margin:0 0 .85rem; }
.engagement-refresh-failure span { color:var(--muted); font-size:.75rem; }
.engagement-refresh-failure p { grid-column:1/-1; margin:2px 0 0; }
.snapshot-history li { display:flex; flex-wrap:wrap; gap:4px 12px; align-items:center; }
@media(max-width:767px) { .engagement-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .engagement-panel .panel-head { align-items:flex-start; gap:.75rem; flex-direction:column; } }

/* Platform-aware review workspace. These rules are deliberately scoped and
   do not alter the application's global scale. */
.metadata-summary,.ai-provenance { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; margin:0; overflow:hidden; border:1px solid var(--border); border-radius:10px; }
.metadata-summary > div,.ai-provenance > div { min-width:0; padding:10px 12px; border-right:1px solid var(--border); border-bottom:1px solid var(--border); background:#fbfcfe; }
.metadata-summary .summary-wide { grid-column:1/-1; }
.metadata-summary dt,.ai-provenance dt,.technical-details dt { color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.metadata-summary dd,.ai-provenance dd,.technical-details dd { margin:3px 0 0; overflow-wrap:anywhere; }
.primary-media-layout { display:grid; grid-template-columns:minmax(260px,360px) minmax(180px,1fr); gap:20px; align-items:center; }
.compact-media-preview { width:min(360px,100%); min-height:160px; max-height:220px; margin:auto; overflow:hidden; border:1px solid var(--border); border-radius:10px; background:#f8fafc; }
.compact-media-preview img { display:block; width:auto; max-width:100%; height:auto; max-height:220px; margin:auto; object-fit:contain; }
.compact-media-preview .no-image { width:100%; height:180px; }
.media-facts { display:flex; flex-direction:column; align-items:flex-start; gap:9px; color:var(--muted); }
.media-facts a { font-weight:600; text-decoration:none; }
.facebook-post-preview { display:-webkit-box; min-width:0; overflow:hidden; color:#273449; font-family:Inter,"Noto Sans Bengali","Nirmala UI",ui-sans-serif,sans-serif; font-size:15px; line-height:1.65; overflow-wrap:anywhere; white-space:pre-line; -webkit-box-orient:vertical; -webkit-line-clamp:3; text-overflow:ellipsis; }
.facebook-media-strip { display:flex; flex-wrap:wrap; gap:10px; margin-top:16px; }
.facebook-media-strip figure { position:relative; display:flex; width:132px; height:96px; margin:0; align-items:center; justify-content:center; overflow:hidden; border:1px solid var(--border); border-radius:9px; background:#f8fafc; }
.facebook-media-strip img { display:block; width:100%; height:100%; object-fit:cover; }
.facebook-media-strip figcaption { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.media-type-placeholder { display:flex; flex-direction:column; align-items:center; gap:4px; color:var(--muted); font-size:11px; }
.media-type-placeholder i { font-size:22px; }
.advanced-metadata-editing { margin-top:16px; }
.advanced-metadata-editing .technical-details-body { padding-top:4px; }
.technical-url-field textarea,.technical-url-field input { font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:11px; }
.technical-details { margin-top:16px; border:1px solid var(--border); border-radius:9px; background:#fbfcfe; }
.technical-details summary { padding:10px 12px; color:#526074; font-weight:700; cursor:pointer; }
.technical-details > dl,.technical-details > ol,.technical-details-body { margin:0; padding:0 12px 12px; }
.technical-details dd { max-height:90px; overflow:auto; font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:11px; }
.ai-state-summary { margin-bottom:16px; padding:13px 15px; border:1px solid #cdddf8; border-radius:10px; background:#f5f8ff; }
.ai-state-summary p { margin:5px 0 0; color:var(--muted); }
.ai-state-fixture .ai-state-summary { border-color:#f2d39a; background:#fffaf0; }
.ai-state-failed .ai-state-summary { border-color:#f4b8bf; background:#fff7f8; }
.fixture-warning { color:#74480a; font-weight:600; }
.fixture-value-list { display:grid; gap:8px; margin:0; }
.fixture-value-list > div { padding:8px 0; border-bottom:1px solid var(--border); }
.fixture-value-list dd { max-height:none; overflow:visible; font-family:inherit; font-size:13px; }
.ai-state-badge { background:#edf1f6; color:#526074; }
.ai-state-fixture .ai-state-badge,.ai-preview-fixture { color:#9a5a06; }
.ai-state-failed .ai-state-badge,.ai-preview-failed { color:#b4232d; }
.ai-preview-not_generated,.ai-preview-unknown { color:var(--muted); }
.ai-provenance { grid-template-columns:repeat(3,minmax(0,1fr)); margin-bottom:18px; }
.editorial-content { color:#273449; font-family:Georgia,"Times New Roman",serif; font-size:15px; }
.source-body-content { width:min(100%,1000px); margin-right:auto; margin-left:auto; font-size:16px; line-height:1.78; }
.source-body-content p { margin-bottom:1.15em; }
.facebook-post-content { font-family:Inter,"Noto Sans Bengali","Nirmala UI",ui-sans-serif,sans-serif; font-size:16px; line-height:1.8; }
.article-reading-header { width:min(100%,1000px); margin:0 auto 14px; padding:14px 16px; border:1px solid var(--border); border-radius:10px; background:#fbfcfe; }
.article-reading-header h3 { margin:0 0 8px; color:var(--navy); font-size:19px; line-height:1.35; }
.article-reading-header > div { display:flex; flex-wrap:wrap; gap:6px 18px; align-items:center; color:var(--muted); font-size:12px; }
.article-reading-header a { margin-left:auto; font-weight:600; text-decoration:none; }
.editorial-content h2,.editorial-content h3,.editorial-content h4 { margin:1.35em 0 .55em; color:var(--navy); font-family:Inter,ui-sans-serif,sans-serif; }
.editorial-content ul,.editorial-content ol { margin:0 0 1em; padding-left:1.5em; }
.editorial-content blockquote { margin:1em 0; padding:.7em 1em; border-left:3px solid var(--blue); background:#f3f7ff; }
.source-media-grid figure { display:flex; min-height:180px; flex-direction:column; align-items:center; justify-content:center; }
.source-media-grid img { width:auto; max-width:100%; height:auto; max-height:320px; }
.source-media-grid.facebook-original-media { display:grid; width:min(100%,1000px); grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; gap:14px; margin-right:auto; margin-left:auto; }
.facebook-original-media figure { width:100%; min-height:300px; max-height:360px; background:#fff; }
.facebook-original-media figure:only-child { width:min(100%,760px); grid-column:1/-1; justify-self:center; }
.facebook-original-media figure > a { display:flex; width:100%; height:320px; align-items:center; justify-content:center; padding:8px; }
.facebook-original-media figure img { width:auto; max-width:100%; height:auto; max-height:320px; object-fit:contain; background:transparent; }
.facebook-original-media figcaption { width:100%; padding:6px 10px; }
.subtle-caption { width:100%; font-style:italic; opacity:.8; }
.compact-empty { padding:18px!important; text-align:left!important; }
.snapshot-history { display:grid; gap:6px; padding-left:30px!important; color:var(--muted); font-size:12px; }
.verification-checks { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.verification-checks > div { display:grid; grid-template-columns:auto minmax(0,1fr); gap:2px 9px; align-items:start; padding:11px 12px; border:1px solid var(--border); border-radius:9px; background:#fbfcfe; }
.verification-checks strong { align-self:center; }
.verification-checks small { grid-column:2; color:var(--muted); overflow-wrap:anywhere; }
.check-state { grid-row:1/3; display:inline-flex; padding:3px 7px; border-radius:999px; background:#edf1f6; color:#526074; font-size:9px; font-weight:800; letter-spacing:.03em; text-transform:uppercase; }
.check-passed { background:#ddf7ef; color:#087669; }
.check-warning { background:#fff0d5; color:#9a5a06; }
.check-failed { background:#fee8e8; color:#b4232d; }
.publishing-unavailable { display:flex; align-items:flex-start; gap:11px; padding:16px; border:1px solid #f2d39a; border-radius:10px; background:#fffaf0; color:#74480a; }
.publishing-unavailable i { margin-top:2px; font-size:18px; }
.publishing-unavailable p { margin:4px 0 0; }
@media(max-width:991px) { .metadata-summary,.ai-provenance { grid-template-columns:repeat(2,minmax(0,1fr)); } .review-tabs .nav-link { flex:0 0 auto; } }
@media(max-width:767px) { .primary-media-layout,.verification-checks { grid-template-columns:1fr; } .metadata-summary,.ai-provenance { grid-template-columns:1fr; } .metadata-summary .summary-wide { grid-column:auto; } }
@media(max-width:767px) { .article-reading-header a { width:100%; margin-left:0; } .source-body-content { font-size:15px; } }
@media(max-width:767px) { .source-media-grid.facebook-original-media { grid-template-columns:1fr; } .facebook-original-media figure:only-child { grid-column:auto; } }

/* Facebook profile operations */
.facebook-profile-create-grid { display:grid; grid-template-columns:minmax(220px,.8fr) minmax(320px,1.4fr) auto; gap:14px; align-items:end; }
.facebook-profile-create-grid .field { min-width:0; }
.facebook-profile-create-grid textarea { min-height:42px; height:42px; resize:vertical; }
.facebook-profile-create-grid .btn { min-height:42px; white-space:nowrap; }
.profile-count { padding:5px 9px; border:1px solid var(--border); border-radius:999px; color:var(--muted); background:#f8fafc; font-size:11px; font-weight:700; }
.facebook-profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; padding:18px; }
.facebook-profile-card { min-width:0; overflow:hidden; border:1px solid var(--border); border-radius:12px; background:#fff; box-shadow:0 4px 14px rgba(16,34,62,.05); }
.facebook-profile-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:16px 17px 13px; border-bottom:1px solid var(--border); background:linear-gradient(180deg,#fff,#fbfcfe); }
.profile-title-row { display:flex; flex-wrap:wrap; align-items:center; gap:7px; }
.facebook-profile-card h3 { margin:0; color:var(--navy); font-size:15px; line-height:1.3; }
.facebook-profile-card-head p { margin:4px 0 0; color:var(--muted); font-size:11px; overflow-wrap:anywhere; }
.profile-default-badge { padding:3px 7px; border-radius:999px; background:#e7efff; color:#2459b8; font-size:9px; font-weight:800; letter-spacing:.03em; text-transform:uppercase; }
.profile-health-row { display:flex; flex-wrap:wrap; gap:7px; padding:12px 17px 0; }
.profile-health-row span { display:inline-flex; gap:5px; align-items:center; padding:5px 8px; border-radius:7px; background:#f2f5f9; color:#6d7787; font-size:10px; font-weight:700; }
.profile-health-row .is-good { background:#e7f8f2; color:#087669; }
.profile-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0; margin:12px 17px 0; border:1px solid var(--border); border-radius:9px; overflow:hidden; }
.profile-facts > div { min-width:0; padding:9px 10px; border-right:1px solid var(--border); border-bottom:1px solid var(--border); background:#fbfcfe; }
.profile-facts > div:nth-child(2n) { border-right:0; }
.profile-facts .profile-fact-wide { grid-column:1/-1; border-right:0; }
.profile-facts > div:last-child { border-bottom:0; }
.profile-facts dt { color:var(--muted); font-size:9px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.profile-facts dd { margin:3px 0 0; color:var(--navy); font-size:12px; font-weight:600; overflow-wrap:anywhere; }
.profile-facts .profile-failure { background:#fff8f8; }
.profile-facts .profile-failure dd { color:#a52b34; }
.profile-primary-actions,.profile-secondary-actions { display:flex; flex-wrap:wrap; gap:7px; }
.profile-primary-actions { padding:14px 17px; }
.profile-primary-actions form,.profile-secondary-actions form { margin:0; }
.profile-manage-details { border-top:1px solid var(--border); background:#fbfcfe; }
.profile-manage-details summary { padding:10px 17px; color:#526074; font-size:11px; font-weight:700; cursor:pointer; }
.profile-manage-body { display:grid; gap:10px; padding:0 17px 14px; }
.profile-rename-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px; }
@media(max-width:1100px) { .facebook-profile-grid { grid-template-columns:1fr; } }
@media(max-width:767px) {
  .facebook-profile-create-grid { grid-template-columns:1fr; }
  .facebook-profile-grid { grid-template-columns:1fr; padding:12px; }
  .facebook-profile-card-head { align-items:flex-start; }
  .profile-primary-actions .btn,.profile-primary-actions form { width:100%; }
}

.ai-article-body-preview dd {
  white-space:pre-wrap;
  line-height:1.65;
  max-width:86ch;
}

/* Scheduler category/source selection */
.schedule-options-field { display:flex; flex-direction:column; gap:8px; }
.schedule-options-head { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:28px; }
.schedule-options-head > label { margin:0; color:#344054; font-size:12px; font-weight:700; }
.schedule-options-actions { display:flex; align-items:center; gap:6px; }
.schedule-options-actions button { padding:3px 8px; border:1px solid var(--border); border-radius:6px; background:#f8fafc; color:#46566e; font-size:11px; font-weight:700; }
.schedule-options-actions button:hover { border-color:#9fbcf4; background:#eef4ff; color:var(--blue); }
.schedule-checklist {
  display:grid;
  gap:2px;
  max-height:260px;
  margin:0;
  padding:8px;
  overflow-y:auto;
  border:1px solid var(--border);
  border-radius:9px;
  background:#fff;
}
.schedule-checklist > div { margin:0; }
.schedule-checklist label {
  display:flex;
  align-items:flex-start;
  gap:9px;
  width:100%;
  margin:0;
  padding:8px 9px;
  border-radius:7px;
  color:var(--navy);
  font-weight:500;
  line-height:1.35;
  cursor:pointer;
}
.schedule-checklist label:hover { background:#f3f7ff; }
.schedule-checklist input[type="checkbox"] {
  flex:0 0 auto;
  width:16px;
  height:16px;
  margin:1px 0 0;
}
@media(max-width:767px) {
  .schedule-options-head { align-items:flex-start; flex-direction:column; }
}

/* RUN_HISTORY_DESKTOP_GRID_V1_START */
/*
 * Run History desktop layout
 * Keep the existing responsive/mobile rule untouched.
 * The previous 145px Details column was too narrow on desktop.
 */
@media (min-width: 901px) {

  .run-history-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  /*
   * Give the final Details column enough room for:
   *   13/13 sources Completed
   *   View details
   */
  .run-history-table th:nth-last-child(1),
  .run-history-table td:nth-last-child(1) {
    width: 190px;
  }

  .run-history-table .run-detail-cell {
    width: 190px;
    min-width: 190px;
    padding-right: 16px;
    padding-left: 12px;
    vertical-align: middle;
    overflow: visible;
  }

  .run-history-table .run-detail-summary {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 5px;
    width: 100%;
    margin-bottom: 8px;
    line-height: 1.25;
    white-space: normal;
  }

  .run-history-table .run-detail-summary strong {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .run-history-table .run-detail-summary em {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .run-history-table .run-detail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 138px;
    max-width: 100%;
    white-space: nowrap;
  }

  /*
   * Prevent the grouped metric columns from forcing the table wider
   * than the available desktop workspace.
   */
  .run-history-table th,
  .run-history-table td {
    min-width: 0;
    overflow-wrap: normal;
  }

  .run-history-table .run-value-grid {
    min-width: 0;
  }
}
/* RUN_HISTORY_DESKTOP_GRID_V1_END */

/* NEWS_RESULTS_LATEST_ARRIVAL_V1_START */

/*
 * Newly collected editorial batch.
 * Keep the treatment visible but restrained enough for a newsroom grid.
 */
.news-results-table tbody tr.latest-arrival-row > td {
  background: #f4f9ff;
}

.news-results-table tbody tr.latest-arrival-row:hover > td {
  background: #edf6ff;
}

.news-results-table tbody tr.latest-arrival-row > td:first-child {
  box-shadow: inset 3px 0 0 #2f6fed;
}

.latest-arrival-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 4px;
  margin: 0 0 4px;
  padding: 2px 7px;
  border: 1px solid #b8d2ff;
  border-radius: 999px;
  background: #e8f1ff;
  color: #1d5ec9;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: .035em;
  text-transform: uppercase;
  white-space: nowrap;
}

.latest-arrival-badge .bi {
  font-size: 9px;
}

/* NEWS_RESULTS_LATEST_ARRIVAL_V1_END */

/* NEWS_RESULTS_DESKTOP_COLUMNS_V2_START */

/*
 * Desktop-only News Results column proportions.
 *
 * Total = exactly 100%.
 * Prevents the browser from squeezing columns because the previous
 * percentage widths exceeded the available table width.
 */
@media (min-width:1280px) {

  .news-results-table {
    width:100%;
    min-width:0;
    table-layout:fixed;
  }

  /* Company workspace: no company column */
  .news-results-table.without-company .col-select      { width:3%; }
  .news-results-table.without-company .col-original    { width:24%; }
  .news-results-table.without-company .col-source      { width:12%; }
  .news-results-table.without-company .col-published   { width:12%; }
  .news-results-table.without-company .col-engagement  { width:9%; }
  .news-results-table.without-company .col-collected   { width:13%; }
  .news-results-table.without-company .col-verification{ width:9%; }
  .news-results-table.without-company .col-ai          { width:10%; }
  .news-results-table.without-company .col-actions     { width:8%; }

  /*
   * Keep desktop column headings clean.
   * Individual cell content can still wrap naturally.
   */
  .news-results-table thead th {
    white-space:nowrap;
    overflow-wrap:normal;
    word-break:normal;
  }

  .news-results-table .source-category-cell,
  .news-results-table .article-dates,
  .news-results-table .collected-time,
  .news-results-table .ai-headline-preview {
    overflow-wrap:normal;
    word-break:normal;
  }

  /*
   * Original title stays compact rather than consuming row height.
   */
  .news-results-table .original-article-text {
    -webkit-line-clamp:2;
    line-clamp:2;
  }

  /*
   * Source names may wrap, but only naturally at spaces.
   */
  .news-results-table .source-name {
    word-break:normal;
    overflow-wrap:normal;
  }

  /*
   * Give status badges enough breathing room.
   */
  .news-results-table td .status {
    max-width:100%;
    white-space:normal;
    word-break:normal;
    overflow-wrap:normal;
  }

  /*
   * Actions stay neatly inside the final column.
   */
  .news-results-table .news-row-actions {
    width:100%;
  }

  .news-results-table .news-row-actions .btn {
    width:100%;
    min-width:0;
    padding-left:4px;
    padding-right:4px;
    white-space:nowrap;
  }
}

/* NEWS_RESULTS_DESKTOP_COLUMNS_V2_END */

/* NEWS_RESULTS_PUBLICATION_TRACKING_V1_START */
.news-results-table > :not(caption) > * > * { padding: 8px 6px; }
.news-results-table tbody tr.latest-arrival-row > td { background: #f8fbff; }
.latest-arrival-badge {
  margin-bottom: 3px;
  padding: 1px 5px;
  border-color: #d6e4fb;
  background: #f3f7fd;
  color: #5578aa;
  font-size: 8px;
}
.news-results-table td.workflow-publication-cell {
  display: table-cell;
  min-width: 0;
}
.workflow-publication-cell .status,
.workflow-publication-cell .publication-state,
.workflow-publication-cell .dw-view-link,
.workflow-publication-cell small {
  display: flex;
  width: fit-content;
  max-width: 100%;
}
.workflow-publication-cell .publication-state { margin-top: 6px; font-size: 11px; font-weight: 700; line-height: 1.3; }
.publication-published { color: #087669; }
.publication-failed { color: #b4232d; }
.publication-not-published { color: #69758a; }
.dw-view-link { margin-top: 3px; color: var(--blue); font-size: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.workflow-publication-cell small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.btn-link-danger { border-color: transparent; background: transparent; color: #9f4650; }
.btn-link-danger:hover { border-color: #f3c7cb; background: #fff5f6; color: #b4232d; }
.news-row-actions .btn { font-size: 10px; }

@media (min-width:1280px) {
  .news-results-table.without-company .col-original    { width:23%; }
  .news-results-table.without-company .col-source      { width:11%; }
  .news-results-table.without-company .col-published   { width:11%; }
  .news-results-table.without-company .col-engagement  { width:8%; }
  .news-results-table.without-company .col-collected   { width:11%; }
  .news-results-table.without-company .col-verification{ width:14%; }
  .news-results-table.without-company .col-ai          { width:11%; }
  .news-results-table.without-company .col-actions     { width:8%; }
  .news-results-table.with-company .col-company        { width:6%; }
  .news-results-table.with-company .col-select         { width:3%; }
  .news-results-table.with-company .col-original       { width:21%; }
  .news-results-table.with-company .col-source         { width:10%; }
  .news-results-table.with-company .col-published      { width:10%; }
  .news-results-table.with-company .col-engagement     { width:7%; }
  .news-results-table.with-company .col-collected      { width:10%; }
  .news-results-table.with-company .col-verification   { width:14%; }
  .news-results-table.with-company .col-ai             { width:11%; }
  .news-results-table.with-company .col-actions        { width:8%; }
}

@media (max-width:1279px) {
  .news-results-table { min-width: 980px; }
}
/* NEWS_RESULTS_PUBLICATION_TRACKING_V1_END */

/* REVIEW_ACTION_BAR_V2_START */

/*
 * Compact desktop editorial toolbar.
 * The old sticky bar became tall because the progress message and
 * publishing eligibility text participated in the flex layout.
 */
@media (min-width: 768px) {

  .review-form {
    padding-bottom: 72px;
  }

  .sticky-actions {
    position: sticky;
    bottom: 8px;
    z-index: 20;

    display: flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;

    gap: 6px;
    padding: 7px 9px;

    border: 1px solid #d9e1ec;
    border-radius: 10px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 8px 24px rgba(71,85,105,.18);
    backdrop-filter: blur(8px);
  }

  .sticky-actions .btn {
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    padding: 7px 11px;
    border-radius: 7px;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
  }

  /*
   * JS already shows progress inside the Retry button itself.
   * Do not create a second green progress column.
   */
  .sticky-actions #retryAiProgress {
    display: none;
  }

  /*
   * Eligibility remains available through the disabled button's title.
   * Do not let a long sentence expand the toolbar.
   */
  .sticky-actions .publish-eligibility-note {
    display: none;
  }

  /*
   * Re-verify + Save remain on the left.
   * Primary editorial decisions move to the right.
   */
  .sticky-actions #retryAiButton,
  .sticky-actions .btn-success {
    margin-left: auto;
  }

  .sticky-actions #retryAiButton + #publishDwButton,
  .sticky-actions .btn-success + #publishDwButton {
    margin-left: 0;
  }

  .sticky-actions #publishDwButton {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sticky-actions .publish-destination-picker {
    flex: 0 1 210px;
    min-width: 150px;
    max-width: 210px;
  }

  .sticky-actions .publish-destination-picker .form-select {
    min-height: 36px;
    height: 36px;
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 12px;
  }

  .sticky-actions .spinner-border-sm {
    width: .85rem;
    height: .85rem;
  }
}

/* REVIEW_ACTION_BAR_V2_END */

/* News review: keep image approval checkbox and label together */
.source-primary-media .field-check {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.source-primary-media .field-check input {
    flex: 0 0 auto;
    margin: 0;
    order: 1;
}

.source-primary-media .field-check label {
    width: auto;
    margin: 0;
    order: 2;
    white-space: nowrap;
}

.source-primary-media .field-check small,
.source-primary-media .field-check .errorlist {
    order: 3;
}
