/* H&S Music billing — uses the established brand tokens, not generic badges. */
.hs-billing {max-width:1200px;margin:0 auto 4rem;font-family:var(--hs-font-ui);color:var(--hs-text)}
.hs-billing-header {display:flex;justify-content:space-between;align-items:center;gap:1.5rem;margin:2rem 0 2.5rem}
.hs-billing-header h1 {font-size:clamp(1.4rem,2.5vw,2rem);font-weight:600;margin:0 0 .5rem}
.hs-billing-header p {color:var(--hs-text-muted);margin:0}
.hs-plan-label {display:inline-flex;align-items:center;font-size:.65rem;line-height:1.4;text-transform:uppercase;letter-spacing:.075em;border:1px solid var(--hs-line-strong);border-radius:4px;padding:.19rem .48rem;vertical-align:middle;font-weight:600;color:var(--hs-text-muted);white-space:nowrap}
.hs-plan-label--plus {border-color:var(--hs-brand-line);color:var(--hs-brand-400)}
.hs-plan-label--premium {border-color:var(--hs-brand-500);color:var(--hs-brand-400);background:var(--hs-brand-soft)}
.hs-plan-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.25rem}
.hs-plan-card {border:1px solid var(--hs-line-strong);border-radius:16px;padding:2rem;display:flex;flex-direction:column;min-width:0;background:var(--hs-bg)}
.hs-plan-card--current {border-color:var(--hs-brand-line)}
.hs-plan-card header {text-align:center;min-height:164px}
.hs-plan-name {font-size:1.1rem;margin-bottom:.65rem}
.hs-plan-price {color:var(--hs-brand-500);display:block;font-size:clamp(2rem,4vw,3.75rem);font-weight:700;line-height:1.12;white-space:nowrap}
.hs-plan-period {display:block;color:var(--hs-text-subtle);font-size:.78rem;margin-top:.6rem;min-height:1.5rem}
.hs-plan-card header p {max-width:18ch;line-height:1.55;font-size:1rem;margin:1rem auto 0}
.hs-plan-inherit {font-weight:600;margin:0 0 .5rem}
.hs-plan-card ul {padding-left:1.1rem;margin:.75rem 0 2rem;flex:1;line-height:1.65}
.hs-plan-card li {padding-left:.25rem;margin:.8rem 0;overflow-wrap:anywhere}
.hs-plan-card footer {min-height:44px;display:flex;align-items:center;justify-content:center}
.hs-plan-card footer button {width:100%;min-height:44px}
.hs-plan-current,.hs-plan-unavailable {font-size:.84rem;color:var(--hs-text-muted);text-align:center}
.hs-billing-section {margin-top:3rem;border-top:1px solid var(--hs-line);padding-top:1.25rem}
.hs-billing-section h2 {font-size:1.2rem;margin:.5rem 0 1.25rem}
.hs-price-list>div,.hs-billing-orders>div {display:flex;flex-wrap:wrap;gap:1rem;align-items:baseline;justify-content:space-between;padding:1rem 0;border-bottom:1px solid var(--hs-line-subtle)}
.hs-price-list strong,.hs-billing-orders strong {margin-left:auto;font-weight:600}
.hs-price-list small {color:var(--hs-brand-400);white-space:nowrap}
.hs-billing-message {color:var(--hs-warning);min-height:1.5rem;margin-top:1rem}
.hs-dashboard-billing {display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.hs-dashboard-billing h2 {font-size:1.2rem;margin:.15rem 0}
.hs-dashboard-billing p {margin:0;color:var(--hs-text-muted)}
@media(max-width:900px){.hs-plan-grid{grid-template-columns:1fr;gap:1rem}.hs-plan-card{padding:1.5rem}.hs-plan-card header{min-height:unset}.hs-billing-header{flex-wrap:wrap;margin:1.5rem 0}.hs-plan-card ul{margin:1rem 0 1.5rem}}
@media(prefers-reduced-motion:reduce){.hs-billing *{scroll-behavior:auto!important}}

.hs-billing-admin .hs-billing-form {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;border-top:1px solid var(--hs-line-subtle);padding:1.3rem 0;margin:1rem 0}
.hs-billing-form h3,.hs-billing-form p {grid-column:1/-1;margin:0}
.hs-billing-form label {display:flex;flex-direction:column;gap:.35rem;color:var(--hs-text-muted);font-size:.87rem}
.hs-billing-form label:has(input[type=checkbox]) {flex-direction:row;align-items:center}
.hs-billing-form input:not([type=checkbox]),.hs-billing-form select {min-height:44px;max-width:100%;width:100%;box-sizing:border-box}
.hs-billing-form button {grid-column:1/-1;justify-self:start;min-height:44px}
@media(max-width:700px){.hs-billing-admin .hs-billing-form{grid-template-columns:minmax(0,1fr)}}

/* Stripe return state never implies payment until the API confirms it. */
.hs-billing-return:not([hidden]){border-left:3px solid var(--hs-brand-500);background:var(--hs-brand-soft);padding:.85rem 1rem;margin:0 0 1.5rem;color:var(--hs-text);line-height:1.5}
.hs-billing-return[hidden]{display:none}
.hs-billing button:disabled{cursor:not-allowed;opacity:.58}

.hs-plan-feature-pending{display:block;font-size:.72rem;color:var(--hs-text-muted);font-weight:500;margin:.18rem 0 .1rem}
.hs-billing-benefit-note{font-size:.86rem;color:var(--hs-text-muted);margin:-.3rem 0 1.25rem}
.hs-billing-contract{font-size:.9rem;color:var(--hs-text);padding:.8rem 1rem;border:1px solid var(--hs-line);border-radius:8px}

/* A4: contract status is the first content a returning customer needs. */
.hs-billing-membership{display:grid;grid-template-columns:minmax(150px,1fr) minmax(0,2.1fr);gap:1.5rem;align-items:center;padding:1.4rem 1.7rem;margin:0 0 2rem;border:1px solid var(--hs-line-strong);border-radius:var(--hs-radius-lg);background:var(--hs-surface-1)}
.hs-billing-membership>div+div{border-left:1px solid var(--hs-line);padding-left:1.5rem}
.hs-billing-membership-label{display:block;color:var(--hs-text-muted);font-size:.82rem;margin-bottom:.25rem}
.hs-billing-membership-plan{display:block;font-size:clamp(1.55rem,2.5vw,2.15rem);line-height:1.25;font-weight:600;color:var(--hs-text)}
.hs-billing-membership-state{display:block;font-size:1rem;font-weight:600;color:var(--hs-text)}
.hs-billing-membership p{margin:.4rem 0 0;line-height:1.5;color:var(--hs-text-muted);font-size:.875rem;max-width:62ch}
.hs-billing-period{border:0;display:flex;gap:1rem;align-items:center;flex-wrap:wrap;margin:0 0 1.5rem;padding:0}
.hs-billing-period legend{float:left;font-weight:500;color:var(--hs-text-muted);font-size:.85rem;margin:0 1.25rem 0 0;padding:0;line-height:2.5}
.hs-billing-period label{display:inline-flex;align-items:center;gap:.4rem;min-height:40px;cursor:pointer;font-size:.88rem}
.hs-billing-period input{accent-color:var(--hs-brand-500);width:17px;height:17px;margin:0}
.hs-plan-card--current{background:var(--hs-surface-1);border-color:var(--hs-brand-line)}
.hs-plan-current{color:var(--hs-brand-400);font-weight:600}
.hs-billing-orders>div,.hs-price-list>div{line-height:1.5}
.hs-billing-orders a{color:var(--hs-brand-400);text-underline-offset:3px;overflow-wrap:anywhere}
.hs-billing-message[data-state="error"]{color:var(--hs-danger)}
.hs-billing-message[data-state="info"]{color:var(--hs-text-muted)}
.hs-billing-return:not([hidden]){overflow-wrap:anywhere}
.hs-billing :is(button,input,select,a):focus-visible{outline:2px solid var(--hs-brand-400);outline-offset:3px;box-shadow:var(--hs-focus-ring)}
@media(max-width:700px){
  .hs-billing-membership{grid-template-columns:minmax(0,1fr);gap:1rem;padding:1.2rem}
  .hs-billing-membership>div+div{border-left:0;border-top:1px solid var(--hs-line);padding:1rem 0 0}
  .hs-billing-period legend{float:none;width:100%;line-height:1.4;margin:0 0 .5rem}
  .hs-billing-orders>div{justify-content:flex-start;column-gap:.75rem;row-gap:.4rem}
  .hs-billing-orders strong{margin-left:0}
}

/* Included benefits: one intentional action area, no decorative card grid. */
.hs-billing-benefits{margin-top:1.5rem}
.hs-billing-benefit-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.5fr) auto;align-items:end;gap:1rem;margin:1.25rem 0}
.hs-billing-benefit-form label{display:flex;flex-direction:column;gap:.4rem;font-size:.9rem;color:var(--hs-text-muted)}
.hs-billing-benefit-form select{width:100%;min-height:44px;min-width:0;box-sizing:border-box;background:var(--hs-surface-1);color:var(--hs-text);border:1px solid var(--hs-line-strong);border-radius:var(--hs-radius-md);padding:.6rem}
.hs-billing-benefit-form button{min-height:44px}
.hs-billing-benefit-form [hidden]{display:none!important}
@media(max-width:800px){.hs-billing-benefit-form{grid-template-columns:minmax(0,1fr)}.hs-billing-benefit-form button{width:100%}}

