/* ==========================================================================
   Account Status card (account-status-card.js)
   The page's own .card and .card-header: status pill and action in the header, the plan and
   one line of facts in the body, add-ons one line each. Colors come only from the
   hig-theme.css tokens, so Light, Dark and Auto follow the appearance menu.
   ========================================================================== */

.si-acct { margin-bottom: 1rem; }

/* Tones: semantic HIG colors, always paired with words. */
.si-tone-green  { --si-tone: var(--hig-green);  --si-tone-text: var(--hig-green-text); }
.si-tone-orange { --si-tone: var(--hig-orange); --si-tone-text: var(--hig-orange-text); }
.si-tone-red    { --si-tone: var(--hig-red);    --si-tone-text: var(--hig-red-text); }
.si-tone-blue   { --si-tone: var(--hig-tint);   --si-tone-text: var(--hig-tint-text); }
.si-tone-purple { --si-tone: var(--hig-purple); --si-tone-text: var(--hig-purple-text); }
.si-tone-indigo { --si-tone: var(--hig-indigo); --si-tone-text: var(--hig-indigo-text); }
.si-tone-gray   { --si-tone: var(--hig-gray);   --si-tone-text: var(--hig-gray-text); }

.si-acct-card { overflow: hidden; }
.si-acct-header { display: flex; align-items: center; gap: 8px; }
.si-acct-head-end { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.si-acct-head-end .btn { white-space: nowrap; }

.si-acct-preview { font-size: 12px; color: var(--hig-label2); margin: 0 0 4px 2px; }

.si-acct-pill {
    display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
    font-size: 11px; font-weight: 600; line-height: 1.35; padding: 1px 7px; border-radius: 999px;
    color: var(--si-tone-text); background: color-mix(in srgb, var(--si-tone) 14%, transparent);
}
.si-acct-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--si-tone); }
.si-acct-flag {
    margin-left: 8px; font-size: 10.5px; font-weight: 600; color: var(--hig-label2);
    background: var(--hig-fill3); border-radius: 999px; padding: 1px 7px; vertical-align: 1px;
}

/* Body: the plan, then one line of facts */
.si-acct-summary { display: grid; gap: 1px; padding: 9px 16px 10px; }
.si-acct-name { font-size: 14px; font-weight: 600; color: var(--hig-label); }
.si-acct-line { font-size: 13px; color: var(--hig-label2); font-variant-numeric: tabular-nums; }
.si-acct-warn { color: var(--hig-red-text); }
.si-acct-seg { white-space: nowrap; }
.si-acct time { text-decoration: underline dotted var(--hig-label3); text-underline-offset: 3px; cursor: help; }

.si-acct-meter { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.si-acct-meter-track { flex: 0 1 200px; height: 4px; border-radius: 2px; background: var(--hig-fill3); overflow: hidden; }
.si-acct-meter-fill { height: 100%; border-radius: 2px; background: var(--hig-tint); }
.si-acct-meter-label { font-size: 12px; color: var(--hig-label2); font-variant-numeric: tabular-nums; }

.si-acct-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin-top: 3px; font-size: 13px; color: var(--hig-label2); }
.si-acct-link {
    appearance: none; border: 0; background: none; padding: 0; font: inherit;
    color: var(--hig-tint-text); cursor: pointer; text-decoration: none;
}
.si-acct-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.si-acct-link:disabled { color: var(--hig-label2); cursor: default; text-decoration: none; }

/* Payment problem: a tinted strip */
.si-acct-banner {
    display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
    padding: 8px 16px;
    background: color-mix(in srgb, var(--hig-red) 9%, var(--hig-bg2));
    border-bottom: var(--hig-hairline, 0.5px) solid var(--hig-separator);
    font-size: 12.5px; color: var(--hig-label2);
}
.si-acct-banner svg { flex: none; width: 15px; height: 15px; color: var(--hig-red-text); }
.si-acct-banner-text { flex: 1 1 260px; min-width: 0; }
.si-acct-banner strong { font-weight: 600; color: var(--hig-label); }

/* Rows (add-ons here, and the Manage sheet) */
.si-acct-row {
    appearance: none; border: 0; background: transparent; color: var(--hig-label);
    font: inherit; font-size: 13.5px; text-align: left; text-decoration: none; width: 100%;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px 16px;
    min-height: 38px; padding: 8px 16px; position: relative;
}
.si-acct-row + .si-acct-row::before {
    content: ""; position: absolute; top: 0; left: 16px; right: 0;
    border-top: var(--hig-hairline, 0.5px) solid var(--hig-separator);
}
button.si-acct-row, a.si-acct-row { cursor: pointer; }
button.si-acct-row:hover, a.si-acct-row:hover { background: var(--hig-fill4); color: var(--hig-label); }
.si-acct-row-value {
    color: var(--hig-label2); display: inline-flex; align-items: center; gap: 4px;
    text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere;
}
.si-acct-row-value.is-link, .si-acct-row .is-tint-text, .si-acct-row.is-tint-text { color: var(--hig-tint-text); }
.si-acct-row-value.is-warn { color: var(--hig-red-text); }
.si-acct-row.is-center { justify-content: center; font-weight: 500; }
.si-acct-row.is-destructive { color: var(--hig-red-text); }
.si-acct-chev { color: var(--hig-label3); font-size: 16px; line-height: 1; }
.si-acct-two { display: grid; text-align: left; min-width: 0; }
.si-acct-two small { font-size: 12px; color: var(--hig-label2); }

