:root {
  color-scheme: light;
  --ink: #21372d;
  --ink-strong: #172a21;
  --muted: #55645a;
  --muted-inverse: #d0dcd2;
  --paper: #f4f1e9;
  --surface: #fffdf8;
  --line: #dedbd0;
  --line-strong: #b9c2b7;
  --green: #234538;
  --green-hover: #173427;
  --accent: #a56f39;
  --accent-light: #dcc49e;
  --danger: #8a342c;
  --serif: Iowan Old Style, Palatino Linotype, Book Antiqua, Georgia, serif;
  --sans: Aptos, Segoe UI, system-ui, sans-serif;
  --mono: ui-monospace, Cascadia Code, Consolas, monospace;
  font-family: var(--sans);
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid #9a5921; outline-offset: 4px; }

.container {
  width: min(100% - 72px, 1120px);
  margin-inline: auto;
}

main.container { padding-bottom: 62px; }

.topbar { border-bottom: 1px solid var(--line); }

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 74px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-strong);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.035em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 25px;
  height: 25px;
  border: 1px solid currentColor;
  border-radius: 100%;
  color: var(--green);
}

.brand-mark::before {
  position: absolute;
  top: 5px;
  left: 11px;
  width: 6px;
  height: 7px;
  border-bottom: 1px solid currentColor;
  border-left: 1px solid currentColor;
  content: "";
}

.brand-mark::after {
  position: absolute;
  top: 11px;
  left: 10px;
  width: 3px;
  height: 3px;
  border-radius: 100%;
  background: var(--accent);
  content: "";
}

.site-nav { display: flex; align-items: center; gap: 25px; }

.site-nav a {
  padding-block: 12px;
  font-size: .88rem;
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.site-nav a:last-child { text-decoration: none; }
.site-nav a:last-child:hover { text-decoration: underline; }

.hero {
  padding: 64px 0 42px;
  max-width: 756px;
}

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

h1, h2 {
  color: var(--ink-strong);
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.048em;
  line-height: 1;
}

h1 { font-size: clamp(3.1rem, 7vw, 5.65rem); }
h2 { font-size: clamp(2.05rem, 4.5vw, 3rem); }

.hero p {
  max-width: 56ch;
  margin-top: 18px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.17rem);
  line-height: 1.6;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.78fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.card, .information, .output-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.card { padding: clamp(22px, 4vw, 35px); }

.card-heading { margin-bottom: 25px; }

.card-heading p, .field-help {
  color: var(--muted);
  line-height: 1.55;
}

.card-heading p { margin-top: 9px; }

.form-layout { display: grid; gap: 20px; }

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

.field { display: grid; gap: 7px; min-width: 0; }

.field-label { font-size: .88rem; font-weight: 700; }
.field-label small { color: var(--muted); font-size: .85em; font-weight: 500; }
.field-help { font-size: .84rem; }

input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fffefa;
  color: var(--ink-strong);
}

.file-field {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px dashed #aab8ad;
  border-radius: 8px;
  background: #f6f8f3;
}

input[type="file"] {
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--muted);
  font-size: .87rem;
}

