/* ============================================================
   ConCal — Free Concrete Calculator, plan-set cut.
   Loads after v2.css + v3.css.
   ============================================================ */

/* hero */
.calc-hero { text-align: center; padding: 64px 0 0; }
.calc-hero .dim-rule { margin: 18px auto 0; }
.calc-lead {
  margin: 14px auto 0; max-width: 560px;
  font-size: 17px; line-height: 1.55; color: var(--text2); text-wrap: pretty;
}

/* ---------- the takeoff sheet ---------- */
.calc-sheet {
  margin-top: 48px; background: var(--surface); border: 1px solid var(--border2);
  border-radius: 3px; overflow: hidden;
  display: grid; grid-template-columns: 0.95fr 1.05fr;
}
.calc-strip {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 26px; border-bottom: 1px dashed var(--border2);
  background: var(--surface2);
}
.calc-strip .l {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--text2);
}
.calc-strip .l b { color: var(--accent); font-weight: 700; }
.calc-strip .r { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 1px; color: var(--text3); }

.calc-left { padding: 24px 26px 28px; border-right: 1px dashed var(--border2); }
.calc-right { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: 16px; }

/* shape tabs */
.shape-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shape-tab {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 0;
  padding: 13px 4px 11px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  cursor: pointer; color: var(--text2); font-family: inherit;
  appearance: none; -webkit-appearance: none;
  transition: none;
}
.shape-tab:hover { border-color: var(--border2); color: var(--text); }
.shape-tab.on { background: var(--accent-wash); border-color: var(--accent-line); color: var(--accent); }
.shape-tab svg { width: 25px; height: 25px; }
.shape-tab span { font-size: 13px; font-weight: 600; letter-spacing: 0.1px; white-space: nowrap; }

/* fields */
.calc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.cfield label {
  display: block; font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 1.3px; text-transform: uppercase; color: var(--text3); margin-bottom: 7px;
}
.cfield .inwrap { position: relative; }
.cfield input {
  width: 100%; height: 42px; box-sizing: border-box;
  background: var(--surface2); border: 1px solid var(--border2); border-radius: 8px;
  color: var(--text); font-family: var(--font, 'Public Sans', sans-serif);
  font-size: 15px; font-weight: 600; padding: 0 46px 0 12px;
  transition: border-color 0.13s; outline: none;
  appearance: textfield; -moz-appearance: textfield;
}
.cfield input::-webkit-outer-spin-button, .cfield input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cfield input:focus { border-color: var(--accent); }
.cfield input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cfield .unit {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.6px;
  color: var(--text3); pointer-events: none;
}
.cfield .hint { font-size: 11px; line-height: 1.45; color: var(--text3); margin-top: 6px; }

/* preview */
.calc-preview { position: relative; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); overflow: hidden; }
.calc-preview svg { display: block; width: 100%; height: auto; }
/* Same viewBox-scaling problem as the audit sheet: 10.9px at 1280 and 7.0px
   at 375. These are the dimensions of the slab being previewed. */
.calc-preview text { font-size: 13px; }
@media (max-width: 600px) { .calc-preview text { font-size: 19px; } }
.calc-preview .ptag {
  position: absolute; top: 10px; left: 12px; font-family: var(--mono);
  font-size: 11px; font-weight: 600; letter-spacing: 1.4px; color: var(--text3);
}
.calc-preview .ptag-br { top: auto; left: auto; bottom: 10px; right: 12px; letter-spacing: 1.1px; }

/* results */
.calc-results { display: flex; flex-direction: column; }
.calc-results .rhead {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--text3); margin-bottom: 4px;
}
.crow { display: flex; align-items: baseline; gap: 10px; padding: 11px 0; font-size: 15px; color: var(--text); }
.crow + .crow { border-top: 1px dashed var(--border); }
.crow .lead { flex: 1; border-bottom: 1px dotted var(--border); transform: translateY(-3px); min-width: 16px; }
.crow .v { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.crow .v.soft { color: var(--text3); }
.crow .v.warn { color: var(--orange); }
.crow .inline-price { display: inline-flex; align-items: center; gap: 4px; }
.crow .inline-price input {
  width: 58px; height: 28px; box-sizing: border-box; text-align: right;
  background: var(--surface2); border: 1px solid var(--border2); border-radius: 6px;
  color: var(--text); font-family: var(--mono); font-size: 13px; font-weight: 600;
  padding: 0 7px; outline: none; transition: border-color 0.13s;
  appearance: textfield; -moz-appearance: textfield;
}
.crow .inline-price input::-webkit-outer-spin-button, .crow .inline-price input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.crow .inline-price input:focus { border-color: var(--accent); }
.crow .inline-price input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.crow .inline-price .cur, .crow .inline-price .per { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--text3); }

/* the order line */
.calc-order {
  margin-top: 12px; padding: 16px 18px 15px; border: 1px solid var(--green-line);
  background: var(--green-wash); border-radius: 10px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.calc-order .lbl { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text2); }
