:root {
  color-scheme: light;
  --bg: #eef3f7;
  --bg-deep: #05253e;
  --brand: #0b4b7f;
  --brand-strong: #08365a;
  --gold: #f6bb1b;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #05253e;
  --muted: #516679;
  --line: #b4c4d1;
  --link: #1d67cd;
  --chip-bg: rgba(11, 75, 127, 0.1);
  --chip-ink: #0b4b7f;
  --shadow: 0 22px 48px rgba(5, 37, 62, 0.12);
  --shadow-strong: 0 28px 60px rgba(5, 37, 62, 0.24);
  --ai-bg: #e9f2fb;
  --ai-ink: #0b4b7f;
  --raw-bg: #fff6dc;
  --raw-ink: #6f5610;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg-deep) 0, var(--brand) 250px, var(--bg) 250px, var(--bg) 100%);
  color: var(--text);
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.04), transparent 26%),
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.08), transparent 16%);
  opacity: 0.9;
}

.runner-shell {
  overflow: hidden;
  border: 1px solid rgba(180, 196, 209, 0.78);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-strong);
}

.runner-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  background: rgba(5, 37, 62, 0.08);
}

.runner-tab {
  appearance: none;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--brand-strong);
  font-weight: 800;
  cursor: pointer;
}

.runner-tab.active {
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(5, 37, 62, 0.1);
}

.runner-panel {
  padding: 24px;
}

