:root {
  --ink: #241a14;
  --paper: #f8eedc;
  --paper-2: #fff8ea;
  --ochre: #e99a08;
  --ochre-dark: #a66000;
  --navy: #17243a;
  --brown: #8a5b30;
  --line: #58432f;
  --muted: #6d5a4c;
  --danger: #a33224;
  --success: #2d6546;
  --white: #fffdf7;
  --shadow: 0 8px 24px rgba(36, 26, 20, 0.1);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); font-size: 18px; line-height: 1.55; }
button, input, textarea { font: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 4px solid #1f6feb; outline-offset: 3px; }

.shell { width: min(100% - 32px, 1040px); margin-inline: auto; }
.narrow { width: min(100% - 32px, 760px); margin-inline: auto; }
.site-header { border-bottom: 2px solid rgba(88, 67, 47, 0.25); background: rgba(248, 238, 220, 0.96); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; line-height: 1.05; letter-spacing: 0.02em; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ochre); font-size: 24px; }
.prototype-label { color: var(--muted); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.top-link { min-height: 48px; display: inline-flex; align-items: center; font-weight: 700; }

main { padding: 40px 0 72px; }
.hero { padding: 28px 0 52px; }
.eyebrow, .section-kicker { margin: 0 0 12px; color: var(--brown); font-size: 15px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { max-width: 900px; margin: 0 0 20px; font-size: clamp(38px, 7vw, 72px); line-height: 1.02; letter-spacing: -0.035em; }
h2 { margin: 0 0 18px; font-size: clamp(28px, 4vw, 42px); line-height: 1.12; }
h3 { margin: 0 0 8px; font-size: 22px; line-height: 1.25; }
p { margin: 0 0 18px; }
.lead { max-width: 760px; font-size: clamp(21px, 3vw, 27px); line-height: 1.4; }
.muted { color: var(--muted); }
.small { font-size: 15px; line-height: 1.45; }

.price-card, .panel, .result-card, .history-card, .notice, .example { border: 2px solid var(--line); border-radius: 18px; background: var(--paper-2); box-shadow: var(--shadow); }
.price-card { margin-top: 28px; padding: 24px; }
.price { display: block; font-size: 44px; line-height: 1; font-weight: 900; }
.price-note { display: block; margin: 8px 0 20px; font-weight: 700; }
.payment-label { margin: 0 0 8px; font-size: 18px; }
.payment-consent { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 18px; font-size: 15px; line-height: 1.45; }
.payment-consent input { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--ochre-dark); }
.button { min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--ink); border-radius: 12px; padding: 12px 20px; background: var(--ochre); color: var(--ink); font-weight: 800; text-align: center; text-decoration: none; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); transition: transform .15s, box-shadow .15s; }
.button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; box-shadow: none; }
.button-secondary { background: var(--paper-2); }
.button-danger { background: transparent; color: var(--danger); border-color: var(--danger); box-shadow: none; }
.button-full { width: 100%; }
.text-link { min-height: 48px; display: inline-flex; align-items: center; font-weight: 800; }

