/* Caldridge — commercial-banking calculator extensions.
   Augments style.css with KV grids, chart wrappers, and CLS-safe ad zones. */

/* Reserved zones for AdSense Auto Ads. The browser allocates the full height
   on first paint, so when Auto Ads later injects an in-page or in-feed unit
   into the zone, no surrounding content has to shift. CLS stays at zero. */
.ad-zone {
  width: 100%;
  min-height: 280px;
  margin: 28px auto;
  display: block;
  /* Visually neutral on dark; collapses to zero margin on print. */
  background: transparent;
  contain: layout style;
}
@media (max-width: 720px) {
  .ad-zone { min-height: 250px; margin: 20px auto; }
}
@media print { .ad-zone { display: none !important; } }

/* "Pro" calc variant: wider results column, denser typography. */
.calc-wrap.pro h2.section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 6px 0 14px;
}
.calc-wrap.pro h2.section + h2.section { margin-top: 22px; }

.results-col { display: flex; flex-direction: column; gap: 18px; }

/* Two-column data grid for outputs */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.kv-grid > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  min-height: 30px;
}
.kv-grid .k { color: var(--ink-mute); font-size: 0.86rem; }
.kv-grid .v {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  white-space: nowrap;
}
.kv-grid .v.strong { color: var(--accent); font-weight: 600; }
@media (max-width: 540px) { .kv-grid { grid-template-columns: 1fr; } }

/* Result headline — verdict colors */
.result-headline .sub.is-pass { color: var(--good); }
.result-headline .sub.is-watch { color: var(--warn); }
.result-headline .sub.is-fail,
.result-headline .sub.is-breach { color: var(--bad); }

/* Chart wrapper — reserves height to avoid CLS while Chart.js mounts */
.chart-wrap {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.chart-wrap .chart-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  margin-bottom: 10px;
}
.chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 220px !important;
  /* explicit height = no layout shift on Chart.js init */
}

/* Action button row beneath results */
.action-row {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.action-row .btn { font-size: 0.92rem; padding: 10px 18px; }

/* Mini button inside section headers (Add guarantor, Remove, etc.) */
.mini-btn {
  background: rgba(122, 167, 255, 0.10);
  color: var(--accent);
  border: 1px solid rgba(122, 167, 255, 0.22);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms ease, color 120ms ease;
}
.mini-btn:hover { background: rgba(122, 167, 255, 0.18); }
.mini-btn.danger { color: var(--bad); border-color: rgba(255, 142, 142, 0.28); background: rgba(255, 142, 142, 0.06); }
.mini-btn.danger:hover { background: rgba(255, 142, 142, 0.14); }

/* Guarantor block */
.guarantor-row {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 14px 6px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.015);
  position: relative;
}
.guarantor-row .g-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.guarantor-row .g-head .g-label {
  font-size: 0.82rem;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}

/* Print rules — clean tear sheet */
@media print {
  body::before, body::after, .site-header, .site-footer, .ad-zone,
  .action-row, .breadcrumbs { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { background: #fff !important; border: 1px solid #ddd !important; box-shadow: none !important; }
}
