:root {
  --bg: #f4efe6;
  --paper: #fffaf1;
  --ink: #1d2a29;
  --muted: #667674;
  --accent: #c3532c;
  --accent-soft: #f3d7ca;
  --line: #ddcfbc;
  --forest: #28443f;
  --gold: #b38b2d;
  --shadow: 0 18px 40px rgba(34, 28, 18, 0.08);
}

html {
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  background:
    radial-gradient(circle at top left, rgba(195, 83, 44, 0.08), transparent 28%),
    linear-gradient(180deg, #f7f1e8 0%, var(--bg) 100%);
  color: var(--ink);
}

a {
  color: var(--forest);
}

.shell {
  display: grid;
  grid-template-columns: clamp(220px, 22vw, 280px) minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.rail {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 28px 22px;
  background: rgba(255, 250, 241, 0.75);
  backdrop-filter: blur(8px);
}

.brand {
  margin-bottom: 36px;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.wordmark {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 8px;
}

.subword,
.lede,
.meta-note,
.nav .disabled {
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-section {
  display: grid;
  gap: 6px;
}

.nav-section-label {
  padding: 8px 12px 2px;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-section a {
  margin-left: 12px;
  padding-left: 16px;
  border-left: 2px solid rgba(40, 68, 63, 0.16);
}

.nav a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
}

.nav a:hover {
  background: var(--accent-soft);
}

.nav .nav-section a {
  padding-left: 16px;
}

.nav-legacy {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  color: var(--muted);
}

.nav-legacy summary {
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
}

.nav-legacy summary:hover {
  background: var(--accent-soft);
}

.nav-legacy a {
  margin-left: 12px;
  padding-left: 16px;
  border-left: 2px solid rgba(40, 68, 63, 0.16);
  color: var(--muted);
}

.disabled {
  pointer-events: none;
}

.main {
  min-width: 0;
  padding: 36px;
  max-width: 100%;
}

.main > * {
  max-width: 100%;
}

.hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.hero-copy {
  min-width: 0;
}

.dashboard-actions {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.dashboard-export-button {
  min-width: 148px;
}

.hero.compact h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.card {
  min-width: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(179, 139, 45, 0.14);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 26px 0;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 12px;
  margin: 26px 0;
}

.health-stat {
  min-height: 116px;
}

.health-command-card {
  border-color: rgba(40, 68, 63, 0.18);
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.8fr);
  gap: 18px;
  margin: 24px 0;
}

.metric-group {
  margin: 26px 0;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0 0;
}

.dashboard-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-action {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 16px;
  border: 1px solid rgba(179, 139, 45, 0.18);
  border-radius: 8px;
  text-decoration: none;
  background: rgba(255, 250, 241, 0.55);
}

.dashboard-action:hover {
  background: var(--accent-soft);
}

.dashboard-action span {
  color: var(--muted);
  line-height: 1.45;
}

.stat {
  min-width: 0;
  padding: 16px;
  display: grid;
  gap: 8px;
}

.compact-stat {
  padding: 15px;
}

.stat span {
  display: block;
  color: var(--muted);
}

.stat strong {
  display: block;
  font-size: clamp(1.25rem, 1.35vw, 1.8rem);
  overflow-wrap: anywhere;
}

.compact-stat strong {
  font-size: 1.45rem;
}

.stat-comparison {
  min-height: 2.6em;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--muted);
}

.stat-comparison.is-positive {
  color: #1b6f4d;
}

.stat-comparison.is-negative {
  color: #9f3724;
}

.stat-comparison.is-neutral {
  color: var(--muted);
}

.is-positive {
  color: #1b6f4d;
}

.is-negative {
  color: #9f3724;
}

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

.filter-card,
.table-card,
.sync-card,
.chart-card {
  padding: 20px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.page-overview-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filter-actions {
  margin-top: 12px;
}

.filters label,
.detail-list {
  display: grid;
  gap: 6px;
}

.filter-field span {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

select,
button,
input[type="date"],
input[type="text"],
input[type="search"] {
  font: inherit;
}

select,
button,
input[type="date"],
input[type="text"],
input[type="search"],
.flash {
  border-radius: 14px;
}

select,
input[type="date"],
input[type="text"],
input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

input[type="date"],
input[type="text"],
input[type="search"] {
  min-height: 44px;
}

button {
  background: var(--forest);
  color: white;
  border: none;
  padding: 12px 16px;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--forest);
  color: white;
  text-decoration: none;
}

.button-link:hover {
  background: #1e3531;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 18px;
  align-items: center;
  margin-top: 16px;
}

.metric-section-heading {
  margin: 18px 0 8px;
  font-size: 0.9rem;
}

.latest-metric-list + .metric-section-heading {
  margin-top: 22px;
}

.legacy-metrics-notice {
  margin-top: 18px;
}

.legacy-metric-marker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  color: #9f3724;
  font-weight: 700;
}

.filter-submit {
  min-height: 44px;
  align-self: stretch;
}

.filter-card-actions {
  margin-top: 14px;
}

.proposal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.proposal-card {
  gap: 18px;
}

.proposal-badge,
.proposal-count {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(214, 104, 50, 0.12);
  color: var(--rust);
  padding: 6px 10px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.proposal-scope-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.proposal-scope-button,
.proposal-secondary-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.proposal-scope-button.is-active {
  background: var(--forest);
  color: white;
  border-color: var(--forest);
}

.proposal-panel {
  display: grid;
  gap: 16px;
}

.proposal-form-grid,
.proposal-builder-grid {
  display: grid;
  gap: 18px;
}

.proposal-builder-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
}

.proposal-preview-card,
.proposal-selection-card,
.proposal-picker {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  padding: 18px;
}

.proposal-preview-card.compact {
  align-content: start;
}

.proposal-preview-card strong,
.proposal-group-card strong,
.proposal-step strong {
  font-size: 1.05rem;
}

.proposal-preview-card p,
.proposal-group-card p,
.proposal-step p {
  margin: 0;
  color: var(--muted);
}

.proposal-preview-label {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.proposal-chip-row,
.proposal-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proposal-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(214, 104, 50, 0.26);
  background: rgba(245, 222, 209, 0.68);
  color: var(--rust);
  padding: 6px 10px;
  font-size: 0.92rem;
}

.proposal-chip.is-selected {
  background: rgba(39, 72, 64, 0.11);
  border-color: rgba(39, 72, 64, 0.18);
  color: var(--forest);
}

.proposal-page-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.proposal-page-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 12px;
}

.proposal-page-option input {
  accent-color: var(--forest);
}

.proposal-page-option span {
  color: var(--ink);
}

.proposal-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.proposal-secondary-button:disabled,
#proposal-save-group:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.proposal-sidecar {
  display: grid;
  gap: 24px;
}

.proposal-group-grid,
.proposal-step-list {
  display: grid;
  gap: 14px;
}

.proposal-group-card {
  display: grid;
  gap: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  padding: 16px;
}

.proposal-group-card:hover {
  border-color: rgba(39, 72, 64, 0.28);
}

.proposal-group-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.proposal-delete-form {
  margin: 0;
}

.proposal-step {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(39, 72, 64, 0.1);
  padding-top: 14px;
}

.proposal-step:first-child {
  border-top: none;
  padding-top: 0;
}

.compact-header {
  align-items: start;
}

.selected-page-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(40, 68, 63, 0.12);
}

