@font-face {
  font-family: "Oswald";
  src: url("../fonts/brand/Oswald-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/brand/PlusJakartaSans-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f4f7fa;
  --ink: #283646;
  --muted: #5b6878;
  --line: #d5dee6;
  --accent: #0e5a8f;
  --card: #ffffff;
  --font-body: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-title: "Oswald", "Arial Narrow", sans-serif;
  /* Shared page wash from Bill by Email: brand ribbons on a near-white gradient.
     Applied via body::before (fixed layer), never background-attachment: fixed. */
  --brand-wash-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 900' preserveAspectRatio='xMidYMid slice'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%2312b88f'/%3E%3Cstop offset='.45' stop-color='%2316b99f'/%3E%3Cstop offset='.8' stop-color='%2319baab'/%3E%3Cstop offset='1' stop-color='%231dbabd'/%3E%3C/linearGradient%3E%3Cfilter id='b' x='-20%25' y='-40%25' width='140%25' height='180%25'%3E%3CfeGaussianBlur stdDeviation='26'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='none' stroke='url%28%23g%29' stroke-linecap='round'%3E%3Cg filter='url%28%23b%29' opacity='.42'%3E%3Cpath stroke-width='130' d='M350 -160 C 800 -60, 1150 220, 1500 330 S 1800 520, 1950 600'/%3E%3Cpath stroke-width='120' d='M-250 620 C 150 660, 480 860, 820 1080'/%3E%3C/g%3E%3Cg opacity='.2'%3E%3Cpath stroke-width='1.5' d='M 350 -90 C 800 10 1150 290 1500 400 S 1800 590 1950 670'/%3E%3Cpath stroke-width='1.5' d='M 350 -70 C 800 30 1150 310 1500 420 S 1800 610 1950 690'/%3E%3Cpath stroke-width='1.5' d='M -250 560 C 150 600 480 800 820 1020'/%3E%3Cpath stroke-width='1.5' d='M -250 580 C 150 620 480 820 820 1040'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  --brand-wash-gradient: linear-gradient(160deg, #f8fbfa 0%, #f1f7f6 55%, #e6f2f0 100%);
  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

/* Fixed wash layer (shared by dashboard, Bill by Email, Receipt by Paper).
   A fixed *layer* is painted once; background-attachment: fixed is not. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    var(--brand-wash-image) center / cover no-repeat,
    var(--brand-wash-gradient);
}

@media (prefers-reduced-transparency: reduce) {
  body::before {
    content: none;
  }
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-wordmark {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 2.25rem;
  white-space: nowrap;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem 1.1rem;
  margin: 0;
  min-height: 2.25rem;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  margin: 0;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 1;
  min-height: 2.25rem;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.75rem 1rem 0.85rem;
  }

  .site-header nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    justify-items: start;
    gap: 0.1rem 0.75rem;
    width: 100%;
    min-height: 0;
  }

  .site-header nav a {
    font-size: 0.875rem;
    min-height: 2rem;
  }

  .site-main {
    margin-top: 1.25rem;
    padding: 0 1rem;
  }
}

.site-main {
  max-width: 52rem;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.site-main.page-wide {
  max-width: 72rem;
}

.messages {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.messages li {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
}

.messages .error {
  color: #8a2b2b;
}

.timeline {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.timeline-step {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  text-align: center;
  color: var(--muted);
  background: #fff;
  white-space: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
  position: relative;
}

.timeline-step a {
  color: inherit;
  text-decoration: none;
}

/* Stretch the link over the whole step, so the full pill is clickable. */
.timeline-step a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.timeline-step.is-done {
  color: var(--accent);
  background: #e3f6f6;
  border-color: #1dbabd;
}

.timeline-step.is-current:not(.is-viewing) {
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--accent);
  background: #fff;
}

.timeline-step.is-viewing {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.phase-index {
  display: inline-block;
  margin-right: 0.35rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
}

h1,
h2 {
  font-family: var(--font-title);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

h1 {
  margin-top: 0;
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.1;
}

h2 {
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.2;
}

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

button,
.button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

textarea,
input[type="file"] {
  width: 100%;
  margin: 0.75rem 0;
}

textarea {
  min-height: 12rem;
  font: inherit;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}

label {
  display: block;
  margin-top: 0.75rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  margin: 0.35rem 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: #fff;
}

.card + .card {
  margin-top: 1rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0.5rem;
  vertical-align: top;
}

ul.plain {
  list-style: none;
  padding: 0;
}

ul.plain li {
  margin: 0.75rem 0;
}

ul.plain form {
  display: inline;
  margin-left: 0.75rem;
}

.error {
  color: #8a2b2b;
}

.pre {
  white-space: pre-wrap;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.file-row input[type="file"] {
  flex: 1;
}

.intake-form button[data-continue]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.messages .warning {
  color: #7a5a12;
}

button.secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.actions {
  margin: 0.75rem 0;
}

.guide-section + .guide-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.guide-person {
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.5rem 1rem;
  background: #fff;
}

.guide-person > summary {
  cursor: pointer;
  font-weight: 600;
}

.callout {
  border-left: 3px solid var(--accent);
  background: #e3f6f6;
  padding: 0.6rem 0.8rem;
}

.callout-warn {
  border-left-color: #7a5a12;
  background: #fbf3e0;
  margin: 0.75rem 0;
}

.callout-warn ul {
  margin: 0.35rem 0 0;
}

.probe,
.guide-fold {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  margin: 0.6rem 0;
}

.guide-fold > summary,
.guide-drafts > summary {
  cursor: pointer;
  font-weight: 600;
}

.guide-fold[open] > summary {
  margin-bottom: 0.5rem;
}

.guide-drafts {
  margin: 1rem 0 0.5rem;
  color: var(--muted);
}

.guide-drafts[open] {
  color: inherit;
}

.guide-task dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 0.75rem;
}

.guide-task dt {
  color: var(--muted);
}

.guide-task dd {
  margin: 0;
}

.badge {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  background: #fff;
}

.badge-critical {
  color: #fff;
  background: #8a2b2b;
  border-color: #8a2b2b;
}

.badge-high {
  color: #8a2b2b;
  border-color: #d9b3b3;
}

.badge-medium {
  color: #7a5a12;
  border-color: #e0cf9f;
}

.badge-low {
  color: var(--accent);
  border-color: #1dbabd;
}

/* Guide tabs: CSS only. Each radio input shows the panel with the same name. */
.guide-tabs {
  position: relative;
  margin: 0.75rem 0 1rem;
}

.guide-tabs > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.guide-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.guide-tab-bar label {
  margin: 0 0 -1px;
  padding: 0.4rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  cursor: pointer;
}

.guide-tab-bar label:hover {
  color: var(--accent);
}

.guide-tab-panel {
  display: none;
  padding-top: 0.75rem;
}

.tab-overview:checked ~ .guide-tab-bar .label-overview,
.tab-tools:checked ~ .guide-tab-bar .label-tools,
.tab-probes:checked ~ .guide-tab-bar .label-probes,
.tab-interview:checked ~ .guide-tab-bar .label-interview,
.tab-shadowing:checked ~ .guide-tab-bar .label-shadowing {
  color: var(--accent);
  font-weight: 600;
  background: #fff;
  border-color: var(--line);
  border-bottom-color: #fff;
}

.tab-overview:focus-visible ~ .guide-tab-bar .label-overview,
.tab-tools:focus-visible ~ .guide-tab-bar .label-tools,
.tab-probes:focus-visible ~ .guide-tab-bar .label-probes,
.tab-interview:focus-visible ~ .guide-tab-bar .label-interview,
.tab-shadowing:focus-visible ~ .guide-tab-bar .label-shadowing {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tab-overview:checked ~ .panel-overview,
.tab-tools:checked ~ .panel-tools,
.tab-probes:checked ~ .panel-probes,
.tab-interview:checked ~ .panel-interview,
.tab-shadowing:checked ~ .panel-shadowing {
  display: block;
}

/* Stage 2 "By subject" view: same tab technique, its own five tabs. */
.guide-subjects {
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.5rem 1rem;
  background: #fff;
}

.guide-subjects > summary {
  cursor: pointer;
  font-weight: 600;
}

.tab-subject-flags:checked ~ .guide-tab-bar .label-subject-flags,
.tab-subject-probes:checked ~ .guide-tab-bar .label-subject-probes,
.tab-subject-tools:checked ~ .guide-tab-bar .label-subject-tools,
.tab-subject-automation:checked ~ .guide-tab-bar .label-subject-automation,
.tab-subject-shadowing:checked ~ .guide-tab-bar .label-subject-shadowing {
  color: var(--accent);
  font-weight: 600;
  background: #fff;
  border-color: var(--line);
  border-bottom-color: #fff;
}

.tab-subject-flags:focus-visible ~ .guide-tab-bar .label-subject-flags,
.tab-subject-probes:focus-visible ~ .guide-tab-bar .label-subject-probes,
.tab-subject-tools:focus-visible ~ .guide-tab-bar .label-subject-tools,
.tab-subject-automation:focus-visible ~ .guide-tab-bar .label-subject-automation,
.tab-subject-shadowing:focus-visible ~ .guide-tab-bar .label-subject-shadowing {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tab-subject-flags:checked ~ .panel-subject-flags,
.tab-subject-probes:checked ~ .panel-subject-probes,
.tab-subject-tools:checked ~ .panel-subject-tools,
.tab-subject-automation:checked ~ .panel-subject-automation,
.tab-subject-shadowing:checked ~ .panel-subject-shadowing {
  display: block;
}

.who {
  display: inline-block;
  border-radius: 4px;
  padding: 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--accent);
  background: #e3f6f6;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Bill by Email demo */
.walkthrough-steps {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.walkthrough-step {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  background: #fff;
}

.walkthrough-step.is-done {
  border-color: #1dbabd;
  background: #f3f7fa;
}

.walkthrough-step.is-current {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.walkthrough-step-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.walkthrough-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

.walkthrough-step.is-done .walkthrough-num {
  background: #1f87b3;
}

.billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.inline-form {
  display: inline;
}

.reject-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  flex: 1 1 16rem;
}

.reject-form label {
  flex: 1 1 100%;
  margin-top: 0;
}

.reject-form input[type="text"] {
  flex: 1 1 12rem;
  margin: 0;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 1rem;
}

.filter-chip {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  color: var(--muted);
  text-decoration: none;
  background: #fff;
  font-size: 0.9rem;
}

.filter-chip:hover {
  color: var(--accent);
  border-color: #1dbabd;
}

.filter-chip.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.billing-table .badge {
  margin-left: 0.25rem;
}

.badge-needs_review,
.badge-rejected {
  color: #8a2b2b;
  border-color: #d9b3b3;
  background: #faf2f2;
}

.badge-awaiting_ceo {
  color: #7a5a12;
  border-color: #e0cf9f;
  background: #fbf7eb;
}

.badge-approved,
.badge-paid,
.badge-routed,
.badge-checked {
  color: var(--accent);
  border-color: #1dbabd;
  background: #e3f6f6;
}

.badge-ingested,
.badge-extracting {
  color: var(--muted);
}

.callout-error {
  border-left: 3px solid #8a2b2b;
  background: #faf2f2;
  padding: 0.75rem 0.9rem;
  margin: 0.75rem 0 0;
}

.callout-error p {
  margin: 0.35rem 0 0;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.preview-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.preview-frame {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0.85rem 1rem;
  min-height: 10rem;
}

.mock-doc header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.mock-doc table {
  width: 100%;
  margin: 0.5rem 0;
}

.mock-unreadable {
  background: #faf2f2;
}

.billing-fields {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  margin: 0.5rem 0 1rem;
}

.billing-fields dt {
  color: var(--muted);
}

.billing-fields dd {
  margin: 0;
}

.event-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.event-timeline li {
  border-left: 2px solid var(--line);
  padding: 0 0 1rem 1rem;
  margin-left: 0.35rem;
}

.event-timeline li:last-child {
  padding-bottom: 0;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.event-timeline p {
  margin: 0;
}

a.button {
  display: inline-block;
  text-decoration: none;
  line-height: 1.25;
}

a.button.secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
}
