@font-face {
  font-family: "Centra";
  src: url("/static/assets/fonts/centra-extra-bold.otf") format("opentype");
  font-display: swap;
  font-style: normal;
  font-weight: 800;
}

@font-face {
  font-family: "Inter";
  src: url("/static/assets/fonts/inter-variable.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

:root {
  --orange: #fc4c02;
  --orange-dark: #d83f00;
  --orange-soft: #fff0e9;
  --purple: #6516c1;
  --purple-dark: #4f0f9b;
  --purple-soft: #f4edfc;
  --ink: #171414;
  --muted: #716b68;
  --paper: #f5f3f1;
  --surface: #ffffff;
  --surface-soft: #faf9f8;
  --line: #e5e0dc;
  --line-strong: #cec7c2;
  --safe: #19734b;
  --safe-soft: #eaf7ef;
  --warning: #9a6100;
  --warning-soft: #fff6df;
  --danger: #a52f2f;
  --danger-soft: #fff0ef;
  --shadow: 0 12px 32px rgba(42, 24, 14, 0.06);
  --rail-width: 176px;
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 0.35em 0.55em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--purple-dark);
  font-size: 0.92em;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 8px;
  left: 8px;
  transform: translateY(-180%);
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
}

.skip-link:focus { transform: translateY(0); }

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

.brand-rail {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 28px 20px 22px;
  background: var(--orange);
  color: white;
}

.brand {
  display: grid;
  gap: 18px;
  color: white;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 128px;
  height: auto;
}

.brand span {
  font-family: "Centra", "Inter", sans-serif;
  font-size: 19px;
  line-height: 1.08;
}

.view-nav {
  display: grid;
  gap: 8px;
  margin-top: 62px;
}

.nav-button {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px 9px;
  background: transparent;
  color: white;
  cursor: pointer;
  text-align: left;
  font-weight: 720;
}

.nav-index {
  font-size: 10px;
  font-weight: 800;
  opacity: 0.7;
}

.nav-button:hover:not(:disabled),
.nav-button.is-active {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.rail-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: white;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.rail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14);
}

.app-stage { min-width: 0; }

.app-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px clamp(20px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.product-heading p,
.product-heading span { margin: 0; }

.product-heading p {
  font-family: "Centra", "Inter", sans-serif;
  font-size: 18px;
  line-height: 1.15;
}

.product-heading span {
  color: var(--muted);
  font-size: 12px;
}

.environment-labels {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.pill,
.status-badge,
.severity-badge,
.category-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 25px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.pill-safe,
.status-confirmed,
.status-complete,
.status-accepted,
.status-verified,
.status-released {
  border-color: #b3dcc5;
  background: var(--safe-soft);
  color: var(--safe);
}

.status-open,
.status-proposed,
.status-submitting,
.status-ambiguous {
  border-color: #efd28f;
  background: var(--warning-soft);
  color: var(--warning);
}

.status-dismissed,
.status-rejected {
  color: var(--muted);
  text-decoration: line-through;
}

.status-planned {
  border-color: #d6c0ee;
  background: var(--purple-soft);
  color: var(--purple);
}

.status-blocked {
  border-color: #efc5c2;
  background: var(--danger-soft);
  color: var(--danger);
}

.period-band {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(20px, 3vw, 48px);
  background: var(--orange);
  color: white;
}

.period-band div { display: grid; }
.period-band span { font-size: 11px; font-weight: 760; text-transform: uppercase; }
.period-band strong { font-family: "Centra", "Inter", sans-serif; font-size: 23px; line-height: 1.1; }
.period-band p { margin: 0; font-size: 12px; font-weight: 700; }

main {
  max-width: 1540px;
  margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 48px) 80px;
}

.view { padding-top: clamp(30px, 4vw, 54px); }

.page-heading,
.journey-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  margin-bottom: 28px;
}

.page-heading h1,
.journey-header h1 {
  max-width: 850px;
  margin: 5px 0 11px;
  font-family: "Centra", "Inter", sans-serif;
  font-size: clamp(35px, 4.2vw, 58px);
  line-height: 0.98;
}