.selected-page-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selected-page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

button:hover {
  background: #1e3531;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.table-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 0.9rem;
}

.table-sort-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 0;
  cursor: pointer;
}

.table-sort-button:hover {
  background: transparent;
  color: var(--accent);
}

th[aria-sort="ascending"] .table-sort-button::after {
  content: " ^";
}

th[aria-sort="descending"] .table-sort-button::after {
  content: " v";
}

.metric-current {
  font-variant-numeric: tabular-nums;
}

.metric-comparison {
  margin-top: 6px;
  padding: 8px 9px 9px;
  border-left: 5px solid rgba(102, 118, 116, 0.48);
  border-radius: 8px;
  background: rgba(102, 118, 116, 0.12);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.metric-comparison[hidden] {
  display: none;
}

.metric-comparison.is-positive {
  border-left-color: #1b6f4d;
  background: rgba(27, 111, 77, 0.16);
}

.metric-comparison.is-negative {
  border-left-color: #9f3724;
  background: rgba(159, 55, 36, 0.16);
}

.metric-comparison.is-neutral {
  border-left-color: rgba(102, 118, 116, 0.5);
  background: rgba(102, 118, 116, 0.12);
}

.metric-previous {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.metric-delta-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(102, 118, 116, 0.14);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.metric-comparison.is-positive .metric-delta-badge {
  background: #1b6f4d;
  color: white;
}

.metric-comparison.is-negative .metric-delta-badge {
  background: #9f3724;
  color: white;
}

.metric-comparison.is-neutral .metric-delta-badge {
  background: rgba(102, 118, 116, 0.14);
  color: var(--muted);
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
}

.pill.success {
  background: #d8eee4;
  color: #1b6f4d;
}

.pill.failed {
  background: #f8dbd5;
  color: #9f3724;
}

.pill.partial {
  background: #f1e6c6;
  color: #8c6510;
}

.pill.skipped {
  background: #f1e6c6;
  color: #8c6510;
}

.primary-link {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(40, 68, 63, 0.2);
  border-radius: 999px;
  color: var(--forest);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.62);
}

.secondary-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.external-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--forest);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.external-link:hover {
  color: var(--accent);
}