.calc-order .sub { font-size: 11px; color: var(--text2); margin-top: 5px; }
.calc-order .amt { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.calc-order .amt .n { font-size: 46px; font-weight: 500; letter-spacing: -0.015em; line-height: 0.95; color: var(--green); font-variant-numeric: tabular-nums; }
.calc-order .amt .u { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--green); }

/* contextual notes */
.calc-note {
  display: flex; gap: 10px; align-items: baseline;
  border: 1px dashed var(--border2); border-radius: 8px; padding: 10px 14px;
  font-size: 13px; line-height: 1.5; color: var(--text2);
}
.calc-note b { color: var(--text); font-weight: 600; }
.calc-note .ic { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.8px; color: var(--orange); flex: 0 0 auto; }
.calc-note .ic.grn { color: var(--green); }

/* draw-it CTA under the sheet */
.calc-draw {
  margin-top: 24px; border: 1px solid var(--accent-line); background: var(--accent-wash);
  border-radius: 12px; padding: 20px 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.calc-draw .t { flex: 1; min-width: 240px; }
.calc-draw .t h2, .calc-draw .t h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.018em; color: var(--text); }
.calc-draw .t p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--text2); }

/* ---------- reference sections ---------- */
.ref-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ref-table th {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 1.3px;
  text-transform: uppercase; color: var(--text3); text-align: left;
  padding: 10px 14px; border-bottom: 1px solid var(--border2); background: var(--surface2);
}
.ref-table td { padding: 11px 14px; border-bottom: 1px dashed var(--border); color: var(--text2); }
.ref-table td:first-child { color: var(--text); font-weight: 600; }
.ref-table tr:last-child td { border-bottom: none; }
.ref-table .hi { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--green); }
.ref-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--card-shadow); }

/* formula */
.formula-card {
  background: var(--surface); border: 1px dashed var(--border2); border-radius: 12px;
  padding: 22px 26px; font-family: var(--mono); font-size: 13px; line-height: 1.9; color: var(--text2);
}
.formula-card b { color: var(--text); font-weight: 700; }
.formula-card .acc { color: var(--accent); }
.formula-card .grn { color: var(--green); }

/* FAQ accordion */
.cfaq { display: flex; flex-direction: column; gap: 12px; }
.cfaq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--card-shadow); }
.cfaq-q {
  width: 100%; display: flex; align-items: baseline; gap: 12px; padding: 16px 20px;
  background: none; border: none; cursor: pointer; text-align: left; font-family: inherit;
  font-size: 15px; font-weight: 700; color: var(--text);
}
.cfaq-q i { font-family: var(--mono); font-style: normal; font-size: 11px; font-weight: 600; color: var(--accent); }
.cfaq-q .chev { margin-left: auto; color: var(--text3); transition: transform 0.18s ease; display: inline-flex; align-self: center; }
.cfaq-q .chev svg { width: 14px; height: 14px; }
.cfaq-item.open .cfaq-q .chev { transform: rotate(180deg); }
.cfaq-a { display: none; padding: 0 20px 18px 47px; font-size: 13px; line-height: 1.65; color: var(--text2); }
.cfaq-a b { color: var(--text); font-weight: 600; }
.cfaq-a a { color: var(--accent); }
.cfaq-item.open .cfaq-a { display: block; }

/* responsive */
@media (max-width: 920px) {
  .calc-sheet { grid-template-columns: 1fr; }
  .calc-left { border-right: none; border-bottom: 1px dashed var(--border2); }
  .shape-tabs { grid-template-columns: repeat(3, 1fr); }
  .calc-fields { grid-template-columns: 1fr; }
  .calc-order .amt .n { font-size: 34px; }
  /* reference tables scroll within their card instead of overflowing the page */
  .ref-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ref-table { min-width: 360px; }
}

/* ── letterform colours ────────────────────────────────── */
/* Accent and green are fine as fills and icons and short of the bar as
   text. Measured in both themes: the sheet label 4.02:1 dark, the active
   shape tab 4.00:1 dark, the CY unit 3.05:1 light, the TIP marker 3.38:1
   light. Ink tokens are defined in v3.css per theme. */
.l b,
.shape-tab span,
.shape-tab.on span { color: var(--accent-ink, var(--accent)); }
.amt .u,
.calc-note .ic.grn { color: var(--green-ink, var(--green)); }
.calc-order .amt .u, html body .calc-note .ic.grn { color: var(--green-ink, var(--green)); }
html body .lbl { color: var(--text); }
html[data-theme="dark"] .l b { color: var(--accent-ink); }
html[data-theme="dark"] .lbl { color: var(--text); }
/* the rounded-CY note inherits text2, which is 4.45:1 on the dark result card */
html[data-theme="dark"] .sub { color: var(--text); }
