  .ghro-calc {
    --paper: #f2efe6;
    --card: #ffffff;
    --ink: #1c1a15;
    --ink-soft: #635d4e;
    --line: #ddd7c6;
    --line-strong: #b9b29c;
    --blue: #0a6ca8;
    --red: #c43d2a;
    --radius: 3px;
    --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

    box-sizing: border-box;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.5;
    max-width: 980px;
    margin: 0 auto;
    padding: clamp(20px, 4vw, 44px);
    -webkit-font-smoothing: antialiased;
  }
  .ghro-calc *, .ghro-calc *::before, .ghro-calc *::after { box-sizing: inherit; }
  .ghro-calc, .ghro-calc :where(button, input, select) { font-family: var(--serif); }

  .ghro-calc :where(h1, h2, .ghro-tab, .ghro-summary-label, .ghro-total-amount,
    .ghro-total-label, .ghro-brand, label, .ghro-copy, .ghro-stats dt, .ghro-stats dd,
    .ghro-summary-desc, select, input) { font-family: var(--sans); }

  .ghro-brand {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
    font-size: 14px; font-weight: 600; margin: 0 0 18px;
    letter-spacing: 0.01em;
  }
  .ghro-brand-sub { font-family: var(--serif); font-weight: 400; font-size: 14px; color: var(--ink-soft); }

  .ghro-head h1 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 600; margin: 0 0 8px; letter-spacing: -0.01em; }
  .ghro-lede { font-size: 16px; color: var(--ink-soft); margin: 0 0 28px; max-width: 52ch; }

  .ghro-tabs { display: flex; gap: 2px; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; width: fit-content; }
  .ghro-tab {
    appearance: none; border: 0; background: transparent; color: var(--ink);
    font-size: 14px; font-weight: 600; padding: 11px 20px; cursor: pointer;
    letter-spacing: 0.01em;
  }
  .ghro-tab + .ghro-tab { border-left: 1.5px solid var(--ink); }
  .ghro-tab.is-active { background: var(--ink); color: var(--paper); }
  .ghro-tab:focus-visible, .ghro-calc button:focus-visible, .ghro-calc select:focus-visible, .ghro-calc input:focus-visible {
    outline: 2.5px solid var(--blue); outline-offset: 2px;
  }
  .ghro-tab-hint { font-size: 14px; color: var(--ink-soft); margin: 12px 0 32px; }

  .ghro-body { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; }
  @media (min-width: 800px) {
    .ghro-body { grid-template-columns: 1.4fr 1fr; gap: 40px; }
    .ghro-summary { position: sticky; top: 20px; }
  }

  .ghro-field { margin-bottom: 18px; }
  .ghro-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
  .ghro-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
  .ghro-dot-blue { background: var(--blue); }
  .ghro-dot-red { background: var(--red); }
  .ghro-help { font-size: 13px; color: var(--ink-soft); margin: 5px 0 0; font-family: var(--serif); }

  .ghro-calc select, .ghro-calc input[type="number"] {
    width: 100%; font-size: 16px; color: var(--ink); background: var(--card);
    border: 1.5px solid var(--line-strong); border-radius: var(--radius);
    padding: 11px 12px; appearance: none;
  }
  .ghro-calc select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231c1a15' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
  }
  .ghro-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

  .ghro-panel[hidden] { display: none; }

  .ghro-fieldset { border: 0; padding: 0; margin: 0 0 22px; }
  .ghro-fieldset legend { font-family: var(--sans); font-size: 13px; font-weight: 600; margin-bottom: 10px; padding: 0; color: var(--ink); }
  .ghro-check-group { display: flex; flex-direction: column; gap: 14px; }
  .ghro-check-label {
    display: flex; align-items: flex-start; gap: 10px; cursor: pointer; position: relative;
    padding: 6px 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  }
  .ghro-check-label input[type="checkbox"] {
    position: absolute; inset: 0; z-index: 1;
    width: 100%; height: 100%; margin: 0; padding: 0;
    opacity: 0 !important;
    appearance: none !important; -webkit-appearance: none !important; -moz-appearance: none !important;
    border: 0 !important; background: none !important;
    cursor: pointer;
  }
  .ghro-checkbox-box {
    display: block; box-sizing: border-box !important;
    width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; position: relative;
    border: 1.5px solid var(--line-strong) !important;
    border-radius: 3px !important;
    background: var(--card) !important;
    transition: background-color .12s ease, border-color .12s ease;
  }
  .ghro-check-label input[type="checkbox"]:checked ~ .ghro-checkbox-box {
    background: var(--blue) !important; border-color: var(--blue) !important;
  }
  .ghro-check-label input[type="checkbox"]:checked ~ .ghro-checkbox-box::after {
    content: ""; position: absolute; left: 5px; top: 2px;
    width: 5px; height: 9px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  .ghro-check-label input[type="checkbox"]:focus-visible ~ .ghro-checkbox-box {
    outline: 2.5px solid var(--blue); outline-offset: 2px;
  }
  .ghro-check-title { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink); display: block; }
  .ghro-check-desc { font-family: var(--serif); font-size: 13px; color: var(--ink-soft); line-height: 1.4; display: block; margin-top: 2px; }

  .ghro-summary-inner {
    background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius);
    padding: 24px;
  }
  .ghro-summary-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--ink-soft); margin: 0 0 6px; }
  .ghro-summary-desc { font-size: 17px; font-weight: 600; margin: 0 0 18px; }

  .ghro-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; margin: 0 0 20px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .ghro-stats > div { min-width: 0; }
  .ghro-stats dt { font-size: 11px; color: var(--ink-soft); font-weight: 600; margin: 0 0 2px; }
  .ghro-stats dd { font-size: 18px; font-weight: 600; margin: 0; font-variant-numeric: tabular-nums; }

  .ghro-total { box-shadow: 4px 4px 0 var(--blue); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 16px 18px; margin: 4px 4px 22px 0; }
  .ghro-total-label { font-size: 12px; color: var(--ink-soft); font-weight: 600; margin: 0 0 4px; }
  .ghro-total-amount { font-size: clamp(26px, 3.4vw, 32px); font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
  .ghro-total-per { font-family: var(--serif); font-size: 14px; color: var(--ink-soft); margin: 4px 0 0; }
  .ghro-total-flag { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--red); margin: 8px 0 0; }

  .ghro-copy {
    width: 100%; appearance: none; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
    font-size: 14px; font-weight: 600; border-radius: var(--radius); padding: 13px; cursor: pointer;
  }
  .ghro-copy:hover { background: var(--blue); border-color: var(--blue); }
  .ghro-copy[data-copied="true"] { background: var(--red); border-color: var(--red); }

  .ghro-note { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); margin: 16px 0 0; }

  @media (prefers-reduced-motion: no-preference) {
    .ghro-copy { transition: background-color .15s ease, border-color .15s ease; }
  }

