:root {
  color-scheme: light;
  --bg: #f7faf8;
  --surface: #ffffff;
  --surface-soft: #eef8f5;
  --ink: #102027;
  --muted: #5b6d72;
  --line: #dbe8e4;
  --teal: #006d67;
  --teal-strong: #00524f;
  --teal-soft: #e2f3ef;
  --amber: #9b5a00;
  --amber-soft: #fff4df;
  --red: #b42318;
  --red-soft: #ffe8e4;
  --green: #20734a;
  --green-soft: #e6f5eb;
  --shadow: 0 18px 40px rgba(16, 32, 39, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 250, 248, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.95rem;
}

main {
  padding: 24px clamp(12px, 3vw, 32px) 0;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(320px, 0.86fr) minmax(420px, 1.14fr);
  align-items: start;
  gap: 16px;
  max-width: 1680px;
  margin: 0 auto;
}

.side-rail,
.workspace-panel,
.review-panel {
  min-width: 0;
}

.rail-card,
.workspace-panel,
.review-card,
.letter-card,
.privacy-box,
.monetization-card,
.attorney-card,
.confirm-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.rail-card {
  padding: 22px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(1.55rem, 2.5vw, 2.35rem);
  line-height: 1.08;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.18rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.steps {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 16px 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.steps span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-weight: 800;
  grid-row: span 2;
}

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

.privacy-box {
  padding: 16px;
  background: var(--surface-soft);
}

.privacy-box p {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.workspace-panel,
.review-panel {
  display: grid;
  gap: 14px;
}

.workspace-panel {
  padding: 16px;
}

.toolbar,
.section-heading,
.metric-row,
.button-row,
.action-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  font-weight: 800;
}

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

.primary-button:hover {
  background: var(--teal-strong);
}

.secondary-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.ghost-button {
  border-color: var(--line);
  background: transparent;
  color: var(--teal);
}

.full-width {
  width: 100%;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 28px;
  border: 1.5px dashed var(--teal);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f6fbf9);
  text-align: center;
}

.dropzone.is-dragging {
  background: var(--teal-soft);
  outline: 3px solid rgba(0, 109, 103, 0.16);
}

.file-icon {
  display: grid;
  width: 64px;
  height: 74px;
  place-items: center;
  margin-bottom: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--teal);
  font-weight: 900;
}

.dropzone p {
  max-width: 420px;
  margin: 0 auto 18px;
}

.paste-box {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
}

textarea:focus,
input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(0, 109, 103, 0.14);
}

.status-strip,
.runtime-strip {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.runtime-strip {
  background: #fbfcfa;
}

.status-strip span,
.runtime-strip span {
  color: var(--muted);
  font-size: 0.85rem;
}

.confirm-panel {
  padding: 16px;
}

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

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

.field-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.field-wide {
  grid-column: 1 / -1;
}

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

.metric-row div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-row strong {
  display: block;
  font-size: 1.5rem;
}

.metric-row span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.review-card,
.letter-card {
  padding: 16px;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

th {
  background: #f2f7f5;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td input {
  min-width: 96px;
  padding: 8px;
}

td strong,
td span {
  display: block;
}

td span {
  color: var(--muted);
  font-size: 0.78rem;
}

.row-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--red);
  font-weight: 800;
}

.empty-row,
.soft-empty {
  color: var(--muted);
  text-align: center;
}

