:root {
  --ink: #171717;
  --muted: #667078;
  --paper: #F4F3F0;
  --panel: #FBFAF7;
  --panel-strong: #ECEBE7;
  --line: #D8D7D2;
  --line-strong: #AAA9A4;
  --navy: #193342;
  --navy-soft: #e9f0f2;
  --signal: #B8472F;
  --signal-soft: #fff0e9;
  --green: #2f7559;
  --green-soft: #e9f4ee;
  --amber: #855817;
  --amber-soft: #fff6df;
  --shadow: 0 18px 55px rgba(25, 36, 43, 0.09);
  --display: Didot, "Didot LT STD", "Bodoni MT", "Bodoni 72", "Hoefler Text", "Big Caslon", Georgia, serif;
  --textface: Charter, "Bitstream Charter", "Sitka Text", "Iowan Old Style", Cambria, Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(24, 33, 40, 0.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 40, 0.027) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: var(--textface);
}

button,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

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

a {
  color: inherit;
}

.app-header {
  display: flex;
  position: sticky;
  z-index: 10;
  top: 0;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(244, 243, 240, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--textface);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  width: 16px;
  height: 16px;
  border: 1px solid #8A8A86;
  border-radius: 50%;
  background: transparent;
}

.brand-mark::after {
  position: absolute;
  right: -4px;
  bottom: 1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.app-header nav {
  display: flex;
  gap: 22px;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 650;
  font-family: var(--textface);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.app-header nav a {
  color: var(--navy);
  text-underline-offset: 3px;
}

.privacy-state {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.06em;
}

.privacy-state::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 64px;
}

.console {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: enter 420ms ease-out both;
}

.console-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  padding: 28px 32px 24px;
}

.kicker,
.section-label,
.status-chip,
.source-mode,
.row-note,
.lane-name > span,
.comparison span,
.comparison time,
.timeline time,
.dialog-state {
  font-family: var(--mono);
}

.kicker {
  margin: 0 0 7px;
  color: var(--navy);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 5px;
  font-family: var(--display);
  font-size: clamp(2.15rem, 4vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
}

.console-intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.console-actions {
  display: flex;
  flex: none;
  gap: 9px;
}

.button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--navy);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 720;
}

.button.primary {
  color: white;
  background: var(--navy);
}

.button.secondary {
  color: var(--navy);
  background: transparent;
}

.button:hover {
  transform: translateY(-1px);
}

.source-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 42px;
  padding: 8px 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel-strong);
  font-size: 0.76rem;
}

.source-bar > div {
  display: flex;
  min-width: 0;
  gap: 12px;
  align-items: center;
}

.source-mode {
  flex: none;
  padding: 3px 7px;
  border-radius: 3px;
  color: var(--navy);
  background: var(--navy-soft);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  border-bottom: 1px solid var(--line);
}

.verdict-card,
.conflict-card {
  min-height: 255px;
  padding: 30px 32px;
}

.verdict-card {
  color: white;
  background: var(--navy);
}

.conflict-card {
  border-left: 1px solid var(--line);
  background: var(--signal-soft);
}

.conflict-card.resolved {
  background: var(--green-soft);
}

.section-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.conflict-card .section-label {
  color: #8a4c3d;
}

.conflict-card.resolved .section-label {
  color: var(--green);
}

.verdict {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(2.65rem, 5.2vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.verdict-card h2 {
  max-width: 560px;
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

.verdict-detail {
  margin: 0 0 22px;
  font-weight: 650;
}

.text-button,
.row-action {
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 720;
}

.text-button {
  color: white;
}

.comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  margin: 4px 0 28px;
}

.comparison > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.comparison span,
.comparison time {
  color: #845d53;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.comparison strong {
  font-family: var(--display);
  font-size: clamp(1.7rem, 3vw, 2.45rem);
}

.comparison-arrow {
  color: var(--signal) !important;
  font-family: inherit !important;
  font-size: 1.6rem !important;
}

.conflict-card > p {
  max-width: 480px;
  margin-bottom: 0;
  color: #69483f;
  line-height: 1.5;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.75fr);
}

.lane-panel,
.rule-panel {
  min-width: 0;
  padding: 28px 32px 32px;
}

.rule-panel {
  border-left: 1px solid var(--line);
  background: var(--panel-strong);
}

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

.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: -0.025em;
}

.panel-head > span {
  color: var(--muted);
  font-size: 0.75rem;
}

.lane-list {
  border-top: 1px solid var(--line);
}