/* ---- v5: server-side calculation states ---- */
.ghro-calc .ghro-summary-desc,
.ghro-calc .ghro-stats dd,
.ghro-calc .ghro-total-amount,
.ghro-calc .ghro-total-per { transition: opacity .15s ease; }

/* Calculating: the old numbers fade so they're clearly no longer current. */
.ghro-calc.is-pending .ghro-summary-desc,
.ghro-calc.is-pending .ghro-stats dd,
.ghro-calc.is-pending .ghro-total-amount,
.ghro-calc.is-pending .ghro-total-per,
.ghro-calc.is-error .ghro-summary-desc,
.ghro-calc.is-error .ghro-stats dd,
.ghro-calc.is-error .ghro-total-amount,
.ghro-calc.is-error .ghro-total-per { opacity: .3; }

.ghro-status { font-family: var(--sans); font-weight: 600; color: var(--blue); margin-left: 6px; white-space: nowrap; }
.ghro-calc.is-pending .ghro-status::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue); margin-right: 6px; vertical-align: 1px;
}
@media (prefers-reduced-motion: no-preference) {
  .ghro-calc.is-pending .ghro-status::before { animation: ghroPulse .9s ease-in-out infinite; }
}
@keyframes ghroPulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

.ghro-error[hidden] { display: none; }
.ghro-error {
  border: 1.5px solid var(--red); border-radius: var(--radius);
  padding: 12px 14px; margin: 0 0 16px; background: #fbf0ee;
}
.ghro-error-msg { font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--red); margin: 0 0 10px; }
.ghro-retry {
  appearance: none; font-family: var(--sans); font-size: 13px; font-weight: 600;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--ink);
  border-radius: var(--radius); padding: 8px 14px; cursor: pointer;
}
.ghro-retry:hover { background: var(--ink); color: var(--paper); }

.ghro-copy:disabled,
.ghro-copy:disabled:hover { background: var(--ink); border-color: var(--ink); opacity: .4; cursor: not-allowed; }

/* Empty state (5.3.1): nothing calculated until the specs are filled in. */
.ghro-calc.is-empty .ghro-summary-desc { font-weight: 400; font-size: 0.95rem; line-height: 1.5; opacity: 0.7; }
.ghro-calc.is-empty .ghro-total-amount { opacity: 0.35; }
