:root {
  --bg: #f4f4f4;
  --bg-2: #edf2f6;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #002744;
  --muted: #686868;
  --line: rgba(0, 39, 68, 0.14);
  --brand: #7b9abc;
  --brand-2: #a7bbd0;
  --accent: #00858c;
  --navy: #002744;
  --grey: #a3a3a3;
  --sand: #f4f4f4;
  --green: #4f913e;
  --red: #9b5e5e;
  --gold: #b49a63;
  --green-soft: #eef6eb;
  --orange-soft: #fff4e6;
  --red-soft: #f8eded;
  --shadow: 0 14px 42px rgba(0, 39, 68, 0.1);
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --font-ui: "Lato", "Open Sans", "Segoe UI Variable", "Segoe UI", sans-serif;
  --font-display: "Abhaya Libre", "Georgia", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--bg) 52%, var(--bg-2) 100%);
  color: var(--ink);
  font-family: var(--font-ui);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(123, 154, 188, 0.11) 1px, transparent 1px);
  background-size: 88px 100%;
  opacity: 0.35;
  pointer-events: none;
}

.ambient {
  display: none;
}

.ambient-a {
  width: 22rem;
  height: 22rem;
  top: 6rem;
  left: -4rem;
  background: rgba(68, 185, 164, 0.5);
}

.ambient-b {
  width: 20rem;
  height: 20rem;
  right: -3rem;
  top: 18rem;
  background: rgba(211, 170, 73, 0.24);
}

.ambient-c {
  width: 26rem;
  height: 26rem;
  right: 10%;
  bottom: 5%;
  background: rgba(123, 154, 188, 0.2);
}

.app-shell {
  position: relative;
  padding: 2rem;
}

.site-header {
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100vw - 4rem));
  margin: 0 auto 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 39, 68, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 24px rgba(0, 39, 68, 0.08);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  min-width: 0;
}

.brand-lockup img {
  display: block;
  height: 2.65rem;
  width: auto;
}

.brand-context {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.brand-context strong {
  color: var(--ink);
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.85rem;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-nav span {
  white-space: nowrap;
}

.landing,
.report-page {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100vw - 4rem));
  margin: 0 auto;
}

.landing {
  display: grid;
  gap: 1.5rem;
  padding: 2rem 0 4rem;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(0, 39, 68, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero,
.upload-panel,
.report-hero,
.section-panel,
.metric-card {
  padding: 2rem;
}

.eyebrow {
  margin-bottom: 0.8rem;
  color: var(--brand);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.02;
}

h1 {
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: 4.35rem;
  font-weight: 700;
  color: var(--ink);
}

h2 {
  font-size: 1.9rem;
  color: var(--ink);
}

h3 {
  font-size: 1.12rem;
}

.lede {
  max-width: 72ch;
  margin-top: 1.1rem;
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--muted);
}

.hero.panel {
  overflow: hidden;
  min-height: 32rem;
  display: grid;
  align-content: end;
  padding: clamp(1.5rem, 4vw, 3rem);
  background:
    linear-gradient(90deg, rgba(0, 39, 68, 0.88), rgba(0, 39, 68, 0.62) 48%, rgba(0, 39, 68, 0.16)),
    url("/static/impulse-office.jpg") center right / cover no-repeat;
  border: 0;
  color: white;
  box-shadow: 0 18px 46px rgba(0, 39, 68, 0.18);
}

.hero .eyebrow,
.hero h1,
.hero .lede {
  color: white;
  text-shadow: 0 1px 16px rgba(0, 39, 68, 0.35);
}

.hero .lede {
  color: rgba(255, 255, 255, 0.86);
}

.feature-grid,
.metrics-grid,
.chart-grid,
.recommendation-grid,
.news-grid,
.form-notes {
  display: grid;
  gap: 1rem;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2rem;
}

.feature-card,
.chart-card,
.recommendation-card,
.news-card {
  min-width: 0;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.hero .feature-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.35);
}

.feature-card p,
.chart-card p,
.recommendation-card p,
.news-card p,
.market-copy p {
  margin: 0.8rem 0 0;
  line-height: 1.55;
  color: var(--muted);
}

.panel-header,
.section-heading,
.hero-actions,
.recommendation-head,
.news-meta {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(0, 39, 68, 0.06);
}

.status-ready {
  background: rgba(79, 145, 62, 0.12);
  color: var(--green);
}

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

.status-high {
  background: rgba(155, 94, 94, 0.13);
  color: var(--red);
}

.status-medium {
  background: rgba(180, 154, 99, 0.16);
  color: #76623b;
}

.status-low {
  background: rgba(123, 154, 188, 0.18);
  color: var(--ink);
}

/* Recommendation action chips — colour means the ACTION, not the priority. */
.action-positive {
  background: rgba(79, 145, 62, 0.14);
  color: var(--green);
}

.action-caution {
  background: rgba(180, 154, 99, 0.18);
  color: #76623b;
}

.action-neutral {
  background: rgba(0, 39, 68, 0.07);
  color: var(--ink);
}

.upload-form {
  margin-top: 1.4rem;
  display: grid;
  gap: 1.2rem;
}

.kind-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  padding: 0.3rem;
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  border: 1px solid var(--line);
  margin-bottom: 1rem;
}

.kind-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.kind-tab:hover {
  color: var(--ink);
}

.kind-tab.is-active {
  background: var(--accent);
  color: #fff;
}

