:root {
    --paper: #eff3ec;
    --paper-deep: #e4ebe1;
    --ink: #1d2a23;
    --ink-soft: #52655b;
    --green: #1e6b4e;
    --green-dark: #185a41;
    --green-soft: #d7e8de;
    --red: #b23a2a;
    --red-soft: #f3ddd8;
    --manila: #eae0c9;
    --manila-edge: #d9cba6;
    --rule: #c9d6cc;
    --drop-edge: #9db8a8;
    --white: #fbfcfa;
  }

  * { box-sizing: border-box; }
  html { color-scheme: light; }
  body {
    margin: 0;
    min-width: 320px;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.55 "Public Sans", -apple-system, "Segoe UI", sans-serif;
  }
  button, input { font: inherit; }
  button { touch-action: manipulation; }
  a { color: var(--green); }
  :focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 3px;
    border-radius: 4px;
  }

  .shell { width: min(100% - 32px, 760px); margin: 0 auto; }
  .site-header {
    border-bottom: 1px solid var(--rule);
    background: rgba(251, 252, 250, .72);
  }
  .site-header .shell {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .brand {
    color: var(--ink);
    text-decoration: none;
    font: 700 18px/1.1 "Bitter", Georgia, serif;
  }
  .brand .tick { color: var(--green); }
  .demo-badge {
    flex: none;
    padding: 5px 9px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    color: var(--ink-soft);
    background: var(--white);
    font: 600 11px/1.2 "IBM Plex Mono", ui-monospace, monospace;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  main { padding: 28px 0 52px; }
  .context {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
    padding: 12px 14px;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--paper-deep);
    color: var(--ink-soft);
    font-size: 13px;
  }
  .context-mark {
    flex: none;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--green);
    color: var(--white);
    font-weight: 700;
  }
  .context strong { color: var(--ink); }
  .context code {
    display: block;
    margin-top: 2px;
    overflow-wrap: anywhere;
    color: var(--green);
    font: 12px/1.45 "IBM Plex Mono", ui-monospace, monospace;
  }

  h1, h2, h3 { font-family: "Bitter", Georgia, serif; line-height: 1.15; }
  h1 { margin: 0; font-size: clamp(30px, 9vw, 46px); }
  h2 { margin: 0; font-size: 21px; }
  h3 { margin: 0; font-size: 17px; }
  .lede { margin: 14px 0 26px; color: var(--ink-soft); font-size: 17px; }

  .card {
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--white);
  }
  .card-head { display: flex; align-items: flex-start; gap: 12px; }
  .step-number {
    flex: none;
    min-width: 32px;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--green);
    color: var(--white);
    text-align: center;
    font: 600 12px/1.2 "IBM Plex Mono", ui-monospace, monospace;
  }
  .card-copy { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; }

  .sample-list, .selected-list, .result-list {
    list-style: none;
    margin: 18px 0;
    padding: 0;
  }
  .sample-file, .selected-file {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 14px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--rule);
  }
  .sample-file:first-child, .selected-file:first-child { border-top: 1px dashed var(--rule); }
  .filename {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
    text-decoration-color: var(--rule);
    text-underline-offset: 3px;
    font: 600 13px/1.4 "IBM Plex Mono", ui-monospace, monospace;
  }
  .file-note { color: var(--ink-soft); font-size: 12px; }
  .sample-pill {
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--manila);
    color: #5b503b;
    font: 600 11px/1.3 "IBM Plex Mono", ui-monospace, monospace;
  }

  .button-row { display: grid; gap: 10px; }
  .btn {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 7px;
    padding: 12px 18px;
    background: var(--green);
    color: var(--white);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .18);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
  }
  .btn:hover { background: var(--green-dark); }
  .btn.secondary {
    border: 1px solid var(--rule);
    background: var(--white);
    color: var(--ink);
    box-shadow: none;
  }
  .btn.secondary:hover { background: var(--paper-deep); }
  .btn.text {
    min-height: 44px;
    padding: 8px 12px;
    background: transparent;
    color: var(--green);
    box-shadow: none;
  }
  .btn:disabled { opacity: .55; cursor: wait; }

  .or {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--ink-soft);
    font: 12px/1.3 "IBM Plex Mono", ui-monospace, monospace;
    text-transform: uppercase;
  }
  .or::before, .or::after { content: ""; height: 1px; background: var(--rule); }

  .dropzone {
    padding: 28px 18px;
    border: 2px dashed var(--drop-edge);
    border-radius: 10px;
    /* The card's own paper, not the page's — a page-coloured fill read as a hole. */
    background: var(--white);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
  }
  .dropzone.is-over { border-color: var(--green); background: var(--green-soft); }
  .dropzone.is-disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
  }
  .drop-icon { display: block; margin-bottom: 6px; font-size: 30px; line-height: 1; }
  .drop-title { font-weight: 600; }
  .drop-hint { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 13px; }
  .chooser-row { display: grid; gap: 10px; margin-top: 12px; }
  .limit-note { margin: 12px 0 0; color: var(--ink-soft); text-align: center; font-size: 12px; }
  /* Closing offer. The demo's last card carries the price and the pilot,
     because a visitor who arrived straight on this link has seen neither. */
  .offer-card {
    border-color: var(--green);
    background: linear-gradient(var(--green-soft), var(--white) 120px);
  }
  .offer-card .button-row { margin-top: 18px; }
  .offer-price {
    margin: 12px 0 0;
    color: var(--ink);
    font-size: 15px;
  }
  .offer-price strong {
    font-size: 19px;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
  }
  .lead-form { margin: 18px 0 0; }
  .lead-label {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
  }
  .lead-row { display: grid; gap: 10px; }
  .lead-input {
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid var(--rule);
    border-radius: 7px;
    background: var(--white);
    color: var(--ink);
    font: 400 16px/1.3 inherit;
  }
  .lead-input:focus-visible { outline: 3px solid var(--green); outline-offset: 1px; }
  .lead-input:disabled { background: var(--paper-deep); color: var(--ink-soft); }
  .lead-message { margin: 10px 0 0; min-height: 19px; font-size: 13px; }
  .lead-message[data-tone="ok"] { color: var(--green); font-weight: 600; }
  .lead-message[data-tone="error"] { color: var(--red); }
  .lead-message[data-tone="pending"] { color: var(--ink-soft); }
  @media (min-width: 560px) {
    .lead-row { grid-template-columns: minmax(0, 1fr) auto; }
    .lead-row .btn { width: auto; }
  }

  .offer-fallback { margin: 14px 0 0; color: var(--ink-soft); font-size: 13px; }
  .offer-fallback .mono {
    color: var(--ink);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    user-select: all;
  }
  .copy-email {
    margin-left: 6px;
    padding: 4px 9px;
    border: 1px solid var(--rule);
    border-radius: 5px;
    background: var(--white);
    color: var(--green);
    cursor: pointer;
    font: 600 12px/1 "IBM Plex Mono", ui-monospace, monospace;
  }
  .copy-email:hover { background: var(--green-soft); }

  .privacy-note {
    margin: 16px 0 0;
    color: var(--ink-soft);
    font-size: 12px;
  }
  .privacy-note strong { color: var(--ink); }
  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .feedback {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 7px;
    background: var(--paper-deep);
    color: var(--ink-soft);
    font-size: 13px;
  }
  .feedback.error { background: var(--red-soft); color: var(--red); }

  .progress-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }
  .timer { color: var(--ink-soft); font: 12px/1.4 "IBM Plex Mono", ui-monospace, monospace; }
  .month-group { margin-top: 20px; }
  .month-group:first-of-type { margin-top: 0; }
  .month-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--ink);
  }
  .month-title span { color: var(--ink-soft); font: 12px/1.4 "IBM Plex Mono", ui-monospace, monospace; }
  .result-list { margin-top: 0; }
  .result-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
  }
  .result-vendor { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
  .result-amount { white-space: nowrap; font: 600 13px/1.5 "IBM Plex Mono", ui-monospace, monospace; }
  .result-meta { min-width: 0; color: var(--ink-soft); font-size: 12px; overflow-wrap: anywhere; }
  .status {
    justify-self: end;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 11px;
    font-weight: 600;
  }
  .status.pending { background: var(--paper-deep); color: var(--ink-soft); }
  .status.review { background: var(--red-soft); color: var(--red); }
  .done-copy { margin: 8px 0 18px; color: var(--ink-soft); }

  .status.fixed { background: var(--manila); color: #5b503b; }
  .result-actions { grid-column: 1 / -1; }
  .fix-toggle {
    border: 0;
    padding: 2px 0;
    background: transparent;
    color: var(--green);
    font: 600 12px/1.4 "IBM Plex Mono", ui-monospace, monospace;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .fix-editor {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
    margin-top: 10px;
    padding: 14px;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--paper);
  }
  .fix-grid { display: grid; gap: 10px; }
  .fix-editor label { display: grid; gap: 4px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
  .fix-editor input, .fix-editor select, .fix-editor textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: var(--white);
    color: var(--ink);
    font-size: 14px;
  }
  .fix-editor textarea { resize: vertical; min-height: 64px; }
  .fix-actions { display: flex; flex-wrap: wrap; gap: 10px; }
  .fix-actions .btn { width: auto; min-height: 40px; padding: 8px 14px; }

  .rule-list { list-style: none; margin: 14px 0 0; padding: 0; }
  .rule-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--rule);
  }
  .rule-item:first-child { border-top: 1px dashed var(--rule); }
  .rule-title { min-width: 0; overflow-wrap: anywhere; font-weight: 600; font-size: 14px; }
  .rule-desc { grid-column: 1; color: var(--ink-soft); font-size: 12px; overflow-wrap: anywhere; }
  .rule-delete {
    align-self: start;
    border: 0;
    padding: 2px 0;
    background: transparent;
    color: var(--red);
    font: 600 12px/1.4 "IBM Plex Mono", ui-monospace, monospace;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .bk-scroll { overflow-x: auto; }
  .bk-table { width: 100%; min-width: 520px; border-collapse: collapse; margin: 6px 0 4px; font-size: 13px; }
  .bk-table th {
    padding: 6px;
    border-bottom: 1px solid var(--rule);
    color: var(--ink-soft);
    text-align: left;
    font: 600 11px/1.4 "IBM Plex Mono", ui-monospace, monospace;
    letter-spacing: .03em;
    text-transform: uppercase;
  }
  .bk-table td { padding: 8px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; }
  .bk-table .bk-amount { text-align: right; white-space: nowrap; font: 600 13px/1.5 "IBM Plex Mono", ui-monospace, monospace; }
  .bk-table tr.bk-checked td { opacity: .55; }
  .bk-muted { color: var(--ink-soft); }
  .bk-review { color: var(--red); font-weight: 600; }

  .page-footer {
    padding: 24px 0 36px;
    border-top: 1px solid var(--rule);
    color: var(--ink-soft);
    font-size: 12px;
    text-align: center;
  }

  [hidden] { display: none !important; }

  @media (min-width: 620px) {
    .shell { width: min(100% - 48px, 760px); }
    main { padding-top: 42px; }
    .card { padding: 26px; }
    .button-row, .chooser-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sample-card .button-row { grid-template-columns: minmax(0, 1fr); }
    .done-card-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .offer-card-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dropzone { padding: 40px 24px; }
    .fix-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fix-grid .full { grid-column: 1 / -1; }
  }

  @media (prefers-reduced-motion: reduce) {
    .dropzone { transition: none; }
  }
