/* CompSheet styles. One stylesheet, self hosted, system font stack, no CDN.
   Screen styles first, print styles for the one-sheet at the end. */

:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --accent: #10b981;
  --accent-dark: #059669;
  --accent-soft: #ecfdf5;
  --navy: #0f172a;
  --warn: #b45309;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); }

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 20;
}
.skip-link:focus { left: 0; }

/* ---- header / footer ---- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: var(--wrap); margin: 0 auto; padding: 1rem 1.25rem;
}
.site-header__brand { display: inline-flex; align-items: center; }
.site-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink-soft); font-weight: 600; font-size: .96rem; }

.site-footer {
  max-width: var(--wrap); margin: 4rem auto 2rem; padding: 2rem 1.25rem 0;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem;
}
.site-footer__name { font-weight: 700; color: var(--ink); margin: 0 0 .2rem; }
.site-footer__tagline { margin: 0 0 1rem; max-width: 46ch; }
.site-footer__nav { display: flex; gap: 1.2rem; margin-bottom: 1rem; }
.site-footer__legal { font-size: .82rem; max-width: 78ch; }

main { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

/* ---- hero + tool ---- */
.hero { padding: 2rem 0 1rem; }
.hero__eyebrow {
  display: inline-block; margin: 0 0 1rem; padding: .35rem .8rem;
  background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 999px; font-size: .82rem; font-weight: 700; letter-spacing: .01em;
}
.hero__title { font-size: clamp(1.9rem, 4.4vw, 3rem); margin: 0 0 .8rem; font-weight: 800; }
.hero__lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 62ch; margin: 0 0 1.6rem; }

.tool {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem; margin-bottom: .8rem;
}
.tool__label { display: block; font-weight: 700; margin-bottom: .5rem; font-size: .95rem; }
.tool__inputgroup { display: flex; gap: .6rem; flex-wrap: wrap; }
.tool__input {
  flex: 1 1 320px; min-width: 0; padding: .85rem 1rem; font-size: 1.05rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2);
  font-family: inherit; color: var(--ink);
}
.tool__input:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); background: #fff; }
.tool__note { margin: .9rem 0 0; font-size: .88rem; color: var(--muted); }
.tool__status {
  margin: .6rem 0 0; padding: .8rem 1rem; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; font-size: .95rem;
}
.tool__status[data-kind="error"] { background: #fef2f2; color: var(--danger); }
.tool__status[data-kind="working"] { background: #eff6ff; color: #1d4ed8; }

/* ---- buttons ---- */
.btn {
  appearance: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: .98rem;
  padding: .8rem 1.25rem; border-radius: var(--radius-sm); border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--ink); transition: transform .04s ease, box-shadow .15s ease;
}
.btn:hover { box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent-dark); color: #04231a; }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--accent-dark); }

/* ---- panels / fields ---- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; margin: 1.4rem 0; box-shadow: var(--shadow-sm);
}
.panel__title { font-size: 1.15rem; margin: 0 0 .3rem; font-weight: 700; }
.panel__intro { margin: 0 0 1rem; color: var(--ink-soft); font-size: .96rem; }
.panel--manual > summary { cursor: pointer; list-style: revert; }
.panel__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field__label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.field__input {
  padding: .65rem .75rem; border: 1.5px solid var(--line-strong); border-radius: 8px;
  font-family: inherit; font-size: 1rem; background: var(--surface-2); color: var(--ink);
}
.field__input:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); background: #fff; }

.manual { margin-bottom: 1rem; }
.manual table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.manual th, .manual td { border: 1px solid var(--line); padding: .35rem; }
.manual input { width: 100%; border: none; background: transparent; font-family: inherit; font-size: .9rem; }

/* ---- method ---- */
.method { margin: 3rem 0 1rem; }
.method__title { font-size: 1.5rem; margin: 0 0 .4rem; }
.method__lead { color: var(--ink-soft); max-width: 64ch; margin: 0 0 1.5rem; }
.method__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.method__card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem; box-shadow: var(--shadow-sm);
}
.method__card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.method__card h3::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent); margin-right: .5rem; vertical-align: middle;
}
.method__card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---- disclaimer ---- */
.disclaimer-block {
  margin: 2.5rem 0 0; padding: 1.1rem 1.3rem; border-left: 4px solid var(--warn);
  background: #fffbeb; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .92rem; color: #78350f;
}