.si-acct-addons { border-top: var(--hig-hairline, 0.5px) solid var(--hig-separator); }
.si-acct-row.is-addon { flex-wrap: nowrap; min-height: 34px; padding-top: 6px; padding-bottom: 6px; }
.si-acct-addon-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; }
.si-acct-addon-name { font-size: 13.5px; color: var(--hig-label); }
.si-acct-addon-sub { font-size: 12px; color: var(--hig-label2); }
.si-acct-row.is-addon .si-acct-row-value { flex: none; font-size: 13px; }

.si-acct-btn:focus-visible, .si-acct-row:focus-visible, .si-acct-link:focus-visible, .si-acct-done:focus-visible {
    outline: 3px solid var(--hig-focus, rgba(0, 122, 255, 0.4)); outline-offset: 2px; border-radius: 6px;
}

/* Loading */
.si-acct-loading { padding: 12px 16px; display: grid; gap: 7px; }
.si-acct-skel { height: 12px; border-radius: 4px; background: var(--hig-fill3); width: 40%; }
.si-acct-skel.is-short { width: 26%; }

/* Manage sheet */
.si-acct-scrim {
    position: fixed; inset: 0; z-index: 1060; background: var(--hig-scrim, rgba(0, 0, 0, 0.35));
    display: grid; place-items: center; padding: 16px;
}
.si-acct-sheet {
    width: min(420px, 100%); max-height: calc(100vh - 32px); overflow: auto;
    background: var(--hig-bg); color: var(--hig-label);
    border-radius: var(--hig-radius-lg, 14px); box-shadow: var(--hig-menu-shadow);
    animation: si-acct-rise 0.2s ease-out;
}
@keyframes si-acct-rise { from { transform: translateY(10px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .si-acct-sheet { animation: none; } }
.si-acct-sheet-bar {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    padding: 8px 10px; background: var(--hig-bg2);
    border-bottom: var(--hig-hairline, 0.5px) solid var(--hig-separator);
    position: sticky; top: 0; z-index: 1;
}
.si-acct-sheet-bar h3 { margin: 0; font-size: 15px; font-weight: 600; text-align: center; color: var(--hig-label); }
.si-acct-done {
    justify-self: end; appearance: none; border: 0; background: none; cursor: pointer;
    color: var(--hig-tint-text); font: inherit; font-size: 14px; font-weight: 600;
    padding: 6px 8px; min-height: 32px; border-radius: 8px;
}
.si-acct-sheet-body { padding: 14px 12px 16px; display: grid; gap: 18px; }
.si-acct-sheet-group { display: grid; gap: 5px; }
.si-acct-cap { font-size: 11px; font-weight: 600; color: var(--hig-label2); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 16px; }
.si-acct-sheet-foot { font-size: 12px; color: var(--hig-label2); padding: 0 16px; margin: 0; }
.si-acct-list { background: var(--hig-bg2); border-radius: var(--hig-radius, 10px); overflow: hidden; }
.si-acct-confirm { display: grid; gap: 12px; text-align: center; padding: 4px 6px 2px; }
.si-acct-confirm h4 { margin: 0; font-size: 16px; font-weight: 600; color: var(--hig-label); }
.si-acct-confirm p { margin: 0; font-size: 13.5px; color: var(--hig-label2); }
.si-acct-confirm-btns { display: grid; gap: 8px; }
.si-acct-btn {
    appearance: none; border: 0; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
    border-radius: 10px; padding: 8px 14px; min-height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
}
.si-acct-btn.is-tint { background: var(--hig-tint); color: var(--hig-on-tint, #fff); }
.si-acct-btn.is-gray { background: var(--hig-fill3); color: var(--hig-tint-text); }
.si-acct-btn.is-gray:hover { background: var(--hig-fill2); }
.si-acct-btn.is-red { background: color-mix(in srgb, var(--hig-red) 82%, #000); color: #fff; }
.si-acct-btn:disabled { opacity: 0.55; cursor: default; }

@media (max-width: 576px) {
    .si-acct-row-value { text-align: left; }
    .si-acct-row.is-addon { flex-direction: column; align-items: flex-start; }
}