.external-link-symbol {
  font-size: 0.78em;
  line-height: 1;
}

.pagination-size-form,
.pagination-nav,
.export-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  color: var(--muted);
}

.pagination-size-form label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pagination-size-form select {
  min-width: 88px;
}

.pagination-nav {
  justify-content: flex-end;
}

.export-actions {
  flex-wrap: wrap;
}

.pagination-disabled {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  opacity: 0.45;
}

.chart-drilldown-note {
  margin-bottom: 8px;
}

.primary-link:hover {
  color: var(--accent);
}

.meta-note {
  font-size: 0.82rem;
  margin-top: 6px;
}

.sync-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 24px 0;
}

.sync-options {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 0;
  border: 0;
}

.sync-options-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.sync-options legend {
  margin-bottom: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sync-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.sync-option input {
  flex: none;
  accent-color: var(--forest);
}

.sync-option span {
  line-height: 1.25;
}

.flash {
  background: #fff0cd;
  border: 1px solid #e5cc7d;
  padding: 14px 16px;
  margin-top: 18px;
}

.callout-list {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--ink);
}

.callout-list li::marker {
  color: var(--accent);
}

.debug-payload {
  max-width: 420px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(39, 72, 64, 0.06);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.table-card .debug-payload,
.payload-card .debug-payload {
  max-width: none;
  max-height: 520px;
  overflow: auto;
}

.dense-detail-list {
  grid-template-columns: 220px minmax(280px, 1fr);
  min-width: 620px;
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  min-width: 0;
}

.dense-controls {
  max-height: 190px;
  overflow-y: auto;
  padding-right: 4px;
}

.chart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  min-width: 0;
}

.chart-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chart-toggle.is-active {
  background: var(--accent-soft);
  border-color: rgba(195, 83, 44, 0.32);
  color: var(--accent);
}

.chart-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.75);
}

.content-overview-page {
  display: grid;
  gap: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.content-overview-page .card {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(102, 118, 116, 0.18);
}

.content-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.content-page-header h1 {
  margin: 6px 0 8px;
  font-size: clamp(1.85rem, 3vw, 2.8rem);
  line-height: 1.04;
}

.content-page-menu,
.content-row-menu {
  position: relative;
}

.content-page-menu summary,
.content-row-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: 1px solid rgba(102, 118, 116, 0.24);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  list-style: none;
}

.content-page-menu summary::-webkit-details-marker,
.content-row-menu summary::-webkit-details-marker {
  display: none;
}

.content-page-menu summary:hover,
.content-row-menu summary:hover {
  border-color: rgba(40, 68, 63, 0.35);
  background: rgba(40, 68, 63, 0.06);
}

.content-menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(102, 118, 116, 0.22);
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 42px rgba(29, 42, 41, 0.16);
}

.content-menu-panel a,
.content-menu-panel span,
.content-menu-panel button,
.content-menu-text summary {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  text-decoration: none;
}

.content-menu-text {
  color: var(--ink);
}

.content-menu-text summary {
  cursor: pointer;
  list-style: none;
}

.content-menu-text summary::-webkit-details-marker {
  display: none;
}

.content-menu-text p {
  max-height: 8rem;
  margin: 2px 10px 8px;
  overflow: auto;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.38;
}

.content-menu-panel span {
  color: var(--muted);
}

.content-menu-panel a:hover,
.content-menu-panel button:hover,
.content-menu-text summary:hover {
  background: rgba(40, 68, 63, 0.08);
  color: var(--forest);
}

.content-filter-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: -8px;
}

.content-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(102, 118, 116, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 0.88rem;
}

.content-filter-chip span {
  color: var(--muted);
}

.content-filter-chip strong {
  font-size: 0.88rem;
}

.content-summary-grid {
  margin: 0;
}

.content-summary-grid .stat {
  min-height: 86px;
}

.content-chart-card {
  padding: 18px 20px 14px;
}

.content-chart-card .chart-shell {
  max-height: 260px;
}

.content-chart-card .chart-shell svg {
  max-height: 250px;
}

.content-table-card {
  overflow: visible;
}

.content-table-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.content-table-header h2 {
  margin-bottom: 4px;
}

.content-table-header p {
  margin: 0;
  color: var(--muted);
}

.content-pagination-size-form {
  margin: 0;
}

.content-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(102, 118, 116, 0.16);
  border-radius: 8px;
  background: white;
}

.content-table {
  min-width: 1120px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.content-table th,
.content-table td {
  padding: 12px 10px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(102, 118, 116, 0.16);
}

.content-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8faf9;
  color: #5c6b69;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.content-table tbody tr:hover {
  background: rgba(37, 99, 116, 0.04);
}

.content-table tbody tr:last-child td {
  border-bottom: 0;
}

.content-select-col {
  width: 44px;
  text-align: center;
}