.section { padding: 52px 0; border-top: 2px solid rgba(88, 67, 47, .25); }
.grid { display: grid; gap: 16px; }
.benefit-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.benefit, .step { padding: 20px; border-left: 6px solid var(--ochre); background: rgba(255, 248, 234, .7); }
.benefit p, .step p { margin: 0; }
.steps { counter-reset: step; }
.step { position: relative; padding-left: 64px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 18px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: white; font-weight: 800; }
.example { padding: 22px; }
.example-source { padding: 16px; border-left: 5px solid var(--brown); background: #f1dfbd; }
.example-result { margin-top: 18px; padding: 18px; border-radius: 12px; background: var(--white); }
.disclaimer { padding: 20px; border-radius: 14px; background: var(--navy); color: white; }

.app-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.balance { flex: 0 0 auto; padding: 12px 16px; border-radius: 12px; background: var(--navy); color: white; font-weight: 800; }
.panel { margin-bottom: 20px; padding: 22px; }
.field-group { margin: 0; padding: 0; border: 0; }
.field-group legend, .field-label { display: block; width: 100%; margin-bottom: 14px; font-size: 23px; line-height: 1.25; font-weight: 800; }
.choice-grid { display: grid; gap: 10px; }
.choice { min-height: 54px; display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 2px solid rgba(88, 67, 47, .45); border-radius: 12px; background: var(--white); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--ochre-dark); background: #ffe7ad; }
.choice input { width: 24px; height: 24px; flex: 0 0 auto; accent-color: var(--ochre-dark); }
details { margin-top: 12px; }
summary { min-height: 48px; display: flex; align-items: center; font-weight: 800; cursor: pointer; }
.input, .textarea { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 14px; background: var(--white); color: var(--ink); font-size: 18px; }
.textarea { min-height: 240px; resize: vertical; }
.textarea-small { min-height: 120px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.file-drop { display: grid; justify-items: center; gap: 8px; padding: 28px 18px; border: 3px dashed var(--brown); border-radius: 16px; background: #fff4d8; text-align: center; cursor: pointer; }
.file-drop strong { font-size: 24px; line-height: 1.25; }
.file-drop > span { color: var(--muted); }
.file-drop .button { margin-top: 8px; }
.file-drop.is-dragging { border-style: solid; border-color: var(--ochre-dark); background: #ffe7ad; }
.file-drop.is-processing { cursor: wait; opacity: .72; }
.file-status { min-height: 28px; margin: 10px 0 0; color: var(--success); font-weight: 800; }
.file-summary { margin-top: 14px; padding: 18px; border: 2px solid var(--success); border-radius: 14px; background: #eef8f1; }
.file-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.file-summary h3, .file-summary p { margin-bottom: 6px; }
.file-name { font-weight: 800; }
.file-remove { min-height: 48px; padding: 8px 14px; box-shadow: none; }
.file-facts { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 14px 0; }
.file-facts div { display: grid; gap: 2px; }
.file-facts dt { color: var(--muted); font-size: 14px; font-weight: 700; }
.file-facts dd { margin: 0; font-weight: 800; }
.file-preview { max-height: 116px; margin: 0; overflow: hidden; padding: 12px; border-radius: 10px; background: var(--white); overflow-wrap: anywhere; }
.source-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.source-divider::before, .source-divider::after { content: ""; height: 2px; flex: 1; background: rgba(88, 67, 47, .3); }
.field-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; color: var(--muted); font-size: 15px; }
.privacy-note { margin-top: 14px; padding: 15px; border-left: 6px solid var(--ochre-dark); background: #fff0c9; font-weight: 700; }
.error { margin: 10px 0 0; color: var(--danger); font-weight: 800; }
.success { padding: 16px; border-left: 6px solid var(--success); background: #e4f2e9; color: #173f2b; font-weight: 700; }
.hidden { display: none !important; }

.result-intro { margin-bottom: 24px; }
.result-stack { display: grid; gap: 16px; }
.result-card { padding: 21px; box-shadow: none; }
.result-card h2 { font-size: 26px; }
.result-card ul { margin: 10px 0 0; padding-left: 24px; }
.result-card li + li { margin-top: 9px; }
.result-summary { border-color: var(--ochre-dark); background: #fff1c7; }
.result-risk { border-color: var(--danger); }
.result-uncertainty { border-style: dashed; }
.result-details { margin: 0; padding: 0; }
.result-details summary { min-height: 64px; padding: 16px 20px; font-size: 24px; line-height: 1.25; }
.result-details summary::after { content: "+"; margin-left: auto; padding-left: 16px; font-size: 30px; }
.result-details[open] summary::after { content: "−"; }
.result-details-body { padding: 0 20px 20px; }
.followup { margin-top: 32px; }
.followup-thread { display: grid; gap: 10px; margin: 16px 0; }
.message { padding: 14px; border-radius: 12px; }
.message-user { margin-left: 20px; background: #e9dcc6; }
.message-answer { margin-right: 20px; background: white; border: 1px solid rgba(88, 67, 47, .35); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.history-list { display: grid; gap: 16px; }
.history-card { padding: 20px; box-shadow: none; }
.history-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 8px; color: var(--muted); font-size: 15px; }
.status { display: inline-flex; align-items: center; min-height: 30px; padding: 3px 9px; border-radius: 999px; background: #dcebdd; color: #1c5034; font-weight: 800; }
.card-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.empty-state { padding: 32px 20px; border: 2px dashed var(--line); border-radius: 18px; text-align: center; }

.login-card { max-width: 600px; margin: 20px auto; padding: 26px; border: 2px solid var(--line); border-radius: 18px; background: var(--paper-2); box-shadow: var(--shadow); }
.login-card .input { min-height: 56px; }

.site-footer { padding: 28px 0; border-top: 2px solid rgba(88, 67, 47, .25); color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer-inner p { margin: 0; }

@media (min-width: 720px) {
  main { padding-top: 56px; }
  .price-card { max-width: 520px; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .panel { padding: 28px; }
  .history-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; }
  .card-actions { margin-top: 0; }
}

@media (max-width: 560px) {
  .shell, .narrow { width: min(100% - 24px, 1040px); }
  .header-inner { min-height: 64px; }
  .brand span:last-child { display: none; }
  .prototype-label { font-size: 12px; }
  main { padding-top: 28px; }
  .app-head { display: block; }
  .balance { display: inline-block; margin-top: 8px; }
  .button, .actions .button { width: 100%; }
  .file-summary-head { display: block; }
  .file-remove { margin-top: 10px; }
  .field-meta { display: block; }
  .field-meta span { display: block; }
  .card-actions { display: grid; }
}

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