/* ---- faq / prose ---- */
.faq { margin: 3rem 0 1rem; }
.faq__title { font-size: 1.5rem; margin: 0 0 1rem; }
.faq__item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .3rem 1rem; margin-bottom: .6rem; background: var(--surface); }
.faq__q { cursor: pointer; font-weight: 700; padding: .6rem 0; }
.faq__a { margin: 0 0 .8rem; color: var(--ink-soft); }

.prose { max-width: 72ch; padding: 1.5rem 0 0; }
.prose--center { text-align: center; margin: 0 auto; }
.prose__title { font-size: clamp(1.7rem, 3.4vw, 2.2rem); margin: 0 0 .7rem; font-weight: 800; }
.prose__lead { font-size: 1.15rem; color: var(--ink-soft); }
.prose h2 { margin: 2rem 0 .6rem; font-size: 1.35rem; }
.glossary dt { font-weight: 700; margin-top: .8rem; }
.glossary dd { margin: 0 0 .2rem; color: var(--ink-soft); }

/* ---- results + one-sheet ---- */
.results { margin: 1.5rem 0; }
.results__actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1rem; }

.onesheet {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.8rem; color: var(--ink);
}
.onesheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 2px solid var(--ink); padding-bottom: .8rem; margin-bottom: 1rem; }
.onesheet__brand { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.onesheet__brand span { color: var(--accent-dark); }
.onesheet__meta { text-align: right; font-size: .8rem; color: var(--muted); }
.onesheet__addr { font-size: 1.4rem; font-weight: 800; margin: 0 0 .2rem; }
.onesheet__sub { color: var(--muted); font-size: .92rem; margin: 0 0 1.2rem; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: 1rem 0; }
.stat { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem; background: var(--surface-2); }
.stat--hero { background: var(--accent-soft); border-color: #a7f3d0; }
.stat__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.stat__value { font-size: 1.5rem; font-weight: 800; margin-top: .15rem; }
.stat__hint { font-size: .78rem; color: var(--muted); }

.onesheet__section { margin: 1.4rem 0; }
.onesheet__section h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); border-bottom: 1px solid var(--line); padding-bottom: .35rem; margin: 0 0 .7rem; }

.comps { width: 100%; border-collapse: collapse; font-size: .88rem; }
.comps th, .comps td { text-align: right; padding: .45rem .5rem; border-bottom: 1px solid var(--line); }
.comps th:first-child, .comps td:first-child { text-align: left; }
.comps thead th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid var(--line-strong); }
.comps tbody tr:last-child td { border-bottom: none; }

.flag { display: inline-block; padding: .3rem .8rem; border-radius: 999px; font-weight: 800; font-size: .85rem; }
.flag--go { background: var(--accent-soft); color: var(--accent-dark); }
.flag--no { background: #fef2f2; color: var(--danger); }
.flag--caution { background: #fffbeb; color: var(--warn); }

.onesheet__summary { background: var(--surface-2); border-radius: var(--radius-sm); padding: 1rem 1.2rem; color: var(--ink-soft); font-size: .95rem; }
.onesheet__ai { margin: .7rem 0 0; font-size: .9rem; color: var(--ink-soft); }
.onesheet__disclaimer { margin-top: 1.2rem; font-size: .74rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .7rem; }
.source-line { font-size: .78rem; color: var(--muted); }

.muted { color: var(--muted); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-nav { gap: 1rem; }
  .onesheet { padding: 1.2rem; }
}

/* ---- print: only the one-sheet ---- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 12px; }
  .site-header, .site-footer, .hero__eyebrow, .hero__title, .hero__lead,
  .tool, #coverage-note, #tool-status, #assumptions, #manual-entry,
  .method, .faq, .disclaimer-block, .results__actions, .skip-link { display: none !important; }
  main { max-width: none; padding: 0; }
  .results { margin: 0; }
  .onesheet { border: none; box-shadow: none; border-radius: 0; padding: 0; }
  .onesheet__head { border-bottom: 2px solid #000; }
  .stat, .stat--hero { background: #fff !important; border: 1px solid #999; }
  .comps th, .comps td { border-color: #999; }
  a { color: #000; text-decoration: none; }
}
