/* AI cost calculator (/tools/cost-calculator) only — linked from calc_page(), nowhere else.
   Layout: left card = the project rows, right card = sticky result panel, breakdown table below both.
   Palette: green / blue / black and their tints only; any text on solid green is white. */
.calc2, .calc-wide {
  --c-green: #16a34a; --c-green-ink: #16a34a; --c-blue: #0ea5e9; --c-ink: #0f1115; --c-muted: #5b6470;
  --c-tint: #ecfdf3; --c-border: #e5e7eb; --c-card: #ffffff; --c-btn2: #f1f4f3; --c-field: #ffffff;
  --c-bar: rgba(15, 17, 21, .12); --c-sh: 0 1px 2px rgba(15, 17, 21, .04), 0 10px 30px -14px rgba(15, 17, 21, .16);
}
html[data-theme="dark"] .calc2, html[data-theme="dark"] .calc-wide {
  --c-green-ink: #34c46a; --c-ink: var(--text); --c-muted: var(--muted); --c-tint: rgba(22, 163, 74, .16);
  --c-border: var(--line); --c-card: var(--panel); --c-btn2: var(--panel-2); --c-field: var(--panel-2);
  --c-bar: rgba(255, 255, 255, .16); --c-sh: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -16px rgba(0, 0, 0, .6);
}

/* compact hero: the result panel must be on screen at 1440x900 without scrolling */
.seo-page .calc2-hero { margin: 8px 0 22px; }
.seo-page .calc2-hero h1 { font-family: "Nunito", var(--font); font-weight: 900; font-size: clamp(28px, 3.2vw, 40px); margin-bottom: 6px; }
.seo-page .calc2-hero .lead { font-size: 16px; margin-top: 6px; max-width: 760px; margin-left: auto; margin-right: auto; }

/* a bit wider than the 1120px text column so the breakdown table fits next to the panel */
.seo-page section.calc2 { margin: 0 calc((100% - min(1240px, 100vw - 32px)) / 2) 40px; }
.calc2-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.calc2-left { display: grid; gap: 16px; min-width: 0; }
.calc2-card { background: var(--c-card); color: var(--c-ink); border: 1px solid var(--c-border); border-radius: 18px;
  box-shadow: var(--c-sh); padding: 20px; }

/* ---------- left: the project ---------- */
.calc2-project .calc-head, .calc2-project .calc-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 84px 40px;
  gap: 8px; align-items: center; margin: 0 0 8px; }
.calc2-project .calc-head { margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--c-muted); }
.calc2-project .calc-row[hidden] { display: none; }
.calc2-project .calc-row select, .calc2-project .calc-row input { width: 100%; min-width: 0; height: 42px; padding: 0 10px; font: inherit; font-size: 15px;
  background: var(--c-field); color: var(--c-ink); border: 1px solid var(--c-border); border-radius: 10px; }
.calc2-project .calc-row select:first-child { font-weight: 700; }
.calc2-project .calc-row input { text-align: right; font-variant-numeric: tabular-nums; }
.calc2-project .calc-row :is(select, input):focus-visible { outline: 2px solid var(--c-blue); outline-offset: 1px; border-color: var(--c-blue); }
.calc-del { width: 40px; height: 42px; display: grid; place-items: center; padding: 0; font: 400 24px/1 var(--font); cursor: pointer;
  background: var(--c-btn2); color: var(--c-ink); border: 0; border-radius: 10px; }