.content-select-col input {
  width: 16px;
  height: 16px;
  accent-color: #267083;
}

.content-table th:nth-child(2) {
  width: 390px;
}

.content-table th:nth-child(3) {
  width: 110px;
}

.content-table th:nth-child(4),
.content-table th:nth-child(5),
.content-table th:nth-child(7) {
  width: 105px;
}

.content-table th:nth-child(6) {
  width: 190px;
}

.content-table th:nth-child(8),
.content-table th:nth-child(9) {
  width: 110px;
}

.content-actions-col {
  width: 74px;
  text-align: center;
}

.content-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.content-thumb {
  width: 58px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(195, 83, 44, 0.12), rgba(40, 68, 63, 0.1));
  border: 1px solid rgba(102, 118, 116, 0.18);
}

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

.content-thumb span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-weight: 800;
}

.content-copy {
  min-width: 0;
}

.content-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.content-format-pill {
  padding: 3px 8px;
  border-radius: 8px;
  background: #f3d7ca;
}

.content-title {
  display: -webkit-box;
  margin-top: 5px;
  color: var(--ink);
  font-weight: 750;
  line-height: 1.3;
  text-decoration: none;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.content-title:hover {
  color: var(--accent);
}

.story-text-disclosure {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.story-text-disclosure summary {
  width: fit-content;
  cursor: pointer;
  color: var(--forest);
  font-weight: 700;
}

.story-text-disclosure p {
  max-width: 62ch;
  max-height: 8.5em;
  margin: 6px 0 0;
  overflow: auto;
  color: var(--muted);
  line-height: 1.4;
}

.content-date {
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.35;
}

.content-metric {
  font-variant-numeric: tabular-nums;
}

.content-metric strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.content-metric span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.content-open-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(40, 68, 63, 0.22);
  border-radius: 8px;
  color: var(--forest);
  font-weight: 750;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.82);
}

.content-open-link:hover {
  border-color: rgba(195, 83, 44, 0.38);
  background: var(--accent-soft);
  color: var(--accent);
}

.content-legacy-marker {
  margin: 7px 0 0;
  font-size: 0.76rem;
}

.chart-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding: 10px 0 4px;
}

.chart-shell svg {
  width: 100%;
  min-width: 0;
  height: auto;
  display: block;
}

.chart-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin: 14px 0 10px;
}

