.sps-hhs-wrap {
    /* Atlantic Bone & Joint Centre palette sampled from the live site design */
    --hhs-accent: #113669;
    --hhs-accent-dark: #0b2b58;
    --hhs-accent-deep: #0a274f;
    --hhs-secondary: #4f6873;
    --hhs-secondary-dark: #415963;
    --hhs-accent-soft: #eef2f7;
    --hhs-accent-soft-2: #f7f8fa;
    --hhs-border: #d4d9df;
    --hhs-border-accent: #b9c5d2;
    --hhs-text: #1d2327;
    --hhs-muted: #5d6d76;
    --hhs-bg: #f1f2f4;
    --hhs-danger: #b42318;
    max-width: 920px;
    margin: 22px auto 8px;
    color: var(--hhs-text);
    font-size: 16px;
    line-height: 1.5;
}

/* The shortcode is normally used inside Popup Maker on the Atlantic Bone & Joint Centre site. */
.pum-content .sps-hhs-wrap {
    margin-top: 10px;
    margin-bottom: 0;
}

/* Match Popup Maker controls to the same site palette when this calculator is inside the popup. */
.pum-container:has(.sps-hhs-wrap) .pum-close {
    background: var(--hhs-accent, #113669) !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
}

.pum-container:has(.sps-hhs-wrap) .pum-close:hover,
.pum-container:has(.sps-hhs-wrap) .pum-close:focus {
    background: var(--hhs-accent-dark, #0b2b58) !important;
    color: #fff !important;
}

.sps-hhs-wrap * { box-sizing: border-box; }

.sps-hhs-intro {
    position: relative;
    margin-bottom: 20px;
    padding: 17px 19px 17px 22px;
    background: linear-gradient(135deg, #f7f8fa 0%, #ffffff 72%);
    border: 1px solid var(--hhs-border-accent);
    border-radius: 9px;
    overflow: hidden;
}

.sps-hhs-intro::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--hhs-accent);
}

.sps-hhs-intro h2 {
    margin: 0 0 6px;
    color: var(--hhs-text);
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
}

.sps-hhs-intro p {
    margin: 0;
    color: var(--hhs-muted);
}

.sps-hhs-form {
    background: #fff;
    border: 1px solid var(--hhs-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(17, 54, 105, .06);
}

.sps-hhs-section {
    position: relative;
    border: 0;
    margin: 0;
    padding: 25px;
    border-bottom: 1px solid var(--hhs-border);
}

.sps-hhs-section:nth-of-type(even) {
    background: var(--hhs-accent-soft-2);
}

.sps-hhs-section legend {
    width: 100%;
    padding: 0 0 17px;
    color: var(--hhs-text);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.3;
}

.sps-hhs-section legend::after {
    content: "";
    display: block;
    width: 44px;
    height: 3px;
    margin-top: 9px;
    border-radius: 999px;
    background: var(--hhs-accent);
}

.sps-hhs-grid { display: grid; gap: 18px; }
.sps-hhs-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.sps-hhs-field label {
    display: block;
    color: var(--hhs-text);
    font-weight: 600;
    margin-bottom: 7px;
}

.sps-hhs-field label span { color: var(--hhs-danger); }

.sps-hhs-field input,
.sps-hhs-field select {
    width: 100%;
    min-height: 47px;
    padding: 10px 12px;
    border: 1px solid #b8c9cf;
    border-radius: 6px;
    background: #fff;
    color: var(--hhs-text);
    font: inherit;
    box-shadow: 0 1px 2px rgba(32, 42, 48, .04);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.sps-hhs-field input:hover,
.sps-hhs-field select:hover {
    border-color: #8fa0ad;
}

.sps-hhs-field input:focus,
.sps-hhs-field select:focus {
    outline: none;
    border-color: var(--hhs-accent);
    box-shadow: 0 0 0 3px rgba(17, 54, 105, .16);
}

.sps-hhs-deformity {
    margin-top: 25px;
    padding: 19px;
    background: var(--hhs-accent-soft);
    border: 1px solid var(--hhs-border-accent);
    border-radius: 8px;
}

.sps-hhs-deformity h3 {
    margin: 0 0 5px;
    color: var(--hhs-secondary-dark);
    font-size: 18px;
}

.sps-hhs-deformity p { margin: 0 0 14px; color: var(--hhs-muted); }

.sps-hhs-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 10px 0;
    cursor: pointer;
}

.sps-hhs-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 3px 0 0;
    flex: 0 0 18px;
    accent-color: var(--hhs-accent);
}

.sps-hhs-rom { margin-top: 22px; max-width: 440px; }

.sps-hhs-consent {
    padding: 19px 24px 7px;
    background: #fff;
}

.sps-hhs-consent .sps-hhs-check {
    margin: 0;
    padding: 13px 14px;
    background: #f7f8fa;
    border: 1px solid var(--hhs-border);
    border-radius: 7px;
}

.sps-hhs-actions {
    padding: 14px 24px 25px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: #fff;
}

.sps-hhs-submit,
.sps-hhs-print,
.sps-hhs-again {
    appearance: none;
    border: 0;
    border-radius: 5px;
    padding: 13px 20px;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .15s ease, background-color .18s ease, box-shadow .18s ease;
}

.sps-hhs-submit,
.sps-hhs-print {
    background: var(--hhs-accent);
    color: #fff;
    box-shadow: 0 6px 16px rgba(17, 54, 105, .20);
}

.sps-hhs-submit:hover,
.sps-hhs-print:hover {
    background: var(--hhs-accent-dark);
    color: #fff;
    transform: translateY(-1px);
}

.sps-hhs-submit:focus-visible,
.sps-hhs-print:focus-visible,
.sps-hhs-again:focus-visible {
    outline: 3px solid rgba(17, 54, 105, .24);
    outline-offset: 2px;
}

.sps-hhs-again {
    background: #e7ebef;
    color: #344b56;
}
.sps-hhs-again:hover { background: #d9e0e5; }
.sps-hhs-submit:disabled { opacity: .65; cursor: wait; transform: none; }
.sps-hhs-status { color: var(--hhs-muted); }
.sps-hhs-status.is-error { color: var(--hhs-danger); }
.sps-hhs-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.sps-hhs-result-card {
    background: #fff;
    border: 1px solid var(--hhs-border-accent);
    border-top: 5px solid var(--hhs-accent);
    border-radius: 10px;
    padding: 27px;
    box-shadow: 0 10px 28px rgba(17, 54, 105, .09);
}

.sps-hhs-result-heading {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    align-items: center;
}

.sps-hhs-result-heading h2 {
    margin: 5px 0 0;
    color: var(--hhs-text);
}

.sps-hhs-eyebrow {
    text-transform: uppercase;
    letter-spacing: .075em;
    font-size: 12px;
    font-weight: 800;
    color: var(--hhs-accent-deep);
}

.sps-hhs-score-badge {
    width: 116px;
    height: 116px;
    flex: 0 0 116px;
    border-radius: 50%;
    background: var(--hhs-accent-soft);
    border: 3px solid var(--hhs-accent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 5px #fff;
}

.sps-hhs-score-badge strong {
    color: var(--hhs-accent-deep);
    font-size: 35px;
    line-height: 1;
}

.sps-hhs-score-badge span {
    color: var(--hhs-muted);
    font-size: 13px;
    margin-top: 5px;
}

.sps-hhs-grade {
    margin: 19px 0;
    padding: 13px 15px;
    background: var(--hhs-accent-soft);
    border-left: 4px solid var(--hhs-accent);
    border-radius: 5px;
}

.sps-hhs-personalised {
    margin: 18px 0 20px;
    padding: 19px;
    background: linear-gradient(135deg, #f7f8fa, var(--hhs-accent-soft));
    border: 1px solid var(--hhs-border-accent);
    border-radius: 8px;
}

.sps-hhs-personalised h3 {
    margin: 0 0 8px;
    color: var(--hhs-accent-deep);
    font-size: 19px;
}

.sps-hhs-personalised p { margin: 0 0 12px; line-height: 1.6; }
.sps-hhs-personalised ul { margin: 0 0 14px 20px; padding: 0; }
.sps-hhs-personalised li { margin-bottom: 7px; line-height: 1.5; }
.sps-hhs-personalised li::marker { color: var(--hhs-accent); }
.sps-hhs-personalised .sps-hhs-next-step { margin-bottom: 0; }

.sps-hhs-breakdown {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.sps-hhs-breakdown > div {
    padding: 14px;
    background: #fff;
    border: 1px solid var(--hhs-border);
    border-radius: 7px;
    box-shadow: 0 2px 6px rgba(32, 42, 48, .035);
}

.sps-hhs-breakdown span,
.sps-hhs-breakdown strong { display: block; }
.sps-hhs-breakdown span { font-size: 13px; color: var(--hhs-muted); margin-bottom: 6px; }
.sps-hhs-breakdown strong { color: var(--hhs-accent-deep); font-size: 18px; }
.sps-hhs-email-note { margin-top: 20px; }
.sps-hhs-email-warning { color: #9a3412; }
.sps-hhs-disclaimer { font-size: 13px; color: var(--hhs-muted); border-top: 1px solid var(--hhs-border); padding-top: 16px; margin-top: 18px; }
.sps-hhs-result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

@media (max-width: 700px) {
    .sps-hhs-wrap { margin-top: 12px; }
    .sps-hhs-grid-2 { grid-template-columns: 1fr; }
    .sps-hhs-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sps-hhs-result-heading { align-items: flex-start; }
    .sps-hhs-score-badge { width: 92px; height: 92px; flex-basis: 92px; }
    .sps-hhs-score-badge strong { font-size: 28px; }
}

@media (max-width: 460px) {
    .sps-hhs-intro { padding: 15px 15px 15px 19px; }
    .sps-hhs-intro h2 { font-size: 21px; }
    .sps-hhs-section { padding: 21px 16px; }
    .sps-hhs-consent { padding: 16px 16px 5px; }
    .sps-hhs-actions { padding: 12px 16px 20px; }
    .sps-hhs-submit { width: 100%; }
    .sps-hhs-result-card { padding: 21px 16px; }
    .sps-hhs-result-heading { display: block; }
    .sps-hhs-score-badge { margin-top: 17px; }
    .sps-hhs-breakdown { grid-template-columns: 1fr; }
}

@media print {
    body * { visibility: hidden !important; }
    .sps-hhs-result,
    .sps-hhs-result * { visibility: visible !important; }
    .sps-hhs-result { position: absolute; left: 0; top: 0; width: 100%; }
    .sps-hhs-result-actions { display: none !important; }
    .sps-hhs-result-card { box-shadow: none; }
}
