/* Hallmark · shape: app screen · genre: modern-minimal · theme: Furrow (deal 2/3, seed invoice-automation-demo-tool-a418·a9a90ed7·2026-11-06·r0)
 * nav: top bar, wordmark + title + one quiet action · signature: the extracted invoice as a notebook record card · states: empty, loading, error, full
 * axes: light/grotesk-sans/warm · posture: committed · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V4 · weakest: E, the wait is 10 to 40 s, so the loading state names the file and counts seconds instead of faking step progress */
@import url("./tokens.css");
@import url("./base.css");

@font-face { font-family: "Red Hat Display"; font-weight: 600; font-display: swap; src: url("./fonts/red-hat-display.woff2") format("woff2"); }
@font-face { font-family: "Red Hat Text"; font-weight: 400 500; font-display: swap; src: url("./fonts/red-hat-text.woff2") format("woff2"); }
@font-face { font-family: "Red Hat Mono"; font-weight: 400 500; font-display: swap; src: url("./fonts/red-hat-mono.woff2") format("woff2"); }

:root { --container: 1200px; --bar-h: 64px; }

/* Top bar */
.bar { border-bottom: var(--rule-hair) solid var(--color-ink); background: var(--color-paper); }
.bar__inner { display: flex; align-items: center; gap: var(--space-lg); min-height: var(--bar-h); }
.wordmark { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-lg); letter-spacing: var(--tracking-display); text-decoration: none; }
.bar__title { color: var(--color-muted); font-size: var(--text-sm); }
.bar .btn { margin-left: auto; }

/* Keys */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--space-lg); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink); font-weight: 500; text-decoration: none; cursor: pointer; box-shadow: inset 0 1px 0 var(--color-sheet), 0 1px 1px var(--color-rule); transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.btn:hover { background: var(--color-paper-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; transition: none; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: progress; background: var(--color-paper-3); color: var(--color-muted); border-color: var(--color-rule); box-shadow: none; transform: none; }
.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); border-color: color-mix(in oklab, var(--color-accent) 78%, var(--color-ink)); box-shadow: inset 0 1px 0 color-mix(in oklab, var(--color-sheet) 32%, transparent), inset 0 -1px 0 color-mix(in oklab, var(--color-ink) 10%, transparent); }
.btn--primary:hover { background: color-mix(in oklab, var(--color-accent) 90%, var(--color-ink)); }
.btn--quiet { min-height: 40px; font-size: var(--text-sm); }

/* Desk */
.desk { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-2xl); padding-block: var(--space-xl) var(--space-2xl); align-items: start; }
.intake { display: grid; gap: var(--space-lg); }
h1 { font-size: var(--text-3xl); }
.lead { color: var(--color-muted); }
.label, legend { font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); }
.hint { font-size: var(--text-sm); color: var(--color-muted); max-width: 52ch; }
.intake__form { display: grid; gap: var(--space-md); justify-items: start; }

.samples { margin: 0; padding: 0; border: 0; border-top: var(--rule-hair) solid var(--color-ink); width: 100%; }
.samples legend { padding: 0 0 var(--space-xs); float: left; width: 100%; border-bottom: var(--rule-hair) solid var(--color-ink); margin-bottom: 0; }
.samples legend + * { clear: both; }
.sample { display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-sm); align-items: baseline; padding: var(--space-sm) var(--space-xs); border-bottom: var(--rule-hair) solid var(--color-rule); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.sample:hover { background: var(--color-paper-3); }
.sample:has(input:checked) { background: var(--color-accent-soft); }
.sample input { grid-row: span 2; accent-color: var(--color-ink); width: 18px; height: 18px; margin: 0; align-self: center; }
.sample input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.sample__name { font-weight: 500; }
.sample__note { grid-column: 2; font-size: var(--text-sm); color: var(--color-muted); }

.paper { margin: 0; display: grid; gap: var(--space-xs); }
.paper img { border-radius: var(--radius-card); box-shadow: 0 0 0 1px var(--color-rule), var(--shadow-card); background: var(--color-sheet); }

