
/* CalcBeacon safe layout fix: targeted two-panel calculator pages only */

body.cb-v34-tool .tool-shell.legacy-tool-shell,
body.cb-v34-tool section.tool-shell.legacy-tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: clamp(18px, 2.2vw, 26px);
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

body.cb-v34-tool .tool-shell.legacy-tool-shell > .cb-v34-tool-head {
  grid-column: 1 / -1;
}

body.cb-v34-tool .tool-shell.legacy-tool-shell > .tool-panel {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

body.cb-v34-tool .tool-shell.legacy-tool-shell > .tool-panel .grid,
body.cb-v34-tool .tool-shell.legacy-tool-shell > .tool-panel .form-grid,
body.cb-v34-tool .tool-shell.legacy-tool-shell > .tool-panel .calculator-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

body.cb-v34-tool .tool-shell.legacy-tool-shell .result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Prevent the old copy button row from becoming a third grid column/card */
body.cb-v34-tool .tool-shell.legacy-tool-shell > .cb-v34-copy-row {
  display: none !important;
}

/* Keep copy buttons horizontal if any page already contains one inside a panel */
body.cb-v34-tool .cb-v34-copy-result {
  writing-mode: horizontal-tb !important;
  transform: none !important;
  width: auto !important;
  min-height: 40px !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
}

/* Remove empty decorative badge spacing */
body.cb-v34-tool .cb-v34-tool-badge:empty {
  display: none !important;
}

@media (max-width: 900px) {
  body.cb-v34-tool .tool-shell.legacy-tool-shell,
  body.cb-v34-tool section.tool-shell.legacy-tool-shell {
    grid-template-columns: 1fr;
  }

  body.cb-v34-tool .tool-shell.legacy-tool-shell .result-grid {
    grid-template-columns: 1fr;
  }
}


/* Safe copy-result button after the calculator block */
body.cb-v34-tool .cb-copy-result-row {
  width: 100%;
  max-width: 1180px;
  margin: -10px auto 26px;
  display: flex;
  justify-content: flex-end;
  box-sizing: border-box;
}

body.cb-v34-tool .cb-copy-result-safe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  width: auto;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 850;
  white-space: nowrap;
  writing-mode: horizontal-tb !important;
  transform: none !important;
  background: rgba(255,255,255,.075) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  color: #f8fbff !important;
}

body.cb-v34-tool .cb-copy-result-safe:hover {
  border-color: rgba(56,189,248,.46) !important;
  background: rgba(56,189,248,.10) !important;
}

@media (max-width: 760px) {
  body.cb-v34-tool .cb-copy-result-row {
    margin: -8px auto 22px;
    justify-content: stretch;
  }

  body.cb-v34-tool .cb-copy-result-safe {
    width: 100%;
  }
}