.report-heading h1 { font-size: clamp(35px, 4vw, 52px); }

.lead {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 19px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 840;
  text-transform: uppercase;
}

.hero-actions,
.form-actions,
.journey-actions,
.report-links,
.review-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.journey-actions { justify-content: flex-end; }

.button,
.back-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 760;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: 0.52; }
.button-primary { background: var(--orange); color: white; }
.button-primary:hover:not(:disabled) { background: var(--orange-dark); }
.button-secondary { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) { border-color: var(--purple); color: var(--purple); }
.button-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.button-danger { border-color: #efc5c2; background: var(--danger-soft); color: var(--danger); }
.button-small { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.button-block { width: 100%; justify-content: center; }
.back-button {
  margin: 0 0 20px;
  border: 0;
  padding-left: 0;
  background: transparent;
  color: var(--purple);
}
.back-button::before { content: "← "; }

.notice {
  display: flex;
  gap: 8px;
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  background: var(--surface);
}
.notice-safe { border-left-color: var(--safe); background: var(--safe-soft); }
.notice-warning { border-left-color: var(--warning); background: var(--warning-soft); }
.notice-danger { border-left-color: var(--danger); background: var(--danger-soft); }

.panel,
.run-card,
.metric-grid,
.timeline-item,
.finding-card,
.action-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel { padding: clamp(19px, 2.2vw, 28px); }
.form-panel { margin: 26px 0 32px; box-shadow: var(--shadow); }

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(300px, 0.86fr);
  gap: 24px;
  margin-top: 28px;
  align-items: start;
}

.overview-main,
.overview-aside { min-width: 0; }
.overview-main { display: grid; gap: 26px; }
.overview-aside { position: sticky; top: 22px; display: grid; gap: 16px; }

.mailbox-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
}

.status-kicker {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
  text-transform: uppercase;
}

.status-light {
  width: 13px;
  height: 13px;
  border: 3px solid #d8f0e2;
  border-radius: 50%;
  background: var(--safe);
}