input[type="file"]::file-selector-button, .file-picker-button {
  padding: 7px 11px;
  border: 1px solid #aab8ad;
  border-radius: 5px;
  color: var(--ink-strong);
  background: #fffefa;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

input[type="file"]::file-selector-button { margin-right: 11px; }
input[type="file"]::file-selector-button:hover,
.file-picker[data-enhanced="true"]:hover .file-picker-button { background: #e9eee7; }

.file-picker { position: relative; min-width: 0; }
.file-picker-display { display: none; }

.file-picker[data-enhanced="true"] input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 1;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-picker[data-enhanced="true"] .file-picker-display {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: .87rem;
  color: var(--muted);
}

.file-picker-button { flex: none; }
.file-picker [data-file-name] { min-width: 0; overflow-wrap: anywhere; }
.file-picker input:focus-visible + .file-picker-display .file-picker-button {
  outline: 2px solid #9a5921;
  outline-offset: 4px;
}

.form-actions, .output-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-hover); }
.button-secondary { border-color: var(--line-strong); background: #fffefa; color: var(--green); }
.button-secondary:hover { background: #ecf0e8; }
.button:disabled { opacity: .62; cursor: wait; }

.arrow { font-size: 1.1em; font-weight: 400; }

.information {
  padding: clamp(22px, 4vw, 33px);
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.information h2 {
  margin-bottom: 13px;
  color: white;
  font-size: 1.96rem;
}

.information h3 { font-size: .94rem; font-weight: 700; }
.information p { color: var(--muted-inverse); font-size: .92rem; line-height: 1.55; }

.information .brand-mark {
  width: 30px;
  height: 30px;
  margin-bottom: 19px;
  color: var(--accent-light);
}

.information .brand-mark::before { top: 6px; left: 13px; width: 8px; height: 8px; }
.information .brand-mark::after { top: 13px; left: 12px; background: var(--accent-light); }

.information ul {
  display: grid;
  gap: 14px;
  margin: 21px 0 0;
  padding: 0;
  list-style: none;
}

.information li { padding-bottom: 14px; border-bottom: 1px solid #527063; }
.information li:last-child { padding-bottom: 0; border: 0; }
.information li p { margin-top: 3px; }

.stack { display: grid; gap: 13px; }
.verification { margin-top: 24px; }
.verification .form-layout { max-width: 720px; }
.verification .file-field { align-content: start; }

.report-asin-field { max-width: 220px; }

.report-result {
  max-width: 720px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #eff3ec;
}

.status, .verification-result {
  color: var(--ink);
  font-size: .91rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.status[data-state="error"] { color: var(--danger); }

.verification-result {
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #eff3ec;
  white-space: pre-wrap;
}

.output-card { margin-top: 18px; padding: clamp(19px, 4vw, 31px); }
.output-actions { margin-bottom: 20px; }
.output-actions .field-help { flex-basis: 100%; }

.certificate {
  min-width: 0;
  padding: clamp(18px, 5vw, 46px);
  border: 1px solid #b7aa92;
  background: #f9f6ee;
  color: var(--ink-strong);
}

.certificate .wordmark { margin-bottom: 24px; text-decoration: none; }
.certificate h2 { margin-bottom: 10px; }
.certificate-intro, .certificate-note { font-size: .9rem; line-height: 1.55; }
.certificate-note + .certificate-note { margin-top: 8px; }

.certificate dl {
  display: grid;
  grid-template-columns: minmax(104px, 32%) 1fr;
  gap: 0;
  margin: 22px 0 20px;
  border-top: 1px solid #cec3ae;
}

.certificate dt, .certificate dd {
  min-width: 0;
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid #cec3ae;
  overflow-wrap: anywhere;
  font-size: .9rem;
}

.certificate dt { padding-right: 8px; font-weight: 700; }
.certificate .certificate-timestamp { color: var(--green-hover); font-weight: 750; }
.certificate .certificate-metadata { color: var(--muted); }
.certificate .certificate-metadata small { font-size: .88em; font-weight: 500; }
.certificate .digest { font-family: var(--mono); font-size: .77rem; }
.certificate a { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .container { width: calc(100% - 38px); }
  .topbar-inner { min-height: 62px; }
  .site-nav { gap: 15px; }
  .site-nav a { font-size: .81rem; }
  .hero { padding-top: 41px; padding-bottom: 30px; }
  .workspace { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .topbar-inner { flex-wrap: wrap; gap: 4px 10px; padding-block: 7px; }
  .wordmark { gap: 8px; font-size: 1.15rem; }
  .site-nav { gap: 11px; }
  .field-grid { grid-template-columns: 1fr; }
  .certificate dl { grid-template-columns: 1fr; }
  .certificate dt { border-bottom: 0; padding-bottom: 1px; }
  .certificate dd { padding-top: 4px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@page { margin: 15mm; size: A4 portrait; }

@media print {
  :root, body, main { background: white; }
  .topbar, .hero, .workspace, .verification, .output-actions { display: none !important; }
  .container { width: 100%; }
  main.container { padding-bottom: 0; }
  .output-card { margin: 0; padding: 0; border: 0; border-radius: 0; }
  .certificate { border-color: #787366; background: white; break-inside: avoid; }
  .certificate h2 { font-size: 27pt; }
  .certificate dl { grid-template-columns: 28% 1fr; }
  .certificate .digest { font-size: 8pt; }
}