.hs-billing-admin-requests .hs-billing-benefit-admin-item{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,2fr) auto;align-items:end;gap:1rem;border-bottom:1px solid var(--hs-line-subtle);padding:1.1rem 0}
.hs-billing-admin-requests .hs-billing-benefit-admin-item>strong{grid-column:1/-1;font-weight:600}
.hs-billing-benefit-admin-item label{display:flex;flex-direction:column;gap:.4rem;font-size:.9rem;color:var(--hs-text-muted)}
.hs-billing-benefit-admin-item :is(select,input){min-height:44px;width:100%;min-width:0;box-sizing:border-box}
.hs-billing-benefit-admin-item button,.hs-billing-admin-requests>[data-hs-load-benefits]{min-height:44px}
@media(max-width:800px){.hs-billing-admin-requests .hs-billing-benefit-admin-item{grid-template-columns:minmax(0,1fr)}}


/* A4.3 – recording-scoped checkout choices; follows existing H&S tokens. */
.hs-billing-addon-form{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) auto;gap:12px;align-items:end}
.hs-billing-addon-form label{display:flex;flex-direction:column;gap:7px;min-width:0}
.hs-billing-addon-form select,.hs-billing-addon-form button{min-height:44px;max-width:100%;font:inherit}
.hs-billing-addon-list{display:grid;gap:8px;margin-top:18px}
.hs-billing-addon-list>div{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:12px 0;border-bottom:1px solid var(--border-color,rgba(255,255,255,.15))}
.hs-billing-addon-list span{min-width:0;overflow-wrap:anywhere;flex:1 1 15rem}
.hs-billing-addon-list strong{font-size:.875rem}
.hs-billing-addon-list button{min-height:44px;padding:8px 14px}
@media(max-width:760px){.hs-billing-addon-form{grid-template-columns:minmax(0,1fr)}.hs-billing-addon-form button{width:100%}}