.mailbox-copy h2,
.mailbox-copy p { margin-top: 0; margin-bottom: 3px; }
.mailbox-copy h2 { font-family: "Centra", "Inter", sans-serif; font-size: 23px; line-height: 1.1; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 12px 0 14px;
}
.section-heading:first-child { margin-top: 0; }
.section-heading-compact { margin-bottom: 10px; }
.section-heading h2,
.section-heading h3 { margin: 2px 0 0; line-height: 1.15; }
.section-heading h2 { font-family: "Centra", "Inter", sans-serif; font-size: clamp(23px, 2.3vw, 31px); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}
.field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 720; }
.field-wide { grid-column: 1 / -1; }
.field input,
.field select,
.field textarea,
.category-control select,
.action-footer select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 9px 10px;
  background: white;
  color: var(--ink);
  font-weight: 520;
}
.field textarea { min-height: 82px; resize: vertical; }
.check-field { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.check-field input { width: 18px; height: 18px; accent-color: var(--orange); }
.month-filter { display: flex; align-items: end; gap: 9px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.metric-card {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}
.metric-card:last-child { border-right: 0; }
.metric-card strong {
  display: block;
  font-family: "Centra", "Inter", sans-serif;
  font-size: clamp(25px, 3vw, 35px);
  line-height: 1;
}
.metric-card span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }

.card-grid { display: grid; gap: 9px; }

.run-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 17px 18px;
}
.run-card:hover { border-color: #cdbbe1; box-shadow: 0 8px 22px rgba(101, 22, 193, 0.055); }
.run-identity { min-width: 0; }
.run-identity h3 { margin: 8px 0 3px; font-family: "Centra", "Inter", sans-serif; font-size: 19px; line-height: 1.15; }
.run-identity p { margin: 0; color: var(--muted); font-size: 12px; }
.run-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.run-counts { display: grid; grid-template-columns: repeat(3, 58px); gap: 7px; }
.run-counts div { padding: 7px 5px; border-left: 1px solid var(--line); text-align: center; }
.run-counts strong,
.run-counts small { display: block; }
.run-counts strong { font-family: "Centra", "Inter", sans-serif; font-size: 18px; }
.run-counts small { color: var(--muted); font-size: 10px; text-transform: uppercase; }

.action-panel { border-top: 5px solid var(--purple); }
.action-panel h2,
.guardrail-panel h2 {
  margin: 5px 0 15px;
  font-family: "Centra", "Inter", sans-serif;
  font-size: 25px;
  line-height: 1.08;
}

.process-list { display: grid; gap: 0; margin: 0 0 20px; padding: 0; list-style: none; }
.process-list li { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.process-list li > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 11px;
  font-weight: 820;
}
.process-list strong,
.process-list small { display: block; }
.process-list small { margin-top: 1px; color: var(--muted); }

.guardrail-panel { background: var(--purple); color: white; }
.guardrail-panel .eyebrow { color: #e5caff; }
.guardrail-panel p:last-child { margin-bottom: 0; color: rgba(255, 255, 255, 0.82); }

.journey-header { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.journey-header p { margin: 0; color: var(--muted); }
.context-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.context-grid .panel { height: 100%; }

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(330px, 0.78fr);
  gap: 20px;
  margin-top: 22px;
  align-items: start;
}
.workspace-stack { display: grid; gap: 16px; }
.workspace-grid > *, .workspace-stack > * { min-width: 0; }
.compact-panel { padding: 20px; }

.inline-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tool-form { padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.tool-form h3 { margin: 0 0 12px; font-family: "Centra", "Inter", sans-serif; font-size: 18px; }
.tool-form .field { margin-bottom: 10px; }

.timeline { display: grid; }
.timeline-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 13px;
  padding: 16px 0;
  border-width: 1px 0 0;
  border-radius: 0;
}
.timeline-item:first-child { border-top: 0; padding-top: 2px; }
.timeline-dot {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--purple);
  color: white;
  font-size: 9px;
  font-weight: 820;
}
.timeline-item-message .timeline-dot { background: var(--orange); color: white; }
.timeline-main h3 { margin: 4px 0; font-family: "Centra", "Inter", sans-serif; font-size: 17px; line-height: 1.2; }
.timeline-main p { margin: 4px 0; color: var(--muted); }
.timeline-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 11px; }
.message-body { margin-top: 10px; padding: 11px; border-left: 3px solid var(--orange); background: var(--surface-soft); color: var(--ink); white-space: pre-wrap; }
.snapshot { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.snapshot span { padding: 3px 6px; border-radius: 4px; background: var(--purple-soft); color: var(--purple-dark); font-size: 10px; }
.category-control { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.category-control select { max-width: 260px; min-height: 34px; }

.finding-list,
.action-list { display: grid; gap: 10px; }
.finding-card { padding: 15px; border-left: 4px solid var(--purple); background: #fdfbff; }
.finding-card h3,
.action-card h3 { margin: 8px 0 4px; font-family: "Centra", "Inter", sans-serif; font-size: 17px; line-height: 1.22; }
.finding-card p,
.action-card p { margin: 5px 0; color: var(--muted); }
.finding-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.severity-high { border-color: #efbbb7; background: var(--danger-soft); color: var(--danger); }
.severity-medium { border-color: #efd28e; background: var(--warning-soft); color: var(--warning); }
.severity-low,
.severity-info { border-color: #d6c0ee; background: var(--purple-soft); color: var(--purple); }
.evidence-list { margin: 9px 0 0; padding-left: 19px; color: var(--muted); font-size: 12px; }
.review-controls { display: grid; gap: 8px; margin-top: 12px; }
.review-controls textarea { min-height: 58px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px; }

.report-links { margin: 16px 0 24px; }
.severity-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; }
.severity-grid .metric-card { border: 1px solid var(--line); border-right: 0; background: var(--surface); }
.severity-grid .metric-card:last-child { border-right: 1px solid var(--line); }
.action-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 13px;
  padding: 18px;
}
.action-number { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--orange); color: white; font-family: "Centra", "Inter", sans-serif; }
.action-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; }
.action-footer select { max-width: 170px; min-height: 35px; }
.limitations { margin: 8px 0 0; padding-left: 19px; color: var(--muted); }

.empty-state { grid-column: 1 / -1; padding: 32px 22px; text-align: center; }
.empty-state h3 { margin: 0 0 5px; font-family: "Centra", "Inter", sans-serif; }
.empty-state p { max-width: 580px; margin: 0 auto; color: var(--muted); }
.muted { color: var(--muted); }

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: min(430px, calc(100vw - 40px));
  padding: 12px 15px;
  border-radius: 7px;
  background: var(--ink);
  color: white;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}
.toast.is-error { background: var(--danger); }

@media (max-width: 1120px) {
  :root { --rail-width: 148px; }
  .brand-rail { padding-inline: 16px; }
  .brand img { width: 112px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .environment-labels .pill:nth-last-child(-n + 2) { display: none; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .brand-rail {
    position: sticky;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    padding: 11px 16px;
  }
  .brand { display: flex; align-items: center; gap: 10px; }
  .brand img { width: 92px; }
  .brand span { display: none; }
  .view-nav { display: flex; flex: 1; justify-content: flex-end; gap: 4px; margin: 0; }
  .nav-button { width: auto; min-height: 38px; grid-template-columns: 1fr; padding: 7px 10px; }
  .nav-index { display: none; }
  .rail-foot { display: none; }
  .overview-grid,
  .workspace-grid { grid-template-columns: 1fr; }
  .overview-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .context-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-header { align-items: flex-start; padding: 12px 16px; }
  .product-heading span { display: none; }
  .environment-labels { max-width: 52%; }
  .environment-labels .pill:not(:first-child) { display: none; }
  .period-band { min-height: 58px; padding: 10px 16px; }
  .period-band p { display: none; }
  main { padding: 0 16px 64px; }
  .view { padding-top: 28px; }
  .page-heading,
  .journey-header { grid-template-columns: 1fr; align-items: start; gap: 18px; }
  .page-heading h1,
  .journey-header h1 { font-size: clamp(33px, 10vw, 46px); }
  .hero-actions,
  .journey-actions { justify-content: flex-start; }
  .overview-aside { grid-template-columns: 1fr; }
  .mailbox-panel { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .status-kicker { display: flex; justify-items: start; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card:nth-child(2) { border-right: 0; }
  .metric-card:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .run-card { grid-template-columns: 1fr; gap: 13px; }
  .run-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .run-counts div:first-child { border-left: 0; }
  .run-card .button { width: 100%; }
  .form-grid,
  .inline-forms { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .month-filter { width: 100%; align-items: end; }
  .month-filter .field { flex: 1; }
  .severity-grid { grid-template-columns: repeat(2, 1fr); }
  .severity-grid .metric-card:nth-child(2) { border-right: 1px solid var(--line); }
  .notice { display: grid; }
}

@media (max-width: 470px) {
  .brand-rail { display: grid; grid-template-columns: 88px minmax(0, 1fr); }
  .brand img { width: 82px; }
  .view-nav { justify-content: stretch; }
  .nav-button { flex: 1; justify-items: center; padding-inline: 5px; font-size: 11px; }
  .app-header { min-height: 58px; }
  .product-heading p { font-size: 15px; }
  .period-band strong { font-size: 20px; }
  .page-heading h1,
  .journey-header h1 { font-size: 36px; }
  .hero-actions .button,
  .journey-actions .button { width: 100%; }
  .month-filter { display: grid; }
  .month-filter .button { width: 100%; }
  .action-card { grid-template-columns: 32px 1fr; padding: 15px; }
  .action-number { width: 30px; height: 30px; }
}

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