.dropzone {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(0, 39, 68, 0.22);
  background: linear-gradient(135deg, rgba(123, 154, 188, 0.11), rgba(255, 255, 255, 0.86));
  cursor: pointer;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-icon {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: white;
  font-weight: 700;
}

.dropzone-copy {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

.dropzone-copy strong {
  color: var(--ink);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 600;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(0, 39, 68, 0.05);
  border: 1px solid rgba(0, 39, 68, 0.08);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.toggle-row:hover {
  background: rgba(0, 39, 68, 0.08);
  border-color: rgba(0, 39, 68, 0.18);
}

.toggle-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  inline-size: 1.2rem;
  block-size: 1.2rem;
  margin: 0;
  flex-shrink: 0;
  border: 1.5px solid rgba(0, 39, 68, 0.35);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background 120ms ease, border-color 120ms ease;
}

.toggle-row input[type="checkbox"]::before {
  content: "";
  inline-size: 0.7rem;
  block-size: 0.7rem;
  transform: scale(0);
  transform-origin: center;
  transition: transform 120ms ease;
  background: #fff;
  clip-path: polygon(14% 44%, 0 65%, 38% 100%, 100% 24%, 84% 8%, 38% 68%);
}

.toggle-row input[type="checkbox"]:checked {
  background: var(--ink);
  border-color: var(--ink);
}

.toggle-row input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.toggle-row:hover input[type="checkbox"] {
  border-color: var(--ink);
}

.toggle-row:has(input:checked) {
  background: rgba(0, 39, 68, 0.09);
  border-color: rgba(0, 39, 68, 0.22);
}

.toggle-row input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.selected-file {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(0, 39, 68, 0.05);
  color: var(--muted);
  font-weight: 600;
}

.active-run-card {
  margin-top: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: rgba(0, 39, 68, 0.05);
  border: 1px solid var(--line);
}

.active-run-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.active-run-copy {
  margin: 0.9rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.active-run-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.active-run-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.active-run-actions .secondary-button {
  width: 100%;
}

.expectation-card,
.issue-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.expectation-card {
  display: grid;
  gap: 0.8rem;
}

.expectation-card ul {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.65;
  color: var(--muted);
}

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

.form-notes h3 {
  margin-bottom: 0.7rem;
}

.form-notes ul {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.6;
  color: var(--muted);
}

.primary-button,
.secondary-button {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  font: inherit;
  overflow-wrap: anywhere;
}

.primary-button {
  color: white;
  background: var(--brand);
  box-shadow: 0 12px 28px rgba(123, 154, 188, 0.3);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.secondary-button {
  background: rgba(0, 39, 68, 0.06);
  color: var(--ink);
}

.danger-button {
  background: rgba(155, 94, 94, 0.12);
  color: var(--red);
}

.button-meta {
  font-size: 0.8rem;
  opacity: 0.78;
}

.error-banner,
.info-banner {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  font-weight: 600;
}

.error-banner {
  color: #8b2f26;
  background: var(--red-soft);
}

.info-banner {
  color: #76623b;
  background: rgba(180, 154, 99, 0.18);
}

.modal-open {
  overflow: hidden;
}

.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(0, 39, 68, 0.48);
  backdrop-filter: blur(10px);
  overflow-y: auto;
}

.progress-overlay[hidden] {
  display: none !important;
}

.progress-dialog {
  width: min(680px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1.6rem;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.progress-copy {
  margin: 0.9rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.progress-track {
  margin-top: 1.4rem;
  border-radius: 999px;
  background: rgba(0, 39, 68, 0.08);
  overflow: hidden;
}

.progress-bar {
  min-height: 0.75rem;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--navy));
  transition: width 0.35s ease;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

.progress-runtime {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.progress-log-shell {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-log-title {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #d6e1eb;
}

.progress-log {
  margin: 0.85rem 0 0;
  min-height: 7rem;
  max-height: 12rem;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.92rem;
  color: #eef4f8;
}

.progress-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
  gap: 0.8rem;
}

.progress-actions .secondary-button {
  align-items: flex-start;
  width: 100%;
}

.progress-steps,
.issue-grid {
  display: grid;
  gap: 0.8rem;
}

.progress-steps {
  margin-top: 1.3rem;
}

.progress-step {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(0, 39, 68, 0.05);
  color: var(--muted);
  font-weight: 700;
  border: 1px solid transparent;
}

.progress-step.is-active {
  color: var(--ink);
  border-color: rgba(123, 154, 188, 0.34);
  background: rgba(123, 154, 188, 0.16);
}

.progress-step.is-complete {
  color: var(--green);
  background: rgba(79, 145, 62, 0.08);
}

.report-page {
  display: grid;
  gap: 1.3rem;
  padding: 1rem 0 4rem;
}

.report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.4rem;
  align-items: end;
}

.report-hero > div {
  min-width: 0;
}

.report-title {
  max-width: none;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: var(--font-ui);
  font-size: 2.65rem;
  font-weight: 800;
  line-height: 1.08;
}

/* The exact source filename, demoted to a quiet identifier under the title. */
.report-source-file {
  margin-top: 0.35rem;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 0.8rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* --- Data-confidence panel (replaces the engineer "production-readiness" grid) --- */
.confidence-panel {
  display: grid;
  gap: 0.7rem;
}

.confidence-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.confidence-badge {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.confidence-complete {
  background: rgba(79, 145, 62, 0.14);
  color: var(--green);
}

.confidence-attention {
  background: rgba(180, 154, 99, 0.18);
  color: #76623b;
}

.confidence-summary {
  color: #3b4a55;
  font-size: 0.95rem;
}

.confidence-issues {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.3rem;
  color: #3b4a55;
  font-size: 0.92rem;
  line-height: 1.5;
}

.confidence-flagged {
  font-size: 0.92rem;
  color: var(--ink);
}

.confidence-review {
  display: grid;
  gap: 0.4rem;
}
.confidence-review-head {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}
.confidence-review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.review-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0.3rem 0.6rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-left: 3px solid #c9ced6;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.review-item.review-high { border-left-color: #b43636; background: #fdf6f6; }
.review-item.review-medium { border-left-color: #f49632; background: #fdfaf4; }
.review-item.review-info { border-left-color: #9aa7b1; background: #f7f9fa; }
.confidence-review-info { margin-top: 0.5rem; opacity: 0.92; }
.confidence-review-info .confidence-review-head { font-weight: 600; color: #5a6b78; }
.review-sev {
  align-self: start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  color: #fff;
}
.review-high .review-sev { background: #b43636; }
.review-medium .review-sev { background: #d98324; }
.review-info .review-sev { background: #9aa7b1; }
.review-fund { font-weight: 600; color: var(--ink); }
.review-fund code { font-weight: 500; font-size: 0.85em; color: #5a6b78; }
.review-reason { grid-column: 2; color: #3b4a55; }
.review-fix { grid-column: 2; color: #6b7682; font-size: 0.85rem; }

.operator-details {
  margin-top: 0.2rem;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
}

.operator-details > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

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

.operator-details > summary::after {
  content: " ›";
}

.operator-details[open] > summary::after {
  content: " ⌄";
}

.operator-details .audit-stat-grid {
  margin-top: 0.9rem;
}

.hero-actions {
  flex-direction: column;
  align-items: stretch;
}

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

.metric-card {
  min-height: 10rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-title {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-value {
  font-size: 1.8rem;
  line-height: 1.08;
  font-weight: 800;
  color: var(--ink);
  overflow-wrap: normal;
  word-break: normal;
}

.metric-subtitle {
  color: var(--muted);
  font-weight: 600;
}

.issue-hero {
  align-items: center;
}

.issue-hint {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(123, 154, 188, 0.12);
  font-weight: 600;
}

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

.details-panel {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.details-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.section-panel {
  display: grid;
  gap: 1.2rem;
}

.section-panel-muted {
  opacity: 0.9;
}

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

.chart-card-wide {
  grid-column: span 2;
}

.chart {
  min-height: 320px;
}

.table-shell {
  overflow-x: auto;
}

.positions-table {
  width: 100%;
  border-collapse: collapse;
}

.positions-table th,
.positions-table td {
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.positions-table th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.market-empty-state {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.market-empty-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.market-empty-card p {
  margin: 0.8rem 0 0;
  line-height: 1.6;
  color: var(--muted);
}

.market-copy {
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.market-client-message {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(123, 154, 188, 0.12);
  font-weight: 600;
}

/* --- Market-state summary hierarchy --- */
.market-copy-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.market-read-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.market-copy h3 {
  margin: 0.15rem 0 0;
  font-size: 1.18rem;
  line-height: 1.34;
}

.market-copy p.market-summary-body {
  margin: 0.7rem 0 0;
  line-height: 1.62;
  color: #3b4a55;
}

/* Full-width "read" card: keep the prose at a readable measure even though the
   card now spans the whole panel (the two side charts were removed). */
.market-copy-full .market-summary-body,
.market-copy-full .market-client-message {
  max-width: 72ch;
}

.market-summary-lead {
  color: var(--ink);
}

/* --- Asset / macro stance ladder (replaces the cropped SVG score chart) --- */
.stance-card {
  margin-top: 1rem;
}

.stance-card > h3 {
  margin: 0 0 0.5rem;
}

.chart-ladder {
  min-height: 0;
}

.stance-ladder {
  display: grid;
  gap: 0.85rem;
}

.stance-card .stance-ladder {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 2.25rem;
}

/* The trailing note spans the full grid as a footer, not an orphaned 8th tile. */
.stance-ladder .chart-note {
  grid-column: 1 / -1;
}

.stance-row {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.stance-row:last-child {
  border-bottom: 0;
}

.stance-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.stance-label {
  font-weight: 700;
  color: var(--ink);
}

.stance-tags {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.stance-chip {
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(0, 39, 68, 0.06);
  color: var(--muted);
}

.stance-chip-positive {
  background: rgba(79, 145, 62, 0.14);
  color: var(--green);
}

.stance-chip-negative {
  background: rgba(155, 94, 94, 0.16);
  color: var(--red);
}

.stance-score {
  min-width: 1.6rem;
  text-align: right;
  font-weight: 800;
  font-size: 0.95rem;
}

.stance-score-positive {
  color: var(--green);
}

.stance-score-negative {
  color: var(--red);
}

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

.stance-bar {
  position: relative;
  height: 9px;
  margin: 0.5rem 0 0;
  border-radius: 999px;
  background: rgba(0, 39, 68, 0.06);
}

.stance-bar-axis {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: rgba(0, 39, 68, 0.24);
  transform: translateX(-0.5px);
}

.stance-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

.stance-bar-fill-positive {
  background: var(--green);
}

.stance-bar-fill-negative {
  background: var(--red);
}

.stance-bar-fill-neutral {
  background: var(--grey);
}

.stance-reason {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #3b4a55;
}

.stance-details {
  margin-top: 0.3rem;
}

.stance-details > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

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

.stance-details > summary::after {
  content: " ›";
}

.stance-details[open] > summary::after {
  content: " ⌄";
}

.stance-details > p {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

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

.recommendation-card {
  position: relative;
}

/* High-priority ideas get a quiet left accent + tag; importance is also conveyed
   by order (they sort to the top). Medium/low stay unadorned to avoid noise. */
.recommendation-card--high {
  border-left: 3px solid var(--red);
}

.recommendation-priority {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red);
}

/* Holding linkage is supporting metadata, not the headline — calm it down so the
   title and the one-line call lead the card. */
.recommendation-link {
  margin-top: 0.5rem;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.84rem;
  line-height: 1.45;
  opacity: 0.78;
}

.recommendation-card p {
  color: #3b4a55;
}

.recommendation-risk {
  margin-top: 0.9rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--line);
  background: rgba(0, 39, 68, 0.035);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
}

.recommendation-risk strong {
  color: var(--muted);
}

/* The one-line call is the scannable payload; full rationale + risk drop down. */
.recommendation-card p.recommendation-call {
  margin-top: 0.7rem;
  font-size: 0.98rem;
  line-height: 1.5;
  font-weight: 600;
  color: var(--ink);
}

.rec-details {
  margin-top: 0.7rem;
}

.rec-details > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

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

.rec-details > summary::after {
  content: " ›";
}

.rec-details[open] > summary::after {
  content: " ⌄";
}

.rec-details > p {
  margin: 0.55rem 0 0;
  line-height: 1.55;
}

.rec-details .recommendation-risk {
  margin-top: 0.7rem;
}

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

.news-meta {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.news-importance {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.importance-meter {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 39, 68, 0.1);
  overflow: hidden;
}

.importance-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--brand);
}

.imp-0 { width: 0; }
.imp-1 { width: 10%; }
.imp-2 { width: 20%; }
.imp-3 { width: 30%; }
.imp-4 { width: 40%; }
.imp-5 { width: 50%; }
.imp-6 { width: 60%; }
.imp-7 { width: 70%; }
.imp-8 { width: 80%; background: var(--gold); }
.imp-9 { width: 90%; background: var(--gold); }
.imp-10 { width: 100%; background: var(--gold); }

.news-card a,
.sources-block a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.sources-block ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  line-height: 1.7;
}

.source-group {
  margin-top: 0.85rem;
}

.source-group h4 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* Sources are verification/reference — collapsed by default, one click deep. */
.sources-block {
  margin-top: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.sources-block > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.sources-block > summary::-webkit-details-marker {
  display: none;
}

.sources-block > summary::after {
  content: " ›";
  color: var(--accent);
}

.sources-block[open] > summary::after {
  content: " ⌄";
  color: var(--accent);
}

/* What to watch — portfolio-specific monitoring triggers as a scannable list
   (replaces the old pill blobs that crammed paragraphs into rounded chips). */
.watch-block {
  margin-top: 1.4rem;
}

.watch-title {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}

.watch-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.watch-list li {
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-md);
  background: var(--panel-2);
  font-size: 0.92rem;
  line-height: 1.5;
  color: #3b4a55;
}

.watch-list li strong {
  color: var(--ink);
}

.disclaimer {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.log-view {
  margin: 0;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--navy);
  color: #eef4f8;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

.svg-chart {
  width: 100%;
  height: 100%;
}

.chart-legend {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.92rem;
}

.legend-left {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.legend-swatch {
  inline-size: 0.75rem;
  block-size: 0.75rem;
  border-radius: 999px;
}

.chart-note {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

code {
  padding: 0.18rem 0.35rem;
  border-radius: 0.45rem;
  background: rgba(0, 39, 68, 0.08);
  font-family: "Consolas", "SFMono-Regular", monospace;
}

@media (max-width: 1120px) {
  h1 {
    font-size: 3.45rem;
  }

  .report-title {
    font-size: 2.35rem;
  }

  .feature-grid,
  .metrics-grid,
  .news-grid,
  .recommendation-grid,
  .chart-grid,
  .form-notes,
  .market-empty-state,
  .issue-grid,
  .stance-card .stance-ladder,
  .active-run-actions {
    grid-template-columns: 1fr;
  }

  .report-hero {
    grid-template-columns: 1fr;
  }

  .chart-card-wide {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 0.85rem;
  }

  .site-header {
    width: 100%;
    max-width: calc(100vw - 1.7rem);
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-lockup {
    width: 100%;
  }

  .brand-lockup img {
    height: 2.25rem;
  }

  .brand-context span {
    display: none;
  }

  .site-nav {
    display: none;
  }

  .landing,
  .report-page {
    width: 100%;
    max-width: calc(100vw - 1.7rem);
  }

  .hero,
  .upload-panel,
  .report-hero,
  .section-panel,
  .metric-card {
    width: 100%;
    max-width: calc(100vw - 1.7rem);
    padding: 1.05rem;
  }

  .feature-grid,
  .feature-card,
  .chart-card,
  .recommendation-card,
  .news-card {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

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

  h1 {
    max-width: none;
    font-size: 2.08rem;
    overflow-wrap: break-word;
  }

  h2 {
    font-size: 1.45rem;
  }

  .report-title {
    font-size: 1.85rem;
  }

  .hero.panel {
    min-height: auto;
    background:
      linear-gradient(180deg, rgba(0, 39, 68, 0.9), rgba(0, 39, 68, 0.58)),
      url("/static/impulse-office.jpg") center / cover no-repeat;
  }

  .lede {
    max-width: 100%;
    font-size: 0.98rem;
  }

  .hero > *,
  .upload-panel > *,
  .report-hero > *,
  .section-panel > * {
    max-width: 100%;
  }

  .hero .lede,
  .feature-card *,
  .feature-card p,
  .dropzone-copy,
  .active-run-copy {
    overflow-wrap: anywhere;
  }

  .hero-actions .primary-button,
  .hero-actions .secondary-button {
    width: 100%;
  }

  .progress-runtime,
  .progress-actions {
    grid-template-columns: 1fr;
  }

  .progress-dialog {
    max-height: calc(100vh - 1rem);
  }
}

/* ─── Input kind segmented toggle ──────────────────────────────── */
.input-kind-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(0, 39, 68, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(0, 39, 68, 0.03);
}

.input-kind-toggle input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.input-kind-toggle label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  text-align: center;
  align-items: center;
  transition: background 120ms ease, color 120ms ease;
  color: var(--ink);
}

.input-kind-toggle label strong {
  font-size: 0.95rem;
}

.input-kind-toggle label small {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}

.input-kind-toggle input[type="radio"]:checked + label {
  background: var(--ink);
  color: #fff;
}

.input-kind-toggle input[type="radio"]:checked + label small {
  color: rgba(255, 255, 255, 0.78);
}

.input-kind-toggle label:hover {
  background: rgba(0, 39, 68, 0.08);
}

.input-kind-toggle input[type="radio"]:checked + label:hover {
  background: var(--ink);
}

.input-kind-toggle input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ─── Statements file list ──────────────────────────────────────── */
.statements-list {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.statements-list[hidden] {
  display: none;
}

.statements-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.85rem;
  background: rgba(0, 39, 68, 0.04);
  border: 1px solid rgba(0, 39, 68, 0.08);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--ink);
}

.statements-item-kind {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
}

.statements-item-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statements-item-size {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.progress-step[hidden] {
  display: none;
}

/* ─── Source mode selector (index page) ──────────────────────────── */
.source-mode {
  border: 1px solid rgba(0, 39, 68, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem 0.5rem;
  margin-top: 0.4rem;
  display: grid;
  gap: 0.55rem;
}

.source-mode legend {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  padding: 0 0.4rem;
}

.source-option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  transition: background 120ms ease;
}

.source-option:hover {
  background: rgba(0, 39, 68, 0.05);
}

.source-option input[type="radio"] {
  margin-top: 0.2rem;
  accent-color: var(--ink);
  flex-shrink: 0;
}

.source-option span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.source-option strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.source-option small {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ─── Run meta row (report hero strip) ──────────────────────────── */
.run-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: -0.4rem 0 0.2rem;
}

/* ─── Data quality / audit panel ────────────────────────────────── */
.data-quality .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.audit-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin-top: 1.1rem;
}

.audit-stat {
  background: rgba(0, 39, 68, 0.04);
  border: 1px solid rgba(0, 39, 68, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.audit-stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.audit-stat-value {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.audit-block-list {
  margin-top: 1.4rem;
  border-left: 3px solid #9b5e5e;
  padding: 0.6rem 0 0.6rem 1rem;
  background: rgba(155, 94, 94, 0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.audit-block-list-muted {
  border-left-color: rgba(0, 39, 68, 0.25);
  background: rgba(0, 39, 68, 0.04);
}

.audit-block-list h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: var(--ink);
}

.audit-block-list ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

.audit-block-list code {
  background: rgba(0, 39, 68, 0.08);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* ─── Queue chip strip (progress overlay) ────────────────────────── */
.progress-queue-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0.4rem;
}

.queue-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  padding: 0.45rem 0.75rem;
  background: rgba(0, 39, 68, 0.05);
  border: 1px solid rgba(0, 39, 68, 0.12);
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  color: var(--ink);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
  text-align: left;
  max-width: 320px;
}

.queue-chip:hover {
  background: rgba(0, 39, 68, 0.1);
  border-color: rgba(0, 39, 68, 0.25);
}

.queue-chip.is-viewing {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  cursor: default;
}

.queue-chip.is-viewing:hover {
  transform: none;
}

.queue-chip-role {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.7;
}

.queue-chip-name {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

/* ─── Queue confirm modal ───────────────────────────────────────── */
.queue-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 12, 24, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  backdrop-filter: blur(3px);
}

.queue-confirm-overlay[hidden] {
  display: none;
}

.queue-confirm-card {
  max-width: 540px;
  width: 100%;
  padding: 1.6rem 1.6rem 1.4rem;
  background: #fff;
  border-radius: var(--radius-lg, 16px);
}

.queue-confirm-card h2 {
  margin: 0.3rem 0 0.6rem;
  font-size: 1.35rem;
}

.queue-confirm-copy {
  margin: 0 0 1.2rem;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.5;
}

.queue-confirm-copy strong {
  color: var(--ink);
}

.queue-confirm-actions {
  display: grid;
  gap: 0.65rem;
}

.queue-confirm-actions .primary-button,
.queue-confirm-actions .secondary-button {
  width: 100%;
}

/* ─── Deck (PPT) generation panel ───────────────────────────────── */
.deck-panel .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.deck-intro {
  margin: 0.4rem 0 1rem;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.5;
}

.deck-form {
  display: grid;
  gap: 1rem;
}

.deck-mode {
  margin-top: 0;
}

.deck-macro {
  border: 1px solid rgba(0, 39, 68, 0.1);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  background: rgba(0, 39, 68, 0.03);
}

.deck-macro[hidden] {
  display: none;
}

.deck-macro-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.deck-macro-current {
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.deck-macro-current code {
  background: rgba(0, 39, 68, 0.08);
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.deck-macro-age {
  color: var(--muted);
}

.deck-macro-missing {
  color: #8b2f26;
}

.deck-macro-advanced {
  margin-top: 0.6rem;
}

.deck-macro-advanced > summary {
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.deck-macro-advanced > summary:hover {
  color: var(--ink);
  text-decoration: underline;
}

.deck-macro-advanced[open] > summary {
  margin-bottom: 0.5rem;
}

.deck-macro-review {
  margin-top: 0.75rem;
}

.deck-macro-review-hint {
  margin-left: 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.deck-review-panel {
  margin-top: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line, #e2e6ec);
  border-radius: 10px;
  background: #fbfcfe;
}

.deck-review-panel[hidden] { display: none; }

.deck-review-intro {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.mr-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.6rem;
}

.mr-field > label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
}

.mr-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line, #d8dde6);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

textarea.mr-input {
  resize: none;       /* height is auto-grown to fit content */
  overflow: hidden;
  min-height: 30px;
}

.mr-count {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
}

.mr-count.mr-over {
  color: #b4413a;
  font-weight: 600;
}

.mr-group {
  margin-top: 0.9rem;
}

.mr-group-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand, #194793);
  margin-bottom: 0.45rem;
}

.mr-card {
  border-left: 3px solid var(--brand, #194793);
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.6rem;
  background: #fff;
  border-radius: 0 8px 8px 0;
}

.link-button,
.mr-remove {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--brand, #194793);
  cursor: pointer;
  text-decoration: underline;
}

.mr-remove {
  color: #8b2f26;
}

.deck-review-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.deck-review-saved {
  font-size: 0.8rem;
  color: #1f7a44;
}

.deck-review-saved[hidden] { display: none; }

.deck-macro-upload {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
}

.deck-macro-upload input[type="file"] {
  font-size: 0.85rem;
  color: var(--ink);
}

.deck-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.deck-progress {
  display: grid;
  gap: 0.5rem;
}

.deck-progress[hidden] { display: none; }

.deck-progress .progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 39, 68, 0.08);
  overflow: hidden;
}

.deck-progress .progress-bar {
  height: 100%;
  background: var(--ink);
  border-radius: 999px;
  transition: width 600ms ease;
}

.deck-progress-message {
  font-size: 0.88rem;
  color: var(--muted);
}

.deck-result {
  border: 1px solid rgba(79, 145, 62, 0.3);
  background: rgba(79, 145, 62, 0.07);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.7rem;
}

.deck-result[hidden] { display: none; }
.deck-error[hidden] { display: none; }
.deck-thumbnail[hidden] { display: none; }
.dropzone[hidden] { display: none; }
.kind-switch[hidden] { display: none; }
.progress-step[hidden] { display: none; }
[hidden] { display: none; }

.deck-result-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  color: var(--ink);
  font-size: 0.95rem;
}

.deck-result-stats {
  color: var(--muted);
  font-size: 0.88rem;
}

.deck-result-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.deck-thumbnail {
  border: 1px solid rgba(0, 39, 68, 0.12);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 0.4rem;
  max-width: 240px;
}

.deck-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-md) - 4px);
}

.deck-error {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--red-soft);
  color: #8b2f26;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ─── Advanced settings disclosure ───────────────────────────── */
.advanced-settings {
  margin-top: 0.4rem;
  border: 1px solid rgba(0, 39, 68, 0.1);
  border-radius: var(--radius-md);
  background: rgba(0, 39, 68, 0.02);
}

.advanced-settings > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.92rem;
  position: relative;
}

.advanced-settings > summary::-webkit-details-marker { display: none; }

.advanced-settings > summary::after {
  content: "▾";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 150ms ease;
}

.advanced-settings[open] > summary::after {
  transform: translateY(-50%) rotate(180deg);
}

.advanced-settings-body {
  padding: 0 1rem 1rem;
  display: grid;
  gap: 0.85rem;
}

/* ─── Site nav (real links instead of decorative spans) ────────── */
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* Custom language dropdown — a native <select> can't style its open list, so we
   use a button + menu that matches the site's design. */
.lang-switch {
  position: relative;
  display: inline-flex;
  margin-left: 0.8rem;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(0, 39, 68, 0.18);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.lang-btn:hover {
  border-color: rgba(0, 39, 68, 0.4);
}

.lang-btn[aria-expanded="true"] {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(0, 39, 68, 0.10);
}

.lang-btn-caret {
  color: var(--muted);
  transition: transform 150ms ease;
}

.lang-btn[aria-expanded="true"] .lang-btn-caret {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 100%;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(0, 39, 68, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 39, 68, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
}

.lang-switch.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-menu li {
  list-style: none;
}

.lang-menu a {
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 0;
}

.lang-menu a:hover {
  background: rgba(0, 39, 68, 0.06);
  border-bottom: 0;
}

.lang-menu a.is-active {
  background: var(--ink);
  color: #fff;
}

/* ─── Active runs list (upload page) ────────────────────────────── */
.active-runs-list {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(0, 39, 68, 0.04);
  border: 1px solid rgba(0, 39, 68, 0.1);
  border-radius: var(--radius-md);
}

.active-runs-list[hidden] {
  display: none;
}

.active-runs-heading {
  margin-bottom: 0.1rem;
}

.active-run-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.7rem;
  background: #fff;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid rgba(0, 39, 68, 0.08);
}

.active-run-row.is-viewing {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink) inset;
}

.active-run-row-role {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.active-run-row-name {
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-run-row-stage {
  font-size: 0.82rem;
  color: var(--muted);
}

.active-run-row-actions {
  display: flex;
  gap: 0.4rem;
}

/* ─── Link pill (small inline button) ──────────────────────────── */
.link-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: rgba(0, 39, 68, 0.07);
  border: 1px solid rgba(0, 39, 68, 0.15);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease;
}

.link-pill:hover {
  background: rgba(0, 39, 68, 0.13);
}

.link-pill-danger {
  background: rgba(180, 54, 54, 0.08);
  border-color: rgba(180, 54, 54, 0.25);
  color: #8b2f26;
}

.link-pill-danger:hover {
  background: rgba(180, 54, 54, 0.16);
}

/* ─── Kind switch hint (upload page auto-detect) ────────────────── */
.kind-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(180, 154, 99, 0.13);
  border: 1px solid rgba(180, 154, 99, 0.3);
  font-size: 0.88rem;
  color: var(--ink);
}

/* ─── Compact dropzone (used in deck macro picker) ─────────────── */
.dropzone-compact {
  padding: 0.85rem 1rem;
  grid-template-columns: auto 1fr;
}

.dropzone-compact .dropzone-icon {
  width: 2.4rem;
  height: 2.4rem;
  font-size: 0.72rem;
}

.dropzone-compact .dropzone-copy strong {
  font-size: 0.92rem;
}

.dropzone-compact .dropzone-copy span {
  font-size: 0.82rem;
}

.deck-macro-selected {
  font-size: 0.85rem;
  color: var(--ink);
  font-weight: 600;
  padding: 0.4rem 0;
}

.deck-macro-selected[hidden] { display: none; }

/* ─── Runs history table ──────────────────────────────────────── */
.runs-table-shell {
  overflow-x: auto;
}

.runs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.runs-table thead th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(0, 39, 68, 0.1);
}

.runs-table tbody td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid rgba(0, 39, 68, 0.06);
  vertical-align: top;
}

.runs-table tbody tr:hover {
  background: rgba(0, 39, 68, 0.025);
}

.run-cell-title {
  font-weight: 700;
  color: var(--ink);
}

.run-cell-sub {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.run-cell-when {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.run-cell-actions {
  display: flex;
  gap: 0.4rem;
  white-space: nowrap;
  align-items: center;
  flex-wrap: wrap;
}

/* ─── Run organization: folders, pins, move ───────────────────── */
.runs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.new-folder-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.folder-input {
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.9rem;
  min-width: 220px;
}

.folder-input:focus {
  outline: none;
  border-color: var(--brand);
}

.secondary-button-compact {
  padding: 0.55rem 0.95rem;
}

.pin-counter {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* Each folder is its own section + table, so its columns size to its own content
   (a single shared table compressed the columns and wrapped the status chip). */
.folder-section { margin-top: 1.5rem; }

.folder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.2rem;
  border-bottom: 1px solid rgba(0, 39, 68, 0.1);
}

/* Collapsed folder hides its runs (state persisted in localStorage by runs.js). */
.folder-section.is-collapsed .folder-body { display: none; }

/* Status chips never wrap to two lines. */
.runs-table .status-chip { white-space: nowrap; }

/* Fixed proportional columns: the row fills the width evenly (no left-packed data +
   empty right gap) AND columns align across every folder's table. */
.runs-table { table-layout: fixed; }
.run-cell-title { overflow-wrap: anywhere; }     /* break long file names cleanly */

.folder-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.98rem;
  cursor: pointer;
  user-select: none;
}
.folder-title:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Collapse affordance: chevron points down when open, right when collapsed. */
.group-chevron {
  display: inline-block;
  color: var(--muted);
  font-size: 0.68rem;
  transition: transform 0.12s ease;
}
.folder-section.is-collapsed .group-chevron { transform: rotate(-90deg); }

.folder-glyph {
  color: var(--muted);
  flex: none;
}

.folder-title.is-muted { color: var(--muted); }
.folder-title.is-muted .folder-name { font-weight: 600; }

.folder-count {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* Secondary management actions stay out of the way until the row/folder is hovered,
   so the page reads as data first (WM tools whisper their controls). */
.folder-actions,
.row-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.folder-section:hover .folder-actions,
.folder-head:focus-within .folder-actions,
.runs-table tbody tr:hover .row-tools,
.runs-table tbody tr:focus-within .row-tools {
  opacity: 1;
  pointer-events: auto;
}

.folder-empty {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.7rem 0.2rem;
}

/* Quiet text / icon buttons — no pill fill, so the data leads and actions recede. */
.text-button {
  border: none;
  background: none;
  padding: 0.2rem 0.05rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.text-button:hover { color: var(--ink); text-decoration: underline; }
.text-button-danger:hover { color: var(--red); }

.icon-button {
  border: none;
  background: none;
  padding: 0.1rem 0.15rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.icon-button:hover { color: var(--ink); }
.icon-button.is-pinned { color: var(--gold); }

.pin-dot { color: var(--gold); font-size: 0.82rem; }

/* Folder picker — same pill + popup language as the header language toggle, so the
   "move to folder" control reads as native to the site (was a raw OS <select>). */
.dir-switch { position: relative; display: inline-flex; }
.dir-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(0, 39, 68, 0.18);
  border-radius: 999px;
  padding: 0.26rem 0.6rem;
  max-width: 150px;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.dir-btn:hover { border-color: rgba(0, 39, 68, 0.4); }
.dir-btn[aria-expanded="true"] { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0, 39, 68, 0.10); }
.dir-btn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-btn-caret { color: var(--muted); flex: none; transition: transform 150ms ease; }
.dir-btn[aria-expanded="true"] .dir-btn-caret { transform: rotate(180deg); }

.dir-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 100%;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(0, 39, 68, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 39, 68, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
  max-height: 260px;
  overflow-y: auto;
}
.dir-switch.open .dir-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dir-menu li { list-style: none; }
.dir-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
}
.dir-option:hover { background: rgba(0, 39, 68, 0.06); }
.dir-option.is-active { background: var(--ink); color: #fff; }

/* Let the folder-picker popup escape the table instead of being clipped. */
.runs-table-shell { overflow: visible; }

/* In-app confirm / alert modal — replaces the native browser dialog so destructive
   actions match the site instead of "127.0.0.1 says…". */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 39, 68, 0.34);
  animation: modalFade 0.12s ease;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 39, 68, 0.28);
  padding: 1.5rem;
}
.modal-title {
  margin: 0 0 0.55rem;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.modal-message {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}
.modal-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, filter 120ms ease;
}
.modal-cancel {
  background: rgba(0, 39, 68, 0.06);
  color: var(--ink);
  border-color: rgba(0, 39, 68, 0.12);
}
.modal-cancel:hover { background: rgba(0, 39, 68, 0.12); }
.modal-confirm { background: var(--ink); color: #fff; }
.modal-confirm:hover { filter: brightness(1.12); }
.modal-confirm.is-danger { background: var(--red); }
.modal-confirm.is-danger:hover { filter: brightness(0.94); }

/* ── Settings: Claude API key page ──────────────────────────────── */
.report-page-narrow { max-width: 880px; }
.muted { color: var(--muted); }

/* Compact hero: a settings page is a utility, not a landing hero. */
.report-hero-compact { padding-top: 1.4rem; padding-bottom: 1.4rem; }
.report-hero-compact h1 { font-size: 2.1rem; line-height: 1.12; margin: 0.2rem 0; }
.report-hero-compact .lede { font-size: 0.95rem; }

/* Single status, in the hero (chip + key + remove) — no duplicate status block. */
.key-hero-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  text-align: right;
}
.key-status-body { margin: 0; font-size: 0.85rem; color: var(--muted); max-width: 260px; }

.settings-block { padding: 1.3rem 0; border-bottom: 1px solid rgba(0, 39, 68, 0.08); }
.settings-block:last-child { border-bottom: none; padding-bottom: 0.2rem; }
.settings-block-title { margin: 0 0 0.85rem; font-size: 0.95rem; color: var(--ink); }

/* Collapsible "how to get a key" — open when no key, collapsed once set. */
.guide-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
}
.guide-summary::-webkit-details-marker { display: none; }
.guide-summary::before {
  content: "\25B8"; /* ▸ */
  color: var(--muted);
  font-size: 0.7rem;
  transition: transform 0.12s ease;
}
.guide-details[open] .guide-summary { margin-bottom: 0.85rem; }
.guide-details[open] .guide-summary::before { transform: rotate(90deg); }

.guide-steps {
  margin: 0;
  padding-left: 1.4rem;
  display: grid;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.5;
}
.guide-steps li { padding-left: 0.2rem; }
.guide-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 133, 140, 0.35);
}
.guide-link:hover { border-bottom-color: var(--accent); }
.guide-hint { color: var(--muted); font-size: 0.78rem; }

.powers-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.key-form { display: grid; gap: 0.6rem; max-width: 580px; }
.key-label { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.key-input-row { display: flex; gap: 0.5rem; align-items: center; }
.key-input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
.key-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(123, 154, 188, 0.22); }
.key-toggle { flex: none; }
.key-form-actions { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin-top: 0.2rem; }
.key-save { flex-direction: row; padding: 0.7rem 1.3rem; }
.key-feedback { font-size: 0.88rem; font-weight: 600; }
.key-feedback.is-ok { color: var(--green); }
.key-feedback.is-error { color: var(--red); }
.key-feedback.is-info { color: var(--muted); }
.key-security { margin: 1rem 0 0; font-size: 0.82rem; line-height: 1.5; }
.key-remove.is-armed { background: rgba(180, 54, 54, 0.16); color: #8b2f26; }

/* Muted one-line meta replaces the chip clutter under the run name. */
.run-meta {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Right-align figures — the finance-table convention. */
.runs-table th.num,
.runs-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Quiet left accent marks a pinned run. */
.runs-table tbody tr.is-pinned td:first-child {
  box-shadow: inset 3px 0 0 0 var(--gold);
}

/* In-place rename: the input sits exactly where the name was. */
.inline-edit {
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--panel);
  min-width: 180px;
  max-width: 320px;
}
.inline-edit:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(123, 154, 188, 0.25);
}

/* Sign-coloured quarterly figure — gains/losses scannable at a glance. */
.runs-table td.pos { color: var(--green); }
.runs-table td.neg { color: var(--red); }

/* ─── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  display: grid;
  gap: 0.8rem;
  justify-items: center;
}

.empty-state h2 {
  margin: 0;
}

.empty-state p {
  max-width: 480px;
  color: var(--muted);
}

/* ─── Collapsed updater log on report page ─────────────────────── */
.collapsed-log {
  padding: 0;
  overflow: hidden;
}

.collapsed-log > summary {
  list-style: none;
  cursor: pointer;
  padding: 1.4rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: background 120ms ease;
}

.collapsed-log > summary:hover {
  background: rgba(0, 39, 68, 0.03);
}

.collapsed-log > summary::-webkit-details-marker { display: none; }

.collapsed-log > summary > div {
  display: grid;
  gap: 0.2rem;
}

.collapsed-log > summary > .status-chip::after {
  content: " ▾";
  display: inline-block;
  margin-left: 0.3rem;
  transition: transform 150ms ease;
}

.collapsed-log[open] > summary > .status-chip::after {
  transform: rotate(180deg);
  display: inline-block;
}

.collapsed-log[open] > summary {
  border-bottom: 1px solid rgba(0, 39, 68, 0.08);
}

.collapsed-log .log-view {
  margin: 0;
  padding: 1.4rem 1.6rem;
  color: var(--ink);
  background: rgba(0, 39, 68, 0.03);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ─── Progress log in overlay (collapsed by default) ───────────── */
.progress-log-shell {
  margin-top: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 39, 68, 0.1);
  background: rgba(0, 39, 68, 0.03);
  padding: 0;
}

.progress-log-shell > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.7rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  transition: background 120ms ease;
}

.progress-log-shell > summary:hover {
  background: rgba(0, 39, 68, 0.05);
}

.progress-log-shell > summary::-webkit-details-marker { display: none; }

.progress-log-shell > summary::after {
  content: "▾";
  font-size: 0.85rem;
  color: var(--muted);
  transition: transform 150ms ease;
  flex-shrink: 0;
}

.progress-log-shell[open] > summary {
  border-bottom: 1px solid rgba(0, 39, 68, 0.1);
  background: rgba(0, 39, 68, 0.05);
}

.progress-log-shell[open] > summary::after {
  transform: rotate(180deg);
}

.progress-log-shell .progress-log {
  margin: 0;
  padding: 0.7rem 0.95rem;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  min-height: 0;
  overflow-y: auto;
  background: transparent;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ─── Hero refinements on report page (chip row baked in) ─────── */
.report-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: start;
}

.report-hero-text {
  min-width: 0;
}

.report-hero .run-meta-row {
  margin-top: 0.8rem;
  margin-bottom: 0;
}

.report-hero .hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 240px;
}

@media (max-width: 880px) {
  .report-hero {
    grid-template-columns: 1fr;
  }
  .report-hero .hero-actions {
    min-width: 0;
  }
}

/* ─── Previous decks list ─────────────────────────────────────── */
.previous-decks-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.previous-decks-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.95rem;
  background: rgba(0, 39, 68, 0.04);
  border-radius: var(--radius-md);
}

.previous-deck-meta {
  display: grid;
  gap: 0.15rem;
}

.previous-deck-meta strong {
  color: var(--ink);
}

.previous-deck-meta span {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── Branded sign-in page + logout control ─────────────────────────────── */
.login-main {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 4rem;
}
.login-card {
  width: 100%;
  max-width: 430px;
  padding: 2.4rem 2.4rem 2.6rem;
  text-align: left;
}
.login-card h1 {
  font-size: 2.5rem;
  max-width: none;
  margin: 0.3rem 0 0.55rem;
}
.login-card .lede {
  font-size: 1rem;
  line-height: 1.55;
  margin-top: 0;
  margin-bottom: 1.7rem;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.login-field > span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.login-field input {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border, #d4dbe1);
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
  color: var(--ink, #1f2a33);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login-field input:focus {
  outline: none;
  border-color: var(--accent, #2f6f8f);
  box-shadow: 0 0 0 3px rgba(47, 111, 143, 0.18);
}
.login-submit {
  margin-top: 0.6rem;
  width: 100%;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.2rem;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.login-submit:hover { filter: brightness(1.06); }
.login-error {
  border-left: 3px solid #b43636;
  background: #fdf6f6;
  color: #8a2b2b;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.logout-form { margin: 0 0 0 0.5rem; display: inline-flex; }
/* Match the language toggle exactly so the header controls read as one set. */
.logout-btn {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(0, 39, 68, 0.18);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.logout-btn:hover {
  border-color: rgba(0, 39, 68, 0.4);
}
