/* MoneyHackHQ Site Tools: rate tables, bonus table, interest calculator.
   Colours come from the theme's custom properties when present, with plain fallbacks. */
.mhhq-data, .mhhq-calc, .mhhq-rate-panel, .mhhq-disclose {
  --t-ink: var(--mh-ink, #111a26);
  --t-ink-2: var(--mh-ink-2, #3c4757);
  --t-muted: var(--mh-muted, #5d6878);
  --t-rule: var(--mh-rule, #d5dbe3);
  --t-band: var(--mh-band, #f1f4f8);
  --t-blue: var(--mh-blue, #1d4ed8);
  --t-blue-ink: var(--mh-blue-ink, #163a9e);
  --t-blue-wash: var(--mh-blue-wash, #e8eefc);
}
.mhhq-stamp { font-family: var(--mh-mono, ui-monospace, Menlo, monospace); font-size: 13px; color: var(--mh-muted, #5d6878); }
.mhhq-stamp b { color: var(--mh-ink, #111a26); font-weight: 500; white-space: nowrap; }

.mhhq-btn { display: inline-block; padding: 10px 16px; border: 1px solid var(--t-blue); background: var(--t-blue); color: #fff !important; font: 600 15px/1.2 inherit; text-decoration: none !important; border-radius: 2px; cursor: pointer; white-space: nowrap; }
.mhhq-btn:hover { background: var(--t-blue-ink); border-color: var(--t-blue-ink); }
.mhhq-btn-secondary { background: #fff; color: var(--t-blue) !important; }
.mhhq-btn-secondary:hover { background: var(--t-blue-wash); color: var(--t-blue-ink) !important; }
.mhhq-arrow { font-weight: 600; text-decoration: none; }
.mhhq-arrow::after { content: " →"; }

/* Tables */
.mhhq-data { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; color: var(--t-ink); margin: 0; }
.mhhq-data th { text-align: left; font-size: 13px; font-weight: 600; color: var(--t-muted); padding: 8px 12px; border-bottom: 2px solid var(--t-ink); background: none; vertical-align: bottom; }
.mhhq-data td { padding: 14px 12px; border-bottom: 1px solid var(--t-rule); vertical-align: top; background: none; }
.mhhq-data td:first-child, .mhhq-data th:first-child { padding-left: 0; }
.mhhq-data td:last-child, .mhhq-data th:last-child { padding-right: 0; }
.mhhq-data .mhhq-name { font-weight: 700; }
.mhhq-data .mhhq-name a { color: var(--t-ink); text-decoration-color: var(--t-rule); }
.mhhq-data .mhhq-sub { display: block; font-weight: 400; font-size: 14px; color: var(--t-muted); }
.mhhq-data .mhhq-num { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; white-space: nowrap; line-height: 1.1; }
.mhhq-data .mhhq-num small { display: block; font-size: 12px; font-weight: 500; color: var(--t-muted); letter-spacing: 0; margin-top: 4px; white-space: normal; }
.mhhq-data .mhhq-rule { color: var(--t-ink-2); }
.mhhq-data .mhhq-bonus { font-weight: 800; font-size: 26px; letter-spacing: -0.02em; white-space: nowrap; }
.mhhq-data .mhhq-cta { text-align: right; }
.mhhq-tag { display: inline-block; font: 500 12px/1.4 var(--mh-mono, ui-monospace, Menlo, monospace); padding: 1px 6px; border: 1px solid currentColor; border-radius: 2px; white-space: nowrap; }
.mhhq-tag-none { color: var(--t-muted); }
.mhhq-disclose { font-size: 14px; color: var(--t-ink-2); background: var(--t-band); padding: 10px 14px; margin-top: 16px; border-left: 3px solid var(--t-ink); }

.mhhq-rate-panel { border: 1px solid var(--t-ink); padding: 20px 22px 16px; background: #fff; }
.mhhq-rate-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.mhhq-rate-top h2 { font-size: 20px; font-weight: 800; margin: 0; }
.mhhq-rate-note { font-size: 13px; color: var(--t-muted); margin: 0 0 4px; }
.mhhq-rate-panel .mhhq-data td { padding: 12px 10px; }
.mhhq-rate-panel .mhhq-data td:first-child { padding-left: 0; }
.mhhq-rate-panel .mhhq-data td:last-child { padding-right: 0; }
.mhhq-rate-panel .mhhq-data .mhhq-num { font-size: 20px; }
.mhhq-rate-foot { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding-top: 12px; font-size: 14px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .mhhq-stack thead { display: none; }
  .mhhq-stack, .mhhq-stack tbody, .mhhq-stack td { display: block; width: 100%; }
  .mhhq-stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--t-rule); }
  .mhhq-stack tr:first-child { border-top: 2px solid var(--t-ink); }
  .mhhq-stack td, .mhhq-rate-panel .mhhq-stack td { padding: 0; border: 0; }
  .mhhq-stack td.mhhq-num, .mhhq-stack td.mhhq-bonus { text-align: right; }
  .mhhq-stack td.mhhq-rule, .mhhq-stack td.mhhq-deadline, .mhhq-stack td.mhhq-cta { grid-column: 1 / -1; text-align: left; }
  .mhhq-stack td.mhhq-rule { margin-top: 6px; }
  .mhhq-bonuses td[data-label]:not(.mhhq-bonus)::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--t-muted); margin-top: 8px; }
  .mhhq-bonuses td.mhhq-cta { padding-top: 10px; }
  .mhhq-rate-panel { padding: 16px 14px 12px; }
}

/* Calculator */
.mhhq-calc { border: 1px solid var(--t-ink); margin: 26px 0; font-size: 16px; color: var(--t-ink); background: #fff; }
.mhhq-calc-head { background: var(--t-ink); color: #fff; padding: 12px 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.mhhq-calc-head h3 { margin: 0 !important; font-size: 18px !important; color: #fff !important; border: 0 !important; padding: 0 !important; }
.mhhq-calc-head span { font-size: 13px; color: #c9d2de; }
.mhhq-calc-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.mhhq-calc-inputs { padding: 18px; display: grid; gap: 14px; border-right: 1px solid var(--t-rule); }
.mhhq-calc-inputs label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.mhhq-hint { font-size: 13px; color: var(--t-muted); margin: 3px 0 0; }
.mhhq-affix { display: flex; align-items: stretch; border: 1px solid #9aa6b5; border-radius: 2px; background: #fff; }
.mhhq-affix:focus-within { outline: 2px solid var(--t-blue); border-color: var(--t-blue); }
.mhhq-affix span { padding: 0 10px; display: flex; align-items: center; color: var(--t-muted); background: var(--t-band); font-size: 15px; }
.mhhq-affix input { border: 0; flex: 1; min-width: 0; width: 100%; height: 42px; padding: 0 10px; font: 500 16px inherit; color: var(--t-ink); background: none; outline: none; box-shadow: none; }
.mhhq-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.mhhq-calc-out { padding: 18px; background: var(--t-band); display: flex; flex-direction: column; gap: 10px; }
.mhhq-calc-label { font-size: 14px; font-weight: 600; color: var(--t-ink-2); }
.mhhq-calc-big { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.mhhq-calc-out dl { margin: 6px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 15px; }
.mhhq-calc-out dt { color: var(--t-ink-2); }
.mhhq-calc-out dd { margin: 0; font-weight: 700; text-align: right; }
.mhhq-calc-out [data-reset] { align-self: flex-start; margin-top: auto; }
.mhhq-calc-assume { border-top: 1px solid var(--t-rule); padding: 14px 18px; font-size: 14px; color: var(--t-ink-2); }
.mhhq-calc-assume h4 { font-size: 14px; margin: 0 0 6px; }
.mhhq-calc-assume ul { margin: 0; padding-left: 1.1em; }
@media (max-width: 560px) {
  .mhhq-calc-body { grid-template-columns: minmax(0, 1fr); }
  .mhhq-calc-inputs { border-right: 0; border-bottom: 1px solid var(--t-rule); }
  .mhhq-calc-big { font-size: 38px; }
}
