/* AcquireCalc — global styles */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #15233b;
  --ink-soft: #4b5b75;
  --line: #dde4ee;
  --brand: #0b5fff;
  --brand-dark: #0747bd;
  --good: #0a7d4f;
  --good-bg: #e6f7ef;
  --warn: #b54708;
  --warn-bg: #fdf1e2;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(21, 35, 59, .08), 0 8px 24px rgba(21, 35, 59, .06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
header.site .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.logo span { color: var(--brand); }
nav.main { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
nav.main a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; font-weight: 500; }
nav.main a:hover { color: var(--brand); }

/* Hero */
.hero { padding: 48px 0 28px; text-align: center; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); letter-spacing: -.03em; margin: 0 0 12px; }
.hero p.sub { max-width: 720px; margin: 0 auto; color: var(--ink-soft); font-size: 1.08rem; }
.chips { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 22px; box-shadow: var(--shadow); min-width: 180px;
}
.chip .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.chip .value { font-size: 1.35rem; font-weight: 700; }

/* Cards / sections */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px 26px; margin: 26px 0;
}
.card h2 { margin: 0 0 6px; font-size: 1.3rem; letter-spacing: -.01em; }
.card p.hint { margin: 0 0 16px; color: var(--ink-soft); font-size: .94rem; }

/* Tables */
.table-scroll { overflow-x: auto; }
table.calc-table { width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 640px; }
table.calc-table th {
  text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-soft); padding: 8px 10px; border-bottom: 2px solid var(--line);
}
table.calc-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
table.calc-table tfoot td { font-weight: 700; border-bottom: none; border-top: 2px solid var(--ink); }
td.calc { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
td.method { color: var(--ink-soft); font-size: .88rem; }

input.num {
  width: 120px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px;
  font-size: .94rem; font-variant-numeric: tabular-nums; color: var(--ink); background: #fbfcfe;
}
input.num:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
input.num.pct { width: 72px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }

.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.field-row label { font-size: .95rem; }

/* Help tooltips */
.help {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 16px; height: 16px; line-height: 1; margin-left: 6px; border-radius: 50%;
  background: var(--line); color: var(--ink-soft); font-size: 11px; font-weight: 700;
  cursor: help; position: relative; vertical-align: middle; user-select: none; text-transform: none;
}
.help:hover, .help:focus { background: var(--brand); color: #fff; outline: none; }
.help::after {
  content: attr(data-tip); position: absolute; bottom: 150%; left: 50%; transform: translateX(-50%);
  width: 220px; max-width: 72vw; padding: 9px 11px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: .8rem; font-weight: 400; line-height: 1.45;
  text-align: left; text-transform: none; letter-spacing: normal;
  box-shadow: var(--shadow); opacity: 0; visibility: hidden;
  transition: opacity .12s; z-index: 60; pointer-events: none; white-space: normal;
}
.help:hover::after, .help:focus::after { opacity: 1; visibility: visible; }

/* Label + help wrapper. The label text may wrap to several lines; we pin the
   ? badge to the TOP of that block (flex-start) and then nudge it down by the
   half-leading of the first line so it sits optically centered on the FIRST
   line of the label, for both single- and multi-line labels.
   Body line box = .94rem * 1.6 ≈ 24px, badge = 16px -> (24-16)/2 = 4px. */
.lblcell { display: flex; align-items: flex-start; gap: 5px; }
.lblcell .lbltxt { min-width: 0; }
.lblcell .help { margin-left: 0; margin-top: 4px; }

/* Table-header help: keep the badge on one line beside the label, and open the
   tooltip downward (an upward one is clipped by the table's scroll wrapper).
   Edge columns anchor left/right so the tooltip stays inside the wrapper. */
.calc-table th { white-space: nowrap; }
/* Header labels are a smaller font (line box ≈ 20px), so center on 2px not 4px. */
.calc-table th .help { background: #c7d2e2; margin-top: 2px; }
.calc-table th .help::after { top: 160%; bottom: auto; }
.calc-table th:first-child .help::after { left: 0; transform: none; }
.calc-table th:last-child .help::after { left: auto; right: 0; transform: none; }
.field-row .out { font-weight: 700; font-variant-numeric: tabular-nums; }

.verdict { padding: 10px 14px; border-radius: 8px; font-weight: 600; font-size: .94rem; margin-top: 12px; }
.verdict.good { background: var(--good-bg); color: var(--good); }
.verdict.warn { background: var(--warn-bg); color: var(--warn); }

/* Toggle */
.toggle-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.toggle-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--brand); }

/* Deal stack */
.stack { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.stack li { display: flex; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: .98rem; }
.stack li.subtotal { font-weight: 700; background: #f0f4fa; }
.stack li.total { font-weight: 800; font-size: 1.12rem; border: none; background: var(--ink); color: #fff; border-radius: 8px; margin-top: 8px; }
.deal-verdict { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); font-weight: 600; }
.deal-verdict.good { background: var(--good-bg); color: var(--good); }
.deal-verdict.warn { background: var(--warn-bg); color: var(--warn); }

button.btn {
  background: var(--brand); color: #fff; border: none; border-radius: 8px;
  padding: 10px 20px; font-size: .95rem; font-weight: 600; cursor: pointer;
}
button.btn:hover { background: var(--brand-dark); }
button.btn.ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }

/* Ad slots */
.ad-slot {
  margin: 28px auto; padding: 24px; text-align: center; border: 1px dashed var(--line);
  border-radius: var(--radius); color: #9aa7bd; font-size: .82rem; background: #fbfcfe;
  max-width: 1100px;
}

/* Article / content */
article.content { max-width: 760px; margin: 0 auto; padding: 36px 20px 60px; }
article.content h1 { font-size: 2rem; letter-spacing: -.02em; }
article.content h2 { margin-top: 2em; font-size: 1.4rem; }
article.content h3 { margin-top: 1.5em; }
article.content p, article.content li { color: #2a3a55; font-size: 1.02rem; }
article.content code { background: #eef2f8; padding: 2px 6px; border-radius: 4px; }
.content-section { max-width: 820px; margin: 0 auto; }
.content-section h2 { font-size: 1.5rem; margin-top: 2.2em; }
.content-section h3 { font-size: 1.15rem; }
.content-section p, .content-section li { color: #2a3a55; }

/* FAQ */
details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px; margin: 10px 0; }
details.faq summary { font-weight: 600; cursor: pointer; padding: 10px 0; }
details.faq p { margin-top: 0; color: var(--ink-soft); }

/* Guide cards */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 20px 0; }
.guide-card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.guide-card:hover { border-color: var(--brand); }
.guide-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.guide-card p { margin: 0; color: var(--ink-soft); font-size: .9rem; }

/* Footer */
footer.site { border-top: 1px solid var(--line); background: var(--surface); margin-top: 48px; padding: 28px 0; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; color: var(--ink-soft); font-size: .9rem; }
footer.site a { color: var(--ink-soft); margin-right: 16px; }
.disclaimer { font-size: .8rem; color: #8896ad; max-width: 720px; }