/* A5.12f: hierarchy based on actual tasks; no decorative container maze. */
.hs-billing-header{margin-bottom:1.25rem}
.hs-billing-header h1{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap;line-height:1.2}
.hs-billing-membership{margin-bottom:2.25rem}
.hs-billing-plans{padding:0 0 .5rem}
.hs-billing-plans-heading{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:.5rem 1.5rem;margin-bottom:1.2rem}
.hs-billing-plans-heading h2{font-size:1.25rem;margin:0;font-weight:600}
.hs-billing-plans-heading p{margin:0;color:var(--hs-text-muted);font-size:.85rem;max-width:60ch;line-height:1.5}
.hs-billing-plans .hs-plan-card{padding:1.5rem 1.4rem;border-radius:var(--hs-radius-lg)}
.hs-billing-plans .hs-plan-card header{min-height:128px;text-align:left}
.hs-billing-plans .hs-plan-price{font-size:clamp(1.75rem,2.5vw,2.65rem);letter-spacing:-.025em}
.hs-billing-plans .hs-plan-price--missing{font-size:1.05rem;letter-spacing:0;color:var(--hs-text-muted);white-space:normal;font-weight:500}
.hs-billing-plans .hs-plan-card ul{margin:.4rem 0 1.2rem;line-height:1.55;font-size:.875rem}
.hs-billing-plans .hs-plan-card li{margin:.55rem 0}
.hs-billing-plans .hs-plan-card footer{justify-content:flex-start}
.hs-billing-benefit-note{margin:1rem 0 0;line-height:1.6}
.hs-billing .hs-billing-message[hidden]{display:none}
.hs-billing .hs-billing-message:not([hidden]){min-height:0;padding:.85rem 1rem;margin:0 0 1rem;border-left:3px solid var(--hs-brand-500);background:var(--hs-surface-2);color:var(--hs-text);line-height:1.5;overflow-wrap:anywhere}
.hs-billing .hs-billing-message[data-state="error"]{border-left-color:var(--hs-danger);background:var(--hs-danger-soft)}
.hs-billing-history,.hs-billing-admin-details{border-top:1px solid var(--hs-line);margin-top:2.5rem;padding:1.15rem 0 0}
.hs-billing-history>summary,.hs-billing-admin-details>summary{list-style:none;cursor:pointer;padding:.75rem 2rem .75rem 0;position:relative;min-height:44px;box-sizing:border-box;font-weight:600;font-size:1.05rem}
.hs-billing-history>summary::-webkit-details-marker,.hs-billing-admin-details>summary::-webkit-details-marker{display:none}
.hs-billing-history>summary:after,.hs-billing-admin-details>summary:after{content:'+';position:absolute;right:.5rem;top:.5rem;color:var(--hs-brand-400);font-size:1.4rem;font-weight:400}
.hs-billing-history[open]>summary:after,.hs-billing-admin-details[open]>summary:after{content:'−'}
.hs-billing-history>.hs-billing-section{margin-top:0;padding-top:1rem;border-color:var(--hs-line-subtle)}
.hs-billing-admin-details>.hs-billing-section{margin-top:1rem}
.hs-billing :is(.hs-billing-history,.hs-billing-admin-details)>summary:focus-visible{outline:2px solid var(--hs-brand-400);outline-offset:3px}
.hs-billing :is(input,select,textarea){min-width:0;max-width:100%}
.hs-billing .hs-billing-benefits{margin-top:2.5rem}
@media (min-width:901px){.hs-billing .hs-plan-grid{gap:1rem}}
@media (max-width:900px){.hs-billing-plans .hs-plan-card{padding:1.25rem}.hs-billing-plans .hs-plan-card header{min-height:0}.hs-billing-plans .hs-plan-card ul{margin:.7rem 0 1rem}.hs-billing-plans .hs-plan-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:620px){.hs-billing-plans .hs-plan-grid{grid-template-columns:minmax(0,1fr)}.hs-billing-plans-heading{display:block}.hs-billing-plans-heading p{margin-top:.4rem}.hs-billing-header>[data-hs-portal]{width:100%}}

