:root {
  --bg: #0f172a;
  --surface: #182236;
  --surface-2: #222f45;
  --text: #f8fafc;
  --muted: #aab8cb;
  --border: #52627a;
  --accent: #4ade80;
  --accent-ink: #062b16;
  --warn: #fbbf24;
  --danger: #f87171;
  --focus: #ffffff;
  --radius: 14px;
  font-family: Tahoma, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; background: radial-gradient(circle at 75% 0, #1d3556 0, var(--bg) 34rem); color: var(--text); font-size: 16px; line-height: 1.6; }
a { color: inherit; text-decoration-color: #7e91ac; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; }
button, a, input, select { touch-action: manipulation; transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; inset-block-start: 8px; inset-inline-start: 8px; z-index: 100; padding: 10px 14px; background: white; color: #111827; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 250px; padding: 22px 18px; background: rgba(15, 23, 42, .94); border-inline-end: 1px solid var(--border); backdrop-filter: blur(16px); display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.brand div { display: grid; }
.brand small { color: var(--muted); }
.brand-mark { width: 30px; height: 30px; border: 8px solid var(--accent); border-inline-start-color: transparent; border-radius: 50%; box-shadow: 0 0 22px rgba(74, 222, 128, .28); }
nav { margin-block-start: 36px; display: grid; gap: 6px; }
nav a { display: flex; align-items: center; min-height: 46px; padding: 8px 12px; border-radius: 9px; text-decoration: none; color: #dce5f1; }
nav a:hover { background: var(--surface-2); color: white; }
.nav-label { margin-block-start: 16px; padding-inline: 12px; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .06em; }
nav .nav-label:first-child { margin-block-start: 0; }
nav a.active { background: #173e2c; color: #d6ffe4; box-shadow: inset -3px 0 0 var(--accent); }
.logout-form { margin-block-start: auto; }
.main-content { margin-inline-start: 250px; padding: 28px clamp(18px, 3vw, 46px) 64px; min-height: 100vh; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-block-end: 28px; }
h1, h2, p { margin-block-start: 0; }
h1 { margin-block-end: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.3; }
h2 { margin-block-end: 0; font-size: 1.08rem; }
.eyebrow { margin-block-end: 3px; color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .04em; }
.muted, .hint, small { color: var(--muted); }
.operator { display: flex; align-items: center; gap: 9px; padding: 8px 13px; border: 1px solid var(--border); border-radius: 999px; background: rgba(24, 34, 54, .8); }
.operator > span:last-child { display: grid; line-height: 1.25; }
.operator small { font-size: .68rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(74, 222, 128, .13); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-block-end: 18px; }
.metric, .panel, .item-card { background: rgba(24, 34, 54, .89); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 16px 42px rgba(0, 0, 0, .16); }
.metric { padding: 20px; display: grid; gap: 8px; border-block-start: 3px solid var(--accent); }
.metric.warn { border-block-start-color: var(--warn); }
.metric span { color: var(--muted); }
.metric strong { font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.metric strong.metric-text { font-size: 1rem; line-height: 1.5; }
.split-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); gap: 18px; margin-block-end: 18px; }
.panel { padding: 20px; margin-block-end: 18px; }
.panel.compact { padding: 14px 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 18px; margin-block-end: 18px; }
.panel-head p { margin-block-end: 0; max-width: 48rem; }
.text-link { color: var(--accent); white-space: nowrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 12px 10px; text-align: start; border-block-end: 1px solid #3d4b61; vertical-align: top; }
th { color: #c9d4e3; font-size: .82rem; }
td small { display: block; margin-block-start: 4px; max-width: 34rem; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 9px; border: 1px solid var(--border); border-radius: 999px; font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.badge.approved, .badge.succeeded, .badge.dry_run { background: #123d28; border-color: #2e8c59; color: #a7f3c2; }
.badge.pending, .badge.running { background: #493914; border-color: #9a7621; color: #fde68a; }
.badge.rejected, .badge.failed { background: #4a2026; border-color: #9d3c48; color: #fecaca; }
.run-list { display: grid; gap: 2px; }
.run-list article { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-block-end: 1px solid #3d4b61; }
.run-list article > div { display: grid; gap: 3px; }
.run-list article > div:last-child { justify-items: end; }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stack-form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; color: #e6edf7; font-size: .9rem; font-weight: 700; }
input, select { width: 100%; min-height: 46px; padding: 9px 12px; color: var(--text); background: #101a2d; border: 1px solid var(--border); border-radius: 9px; }
input:hover, select:hover { border-color: #8292a9; }
input:focus, select:focus { border-color: white; }
.wide { grid-column: 1 / -1; }
.form-action { display: flex; align-items: end; }
.button { min-height: 44px; padding: 8px 15px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; cursor: pointer; font-weight: 700; }
.button:hover { border-color: #8394ad; background: #2d3d57; }
.button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button.primary:hover { background: #86efac; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button.danger { background: #672a32; border-color: #a74753; }
.button.ghost { background: transparent; }
.button.small { min-height: 44px; padding: 5px 10px; font-size: .82rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; gap: 6px; align-items: center; padding: 5px 9px; background: #163d2a; border: 1px solid #307b51; border-radius: 8px; color: #c2f8d4; }
.tag.neutral { background: #26364e; border-color: #526885; color: #dbe7f7; }
.tag small { color: inherit; opacity: .76; }
.item-list { display: grid; gap: 14px; }
.item-card { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 20px; padding: 20px; }
.item-card.reader { grid-template-columns: 1fr; }
.item-card.has-image { grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) 210px; }
.item-card.has-image.reader { grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); }
.item-card h2 { margin-block: 10px 8px; font-size: 1.15rem; }
.item-card p { color: #d7e1ee; }
.news-media { margin: 0; min-width: 0; }
.news-media img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 11px; background: var(--surface-2); }
.news-media figcaption { margin-block-start: 6px; color: var(--muted); font-size: .75rem; }
.news-media figcaption a { color: var(--muted); }
.content-label { margin: 0; color: var(--muted) !important; font-size: .75rem; font-weight: 700; }
.original-copy > p:last-child, .translation-copy > p:last-child { margin-block-end: 0; }
.translation-copy { margin-block: 16px; padding: 14px 16px; background: #102b22; border: 1px solid #2f7652; border-radius: 11px; }
.translation-copy h3 { margin: 6px 0 8px; font-size: 1.06rem; }
.translation-pending { color: #fde68a !important; }
.media-error { margin: 12px 0 0; padding: 8px 10px; background: #4a2026; border-radius: 8px; color: #fecaca !important; font-size: .8rem; overflow-wrap: anywhere; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 14px; color: var(--muted); font-size: .83rem; }
.item-main > small { display: block; margin-block-start: 14px; }
.review-box { border-inline-start: 1px solid var(--border); padding-inline-start: 18px; }
.review-box form { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-bar { display: flex; align-items: end; gap: 12px; }
.filter-bar label:first-child { flex: 1; }
.filter-reset { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.entity-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.entity-directory { display: grid; gap: 8px; }
.entity-list-head, .entity-summary { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(120px, .8fr) minmax(120px, .8fr) minmax(110px, .65fr); align-items: center; gap: 16px; }
.entity-list-head { padding: 0 18px 6px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.entity-entry { padding: 0; margin-block-end: 0; overflow: hidden; }
.entity-summary { min-height: 68px; padding: 10px 18px; cursor: pointer; list-style: none; }
.entity-summary::-webkit-details-marker { display: none; }
.entity-summary:hover { background: rgba(34, 47, 69, .7); }
.entity-entry[open] > .entity-summary { background: rgba(34, 47, 69, .82); }
.entity-name-cell { min-width: 0; display: flex; align-items: center; gap: 10px; }
.entity-name-cell > span:last-child { min-width: 0; display: grid; gap: 1px; }
.entity-name-cell strong { font-size: 1rem; overflow-wrap: anywhere; }
.entity-name-cell small { font-size: .75rem; }
.entity-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 50%; object-fit: cover; background: var(--surface-2); color: #d6ffe4; font-weight: 700; }
.entity-location-cell { color: #e0e8f3; overflow-wrap: anywhere; }
.entity-open-cell { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; }
.entity-chevron { width: 10px; height: 10px; border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor; transform: rotate(45deg); transition: transform 160ms ease; }
.entity-entry[open] .entity-chevron { transform: rotate(225deg); }
.entity-detail { border-block-start: 1px solid var(--border); }
.entity-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding: 18px 20px; background: rgba(16, 26, 45, .38); border-block-end: 1px solid var(--border); }
.entity-head form { min-width: 180px; }
.entity-head form .button { width: 100%; }
.entity-profile-head { display: flex; align-items: start; gap: 18px; }
.entity-primary-photo { width: 160px; margin: 0; flex: 0 0 auto; }
.entity-primary-photo img { display: block; width: 160px; height: 160px; object-fit: cover; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.entity-primary-photo figcaption { margin-block-start: 6px; color: var(--muted); font-size: .76rem; }
.entity-image-section { padding: 18px 20px; border-block-end: 1px solid var(--border); }
.entity-image-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-block-end: 12px; }
.entity-image-heading p { margin: 0; max-width: 54rem; color: var(--muted); font-size: .8rem; }
.entity-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.entity-image-card { margin: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #101a2d; }
.entity-image-card.pending { border-color: #9a7621; }
.entity-image-card.approved { border-color: #2e8c59; }
.entity-image-card > img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.entity-image-card figcaption { display: grid; gap: 8px; padding: 12px; }
.entity-image-card figcaption small { display: block; overflow-wrap: anywhere; }
.entity-image-card figcaption > a { width: fit-content; color: var(--accent); font-size: .8rem; font-weight: 700; }
.image-review-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-block-start: 4px; }
.image-review-actions .button { width: auto !important; }
.entity-image-empty { margin: 0; border-block-end: 1px solid var(--border); }
.alias-list { margin: 9px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.fact-list { display: grid; }
.fact-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, .42fr); gap: 22px; padding: 16px 20px; border-block-end: 1px solid #3d4b61; }
.fact-row:last-child { border-block-end: 0; }
.fact-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fact-content p { margin: 7px 0 0; color: #e3eaf4; }
.fact-provenance { display: grid; align-content: start; gap: 3px; color: var(--muted); font-size: .8rem; }
.fact-provenance a { width: fit-content; margin-block-start: 5px; color: var(--accent); font-weight: 700; }
.source-disclosure { margin: 0 20px 20px; padding-block-start: 14px; border-block-start: 1px solid var(--border); }
.source-disclosure h2 { margin: 0; color: #dce5f1; font-size: .9rem; }
.source-disclosure ul { margin-block-end: 0; padding-inline-start: 22px; }
.source-disclosure li { margin-block: 8px; overflow-wrap: anywhere; }
.evidence-note { margin-block-start: 18px; border-inline-start: 4px solid var(--warn); }
.evidence-note p { margin-block-end: 0; color: #d7e1ee; }
.alert { padding: 12px 14px; margin-block: 16px; border-radius: 9px; }
.alert.error { background: #4a2026; border: 1px solid #a74753; color: #fecaca; }
.alert.success { background: #123d28; border: 1px solid #2e8c59; color: #c5f7d6; }
.alert.warning { background: #493914; border: 1px solid #9a7621; color: #fde68a; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-shell { width: min(100%, 460px); }
.login-card { padding: clamp(24px, 6vw, 42px); background: rgba(24, 34, 54, .94); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 28px 80px rgba(0, 0, 0, .32); }
.login-brand { margin-block-end: 34px; }
.login-card h1 { margin-block-end: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.report-preview-count, .report-status { display: grid; justify-items: center; min-width: 116px; padding: 12px; background: #101a2d; border: 1px solid var(--border); border-radius: 12px; }
.report-preview-count strong, .report-status strong { color: var(--accent); font-size: 1.8rem; line-height: 1; }
.report-preview-count span, .report-status span { color: var(--muted); font-size: .75rem; text-align: center; }
.report-intro, .report-head { display: flex; justify-content: space-between; align-items: start; gap: 24px; }
.report-intro > div { max-width: 52rem; }
.report-list { display: grid; gap: 18px; }
.weekly-report { overflow: hidden; }
.report-head { padding-block-end: 18px; border-block-end: 1px solid var(--border); }
.report-head h2 { font-size: 1.35rem; }
.report-summary { max-width: 70rem; margin-block: 20px; color: #e1eaf6; font-size: 1.02rem; }
.breakdown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding-block-end: 18px; border-block-end: 1px solid var(--border); }
.breakdown-grid h3 { margin-block: 0 10px; font-size: .9rem; color: var(--muted); }
.headline-list { margin: 0; padding: 18px 24px 0 0; display: grid; gap: 4px; }
.headline-list li { padding: 12px 8px 12px 0; border-block-end: 1px solid #3d4b61; }
.headline-list a { font-weight: 700; text-decoration-thickness: 1px; }
.headline-list span { display: block; margin-block-start: 4px; color: var(--muted); font-size: .82rem; }
.report-footer { margin-block-start: 18px; color: var(--muted); font-size: .8rem; }
.user-actions { display: grid; gap: 8px; min-width: 280px; }
.inline-password { display: flex; align-items: center; gap: 8px; }
.inline-password label { flex: 1; }
.inline-password input { min-height: 44px; }
.option-group { margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 10px; display: flex; flex-wrap: wrap; gap: 10px 18px; }
.option-group legend { padding-inline: 7px; color: #e6edf7; font-size: .9rem; font-weight: 700; }
.option-group .hint { width: 100%; margin: 0; font-weight: 400; }
.check-option { min-height: 44px; display: inline-flex; grid-template-columns: none; flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
.check-option input { width: 20px; min-height: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.recipient-list { display: grid; gap: 10px; }
.recipient-card { padding: 0; margin: 0; overflow: hidden; }
.recipient-summary { min-height: 68px; padding: 10px 18px; display: grid; grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto 20px; align-items: center; gap: 14px; cursor: pointer; list-style: none; }
.recipient-summary::-webkit-details-marker { display: none; }
.recipient-summary:hover, .recipient-card[open] > .recipient-summary { background: rgba(34, 47, 69, .72); }
.recipient-summary > span:first-child { display: grid; }
.recipient-summary small { font-size: .74rem; }
.recipient-card[open] .entity-chevron { transform: rotate(225deg); }
.channel-list { display: flex; flex-wrap: wrap; gap: 6px; }
.recipient-detail { padding: 18px; border-block-start: 1px solid var(--border); }
.recipient-actions { display: flex; gap: 8px; }
.recipient-toggle { margin-block-start: 12px; padding-block-start: 12px; border-block-start: 1px solid var(--border); }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .split-grid { grid-template-columns: 1fr; }
  .fact-row { grid-template-columns: 1fr; gap: 10px; }
  .breakdown-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .sidebar { position: static; width: auto; border-inline-end: 0; border-block-end: 1px solid var(--border); }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-block-start: 18px; }
  .logout-form { margin-block-start: 16px; }
  .main-content { margin-inline-start: 0; padding: 20px 14px 50px; }
  .topbar { align-items: start; }
  .form-grid, .item-card, .item-card.has-image, .item-card.has-image.reader { grid-template-columns: 1fr; }
  .news-media img { max-height: 360px; }
  .review-box { border-inline-start: 0; border-block-start: 1px solid var(--border); padding-inline-start: 0; padding-block-start: 14px; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .entity-list-head { display: none; }
  .entity-summary { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 14px 16px; }
  .entity-name-cell { grid-column: 1 / -1; }
  .entity-location-cell { display: grid; grid-template-columns: auto 1fr; gap: 7px; font-size: .85rem; }
  .entity-location-cell::before { content: attr(data-label) ":"; color: var(--muted); font-size: .76rem; }
  .entity-open-cell { justify-content: end; }
  .entity-head { align-items: stretch; flex-direction: column; }
  .entity-head form { min-width: 0; }
  .entity-profile-head, .entity-image-heading { align-items: stretch; flex-direction: column; }
  .entity-primary-photo { width: min(100%, 240px); }
  .entity-primary-photo img { width: 100%; height: auto; aspect-ratio: 1; }
  .report-intro, .report-head { align-items: stretch; flex-direction: column; }
  .report-status { width: 100%; grid-template-columns: auto auto; justify-content: center; align-items: baseline; gap: 8px; }
  .user-actions { min-width: 220px; }
  .inline-password { align-items: stretch; flex-direction: column; }
  .recipient-summary { grid-template-columns: minmax(0, 1fr) auto; }
  .recipient-summary .channel-list { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 460px) {
  .metric-grid { grid-template-columns: 1fr; }
  .sidebar nav { grid-template-columns: 1fr; }
  .operator { display: none; }
}

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