/* Design: Google Stitch, Fee Check — Studio Terracotta, project 15176334921739450072. */
:root {
  --primary: #933015;
  --primary-hover: #762710;
  --paper: #fff8f6;
  --card: #fff;
  --tonal: #fff1ed;
  --ink: #241916;
  --muted: #57423c;
  --border: #dec0b8;
  --error: #ba1a1a;
  --warning: #8a4b08;
  --success: #1b6e47;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

/* Base and shared layout. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-underline-offset: 3px; }
button, input { font: inherit; }
button, a, input { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
button, input { transition: border-color .12s, background-color .12s, box-shadow .12s; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }
::selection { background: #f5d6cc; }
.shell { width: min(100%, 1040px); margin-inline: auto; padding-inline: 24px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 36px; line-height: 1.22; letter-spacing: -1.2px; margin-bottom: 12px; font-weight: 700; }
h2 { font-size: 22px; line-height: 1.35; letter-spacing: -.25px; font-weight: 650; }
h3 { font-size: 18px; line-height: 1.45; letter-spacing: -.1px; font-weight: 650; }
.site-header { background: var(--card); border-bottom: 1px solid var(--border); }
.header-inner { min-height: 76px; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 19px; font-weight: 700; letter-spacing: -.5px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; background: var(--primary); color: #fff; border-radius: 7px; }
.header-caption { color: var(--muted); padding-left: 16px; border-left: 1px solid var(--border); font-size: 14px; }
.market-badge, .small-badge, .status-badge { display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; line-height: 1.4; border: 1px solid var(--border); background: var(--tonal); border-radius: 999px; padding: 5px 9px; white-space: nowrap; }
.market-badge { margin-left: auto; letter-spacing: .4px; }
.main-content { padding-top: 34px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 44px; }
.intro { margin-bottom: 24px; max-width: 690px; }
.eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 1.8px; color: var(--primary); }
.intro-copy { font-size: 18px; line-height: 1.6; color: var(--muted); margin: 0; max-width: 650px; }
.calculator-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
.card { border: 1px solid var(--border); background: var(--card); border-radius: 12px; min-width: 0; }
.card-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.card-heading h2 { margin: 0; }
.small-note { font-size: 14px; line-height: 1.6; color: var(--muted); }

/* Inputs: keep labels readable while giving zero controls their own column. */
.input-card { padding: 24px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
.field { min-width: 0; }
.field-label { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; min-height: 50px; margin-bottom: 8px; }
.field-label label { grid-column: 1; grid-row: 1; font-size: 16px; line-height: 1.4; font-weight: 600; }
.field-label:not(:has(.required-label)) label { grid-row: 1 / span 2; }
.required-label { grid-column: 1; grid-row: 2; font-size: 12px; line-height: 1.4; color: var(--primary); }
.zero-button { grid-column: 2; grid-row: 1 / span 2; border: 1px solid var(--border); background: var(--tonal); color: var(--primary); border-radius: 999px; font-size: 14px; line-height: 1.4; font-weight: 600; min-height: 44px; padding: 7px 10px; white-space: nowrap; }
.zero-button:hover { background: #ffe9e4; }
.input-wrap { position: relative; }
.input-wrap input { display: block; width: 100%; min-height: 52px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--ink); padding: 11px 12px 11px 33px; font: 18px/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.input-wrap input::placeholder { color: #9a8983; font-size: 16px; }
.input-unit { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font: 16px var(--mono); color: var(--muted); pointer-events: none; }
.percent-input input { padding-left: 12px; padding-right: 34px; }
.input-unit.percent { left: auto; right: 13px; }
.field-hint { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 8px 0 0; overflow-wrap: anywhere; }
.field-error { font-size: 14px; line-height: 1.6; color: var(--error); margin: 8px 0 0; overflow-wrap: anywhere; }
input[aria-invalid=true] { border-color: var(--error); background: #fff8f7; }
.rate-help { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.rate-help summary { color: var(--primary); cursor: pointer; min-height: 44px; padding-block: 10px; }
.rate-help p { margin: 8px 0 0; overflow-wrap: anywhere; }
.estimate-context { font-size: 14px; line-height: 1.65; color: var(--muted); margin: 16px 0 0; overflow-wrap: anywhere; }
.costs-group { margin: 26px 0 0; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px 18px; background: var(--tonal); min-width: 0; }
.costs-group legend { padding: 0 6px; font-size: 16px; line-height: 1.5; font-weight: 600; max-width: 100%; }
.costs-group legend span { display: block; font-size: 14px; line-height: 1.5; color: var(--muted); font-weight: 400; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.button { min-height: 48px; padding: 11px 14px; border: 1px solid transparent; border-radius: 8px; font-weight: 600; font-size: 16px; line-height: 1.5; }
.primary-button { background: var(--primary); color: white; display: inline-flex; align-items: center; justify-content: center; gap: 12px; }
.primary-button:hover { background: var(--primary-hover); }
.primary-button span { font-size: 20px; line-height: 1; font-weight: 400; }
.secondary-button { border-color: var(--border); background: #fff; color: var(--ink); }
.secondary-button:hover { background: var(--tonal); }
.text-button { color: var(--muted); background: transparent; padding-inline: 10px; }
.text-button:hover { background: var(--tonal); }
.form-error { padding: 12px; border: 1px solid #ecc0b5; background: #fff3ef; border-radius: 8px; color: var(--error); font-size: 14px; line-height: 1.6; margin: 20px 0 0; overflow-wrap: anywhere; }
.example-note { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 14px 0 0; }

/* Results: amounts first, with readable explanations and fee details. */
.result-card { padding: 24px; }
.result-card .card-heading { margin-bottom: 16px; }
.status-badge { padding: 5px 8px; background: #f7f4f2; color: var(--muted); }
.status-badge[data-state=estimate] { background: #e6f4ec; border-color: #b6d7c3; color: var(--success); }
.status-badge[data-state=update-needed] { background: #fef3c7; border-color: #dfce9a; color: var(--warning); }
.result-status { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.result-placeholder { padding: 28px 12px 36px; text-align: center; color: var(--muted); border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); }
.empty-receipt { display: grid; place-items: center; margin: 0 auto 14px; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 10px; color: var(--primary); background: var(--tonal); }
.empty-receipt svg { width: 23px; height: 23px; }
.result-placeholder p { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.result-placeholder > span:not(.empty-receipt) { font-size: 14px; line-height: 1.7; }
.placeholder-lines { display: flex; flex-direction: column; align-items: center; gap: 7px; margin-top: 25px; }
.placeholder-lines span { height: 3px; background: #f1e6e2; border-radius: 2px; width: 70%; }
.placeholder-lines span:nth-child(2) { width: 58%; }
.placeholder-lines span:nth-child(3) { width: 44%; }
.outcome { background: var(--tonal); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-top: 12px; }
.outcome-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 16px; line-height: 1.5; font-weight: 600; }
.currency-label { font-size: 12px; letter-spacing: 1px; color: var(--muted); font-weight: 500; }
.outcome-amount { font: 32px/1.3 var(--mono); letter-spacing: -1.2px; font-weight: 500; color: var(--primary); margin: 9px 0 5px; overflow-wrap: anywhere; }
.outcome-description { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0; }
.unknown-note { font-size: 14px; line-height: 1.6; color: var(--warning); margin: 8px 0 0; overflow-wrap: anywhere; }
.unknown-note:empty { display: none; }
.outcome-amount[data-negative=true], dd[data-negative=true] { color: var(--error); }
.profit-outcome { margin-top: 12px; }
#result-values > h3 { font-size: 18px; line-height: 1.5; margin: 24px 0 0; }
.fee-lines { margin: 12px 0 0; padding-top: 8px; border-top: 1px solid var(--border); }
.fee-lines > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 13px 0; border-bottom: 1px solid #f1e5e0; }
.fee-lines dt { min-width: 0; font-size: 16px; line-height: 1.55; color: var(--muted); }
.fee-lines dd { margin: 0; max-width: 58%; font: 18px/1.5 var(--mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; text-align: right; }
.fee-lines .fees-total { border-bottom-color: var(--border); }
.fees-total dt, .fees-total dd { color: var(--ink); font-weight: 600; }
.fee-lines .after-fees { padding-bottom: 16px; border-bottom: 0; }
.after-fees dd { font-weight: 600; }
.estimate-limit { font-size: 14px; line-height: 1.65; color: var(--muted); margin: 20px 0 12px; overflow-wrap: anywhere; }
.quiet-link { font-size: 14px; line-height: 1.6; text-decoration: none; display: inline-flex; align-items: center; gap: 12px; }
.quiet-link:hover { text-decoration: underline; }

/* Formula, example and source sections. */
.reference-section { min-width: 0; }
.section-heading { margin-bottom: 20px; }
.section-heading h2 { margin-bottom: 6px; }
.section-heading p { font-size: 16px; color: var(--muted); margin: 0; }
.reference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.reference-card { border: 1px solid var(--border); border-radius: 10px; background: var(--tonal); padding: 22px; min-width: 0; }
.reference-card h3 { margin-bottom: 16px; }
.reference-card p { font-size: 16px; line-height: 1.7; color: var(--muted); margin-bottom: 14px; }
.reference-card p:last-child { margin-bottom: 0; }
.formula { border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 12px; margin: 12px 0; }
.formula span { display: block; font-size: 14px; line-height: 1.6; color: var(--muted); margin-bottom: 6px; }
.formula code { font: 14px/1.7 var(--mono); overflow-wrap: anywhere; }
.example-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 8px 10px; }
.example-heading h3 { margin-bottom: 0; }
.small-badge { padding: 5px 8px; background: transparent; }
.example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 20px 0 16px; }
.example-grid > div { padding: 12px 10px; background: #fff; border: 1px solid #e9d7d0; border-radius: 6px; min-width: 0; }
.example-grid dt { font-size: 14px; line-height: 1.5; color: var(--muted); margin-bottom: 7px; }
.example-grid dd { margin: 0; font: 16px/1.5 var(--mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bottom-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.bottom-grid h2 { font-size: 22px; margin-bottom: 16px; }
.bottom-grid p { font-size: 16px; line-height: 1.75; color: var(--muted); }
.source-links { margin: 16px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 1.6; }
.source-links a { text-decoration: none; }
.source-links a:hover { text-decoration: underline; }
.how-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 20px; }
.how-list > li { display: flex; gap: 13px; }
.how-list > li > span { width: 24px; flex: none; font: 14px/1.6 var(--mono); color: var(--primary); padding-top: 1px; }
.how-list h3 { font-size: 16px; line-height: 1.5; margin: 0 0 6px; }
.how-list p { margin: 0; }
.site-footer { border-top: 1px solid var(--border); padding-top: 20px; padding-bottom: 26px; display: flex; align-items: start; justify-content: space-between; gap: 20px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.site-footer nav { display: flex; gap: 20px; flex: none; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-dot { margin: 0 5px; }
.skip-link { position: fixed; left: 16px; top: -90px; z-index: 10; background: var(--primary); color: #fff; padding: 12px; border-radius: 6px; }
.skip-link:focus { top: 12px; }

/* About and Privacy. */
.document-main { max-width: 800px; padding-top: 36px; padding-bottom: 56px; }
.back-link { display: inline-block; font-size: 16px; line-height: 1.6; margin-bottom: 28px; text-decoration: none; }
.document-main h1 { font-size: 34px; }
.document-lead { font-size: 18px; line-height: 1.7; color: var(--muted); max-width: 650px; }
.document-card { padding: 30px; margin-top: 28px; }
.document-card h2 { font-size: 22px; margin-top: 30px; margin-bottom: 12px; }
.document-card h2:first-child { margin-top: 0; }
.document-card p { font-size: 16px; line-height: 1.8; color: var(--muted); margin-bottom: 18px; }
.document-card p:last-child { margin-bottom: 0; }

@media (max-width: 960px) {
  .field-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .calculator-grid { grid-template-columns: 1fr; }
  .result-card { max-width: none; }
  .reference-grid, .bottom-grid { grid-template-columns: 1fr; }
  .bottom-grid { gap: 28px; }
  .main-content { gap: 36px; }
  .intro-copy { max-width: 600px; }
  .result-placeholder { padding-block: 28px; }
  .reference-card { padding: 20px; }
  .header-caption { font-size: 14px; }
}

@media (max-width: 520px) {
  .shell { padding-inline: 16px; }
  .header-inner { min-height: 66px; gap: 10px; }
  .header-caption { display: none; }
  .brand { font-size: 18px; }
  .brand-mark { width: 32px; height: 32px; }
  .main-content { padding-top: 26px; padding-bottom: 36px; }
  .intro { margin-bottom: 22px; }
  .eyebrow { font-size: 12px; letter-spacing: 1.4px; margin-bottom: 10px; }
  h1 { font-size: 28px; line-height: 1.25; letter-spacing: -.8px; }
  .intro-copy { font-size: 16px; line-height: 1.65; }
  .input-card, .result-card { padding: 18px; }
  .card-heading { margin-bottom: 20px; }
  .card-heading h2 { font-size: 22px; }
  .field-grid { gap: 22px; }
  .field-label { min-height: 48px; }
  .zero-button { min-width: 56px; }
  .costs-group { padding: 12px 12px 18px; margin-top: 24px; }
  .form-actions { gap: 10px; }
  .primary-button { width: 100%; }
  .secondary-button, .text-button { flex: 1; }
  .example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reference-card { padding: 18px; }
  .reference-grid { gap: 18px; }
  .site-footer { flex-direction: column; gap: 16px; }
  .site-footer nav a { min-height: 44px; padding: 10px 0; display: inline-block; }
  .document-main { padding-top: 26px; }
  .document-main h1 { font-size: 28px; }
  .document-card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