/* Result states */
.result { min-width: 0; scroll-margin-top: var(--space-md); }
.state { display: grid; gap: var(--space-lg); }
.state__head { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-xl); letter-spacing: var(--tracking-display); line-height: 1.1; }
.state--empty { border: var(--rule-hair) dashed var(--color-grid-strong); border-radius: var(--radius-entry); padding: var(--space-xl); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; border-top: var(--rule-hair) solid var(--color-ink); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2rem 1fr; padding: var(--space-sm) 0; border-bottom: var(--rule-hair) solid var(--color-rule); color: var(--color-muted); font-size: var(--text-sm); }
.steps li::before { content: counter(step); grid-row: span 2; font-family: var(--font-outlier); color: var(--color-ink); }
.steps__name { color: var(--color-ink); font-weight: 500; font-size: var(--text-md); }

/* The record card */
.entry { border-radius: var(--radius-entry); background: var(--color-paper-2); box-shadow: 0 0 0 1px var(--color-ink), var(--shadow-lift); overflow: hidden; }
.entry__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-md); padding: var(--space-md) var(--space-lg); background: var(--color-ink); color: var(--color-paper-2); }
.entry__kind { font-weight: 500; }
.entry__total { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 2.75rem; letter-spacing: var(--tracking-display); line-height: 1.05; font-variant-numeric: tabular-nums; }
.notebook { background: linear-gradient(var(--color-grid) 1px, transparent 1px) 0 0 / 8px 8px, linear-gradient(90deg, var(--color-grid) 1px, transparent 1px) 0 0 / 8px 8px, var(--color-paper-2); }
.cells { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cells > div { padding: var(--space-sm) var(--space-lg); border-bottom: var(--rule-hair) solid var(--color-ink); }
.cells > div:nth-child(odd) { border-right: var(--rule-hair) solid var(--color-ink); }
.cells dt { font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }
.cells dd { margin: 0; font-family: var(--font-outlier); overflow-wrap: anywhere; }
.entry__lines { padding: var(--space-md) var(--space-lg) var(--space-lg); overflow-x: auto; }
.lines { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.lines th, .lines td { padding: var(--space-xs) var(--space-xs); text-align: left; font-weight: 400; vertical-align: baseline; }
.lines thead th { font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); border-bottom: var(--rule-hair) solid var(--color-ink); }
.lines tbody td { border-bottom: var(--rule-hair) solid var(--color-rule); }
.lines .r { text-align: right; }
.lines .num { font-family: var(--font-outlier); white-space: nowrap; }
.lines tfoot th { text-align: right; color: var(--color-muted); }
.lines__total th, .lines__total td { border-top: 2px solid var(--color-ink); font-weight: 500; color: var(--color-ink); }

.chip { flex: none; padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 500; background: var(--color-green-soft); color: var(--color-ink); }
.chip--review { background: var(--color-accent); color: var(--color-accent-ink); }

.verdict { display: grid; gap: var(--space-sm); padding-top: var(--space-md); }
.verdict h3 { max-width: none; padding-top: var(--space-sm); border-top: var(--rule-hair) solid var(--color-ink); }
.problems { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-xs); }
.problems li { padding: var(--space-sm) var(--space-md); border-radius: var(--radius-pill); background: var(--color-accent-soft); border: var(--rule-hair) solid var(--color-accent); }
.ok { color: var(--color-green); font-weight: 500; }
.next-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

/* Skeleton */
.entry--skeleton .entry__head { flex-direction: column; }
.entry--skeleton .entry__body { display: grid; gap: var(--space-md); padding: var(--space-lg); min-height: 240px; }
.bone { display: block; height: 14px; border-radius: 4px; background: var(--color-paper-3); animation: pulse 1.4s var(--ease-in-out) infinite alternate; }
.entry__head .bone { background: var(--color-ink-2); }
.bone--short { width: 40%; } .bone--long { width: 60%; height: 36px; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .bone { animation: none; } }

.foot { padding-block: var(--space-lg) var(--space-xl); font-size: var(--text-sm); color: var(--color-muted); }

@media (max-width: 60rem) {
  .desk { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
  .paper { max-width: 420px; }
  .bar__title { display: none; }
}
@media (max-width: 40rem) {
  h1 { font-size: var(--text-2xl); }
  .entry__total { font-size: 2.074rem; }
  .entry__head, .cells > div, .entry__lines { padding-inline: var(--space-md); }
  .cells { grid-template-columns: minmax(0, 1fr); }
  .cells > div:nth-child(odd) { border-right: 0; }
  .state--empty { padding: var(--space-lg); }
}
