/* =============================================================
   Shared web-calculator styles (every tool page + the Foster Tools suite).
   Colors come from the page's tokens (site.css on search pages, suite.css
   in /tools/), so the same markup looks right in both. Per-tool accent:
   set --calc-accent / --calc-accent-soft on the .calc element.
   ============================================================= */
.calc {
  --calc-accent: #0284c7;
  --calc-accent-soft: rgba(2, 132, 199, 0.12);
  /* --ca / --cas are what the rules use: the page accent, or its --calc-accent-dark twin in the dark theme. */
  --ca: var(--calc-accent);
  --cas: var(--calc-accent-soft);
  max-width: 860px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.calc fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.calc legend, .calc label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.calc input[type="number"], .calc input[type="text"], .calc select {
  width: 100%;
  font: 600 22px/1.2 var(--font-body);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.calc select { font-size: 17px; appearance: none; }
.calc input:focus, .calc select:focus { outline: 2px solid var(--ca); outline-offset: 1px; }
.calc .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calc .pair label { margin-bottom: 6px; }
.calc .field + .field { margin-top: 12px; }
.calc .pair .field + .field { margin-top: 0; }
/* A label that wraps on a phone grows upward, so both inputs in a pair stay level. */
.calc .pair .field { display: flex; flex-direction: column; }
.calc .pair .field label { flex: 1; }
.calc .hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button, .presets button {
  font: 600 14px/1 var(--font-body);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  min-height: 40px;
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--ca); border-color: var(--ca); color: var(--calc-on-accent, #fff); }
.seg button[data-pro-feature]::after, .result-actions button[data-pro-feature]::after { content: " · Pro"; font-size: 11px; color: var(--ca); }
.seg button[data-pro-feature][aria-pressed="true"]::after { color: var(--calc-on-accent, #fff); }
html[data-pro="true"] [data-pro-feature]::after { content: none; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.presets button { font-size: 12px; padding: 7px 10px; min-height: 32px; color: var(--muted); }
.lock-note { font-size: 14px; background: var(--cas); border-radius: 12px; padding: 12px 14px; margin: 0; }
.lock-note a { color: var(--ca); font-weight: 600; }
.result { background: var(--cas); border-radius: 18px; padding: 22px; align-self: start; }
.result-label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0; }
.result-value { font-size: clamp(34px, 6vw, 48px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 6px 0 4px; color: var(--text); }
.result-sub { font-weight: 600; color: var(--ca); margin: 0 0 16px; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.result-stats div { background: var(--surface); border-radius: 12px; padding: 10px; min-width: 0; }
.result-stats dt { font-size: 11px; color: var(--muted); }
.result-stats dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.result-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 16px; }
.result-actions button { font: 600 14px/1 var(--font-body); color: var(--ca); background: var(--surface); border: 1px solid var(--ca); border-radius: 999px; padding: 10px 14px; min-height: 40px; cursor: pointer; }
.result-actions a, .pro-account { font-size: 14px; font-weight: 600; color: var(--ca); }
.calc-warning { font-size: 14px; color: #9a3412; background: #ffedd5; border-radius: 12px; padding: 10px 12px; margin: 14px 0 0; }
.calc[data-state="empty"] .result-body { opacity: 0.35; }
.options { grid-column: 1 / -1; overflow-x: auto; }
.options table { width: 100%; border-collapse: collapse; font-size: 14px; }
.options caption { text-align: left; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
.options th, .options td { text-align: left; padding: 9px 6px; border-top: 1px solid var(--border); }
.options thead th { border-top: 0; font-size: 12px; color: var(--muted); }
.options tbody th { font-weight: 500; }
.options td { white-space: nowrap; }
.options tr[aria-current="true"] th, .options tr[aria-current="true"] td { color: var(--ca); font-weight: 700; }
.pro-panel { grid-column: 1 / -1; border: 1px dashed var(--ca); border-radius: 18px; padding: 18px; }
.pro-panel h3 { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.pro-panel h3 .pro-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 999px; background: var(--ca); color: var(--calc-on-accent, #fff); }
html[data-pro="true"] .pro-panel h3 .pro-tag { display: none; }
.pro-panel[data-locked="true"] .pro-out { filter: blur(5px); user-select: none; }
.calc-app { grid-column: 1 / -1; font-size: 14px; color: var(--muted); margin: 0; }
.calc-app a { color: var(--ca); font-weight: 600; }
.measure { display: flex; flex-direction: column; gap: 10px; }
.measure-live { font-size: 15px; color: var(--muted); margin: 0; }
.measure button { align-self: flex-start; }
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-top: 1px solid var(--border); padding: 16px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.suite-bar { max-width: 860px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #15120F; color: #F5F1EA; border-radius: 14px; padding: 10px 14px; font-size: 14px; text-decoration: none; }
.suite-bar span { flex-shrink: 1; min-width: 0; }
.suite-bar b { font-weight: 600; }
.suite-bar em { font-style: normal; font-weight: 600; color: #E9C77B; flex-shrink: 0; white-space: nowrap; }
@media (max-width: 760px) {
  .calc { grid-template-columns: 1fr; padding: 18px; gap: 20px; }
  .result-stats { grid-template-columns: 1fr 1fr; }
}
@media print {
  body > header, .hero, section:not(#calculator), footer, .calc fieldset, .presets, .result-actions, .calc-app, .lock-note, .suite-bar, .suite-top, .suite-foot { display: none !important; }
  #calculator { padding: 0 !important; }
  .calc { box-shadow: none; border: 0; display: block; color: #000; }
  .result { background: none; padding: 0; }
  .pro-panel { border: 0; padding: 0; margin-top: 16px; }
}

[data-theme="dark"] .calc {
  --ca: var(--calc-accent-dark, var(--calc-accent));
  --cas: var(--calc-accent-soft-dark, var(--calc-accent-soft));
  --calc-on-accent: #15120F;
}
[data-theme="dark"] .suite-bar { border: 1px solid rgba(233, 199, 123, 0.22); }
/* Per-tool disclaimer (config/tools/<slug>.json "disclaimer", written by tools/build-suite.mjs). Prints with the report. */
.calc-note { grid-column: 1 / -1; margin: 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; line-height: 1.5; color: var(--muted); }
.calc-note a { color: var(--muted); text-decoration: underline; }
@media print { .calc-note { color: #444; border-color: #ccc; } .calc-note a { display: none; } }