.runner-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.runner-head h1 {
  margin: 0;
  color: var(--bg-deep);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

.runner-head p:not(.eyebrow) {
  margin: 10px 0 0;
  max-width: 720px;
  color: var(--muted);
}

.runner-status-pill {
  flex: 0 0 auto;
  min-width: 150px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #edf5ee;
  color: #205b32;
  border: 1px solid rgba(32, 91, 50, 0.18);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.runner-status-pill.is-running {
  background: #fff6dc;
  color: #6f5610;
  border-color: rgba(111, 86, 16, 0.2);
}

.runner-status-pill.is-error {
  background: #fff1f1;
  color: #8f1d1d;
  border-color: rgba(143, 29, 29, 0.28);
}

.run-form,
.add-target-form {
  display: grid;
  gap: 18px;
}

.date-grid,
.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.date-grid label,
.add-target-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.date-grid input,
.add-target-form input,
.add-target-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
}

.target-run-section {
  border-top: 1px solid rgba(180, 196, 209, 0.62);
  padding-top: 16px;
}

.target-run-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.target-run-head h2 {
  margin: 0;
  color: var(--bg-deep);
  font-size: 18px;
  letter-spacing: 0;
}

.target-run-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.run-target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.run-target {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.run-target input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.run-target--primary {
  border-color: rgba(11, 75, 127, 0.28);
  background: #edf4fb;
}

.run-target small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.run-target span {
  min-width: 0;
}

.run-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.primary-action,
.secondary-action,
.danger-action {
  appearance: none;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.secondary-action {
  background: var(--brand-strong);
}

.danger-action {
  background: #8f1d1d;
  color: #fff;
}

.primary-action:disabled,
.secondary-action:disabled,
.danger-action:disabled {
  opacity: 0.58;
  cursor: wait;
}

.form-message {
  color: var(--muted);
  font-size: 13px;
}

.form-message.is-error {
  color: #8f1d1d;
  font-weight: 800;
}

.form-message.is-ok {
  color: #205b32;
  font-weight: 800;
}

.add-target-box {
  margin-top: 18px;
  border: 1px solid rgba(180, 196, 209, 0.72);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.add-target-box > summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 800;
}

.add-target-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.add-target-form {
  margin-top: 14px;
}

.advanced-search-box {
  border: 1px solid rgba(180, 196, 209, 0.72);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.advanced-search-box > summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 800;
}

.field-help,
.advanced-search-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.manage-targets-box {
  margin-top: 14px;
  border: 1px solid rgba(180, 196, 209, 0.72);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.manage-targets-box > summary,
.archived-targets-box > summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 800;
}

.manage-targets-warning {
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid rgba(143, 29, 29, 0.2);
  border-radius: 8px;
  background: #fff5f5;
  color: #7d1b1b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.warning-line {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff6dc;
  color: #6f5610;
  font-size: 13px;
  font-weight: 800;
}

.manage-targets-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.manage-target-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
  overflow-wrap: anywhere;
}

.manage-target-card.is-archived {
  background: #f7f9fb;
  color: var(--muted);
}

.manage-target-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.manage-target-card-head strong,
.manage-target-card-head small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.manage-target-card-head strong {
  color: var(--bg-deep);
  font-size: 16px;
}

.manage-target-card-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.manage-target-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.manage-target-meta div {
  min-width: 0;
}

.manage-target-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.manage-target-meta dd {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.muted-inline,
.manage-target-archive-note {
  color: var(--muted);
}

.manage-target-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.manage-target-form {
  display: grid;
  gap: 12px;
}

.manage-target-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.manage-target-form input,
.manage-target-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

.manage-target-danger {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(143, 29, 29, 0.35);
  border-radius: 8px;
  background: #fff1f1;
  padding: 12px;
  color: #7d1b1b;
}

.manage-target-danger strong {
  color: #7d1b1b;
}

.manage-target-danger p,
.manage-target-archive-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.archived-targets-box {
  margin-top: 14px;
  border-top: 1px solid rgba(180, 196, 209, 0.72);
  padding-top: 12px;
}

.advanced-search-note {
  margin: 0;
}

.progress-track {
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: #dfe8f0;
  border: 1px solid rgba(180, 196, 209, 0.72);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #55b881);
  transition: width 180ms ease;
}

.progress-fill.is-indeterminate {
  width: 100% !important;
  background: linear-gradient(90deg, rgba(246, 187, 27, 0.35), rgba(85, 184, 129, 0.75), rgba(246, 187, 27, 0.35));
  background-size: 220% 100%;
  animation: progressSweep 1.4s linear infinite;
}

.progress-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.progress-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.progress-step {
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(180, 196, 209, 0.72);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.progress-step span {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
}

.progress-step strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.progress-step.is-done {
  border-color: rgba(32, 91, 50, 0.22);
  background: #edf5ee;
  color: #205b32;
}

.progress-step.is-done span {
  border-color: #205b32;
  background: #205b32;
}

.progress-step.is-active {
  border-color: rgba(246, 187, 27, 0.46);
  background: #fff6dc;
  color: #6f5610;
}

.progress-step.is-active span {
  border-color: var(--gold);
  background: var(--gold);
}

.progress-step.is-error {
  border-color: rgba(143, 29, 29, 0.28);
  background: #fff1f1;
  color: #8f1d1d;
}

.progress-step.is-error span {
  border-color: #8f1d1d;
  background: #8f1d1d;
}

.progress-step.is-cancelled {
  border-color: rgba(81, 102, 121, 0.24);
  background: #f3f7fb;
  color: var(--muted);
}

.progress-step.is-cancelled span {
  border-color: var(--muted);
  background: var(--muted);
}

.progress-grid {
  margin-top: 16px;
}

.progress-grid div {
  border: 1px solid rgba(180, 196, 209, 0.72);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.progress-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.progress-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--brand-strong);
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.warning-line {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #fff6dc;
  color: #6f5610;
  border: 1px solid rgba(111, 86, 16, 0.18);
}

.progress-recent {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.progress-live-results {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(56, 129, 103, 0.24);
  border-radius: 8px;
  background: #f2fbf7;
}

.progress-live-results h2,
.progress-recent h2 {
  margin: 0;
  color: var(--bg-deep);
  font-size: 15px;
  letter-spacing: 0;
}

.progress-live-results p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.progress-live-results ul,
.progress-recent ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.progress-live-results li {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.progress-live-results strong,
.progress-recent strong {
  color: var(--brand-strong);
}

.progress-live-results li > div:first-child span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.progress-live-results a {
  text-decoration: none;
}

.chip--live {
  background: #dff4ea;
  border-color: rgba(56, 129, 103, 0.24);
  color: #1f684d;
}

a {
  color: inherit;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
  position: relative;
  z-index: 1;
}

.hero,
.panel {
  border-radius: 28px;
  border: 1px solid rgba(180, 196, 209, 0.78);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
  background:
    radial-gradient(circle at top right, rgba(246, 187, 27, 0.22), transparent 28%),
    linear-gradient(135deg, rgba(5, 37, 62, 0.98), rgba(11, 75, 127, 0.97));
  color: #ececec;
  box-shadow: var(--shadow-strong);
}

.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(246, 187, 27, 0.24), rgba(246, 187, 27, 0));
}

.hero-lockup {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(180, 196, 209, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #ececec;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-tag--gold {
  background: var(--gold);
  border-color: transparent;
  color: var(--bg-deep);
}

.panel {
  background: rgba(255, 255, 255, 0.98);
  margin-top: 18px;
  padding: 22px;
}

.update-panel {
  border-left: 6px solid var(--gold);
}

.update-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 14px 0 12px;
}

.update-grid div {
  border: 1px solid rgba(180, 196, 209, 0.72);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.update-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.update-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--brand-strong);
  font-size: 28px;
  line-height: 1;
}

.story-card {
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0, #f9fbfd 100%);
  scroll-margin-top: 12px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
}

.hero .eyebrow {
  color: #b4c4d1;
}

.hero h1,
.section-head h2,
.story-heading h2,
.article-card h3 {
  margin: 0;
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.02;
  color: #ffffff;
}

.hero p {
  margin: 14px 0 0;
  max-width: 720px;
  color: rgba(236, 236, 236, 0.88);
  font-size: 16px;
}

.stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.stat {
  min-height: 124px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(180, 196, 209, 0.18);
  backdrop-filter: blur(8px);
}

.stat span {
  display: block;
  color: #b4c4d1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.05;
  color: #ffffff;
  overflow-wrap: anywhere;
}

.stat small {
  display: block;
  margin-top: 8px;
  color: rgba(236, 236, 236, 0.8);
  font-size: 12px;
}

.meta-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(180, 196, 209, 0.22);
  font-size: 13px;
  color: #b4c4d1;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.section-head h2 {
  font-size: 24px;
  color: var(--bg-deep);
}

.filter-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.filter-chip {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #f9fbfd 0, #f3f7fb 100%);
  color: var(--text);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 132px;
  max-width: 100%;
  text-align: left;
  overflow-wrap: anywhere;
}

.filter-chip.primary {
  border-color: rgba(11, 75, 127, 0.36);
}

.filter-chip.active {
  background: linear-gradient(135deg, #f6bb1b 0, #ffd76a 100%);
  color: var(--bg-deep);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(246, 187, 27, 0.28);
}

.filter-chip:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
}

.filter-chip__label {
  display: block;
  min-width: 0;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
}

.filter-chip__meta {
  display: block;
  font-size: 12px;
  color: inherit;
  opacity: 0.82;
}

.nav-summary {
  list-style: none;
  cursor: pointer;
  font-weight: 800;
  color: var(--bg-deep);
}

.nav-summary::-webkit-details-marker {
  display: none;
}

.story-index {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.story-index-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid rgba(180, 196, 209, 0.5);
  color: var(--text);
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.story-index-link strong,
.story-index-link span {
  display: block;
}

.story-index-link span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.story-index-link:hover {
  transform: translateY(-1px);
  border-color: rgba(11, 75, 127, 0.34);
  box-shadow: 0 12px 28px rgba(5, 37, 62, 0.08);
}

.story-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  list-style: none;
  cursor: pointer;
  padding: 22px;
  border-bottom: 1px solid rgba(180, 196, 209, 0.55);
}

.story-summary-row::-webkit-details-marker {
  display: none;
}

.story-heading {
  display: flex;
  gap: 12px;
  flex: 1 1 560px;
}

.story-toggle {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
  background: rgba(11, 75, 127, 0.1);
  color: var(--brand);
  transition: transform 120ms ease;
  flex: 0 0 auto;
}

.story-toggle::before {
  content: "\\25b8";
}

details[open] > summary .story-toggle {
  transform: rotate(90deg);
}

.story-heading h2 {
  font-size: 24px;
  line-height: 1.14;
  color: var(--bg-deep);
}

.story-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.story-stats div {
  min-width: 100px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f1f6fa;
  border: 1px solid rgba(180, 196, 209, 0.72);
  text-align: right;
}

.story-stats strong {
  display: block;
  font-size: 22px;
  line-height: 1;
  color: var(--brand-strong);
}

.story-stats span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.story-meta {
  display: flex;
  gap: 8px 14px;
  flex-wrap: wrap;
  padding: 0 22px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.story-blurb {
  padding: 18px 22px 0;
}

.summary-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  background: rgba(11, 75, 127, 0.1);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-blurb p {
  margin: 0;
  color: var(--text);
}

.story-articles {
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
}

.article-card {
  border: 1px solid rgba(180, 196, 209, 0.72);
  border-radius: 22px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 10px 26px rgba(5, 37, 62, 0.05);
}

.article-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.article-card h3 {
  font-size: 22px;
  line-height: 1.12;
  color: var(--bg-deep);
}

.article-card h3 a {
  color: var(--bg-deep);
  text-decoration: none;
}

.article-card h3 a:hover {
  color: var(--link);
}

.article-meta {
  display: flex;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-ink);
  border: 1px solid rgba(11, 75, 127, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.chips--cls {
  margin-top: 6px;
}

.chip--cls {
  font-size: 11px;
  font-weight: 600;
  min-height: 24px;
  padding: 2px 8px;
}

.chip--cls-positive {
  background: #d4edda;
  color: #155724;
  border-color: rgba(21, 87, 36, 0.2);
}

.chip--cls-negative {
  background: #f8d7da;
  color: #721c24;
  border-color: rgba(114, 28, 36, 0.2);
}

.chip--cls-neutral {
  background: #e2e3e5;
  color: #383d41;
  border-color: rgba(56, 61, 65, 0.2);
}

.chip--cls-cat {
  background: #cce5ff;
  color: #004085;
  border-color: rgba(0, 64, 133, 0.2);
}

.cls-display:empty {
  display: none;
}

.cls-editor {
  margin-top: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: var(--surface-soft);
}

.cls-editor > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
  padding: 4px 0;
}

.cls-fieldset {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
}

.cls-fieldset legend {
  font-weight: 700;
  color: var(--brand-strong);
  padding: 0 6px;
}

.cls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.cls-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.cls-field select {
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.cls-cat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.cls-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}

.cls-cat-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
}

.cls-cat-chip.selected {
  background: #cce5ff;
  color: #004085;
  border-color: rgba(0, 64, 133, 0.4);
  font-weight: 700;
}

.cls-article-section {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
}

.cls-field-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.cls-cat-select {
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  min-height: 80px;
  width: 100%;
  max-width: 260px;
}

.cls-add-cat-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}

.cls-new-cat-input {
  font-size: 13px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  flex: 1;
  min-width: 0;
  max-width: 180px;
}

.cls-add-cat-btn {
  border: 1px solid var(--brand);
  background: transparent;
  color: var(--brand);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.cls-actions-row {
  justify-content: flex-end;
}

.cls-save-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 700;
  cursor: pointer;
}

.cls-save-btn[disabled] {
  opacity: 0.5;
  cursor: progress;
}

.cls-save-status {
  font-size: 12px;
  color: var(--muted);
}

.cls-save-status--ok {
  color: #155724;
  font-weight: 700;
}

.cls-save-status--err {
  color: #721c24;
  font-weight: 700;
}

.article-links {
  display: flex;
  gap: 8px 14px;
  flex-wrap: wrap;
  margin: 14px 0 0;
}

.text-link {
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.summary-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
}

.summary-ai {
  background: var(--ai-bg);
  color: var(--ai-ink);
}

.summary-raw {
  background: var(--raw-bg);
  color: var(--raw-ink);
}

.body-text {
  color: inherit;
  font-size: 15px;
  word-break: break-word;
}

.body-text.full {
  margin-top: 12px;
  white-space: pre-wrap;
}

.raw-details {
  margin-top: 14px;
  border-top: 1px solid rgba(5, 37, 62, 0.08);
  padding-top: 14px;
}

.raw-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--link);
}