.lane-row {
  display: grid;
  grid-template-columns: 10px minmax(170px, 1fr) auto 92px;
  gap: 13px;
  align-items: center;
  min-height: 70px;
  border-bottom: 1px solid var(--line);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.lane-row.healthy .status-dot {
  background: var(--green);
}

.lane-row.attention .status-dot,
.lane-row.missing .status-dot {
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(184, 71, 47, 0.12);
}

.lane-name {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.lane-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lane-name > span,
.row-note {
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.status-chip {
  padding: 4px 7px;
  border-radius: 3px;
  color: var(--muted);
  background: #ecebe5;
  font-size: 0.62rem;
  font-weight: 750;
  text-transform: uppercase;
}

.attention .status-chip,
.missing .status-chip {
  color: #9b3a27;
  background: var(--signal-soft);
}

.healthy .status-chip {
  color: var(--green);
  background: var(--green-soft);
}

.row-action {
  justify-self: end;
  color: var(--navy);
}

.row-note {
  justify-self: end;
}

.rule-list {
  display: grid;
  gap: 9px;
}

.rule {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  gap: 11px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.rule-mark {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
}

.rule.warn .rule-mark {
  background: var(--amber);
}

.rule.fail .rule-mark {
  background: var(--signal);
}

.rule strong {
  font-size: 0.8rem;
}

.rule p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.rule > span:last-child {
  color: var(--green);
  font-size: 0.65rem;
  font-weight: 750;
  text-transform: uppercase;
}

.rule.warn > span:last-child {
  color: var(--amber);
}

.rule.fail > span:last-child {
  color: var(--signal);
}

.timeline-panel {
  border-top: 1px solid var(--line);
  background: #fbfaf5;
}

.timeline-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px 32px;
  cursor: pointer;
  list-style: none;
}

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

.timeline-panel summary > span:first-child {
  display: grid;
  gap: 3px;
}

.timeline-panel summary strong {
  font-size: 0.9rem;
}

.timeline-panel summary > span:last-child {
  color: var(--muted);
  font-size: 0.75rem;
}

.timeline {
  margin: 0;
  padding: 0 32px 24px;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 150px 12px 1fr 70px;
  gap: 14px;
  align-items: center;
  min-height: 55px;
  border-top: 1px solid var(--line);
}

.timeline time {
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.timeline-mark {
  width: 8px;
  height: 8px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong);
  background: var(--navy);
}

.timeline li.receipt .timeline-mark {
  background: var(--green);
}

.timeline li > div {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.timeline li > div span {
  color: var(--muted);
  font-size: 0.75rem;
}

.search-panel {
  padding: 26px 32px 30px;
  border-top: 1px solid var(--line);
  background: var(--panel-strong);
}

.search-form {
  display: flex;
  gap: 9px;
}

.search-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  background: var(--panel);
}

.search-form input:focus {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.search-results {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 76px;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
}

.search-result > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.search-result > div span,
.empty-search {
  color: var(--muted);
  font-size: 0.75rem;
}

.search-result > div span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result .status-chip.valid {
  color: var(--green);
  background: var(--green-soft);
}

.search-result .status-chip.degraded,
.search-result .status-chip.invalid {
  color: #9b3a27;
  background: var(--signal-soft);
}

.empty-search {
  margin: 0;
  padding: 18px 0 4px;
}

.proof {
  margin-top: 34px;
  padding: 38px 40px 28px;
  border: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.72);
}

.proof-head {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 60px;
  align-items: end;
}

.proof-head h2 {
  max-width: 630px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.045em;
  line-height: 1;
}

.proof-search-link {
  justify-self: end;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 720;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.proof-head > p {
  margin-bottom: 3px;
  color: var(--muted);
  line-height: 1.55;
}

.proof-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 34px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.proof-metrics article {
  display: grid;
  gap: 6px;
  padding: 20px 18px 20px 0;
}

.proof-metrics a {
  display: grid;
  gap: 6px;
  text-decoration: none;
}

.proof-metrics article + article {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.proof-metrics strong {
  color: var(--navy);
  font-size: 0.88rem;
}

.proof-metrics span {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.proof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  padding: 34px 0 38px;
}

.proof-grid h3 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 1.55rem;
}

.proof-grid p,
.proof-grid li {
  color: var(--muted);
  line-height: 1.55;
}

.proof-grid ol {
  padding-left: 20px;
}

.proof-grid code {
  display: block;
  overflow-x: auto;
  margin-top: 20px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--navy);
  background: var(--panel);
  font-size: 0.75rem;
  white-space: nowrap;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}

footer > span:last-child {
  display: flex;
  gap: 18px;
}

footer a {
  color: var(--navy);
  font-weight: 720;
  text-underline-offset: 3px;
}

dialog {
  width: min(660px, calc(100% - 32px));
  max-height: min(780px, calc(100dvh - 40px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 30px 100px rgba(18, 27, 33, 0.28);
}

dialog::backdrop {
  background: rgba(19, 30, 37, 0.42);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  position: sticky;
  z-index: 1;
  top: 0;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.96);
}

.dialog-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.8rem;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  background: transparent;
  font-size: 1.35rem;
}

#evidence-content {
  padding: 24px 26px 30px;
  color: var(--muted);
  line-height: 1.55;
}

.dialog-state {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 8px;
  border-radius: 3px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.65rem;
  font-weight: 750;
  text-transform: uppercase;
}

.dialog-state.degraded,
.dialog-state.invalid {
  color: var(--signal);
  background: var(--signal-soft);
}

.dialog-summary {
  color: var(--ink);
  font-weight: 650;
}

.evidence-meta {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 7px 14px;
  margin: 24px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.evidence-meta dt {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 720;
}

.evidence-meta dd {
  margin: 0;
}

.evidence-section h3 {
  margin: 22px 0 8px;
  color: var(--ink);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.evidence-section ul {
  margin: 0;
  padding-left: 19px;
}

.evidence-section code {
  color: var(--navy);
  font-size: 0.73rem;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (max-width: 900px) {
  .status-grid,
  .workbench,
  .proof-head {
    grid-template-columns: 1fr;
  }

  .conflict-card,
  .rule-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .proof-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .proof-metrics article:nth-child(3) {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .proof-metrics article:nth-child(4) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 660px) {
  .app-header {
    min-height: 56px;
    padding: 0 14px;
  }

  .app-header nav a,
  .privacy-state {
    display: none;
  }

  .app-header nav .site-link {
    display: inline;
    font-size: 0;
  }

  .app-header nav .site-link::after {
    font-size: 0.72rem;
    content: "Antoine";
  }

  .privacy-state {
    font-size: 0.7rem;
  }

  main {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .console-head {
    display: block;
    padding: 23px 20px 20px;
  }

  .console-actions {
    margin-top: 20px;
  }

  .button {
    flex: 1;
  }

  .source-bar {
    display: block;
    padding: 11px 20px;
  }

  .source-bar > div {
    display: grid;
    gap: 7px;
  }

  .source-bar > span {
    display: block;
    margin-top: 7px;
  }

  .verdict-card,
  .conflict-card,
  .lane-panel,
  .rule-panel {
    min-height: 0;
    padding: 24px 20px;
  }

  .section-label {
    margin-bottom: 22px;
  }

  .comparison {
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
  }

  .comparison strong {
    overflow-wrap: anywhere;
  }

  .lane-row {
    grid-template-columns: 10px 1fr auto;
    gap: 10px;
    padding: 14px 0;
  }

  .lane-row .row-action,
  .lane-row .row-note {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .timeline-panel summary {
    padding: 14px 20px;
  }

  .timeline {
    padding: 0 20px 20px;
  }

  .timeline li {
    grid-template-columns: 12px 1fr auto;
    gap: 10px;
    padding: 12px 0;
  }

  .timeline time {
    grid-column: 2 / -1;
    grid-row: 1;
  }

  .timeline-mark {
    grid-column: 1;
    grid-row: 2;
  }

  .timeline li > div {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    gap: 3px;
  }

  .timeline .row-action {
    grid-column: 3;
    grid-row: 2;
  }

  .search-panel {
    padding: 24px 20px;
  }

  .search-form {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .search-result {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 13px 0;
  }

  .search-result .row-action {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .proof {
    padding: 28px 20px 22px;
  }

  .proof-head {
    gap: 18px;
  }

  .proof-search-link {
    justify-self: start;
    margin: 0;
  }

  .proof-metrics,
  .proof-grid {
    grid-template-columns: 1fr;
  }

  .proof-metrics article,
  .proof-metrics article + article,
  .proof-metrics article:nth-child(3) {
    padding: 15px 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .proof-metrics article:first-child {
    border-top: 0;
  }

  .proof-grid {
    gap: 24px;
    padding-bottom: 28px;
  }

  footer {
    display: grid;
  }

  .dialog-head,
  #evidence-content {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