.chart-readout {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(40, 68, 63, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.chart-note {
  max-width: 320px;
  margin-top: 8px;
  text-align: right;
}

.chart-coverage-note {
  margin-bottom: 12px;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-frame {
  stroke: rgba(40, 68, 63, 0.25);
  stroke-width: 1.2;
}

.chart-hover-line {
  stroke: rgba(40, 68, 63, 0.45);
  stroke-width: 1.4;
  stroke-dasharray: 4 6;
}

.chart-axis {
  fill: var(--muted);
  font-size: 11px;
}

.chart-empty {
  fill: var(--muted);
  font-size: 14px;
}

.dashboard-export-staging {
  position: fixed;
  left: -20000px;
  top: 0;
  width: 1400px;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
}

.detail-list {
  grid-template-columns: 180px 1fr;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
}

@media (max-width: 1240px) {
  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .main {
    padding: 28px 24px;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 3.3vw, 3rem);
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-overview-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .health-stat:first-child,
  .health-stat:nth-child(2) {
    grid-column: span 1;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .proposal-layout,
  .proposal-builder-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .main {
    padding: 22px;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 7vw, 2.7rem);
  }

  .chart-toolbar {
    flex-direction: column;
  }

  .hero {
    flex-direction: column;
  }

  .dashboard-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .chart-note {
    max-width: none;
    text-align: left;
    margin-top: 0;
  }

  .selected-page-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .selected-page-actions {
    justify-content: flex-start;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .health-grid,
  .diagnostic-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-action-grid {
    grid-template-columns: 1fr;
  }

  .chart-shell svg {
    min-width: 0;
  }

  .proposal-action-row,
  .proposal-scope-switch {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .rail {
    padding: 22px 18px;
  }

  .wordmark {
    font-size: 1.7rem;
  }

  .main,
  .filter-card,
  .table-card,
  .sync-card,
  .chart-card {
    padding: 18px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .page-overview-filters {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .health-grid {
    grid-template-columns: 1fr;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .proposal-page-list {
    max-height: 320px;
  }
}

/* Content Overview reference-design pass. */
body {
  background: #f5f7fb;
  color: #0f172a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  grid-template-columns: 224px minmax(0, 1fr);
  background: #f5f7fb;
}

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 22px 12px;
  border-right: 1px solid #09233a;
  background: linear-gradient(180deg, #061b2e 0%, #03111f 100%);
  color: #d7e4f2;
  box-shadow: 14px 0 34px rgba(15, 23, 42, 0.18);
}

.brand {
  margin: 0 8px 28px;
}

.wordmark {
  margin: 0;
  color: #f8fafc;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.wordmark span {
  color: #ff6a00;
}

.subword,
.nav .disabled,
.nav-legacy {
  color: #8ea5ba;
}

.nav {
  gap: 6px;
}

.nav a,
.nav-legacy summary {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #d7e4f2;
  font-size: 0.93rem;
  text-decoration: none;
}

.nav a:hover,
.nav-legacy summary:hover,
.nav a.is-active {
  background: #0b3558;
  color: #ffffff;
}

.nav a.is-active {
  box-shadow: inset 3px 0 0 #ff6a00;
  font-weight: 700;
}

.nav-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(215, 228, 242, 0.16);
}

.nav-section-label {
  padding: 4px 8px 8px;
  color: #9cb0c2;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.nav-section a,
.nav-legacy a {
  margin-left: 0;
  padding-left: 12px;
  border-left: 0;
  color: #d7e4f2;
}

.nav-legacy {
  margin-top: 10px;
}

.rail-footer {
  display: grid;
  gap: 8px;
  margin: auto -12px 0;
  padding: 18px 20px 0;
  border-top: 1px solid rgba(215, 228, 242, 0.16);
}

.rail-project-label {
  color: #8ea5ba;
  font-size: 0.72rem;
}

.rail-project-name {
  color: #ffffff;
  font-size: 0.9rem;
}

.rail-user-email {
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: 0.86rem;
}

.logout-form {
  margin: 6px 0 10px;
}

.logout-form button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(215, 228, 242, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #d7e4f2;
  font-size: 0.82rem;
  font-weight: 700;
}

.logout-form button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.rail-footer a {
  color: #d7e4f2;
  font-size: 0.9rem;
  text-decoration: none;
}

.main {
  padding: 0;
  background: #f5f7fb;
}

.content-overview-page {
  gap: 12px;
  min-height: 100vh;
  padding: 18px 28px 28px;
  background: #f8fafc;
  color: #0f172a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-body {
  min-height: 100vh;
  background: #f5f7fb;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(320px, 1fr);
  width: min(880px, 100%);
  overflow: hidden;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-brand {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 36px;
  border-right: 1px solid #243044;
  background: #172033;
  color: #ffffff;
}

.auth-brand .wordmark {
  margin: 0;
  font-size: 2.2rem;
}

.auth-brand p {
  margin: 0;
  color: #cbd5e1;
}

.auth-form {
  display: grid;
  gap: 16px;
  padding: 36px;
}

.auth-form h1 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 1.6rem;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form label span {
  color: #334155;
  font-size: 0.84rem;
  font-weight: 700;
}

.auth-form input {
  min-height: 44px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd7e3;
  border-radius: 7px;
  color: #172033;
  font: inherit;
}

.auth-form button {
  min-height: 42px;
  border-radius: 7px;
  background: #005bd3;
  font-weight: 750;
}

.auth-form button:hover {
  background: #0046a3;
}

.auth-flash {
  margin: 0;
}

.content-page-header {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding-bottom: 12px;
  border-bottom: 1px solid #d8dee8;
}

.content-page-header h1 {
  margin: 0;
  color: #0f172a;
  font-size: 1.55rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.content-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.content-save-view {
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid #cfd7e3;
  border-radius: 7px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 700;
}

.content-page-menu summary,
.content-row-menu summary {
  width: 36px;
  height: 36px;
  border-color: #cfd7e3;
  border-radius: 7px;
  color: #0f172a;
}

.content-page-menu .content-menu-panel {
  min-width: 230px;
}

.content-menu-panel {
  border-color: #cfd7e3;
  border-radius: 7px;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
}

.content-menu-panel a,
.content-menu-panel span,
.content-menu-panel button,
.content-menu-text summary {
  color: #172033;
  font-size: 0.9rem;
}

.content-filter-card {
  padding: 14px 0 10px;
}

.content-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.content-filters label {
  display: grid;
  gap: 7px;
}

.content-filters label > span {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 650;
}

.content-filters select,
.content-filters input[type="date"],
.content-select-visual {
  min-height: 38px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cfd7e3;
  border-radius: 7px;
  background: #ffffff;
  color: #172033;
  font-size: 0.9rem;
}

.content-select-visual {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.content-select-visual strong {
  color: #172033;
  font-size: 0.9rem;
}

.content-select-visual small {
  color: #64748b;
  font-size: 0.82rem;
}

.content-filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  align-self: end;
}

.content-filter-actions button,
.content-filter-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #cfd7e3;
  border-radius: 7px;
  background: #ffffff;
  color: #005bd3;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.content-filter-actions button {
  background: #005bd3;
  border-color: #005bd3;
  color: #ffffff;
}

.content-hidden-date {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.content-kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #ffffff;
}

.content-kpi-strip article {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 16px 18px;
  border-right: 1px solid #d8dee8;
}

.content-kpi-strip article:last-child {
  border-right: 0;
}

.content-kpi-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #005bd3;
  font-weight: 800;
}

.content-kpi-icon.green {
  background: #e8f8ee;
  color: #17803d;
}

.content-kpi-icon.blue {
  background: #eef2ff;
  color: #1f55ff;
}

.content-kpi-icon.red {
  background: #fff1f0;
  color: #d12b2b;
}

.content-kpi-strip span:not(.content-kpi-icon) {
  display: block;
  color: #475569;
  font-size: 0.78rem;
}

.content-kpi-strip strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.content-kpi-strip small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content-overview-page .card {
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.content-chart-card {
  padding: 0;
}

.content-chart-header {
  display: grid;
  grid-template-columns: minmax(160px, 0.5fr) 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 48px;
  padding: 12px 16px 0;
}

.content-chart-header h2 {
  margin: 0;
  font-size: 0.98rem;
}

.content-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: #475569;
  font-size: 0.82rem;
}

.content-chart-legend .chart-toggle {
  min-height: auto;
  padding: 6px 10px;
  border: 1px solid #d8dee8;
  border-radius: 7px;
  background: #ffffff;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.72;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, opacity 120ms ease;
}

.content-chart-legend .chart-toggle.is-active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #0f172a;
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.content-chart-legend .chart-toggle:hover {
  background: #f8fafc;
  color: #0f172a;
  opacity: 1;
}

.content-chart-legend .chart-swatch {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow: none;
}

.content-chart-legend .chart-swatch.is-dashed {
  background: repeating-linear-gradient(90deg, #64748b 0 2px, transparent 2px 5px) !important;
}

.content-chart-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.content-chart-actions button {
  min-height: 32px;
  padding: 6px 14px;
  border: 1px solid #cfd7e3;
  border-radius: 7px;
  background: #ffffff;
  color: #0f172a;
}

.content-chart-actions button:not(:disabled):hover {
  border-color: #93a4bb;
  background: #f8fafc;
}

.content-chart-card .chart-readout {
  display: block;
  width: auto;
  box-sizing: border-box;
  min-height: 34px;
  margin: 8px 16px 2px;
  padding: 8px 10px;
  border-color: #d8dee8;
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.82rem;
  line-height: 1.35;
}

.content-chart-card .chart-shell {
  height: 224px;
  padding: 4px 18px 12px;
  overflow: hidden;
  transition: height 160ms ease;
}

.content-chart-card.is-expanded .chart-shell {
  height: 640px;
}

.content-chart-card .chart-shell svg {
  width: 100%;
  height: 100%;
  max-height: none;
}

.content-chart-card .chart-grid {
  stroke: #d8dee8;
  stroke-dasharray: 2 3;
}

.content-chart-card .chart-frame {
  stroke: #c6ccd5;
  stroke-width: 1.2;
}

.content-chart-card .chart-axis {
  fill: #475569;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
}

.chart-tooltip {
  pointer-events: none;
}

.chart-tooltip-box {
  fill: #ffffff;
  stroke: #cfd7e3;
  stroke-width: 1;
  filter: drop-shadow(0 10px 22px rgba(15, 23, 42, 0.18));
}

.chart-tooltip-text {
  fill: #334155;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 650;
}

.chart-tooltip-text.is-date {
  fill: #0f172a;
  font-weight: 800;
}

.content-table-card {
  overflow: visible;
  padding: 0;
}

.content-bulk-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  padding: 8px 14px;
  border-bottom: 1px solid #d8dee8;
}

.content-bulk-bar[hidden] {
  display: none;
}

.content-bulk-bar:not(.has-selection) .content-selection-action {
  display: none;
}

.content-bulk-left,
.content-table-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-bulk-left form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.content-bulk-left input,
.content-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #005bd3;
}

.content-bulk-left strong {
  min-width: 78px;
  font-size: 0.9rem;
}

.content-bulk-left button {
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid #005bd3;
  border-radius: 6px;
  background: #005bd3;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 750;
}

.content-bulk-left button.content-clear-selection {
  border-color: transparent;
  background: transparent;
  color: #005bd3;
}

.content-bulk-left button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.content-table-tools {
  color: #334155;
  font-size: 0.86rem;
}

.content-pagination-size-form {
  margin: 0;
}

.content-pagination-size-form label {
  gap: 8px;
  white-space: nowrap;
}

.content-pagination-size-form select {
  width: 76px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 7px;
}

.content-page-step {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #d8dee8;
  border-radius: 7px;
  color: #0f172a;
  text-decoration: none;
  background: #ffffff;
}

.content-page-step.is-disabled {
  color: #94a3b8;
}

.content-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 0;
  border-radius: 0 0 8px 8px;
}

.content-table {
  min-width: 1160px;
  table-layout: fixed;
  font-size: 0.88rem;
}

.content-table th,
.content-table td {
  padding: 10px 12px;
  border-right: 1px solid #e5eaf0;
  border-bottom: 1px solid #d8dee8;
}

.content-table th:last-child,
.content-table td:last-child {
  border-right: 0;
}

.content-table th {
  background: #ffffff;
  color: #0f172a;
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: none;
}

.content-table tbody tr {
  background: #ffffff;
}

.content-table tbody tr.is-selected {
  background: #eef7ff;
}

.content-table tbody tr:hover {
  background: #f4f9ff;
}

.content-select-col {
  width: 42px;
}

.content-table th:nth-child(2) {
  width: 300px;
}

.content-table th:nth-child(3) {
  width: 116px;
}

.content-table th:nth-child(4),
.content-table th:nth-child(5),
.content-table th:nth-child(7),
.content-table th:nth-child(8),
.content-table th:nth-child(9) {
  width: 96px;
}

.content-table th:nth-child(6) {
  width: 190px;
}

.content-actions-col {
  width: 62px;
}

.content-item {
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
}

.content-thumb {
  width: 62px;
  border-radius: 6px;
}

.content-meta-line {
  gap: 5px;
  color: #475569;
  font-size: 0.78rem;
}

.content-meta-line strong {
  color: #172033;
  font-size: 0.8rem;
}

.content-format-pill {
  padding: 2px 6px;
  border-radius: 5px;
  background: #fff1e8;
  color: #f05a00;
  font-size: 0.74rem;
}

.content-title {
  margin-top: 3px;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 720;
}

.story-text-disclosure {
  margin-top: 3px;
  font-size: 0.78rem;
}

.story-text-disclosure summary {
  color: #005bd3;
}

.story-text-disclosure p {
  max-height: 6rem;
}

.content-date {
  color: #172033;
  font-size: 0.9rem;
}

.content-metric strong {
  color: #0f172a;
  font-size: 1.03rem;
}

.content-metric span {
  color: #475569;
  font-size: 0.74rem;
}

.content-engagement-metric span {
  white-space: normal;
}

.content-open-link {
  border: 0;
  color: #005bd3;
  background: transparent;
}

.content-open-link:hover {
  background: transparent;
  color: #0046a3;
}

.content-row-menu .content-menu-panel {
  min-width: 230px;
  right: 10px;
}

.content-page-subtitle {
  max-width: 110ch;
  margin: 6px 0 0;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.content-save-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.content-filter-actions a:last-child:not(:first-child) {
  color: #334155;
}

.page-kpi-strip,
.story-kpi-strip,
.snapshot-kpi-strip {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.page-kpi-strip article,
.story-kpi-strip article,
.snapshot-kpi-strip article {
  border-bottom: 1px solid #d8dee8;
}

.content-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  overflow: hidden;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #ffffff;
}

.content-metric-grid article {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 16px 18px;
  border-right: 1px solid #d8dee8;
  border-bottom: 1px solid #d8dee8;
}

.content-metric-grid article > div {
  min-width: 0;
}

.content-metric-grid span:not(.content-kpi-icon) {
  display: block;
  color: #475569;
  font-size: 0.78rem;
}

.content-metric-grid strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.content-metric-grid small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-overview-page .content-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid #d8dee8;
}

.content-overview-page .content-table-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 760;
}

.content-overview-page .content-table-header p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 0.82rem;
}

.content-detail-grid {
  gap: 12px;
  margin: 0;
}

.content-detail-card {
  padding: 0;
}

.content-detail-card > .detail-list,
.content-detail-card > .latest-metric-list,
.content-detail-card > .detail-actions,
.content-detail-card > form.detail-actions,
.content-detail-card > .legacy-metrics-notice,
.content-detail-card > .metric-section-heading,
.content-detail-card > .meta-note,
.content-detail-card > p,
.content-detail-card > .content-detail-disclosure {
  margin-left: 16px;
  margin-right: 16px;
}

.content-detail-card > .detail-list,
.content-detail-card > .latest-metric-list,
.content-detail-card > .legacy-metrics-notice,
.content-detail-card > p,
.content-detail-card > .meta-note,
.content-detail-card > .content-detail-disclosure {
  margin-top: 14px;
  margin-bottom: 14px;
}

.content-overview-page .detail-actions button,
.content-overview-page .button-link {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid #005bd3;
  border-radius: 7px;
  background: #005bd3;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 750;
}

.content-overview-page .button-link {
  text-decoration: none;
}

.content-overview-page .detail-actions button:hover,
.content-overview-page .button-link:hover {
  background: #0046a3;
}

.content-overview-page .detail-list {
  color: #172033;
  font-size: 0.88rem;
}

.content-overview-page .detail-list dt {
  color: #64748b;
  font-weight: 650;
}

.content-overview-page .detail-list dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.content-detail-card details > summary {
  cursor: pointer;
  color: #005bd3;
  font-weight: 700;
}

.content-table.app-data-table {
  min-width: 960px;
  table-layout: auto;
}

.content-table.app-data-table th:nth-child(n) {
  width: auto;
}

.content-table.app-data-table th,
.content-table.app-data-table td {
  vertical-align: top;
}

.content-table.app-data-table .metric-current {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 760;
}

.content-table.page-comparison-table {
  min-width: 1180px;
}

.content-table.audit-table {
  min-width: 1040px;
}

.content-run-table {
  margin-bottom: 16px;
}

.story-detail-page .content-kpi-strip strong,
.snapshot-detail-page .content-kpi-strip strong {
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.dashboard-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  gap: 12px;
  align-items: stretch;
}

.dashboard-preview-card {
  overflow: hidden;
}

.dashboard-preview-card > .content-kpi-strip,
.dashboard-preview-card > .content-metric-grid {
  border: 0;
  border-radius: 0;
}

.dashboard-kpi-strip {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.dashboard-kpi-strip article {
  border-bottom: 1px solid #d8dee8;
}

.dashboard-content-preview {
  display: grid;
  align-content: start;
}

.dashboard-content-total {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 22px 18px;
  border-bottom: 1px solid #d8dee8;
}

.dashboard-content-total span:not(.content-kpi-icon),
.dashboard-format-list span {
  display: block;
  color: #475569;
  font-size: 0.8rem;
}

.dashboard-content-total strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.dashboard-content-total small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.78rem;
}

.dashboard-format-list {
  display: grid;
  gap: 0;
}

.dashboard-format-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #edf1f5;
}

.dashboard-format-list > div:last-child {
  border-bottom: 0;
}

.dashboard-format-list strong {
  color: #0f172a;
  font-size: 0.95rem;
}

.content-action-grid {
  padding: 14px 16px 16px;
}

.content-action-grid .dashboard-action {
  border-color: #d8dee8;
  border-radius: 8px;
  background: #ffffff;
}

.content-action-grid .dashboard-action:hover {
  border-color: #93c5fd;
  background: #f4f9ff;
}

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

.admin-sync-card {
  display: grid;
  overflow: hidden;
  padding: 0;
}

.admin-sync-card-wide {
  grid-column: 1 / -1;
}

.admin-sync-card .sync-options,
.admin-sync-card .admin-card-body,
.admin-sync-card .admin-card-actions {
  margin: 0;
  padding: 16px;
}

.admin-sync-card .sync-options {
  border: 0;
}

.admin-sync-card .sync-options legend {
  margin-bottom: 10px;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: none;
}

.admin-sync-card .sync-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.admin-sync-card .sync-option {
  min-height: 40px;
  border-color: #d8dee8;
  border-radius: 7px;
  background: #ffffff;
  color: #172033;
  font-size: 0.88rem;
}

.admin-sync-card .sync-option input {
  accent-color: #005bd3;
}

.admin-conditional-panel {
  display: grid;
  gap: 12px;
  margin: 0 16px 16px;
  padding: 14px;
  border: 1px solid #d8dee8;
  border-radius: 7px;
  background: #f8fafc;
}

.admin-conditional-panel[hidden] {
  display: none;
}

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

.sync-field {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 680;
}

.sync-field input {
  min-height: 38px;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #172033;
  font: inherit;
  font-weight: 520;
  padding: 7px 9px;
}

.admin-sync-card .sync-option-inline {
  justify-content: flex-start;
}

.admin-card-body {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.45;
}

.admin-card-body p {
  margin: 0;
}

.admin-card-actions {
  border-top: 1px solid #d8dee8;
}

.admin-card-actions button {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid #005bd3;
  border-radius: 7px;
  background: #005bd3;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 750;
}

.admin-card-actions button:hover {
  background: #0046a3;
}

.page-group-member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.page-groups-table {
  min-width: 920px;
}

.page-list-table {
  min-width: 680px;
}

@media (max-width: 1180px) {
  .content-filters,
  .content-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-preview-grid,
  .admin-sync-grid {
    grid-template-columns: 1fr;
  }

  .content-kpi-strip article {
    border-bottom: 1px solid #d8dee8;
  }

  .content-bulk-bar {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  .rail {
    position: static;
    min-height: auto;
  }

  .content-overview-page {
    padding: 16px;
  }

  .content-filters,
  .content-kpi-strip,
  .content-chart-header {
    grid-template-columns: 1fr;
  }

  .content-chart-card.is-expanded .chart-shell {
    height: 520px;
  }
}