.raw-details[open] summary {
  margin-bottom: 10px;
}

.empty-state {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-note {
  margin-top: 18px;
  color: rgba(5, 37, 62, 0.72);
  font-size: 13px;
  text-align: center;
}

.flat-articles {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.flat-articles .article-card {
  background: var(--surface);
}

.load-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  margin-top: 12px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}

.load-more-btn:hover {
  background: var(--chip-bg);
  border-color: var(--brand);
}

.load-more-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

.flat-loading,
.shell-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 15px;
}

.shell-loading strong {
  display: block;
  color: var(--brand-strong);
}

.shell-loading p {
  margin: 6px 0 0;
}

.app-error {
  color: #8f1d1d;
  background: #fff1f1;
  border-color: rgba(143, 29, 29, 0.28);
}

.flat-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

@keyframes progressSweep {
  to {
    background-position: -220% 0;
  }
}

[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  main {
    width: min(100% - 16px, 100%);
    padding-top: 10px;
  }

  .hero,
  .panel {
    border-radius: 22px;
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .runner-tabs {
    grid-template-columns: 1fr;
  }

  .runner-panel {
    padding: 16px;
  }

  .runner-head,
  .run-actions,
  .progress-actions {
    display: grid;
  }

  .runner-head h1 {
    font-size: 28px;
    line-height: 1.12;
  }

  .runner-status-pill {
    width: 100%;
    min-width: 0;
  }

  .run-target-grid,
  .date-grid,
  .progress-steps,
  .progress-grid,
  .update-grid {
    grid-template-columns: 1fr;
  }

  .filter-chip {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
  }

  .primary-action,
  .secondary-action,
  .danger-action {
    width: 100%;
  }

  .manage-target-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .stat {
    min-height: 112px;
  }

  .story-summary-row,
  .story-meta,
  .story-blurb,
  .story-articles {
    padding-left: 16px;
    padding-right: 16px;
  }

  .story-stats div {
    min-width: 92px;
  }

  .article-links,
  .story-index-link {
    flex-direction: column;
    align-items: flex-start;
  }

  .story-index-link span {
    text-align: left;
  }
}

.outros-candidatos { margin-top: 12px; }
.outros-candidatos summary {
  cursor: pointer; font-size: 14px; color: var(--muted);
  font-weight: 600; padding: 8px 0; list-style: none;
}
.outros-candidatos summary::-webkit-details-marker { display: none; }
.outros-candidatos summary::before { content: "\25b8 "; }
.outros-candidatos[open] summary::before { content: "\25be "; }
.outros-candidatos .filter-row { margin-top: 8px; }
