/* Figure My Home — shared styles. Mobile first, no framework. */
:root {
  --ink: #1d2b2a;
  --muted: #5b6b68;
  --bg: #faf8f4;
  --card: #ffffff;
  --line: #e4dfd5;
  --brand: #2f6b4f;
  --brand-ink: #ffffff;
  --brand-soft: #e7f0eb;
  --accent: #d9932b;
  --good: #2e7d4f;
  --bad: #b3402f;
  --warn: #a86b00;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
img, svg { max-width: 100%; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.small { font-size: .85rem; color: var(--muted); }

/* header / footer */
.site-head { background: var(--card); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--brand); text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.site-nav a { margin-left: 16px; text-decoration: none; color: var(--ink); font-weight: 600; }
.site-foot { margin-top: 56px; padding: 28px 0; border-top: 1px solid var(--line); background: var(--card); color: var(--muted); }
.site-foot p { margin: 6px 0; }

/* page heads */
.crumbs { margin: 18px 0 0; font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.page-head h1, .hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); line-height: 1.15; margin: 10px 0 8px; }
.lede { font-size: 1.1rem; color: var(--muted); margin: 0 0 20px; max-width: 60ch; }
.hero { padding: 36px 0 12px; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 58ch; }

/* tool cards on home & related */
.tool-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tool-card { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.tool-card strong { font-size: 1.05rem; }
.tool-card span:last-child { color: var(--muted); font-size: .92rem; }
.tag { align-self: flex-start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 99px; }
.cat h2 { margin: 30px 0 12px; font-size: 1.25rem; }

/* tool layout */
.tool { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
.tool > * { min-width: 0; } /* stop wide tables from stretching the page on phones */
@media (min-width: 860px) { .tool { grid-template-columns: 1.1fr .9fr; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel h2 { font-size: 1.1rem; margin: 0 0 12px; }
.results { position: sticky; top: 12px; background: var(--brand-soft); border-color: #cfe0d6; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.wide { grid-column: 1 / -1; }
label, .label { font-weight: 600; font-size: .9rem; }
.hint { font-size: .8rem; color: var(--muted); }
input, select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #cfc8bb; border-radius: 8px; background: #fff; color: var(--ink); min-height: 44px; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #9cc7b0; outline-offset: 1px; }
.with-unit { display: flex; }
.with-unit input { border-radius: 8px 0 0 8px; }
.with-unit .unit { display: flex; align-items: center; padding: 0 10px; border: 1px solid #cfc8bb; border-left: 0; border-radius: 0 8px 8px 0; background: #f3efe7; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid #cfc8bb; border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 9px 14px; font: inherit; cursor: pointer; min-height: 42px; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: 8px; border: 0; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; min-height: 44px; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* results */
.big { font-size: 2.1rem; font-weight: 800; line-height: 1.1; }
.big small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.stat-list { list-style: none; padding: 0; margin: 12px 0 0; }
.stat-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid #cfe0d6; }
.stat-list li span:last-child { font-weight: 700; text-align: right; }
.pass, .fail, .warn { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.pass { color: var(--good); } .fail { color: var(--bad); } .warn { color: var(--warn); }
.checks { list-style: none; padding: 0; margin: 10px 0 0; }
.checks li { padding: 8px 0; border-top: 1px solid #cfe0d6; }
.note { font-size: .88rem; color: var(--muted); }
table.simple { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.simple th, table.simple td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.simple th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.scroll-x { overflow-x: auto; }

/* content below tools */
.content { max-width: 70ch; }
.content h2 { margin-top: 32px; }
.disclaimer { margin: 18px 0; font-size: .85rem; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 24px 0; padding: 18px; border-radius: var(--radius); background: #1d2b2a; color: #f4f1ea; }
.cta div { flex: 1 1 320px; }
.cta .btn { background: var(--accent); color: #1d2b2a; }
.cta-tem { background: #1b1f2e; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 8px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.related h2, .faq h2 { margin-top: 32px; }

/* drawing canvas (square footage etc.) */
.canvas-box { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; touch-action: none; width: 100%; aspect-ratio: 4 / 3; display: block; }

@media print {
  .site-head, .site-foot, .cta, .related, .faq, .btn-row, .crumbs { display: none !important; }
  body { background: #fff; }
  .results { position: static; }
}