.calc-del[hidden] { display: none; }
.calc-del:hover:not(:disabled) { background: var(--c-tint); color: var(--c-green-ink); }
.calc-del:disabled { opacity: .35; cursor: default; }
.calc-del:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 1px; }
.calc2-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.calc2-bar [hidden] { display: none !important; }
.calc2 .btn { border: 0 !important; box-shadow: none !important; font-weight: 800; }
.calc2 .btn:not(.ghost) { background: var(--c-green) !important; color: #fff !important; }
.calc2 .btn:not(.ghost):hover { background: #15803d !important; }
.calc2 .btn.ghost { background: var(--c-btn2) !important; color: var(--c-ink) !important; }
.calc2 .btn.ghost:hover:not(:disabled) { background: var(--c-tint) !important; }
.calc2 .btn:disabled { opacity: .45; cursor: default; }

/* ---------- right: sticky result panel ---------- */
.calc2-panel { position: sticky; top: 84px; display: grid; gap: 14px; }
.cp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.calc2 .cp-head h2 { margin: 0; font-family: "Nunito", var(--font); font-weight: 900; font-size: 20px; letter-spacing: -.02em; }
.cp-unit .unit-toggle.top-unit { transform: scale(.92); transform-origin: right center; }
.cp-us { display: grid; gap: 2px; }
.cp-lbl { font-size: 13px; font-weight: 700; color: var(--c-muted); }
.cp-big { font-family: "Nunito", var(--font); font-size: 44px; font-weight: 900; line-height: 1.05; letter-spacing: -.03em;
  color: var(--c-green-ink); font-variant-numeric: tabular-nums; }
.cp-max { font-size: 13px; color: var(--c-muted); }
.cp-max b { color: var(--c-green-ink); font-weight: 800; }
.cp-save { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 12px 14px;
  border-radius: 12px; background: var(--c-green); color: #fff; }
.cp-save b { grid-row: span 2; font-family: "Nunito", var(--font); font-size: 30px; font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.cp-save span { font-weight: 800; font-size: 15px; }
.cp-save small { font-size: 13px; opacity: .92; font-variant-numeric: tabular-nums; }
.cp-save small .pz { color: #fff; }
.cp-vs { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.cp-vs li { display: grid; grid-template-columns: minmax(0, 1fr) auto 46px; column-gap: 10px; row-gap: 4px; align-items: baseline; font-size: 14px; }
.cp-n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-v { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.cp-p { text-align: right; font-size: 13px; font-weight: 800; color: var(--c-green-ink); font-variant-numeric: tabular-nums; }
.cp-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: transparent; overflow: hidden; }
.cp-bar i { display: block; height: 100%; border-radius: 3px; background: var(--c-bar); }
.cp-vs li.us .cp-n, .cp-vs li.us .cp-v { color: var(--c-green-ink); font-weight: 800; }
.cp-vs li.us .cp-bar i { background: var(--c-green); }
.cp-vs li.na { color: var(--c-muted); }
.cp-vs li.na .cp-bar { height: 0; }
.cp-note { margin: 0; font-size: 12px; line-height: 1.45; color: var(--c-muted); }
.calc2 .cp-cta { justify-self: stretch; justify-content: center; text-align: center; }

/* ---------- tables: square corners, light green header, our columns in green ---------- */
.calc2-detail:empty { display: none; }
.calc2-detail { min-width: 0; }
.calc2-detail .unit-bar { display: none; }   /* the panel has its own switch */
.calc2-detail .tg-table-wrap { margin: 0; }
.calc2 .calc-result th, .calc2 .calc-result td { padding: 8px 9px; font-size: 13px; }
.calc2 .calc-result thead th { font-size: 10.5px; }
.calc2 .tg-table-wrap, .calc-wide .tg-table-wrap { border-radius: 0; border: 1px solid var(--c-border); background: var(--c-card); box-shadow: var(--c-sh); }
.calc2 .tg-table, .calc-wide .tg-table { border: 0; border-radius: 0; background: var(--c-card); color: var(--c-ink); }
.calc2 .tg-table th, .calc2 .tg-table td, .calc-wide .tg-table th, .calc-wide .tg-table td { border-radius: 0; border-bottom: 1px solid var(--c-border); }
/* header + our columns come from the site-wide v6 table style (variants.css); only the totals row is ours */
.calc2 .tg-table thead th { background: var(--c-tint); color: var(--c-ink); }
.calc2 .tg-table tfoot th { background: var(--c-tint); color: var(--c-ink); border-top: 1px solid var(--c-border); }
.calc2 .tg-table tfoot th.us { color: var(--c-green-ink); }
.calc-wide .tg-table a.mname:hover { color: var(--c-blue); }
.calc-wide .calc-notes a, .calc-wide p a { color: var(--c-blue); }

/* ---------- tablet / phone: stack, panel stops being sticky ---------- */
@media (max-width: 980px) {
  .calc2-grid { grid-template-columns: 1fr; gap: 16px; }
  .calc2-left { display: contents; }             /* order: project, result panel, breakdown */
  .calc2-project { order: 1; }
  .calc2-panel { position: static; order: 2; }
  .calc2-detail { order: 3; }
}
@media (max-width: 640px) {
  .calc2-card { padding: 14px; border-radius: 14px; }
  .calc2-project .calc-head { display: none; }
  .calc2-project .calc-row { grid-template-columns: minmax(0, 1fr) 76px 40px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--c-border); }
  .calc2-project .calc-row select:first-child { grid-column: 1 / -1; }
  .calc2-bar .btn { flex: 1 1 auto; justify-content: center; }
  .cp-big { font-size: 38px; }
}