/* A5.40: Contract controls use existing billing surface tokens. */
.hs-billing-contracts:empty { display:none; }
.hs-billing-contract { margin-block:1rem; padding-block:.75rem; border-top:1px solid var(--border, #ddd); }
.hs-billing-contract summary { cursor:pointer; font-weight:600; }
.hs-billing-contract p { line-height:1.5; }
.hs-billing-contract-warning { padding:.75rem 1rem; border-inline-start:3px solid currentColor; }
/* A5.41: explicit annual consent and review-before-commit. Existing H&S tokens. */
.hs-billing-year-consent{display:flex;align-items:flex-start;gap:.65rem;max-width:68ch;
  margin:.85rem 0 1.2rem;padding:.7rem 0;color:var(--hs-text);line-height:1.55;font-size:.91rem}
.hs-billing-year-consent input{flex:0 0 auto;margin-top:.3rem;min-width:18px;min-height:18px}
.hs-billing-legal-links{margin:1rem 0 1.25rem;color:var(--hs-text-muted)}
.hs-billing-legal-links a{color:var(--hs-link,var(--hs-brand-400));text-underline-offset:.15em}
.hs-billing-change-dialog{color:var(--hs-text);background:var(--hs-surface-1);border:1px solid var(--hs-line);
  box-shadow:0 1rem 4rem rgb(0 0 0 / .35);border-radius:var(--hs-radius-lg);
  width:min(calc(100% - 2rem),540px);padding:1.7rem}
.hs-billing-change-dialog::backdrop{background:rgb(0 0 0 / .66)}
.hs-billing-change-dialog h2{margin:0 0 .8rem}.hs-billing-change-dialog p{line-height:1.55}
.hs-billing-change-actions{display:flex;flex-wrap:wrap;gap:.7rem;margin-top:1.5rem}
@media(max-width:620px){.hs-billing-change-dialog{padding:1.2rem}.hs-billing-change-actions button{flex:1 1 100%}}
@media(prefers-reduced-motion:reduce){.hs-billing-change-dialog{animation:none!important}}

/* A5.42: compact, accessible account billing data, reusing existing H&S tokens. */
.hs-billing-customer-profile{border-top:1px solid var(--hs-line);padding:1rem 0;margin:1.5rem 0}
.hs-billing-customer-profile>summary{cursor:pointer;min-height:44px;font-weight:600;padding:.65rem 0}
.hs-billing-customer-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem 1.1rem;margin-block:1rem}
.hs-billing-customer-grid label{display:flex;flex-direction:column;gap:.35rem;min-width:0}
.hs-billing-customer-grid :is(input,select){width:100%;box-sizing:border-box;min-height:44px}
.hs-billing-customer-actions{display:flex;grid-column:1/-1;gap:.75rem;flex-wrap:wrap}
.hs-billing-customer-actions button{min-height:44px}
.hs-billing-customer-profile>summary:focus-visible{outline:2px solid var(--hs-brand-400);outline-offset:3px}
@media(max-width:620px){.hs-billing-customer-grid{grid-template-columns:minmax(0,1fr)}.hs-billing-customer-actions button{flex:1 1 100%}}

/* A5.45: paid upgrade verification. No optimistic rights or persistent loading. */
.hs-billing .hs-billing-message[data-state="pending"]::before{
  content:"";display:inline-block;vertical-align:-.14em;box-sizing:border-box;
  width:.84em;height:.84em;margin-right:.65em;border:2px solid var(--hs-line-strong);
  border-top-color:var(--hs-brand-400);border-radius:50%;
  animation:hs-billing-verify-spin .8s linear infinite
}
.hs-billing .hs-billing-message[data-state="success"]{border-left-color:var(--hs-brand-500)}
@keyframes hs-billing-verify-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){
  .hs-billing .hs-billing-message[data-state="pending"]::before{animation:none;border-top-color:var(--hs-brand-400)}
}

/* 4.6D: Stripe TEST card authorization. A settings surface, not a checkout. */
.hs-billing-autocharge{padding:1.2rem 0;margin:1.1rem 0 2rem;border-block:1px solid var(--hs-line)}
.hs-billing-autocharge h2{font-size:1.15rem;margin:0 0 .65rem}
.hs-billing-autocharge p{line-height:1.55;margin:.45rem 0 .85rem;overflow-wrap:anywhere}
.hs-billing-autocharge button{min-height:44px;max-width:100%;white-space:normal}
.hs-autocharge-consent{display:flex;align-items:flex-start;gap:.7rem;max-width:73ch;line-height:1.55;margin:.8rem 0 1rem}
.hs-autocharge-consent input{min-width:20px;min-height:20px;flex:0 0 20px;margin-top:.2rem}
.hs-billing-autocharge [role="alert"]{border-inline-start:3px solid var(--hs-danger);padding:.4rem .8rem}
@media(max-width:620px){.hs-billing-autocharge button{width:100%}}