.soft-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.severity {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.severity-ok,
.severity-low {
  background: var(--green-soft);
  color: var(--green);
}

.severity-medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.severity-high {
  background: var(--red-soft);
  color: var(--red);
}

.flags-list {
  display: grid;
  gap: 10px;
}

.flag-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.flag-card h3 {
  margin-top: 8px;
}

.flag-card p {
  margin-bottom: 0;
}

.flag-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.flag-card li span {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.severity-border-high {
  border-color: rgba(180, 35, 24, 0.45);
}

.severity-border-medium {
  border-color: rgba(155, 90, 0, 0.45);
}

.action-grid {
  align-items: stretch;
}

.monetization-card,
.attorney-card {
  flex: 1;
  padding: 16px;
}

.attorney-card {
  border-color: rgba(180, 35, 24, 0.35);
  background: #fff8f7;
}

.monetization-card p,
.attorney-card p {
  margin-bottom: 12px;
}

.letter-card pre {
  min-height: 360px;
  max-height: 620px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfa;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
}

.fine-print {
  margin: 10px 0 0;
  font-size: 0.84rem;
}

.content-band {
  display: grid;
  grid-template-columns: minmax(240px, 420px) 1fr;
  gap: 24px;
  max-width: 1320px;
  margin: 28px auto 0;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.content-copy h2,
.split-band h2 {
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.code-grid a {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.code-grid a:hover {
  border-color: var(--teal);
  text-decoration: none;
}

.code-grid span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-weight: 900;
}

.code-grid small {
  color: var(--muted);
}

.split-band {
  align-items: start;
}

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

.principles article {
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 36px;
  padding: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.seo-page,
.mockup-page {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 28px 0 0;
}

.breadcrumbs {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.seo-hero {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.seo-hero h1,
.seo-article h1 {
  max-width: 820px;
}

.seo-hero p,
.seo-article .lede {
  max-width: 760px;
  font-size: 1.06rem;
}

.seo-hero .primary-button,
.seo-cta .primary-button {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.code-card {
  display: grid;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.code-card:hover {
  border-color: var(--teal);
  text-decoration: none;
}

.code-card span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-weight: 900;
}

.code-card p {
  margin: 0;
  font-size: 0.94rem;
}

.seo-article {
  display: grid;
  gap: 18px;
}

.seo-article section,
.seo-cta {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.seo-article ul {
  margin-bottom: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
}

.note {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
}

.seo-cta {
  background: var(--surface-soft);
}

.mockup-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.mockup-grid figure {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.mockup-grid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.mockup-grid figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.94rem;
}

@media (max-width: 1360px) {
  .app-shell {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }

  .review-panel {
    grid-column: 1 / -1;
  }
}

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

  .side-rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
    gap: 14px;
  }

  .steps {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .site-header,
  nav,
  .toolbar,
  .section-heading,
  .button-row,
  .action-grid,
  .side-rail,
  .content-band,
  .principles {
    display: grid;
    grid-template-columns: 1fr;
  }

  .site-header {
    position: static;
  }

  nav {
    gap: 10px;
  }

  main {
    padding-inline: 10px;
  }

  .dropzone {
    min-height: 240px;
    padding: 20px;
  }

  .field-grid,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .content-band {
    margin-top: 20px;
  }
}

/* Payments-per-claim rows (rebuilt claim model) */
.payments-cell { min-width: 320px; }
.payment-line { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.payment-line input { max-width: 110px; }
.pay-decoded { font-size: 0.78rem; opacity: 0.75; white-space: nowrap; }
.flag-citation { display: block; font-size: 0.78rem; margin-top: 2px; }

/* --- design pass: match the product mockups ------------------------------ */

.browser-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-strong);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark svg {
  display: block;
}

/* stepper: round markers with a connector line between steps */
.steps span {
  border-radius: 50%;
}

.steps li {
  position: relative;
}

.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 28px;
  bottom: -13px;
  width: 2px;
  height: 13px;
  background: var(--line);
}

.steps li:first-child span {
  background: var(--teal);
  color: #fff;
}

.doc-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 84px;
  margin-bottom: 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--teal);
  box-shadow: 0 6px 16px rgba(16, 32, 39, 0.06);
}

.drop-hint {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.tips-box {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 0.9rem;
}

.tips-box strong {
  display: block;
  margin-bottom: 8px;
}

.tips-box ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.tips-box li {
  padding-left: 22px;
  position: relative;
}

.tips-box li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2320734a' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4 10-10'/%3E%3C/svg%3E");
  background-size: 9px;
  background-position: center;
  background-repeat: no-repeat;
}

.attorney-points {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.9rem;
}

.attorney-points li {
  padding-left: 20px;
  position: relative;
}

.attorney-points li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 900;
}

.attorney-card a {
  display: block;
  font-weight: 700;
}

.attorney-card a.soft-link {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.mail-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--teal-strong);
  font-size: 0.88rem;
}

.mail-note svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.mail-note span {
  color: var(--muted);
}

.mail-note strong {
  color: var(--ink);
}

/* confirmed state on the human-confirmation gate */
#confirm-values.is-confirmed {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* tighter payment rows so the table fits without truncation */
.payment-line input[data-pfield="amount"] { max-width: 88px; }
.payment-line input[data-pfield="lossTypeRaw"] { max-width: 150px; }
.payment-line input[data-pfield="status"] { max-width: 100px; }
.payment-line input { font-size: 0.85rem; padding: 7px 8px; }

/* flag card icon */
.flag-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
}

.severity-border-high .flag-icon { background: var(--red-soft); color: var(--red); }
.severity-border-medium .flag-icon { background: var(--amber-soft); color: var(--amber); }
.flag-card .flag-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .browser-pill { display: none; }
}
