/* Extracted verbatim from templates/pages/settings.html inline <style> near end of {% block content %}.
   Loaded at the same document position as the original inline <style>
   (via <link> in the body); cascade order matters.
   Do not move this stylesheet into extra_css / <head>. */
/* Settings Page - Clean Minimal Design
   Scoped token layer: one Enne band per semantic role (never side by side).
   jade = primary/success, sand = selection, copper = warning,
   rust = danger (--danger), steel = info. */
.settings-page {
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 216px minmax(0, 1fr);
    column-gap: 40px;
    align-items: start;
    --st-jade: var(--primary);
    --st-sand: #D7C28A;
    --st-copper: #96591F;
    --st-copper-raw: #C07B42;
    --st-steel: #4B7DAF;
    --st-steel-deep: #38618B;
    --st-radius-lg: 16px;
    --st-radius-md: 12px;
    --st-radius-sm: 8px;
    --st-display: var(--font-display);
    --st-tint-hover: color-mix(in srgb, var(--foreground) 5%, transparent);
    --st-surface-muted: color-mix(in srgb, var(--foreground) 3%, transparent);
    --st-shadow-card: inset 0 1px 0 var(--surface-edge), var(--shadow-rest);
}

[data-theme="dark"] .settings-page {
    --st-copper: #D9995B;
    --st-steel: #7FA7CE;
    --st-steel-deep: #A7C4E0;
}

.settings-header {
    grid-column: 1 / -1;
    margin-bottom: 20px;
}

.settings-content {
    min-width: 0;
}

.settings-header p {
    color: var(--foreground-secondary);
}

/* Tab Navigation — vertical settings rail on desktop, horizontal strip on
   mobile. The selected tab is the one elevated chip, tinted with the brand
   sand band (selection semantic). */
.settings-tabs {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: 8px;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--st-radius-sm);
    color: var(--foreground-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, box-shadow 0.2s ease, border-color 0.18s ease;
    white-space: nowrap;
    text-align: left;
}

.settings-tab svg {
    width: 18px;
    height: 18px;
    transition: color 0.18s ease;
}

.settings-tab:hover:not(.active) {
    background: var(--st-tint-hover);
    color: var(--foreground);
}

.settings-tab:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--st-jade) 55%, transparent);
    outline-offset: 2px;
}

.settings-tab.active {
    color: var(--foreground);
    background: color-mix(in srgb, var(--st-sand) 24%, var(--card));
    border-color: color-mix(in srgb, var(--st-sand) 50%, transparent);
    box-shadow: var(--st-shadow-card);
}

[data-theme="dark"] .settings-tab.active {
    background: color-mix(in srgb, var(--st-sand) 16%, var(--card));
    border-color: color-mix(in srgb, var(--st-sand) 28%, transparent);
}

/* Settings Card — tier-1 surface: the only elevated box. Everything inside
   sits on inset tier-2 panels (var(--background), smaller radius, no shadow). */
.settings-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--st-radius-lg);
    padding: 28px;
    box-shadow: var(--st-shadow-card);
}

.card-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light, var(--border));
}

/* Where the outer card is just a wrapper (content brings its own cards),
   demote it so provider rows / quota cards / member rows are the only
   boxes — kills card-in-card nesting. */
#usage-tab > .settings-card,
#integrations-tab > .settings-card,
#members-tab > .settings-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

#usage-tab > .settings-card > .card-header,
#integrations-tab > .settings-card > .card-header,
#members-tab > .settings-card > .card-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 20px;
}

.card-header h2 {
    font-family: var(--st-display);
    font-size: 21px;
    font-weight: 500;
    letter-spacing: var(--tracking-snug);
    line-height: var(--leading-tight);
    color: var(--foreground);
    margin-bottom: 4px;
}

.card-header p {
    color: var(--foreground-secondary);
    font-size: 14px;
}

.card-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Form Elements */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--foreground);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input:disabled {
    background: var(--secondary);
    color: var(--foreground-secondary);
    cursor: not-allowed;
}

.form-hint {
    font-size: 12px;
    color: var(--foreground-secondary);
}

.form-hint a {
    color: var(--primary);
}

/* Input with Toggle */
.input-with-toggle {
    position: relative;
}

.input-with-toggle .form-input {
    padding-right: 60px;
}

.toggle-visibility {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--foreground-secondary);
    font-size: 13px;
    cursor: pointer;
}

.toggle-visibility:hover {
    color: var(--foreground);
}

/* Info Box */
.info-box {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--primary-light);
    border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
    border-radius: 10px;
}

.info-box svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.info-box p {
    font-size: 13px;
}

/* Integrations — one full-width provider row per service */
.integrations-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.integration-card {
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--st-radius-lg);
    box-shadow: var(--st-shadow-card);
    transition: border-color 0.15s ease;
}

.integration-card:hover:not(.disabled) {
    border-color: color-mix(in srgb, var(--st-jade) 30%, var(--surface-border));
}

.integration-card.disabled {
    opacity: 0.6;
}

.integration-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

/* Live connection state sits inline with the provider name */
.integration-status {
    margin-left: auto;
}

.integration-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Disconnect: quiet at rest, reveals its rust intent on hover */
.btn-disconnect {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    color: var(--foreground-secondary);
    border: 1px solid var(--border);
    border-radius: var(--st-radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-disconnect:hover:not(:disabled) {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 40%, transparent);
    background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.btn-disconnect:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-disconnect:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--danger) 55%, transparent);
    outline-offset: 2px;
}

/* Row cards are wide — keep the action cluster compact instead of
   stretching full-width buttons across the card. */
#ms365-controls,
#google-controls {
    max-width: 360px;
}

.integration-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.integration-icon svg {
    width: 20px;
    height: 20px;
}

.integration-icon.ms365 {
    background: color-mix(in srgb, #0078d4 12%, transparent);
    border: 1px solid color-mix(in srgb, #0078d4 22%, transparent);
    color: #0078d4;
}
/* Brand-colored logos sit on the page surface so the tile adapts to dark mode
   instead of staying a hard white square. */
.integration-icon.google { background: var(--background); border: 1px solid var(--border); }
.integration-icon.slack { background: var(--background); border: 1px solid var(--border); }

.integration-info {
    flex: 1;
}

.integration-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--foreground);
}

.coming-soon-badge {
    padding: 4px 8px;
    background: var(--secondary);
    color: var(--foreground-secondary);
    font-size: 11px;
    font-weight: 500;
    border-radius: 6px;
}

/* Tools Section */
.tools-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.tools-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tool-badge {
    padding: 4px 10px;
    background: var(--secondary);
    color: var(--foreground);
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
}

/* Status Badges — quiet: no fill, a hairline in the text's own hue (plain
   --border first where color-mix() is unsupported), one band per badge.
   text-transform: modern.css's generic .status-badge capitalizes, which
   turned "Not connected" into "Not Connected" and capitalized emails. */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    background: transparent;
    color: var(--foreground-secondary);
    border: 1px solid var(--border);
    border: 1px solid color-mix(in srgb, currentColor 32%, transparent);
}

.status-badge svg {
    width: 14px;
    height: 14px;
}

.status-badge.status-connected { color: var(--primary); }
.status-badge.status-warning { color: #766333; }
.status-badge.status-error { color: var(--danger); }
.status-badge.status-disconnected,
.status-badge.status-loading { color: var(--foreground-secondary); }

[data-theme="dark"] .status-badge.status-connected { color: #7CCBA8; }
[data-theme="dark"] .status-badge.status-warning { color: #E2D2A7; }
/* Dark --danger is 4.3:1 here; the text-safe rust holds 6.4 */
[data-theme="dark"] .status-badge.status-error { color: #E08A66; }

/* The account email / connected date beside the state: neutral at full
   strength (the old 70% opacity on the hue fell to ~3:1). */
.status-date {
    font-size: 12px;
    font-weight: 400;
    color: var(--foreground-secondary);
    margin-left: 2px;
}

.status-email {
    font-size: 13px;
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.alert-success {
    background: color-mix(in srgb, var(--st-jade) 10%, transparent);
    color: var(--st-jade);
    border: 1px solid color-mix(in srgb, var(--st-jade) 25%, transparent);
}

.alert-error {
    background: rgba(173, 63, 19, 0.1);
    color: var(--danger);
    border: 1px solid rgba(173, 63, 19, 0.2);
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.alert-warning {
    background: color-mix(in srgb, var(--st-copper-raw) 12%, transparent);
    color: var(--st-copper);
    border: 1px solid color-mix(in srgb, var(--st-copper-raw) 32%, transparent);
}

/* Security Section */
.security-section {
    margin-bottom: 24px;
}

.security-section h3 {
    font-family: var(--st-display);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: var(--tracking-snug);
    color: var(--foreground);
    margin-bottom: 16px;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--surface-strong);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    background: var(--secondary);
    border-color: var(--foreground-secondary);
}

/* Utility Classes */
.text-secondary { color: var(--foreground-secondary); }
.text-sm { font-size: 13px; }
.font-medium { font-weight: 500; }
.w-full { width: 100%; }
.flex-1 { flex: 1; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-3 { margin-top: 12px; }
.hidden { display: none !important; }

/* Loading Spinner — same slim jade-arc family as .loading-spinner-modern */
.loading-spinner-inline {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid color-mix(in srgb, var(--primary) 18%, transparent);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Team Members Section */
.members-section {
    margin-top: 20px;
}

/* Sub-section labels (Current Members / Pending Invitations) read as
   quiet eyebrows rather than competing headings. */
.section-title {
    font-size: var(--fs-eyebrow-sm);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--foreground-secondary);
    margin-bottom: 12px;
}

.members-list, .invites-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.member-row, .invite-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--st-radius-md);
    box-shadow: var(--st-shadow-card);
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.member-details {
    display: flex;
    flex-direction: column;
}

.member-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--foreground);
}

.member-email {
    font-size: 12px;
    color: var(--foreground-secondary);
}

.role-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.member-role-select {
    min-width: 112px;
    padding: 6px 10px;
    background-color: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--foreground);
}

.member-role-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.member-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.member-remove-btn {
    opacity: 0;
    transition: opacity 0.15s;
}

.member-row:hover .member-remove-btn {
    opacity: 1;
}

/* Touch devices and narrow viewports have no hover, so reveal the
   remove button by default. */
@media (hover: none), (max-width: 768px) {
    .member-remove-btn {
        opacity: 1;
    }
}

.you-badge {
    font-size: 11px;
    color: var(--foreground-secondary);
    font-weight: normal;
}

.invite-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.invite-email {
    font-size: 14px;
    color: var(--foreground);
}

.invite-meta {
    font-size: 12px;
    color: var(--foreground-secondary);
}

.expired-badge {
    color: var(--danger);
    margin-left: 8px;
}

.invite-actions {
    display: flex;
    gap: 6px;
}

.btn-sm {
    padding: 6px 8px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-sm.btn-secondary {
    background: var(--secondary);
    color: var(--foreground);
}

.btn-sm.btn-secondary:hover {
    background: var(--border);
}

.btn-sm.btn-danger {
    background: rgba(173, 63, 19, 0.1);
    color: var(--danger);
}

.btn-sm.btn-danger:hover {
    background: rgba(173, 63, 19, 0.2);
}

.empty-state, .loading-state {
    padding: 24px;
    text-align: center;
    color: var(--foreground-secondary);
    font-size: 14px;
}

/* Invite Modal */
.modal-dialog {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    /* Reset <dialog> native chrome so only our custom inner box renders */
    padding: 0;
    border: none;
    background: transparent;
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    color: var(--foreground);
    overflow: visible;
}

.modal-dialog[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* With dialog.showModal(), the dialog is hoisted into the browser's top layer.
   backdrop-filter on a child <div> does NOT reliably blur the page behind —
   only the native ::backdrop pseudo-element can. Put the blur there. */
.modal-dialog::backdrop {
    background: var(--modal-backdrop, rgba(0, 0, 0, 0.35));
    backdrop-filter: blur(var(--modal-blur, 8px));
    -webkit-backdrop-filter: blur(var(--modal-blur, 8px));
}

/* Manual backdrop div stays for its onclick="closeInviteModal()" behavior,
   but is visually transparent — the native ::backdrop above paints the blur. */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    cursor: pointer;
}

.modal-content-box {
    position: relative;
    background: var(--surface-strong);
    border: 1px solid var(--surface-border);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
    backdrop-filter: blur(22px) saturate(1.15);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Invite modal — wider, fully responsive */
.invite-modal-box {
    position: relative;
    background: var(--surface-strong);
    border: 1px solid var(--surface-border);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
    backdrop-filter: blur(22px) saturate(1.15);
    border-radius: 16px;
    width: min(640px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    margin: 20px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.invite-modal-box .modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
}

@media (max-width: 640px) {
    .invite-modal-box {
        width: calc(100vw - 16px);
        margin: 8px;
        max-height: calc(100vh - 16px);
        border-radius: 12px;
    }

    .invite-modal-box .modal-header,
    .invite-modal-box .modal-footer {
        padding: 14px 16px;
    }

    .invite-modal-box .modal-body {
        padding: 16px;
    }

    .invite-modal-box .modal-footer {
        flex-wrap: wrap;
    }

    .invite-modal-box .modal-footer .btn-secondary,
    .invite-modal-box .modal-footer .btn-plan-cta {
        flex: 1 1 auto;
        min-width: 0;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-family: var(--st-display);
    font-size: 19px;
    font-weight: 500;
    letter-spacing: var(--tracking-snug);
    color: var(--foreground);
}

.modal-close {
    background: none;
    border: none;
    color: var(--foreground-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}

.modal-close:hover {
    background: var(--secondary);
    color: var(--foreground);
}

.modal-body {
    padding: 24px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-group:last-of-type {
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.mt-6 {
    margin-top: 24px;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

/* Danger Zone Styles */
.danger-zone {
    margin-top: 0;
}

.danger-section {
    padding: 20px;
    background: rgba(173, 63, 19, 0.05);
    border: 1px solid rgba(173, 63, 19, 0.2);
    border-radius: 12px;
}

.text-red-600 {
    color: var(--danger-hover);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(173, 63, 19, 0.1);
    color: var(--danger);
    border: 1px solid rgba(173, 63, 19, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-danger:hover {
    background: rgba(173, 63, 19, 0.2);
    border-color: rgba(173, 63, 19, 0.5);
}

.btn-danger-solid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: #AD3F13;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-danger-solid:hover:not(:disabled) {
    background: #8F3410;
}

.btn-danger-solid:disabled,
.btn-danger-solid.btn-disabled {
    background: color-mix(in srgb, var(--danger) 40%, var(--card));
    cursor: not-allowed;
    opacity: 0.6;
}

/* Delete Account Modal */
.delete-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.delete-modal-content {
    position: relative;
    background: var(--surface-strong);
    border: 1px solid var(--surface-border);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
    backdrop-filter: blur(22px) saturate(1.15);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.delete-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.delete-modal-header h3 {
    font-family: var(--st-display);
    font-size: 19px;
    font-weight: 500;
    letter-spacing: var(--tracking-snug);
    color: var(--danger);
}

.delete-modal-body {
    padding: 24px;
}

.delete-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.delete-warning-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(173, 63, 19, 0.1);
    border: 1px solid rgba(173, 63, 19, 0.2);
    border-radius: 10px;
    color: var(--danger);
}

.delete-warning-box svg {
    flex-shrink: 0;
}

.delete-warning-box .font-medium {
    margin-bottom: 4px;
}

.delete-warning-box .text-sm {
    color: var(--foreground-secondary);
}

.mt-4 {
    margin-top: 16px;
}

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    /* Single column: the rail becomes a horizontal-scrolling tab strip —
       recessed track, no wrapping, smooth touch scroll. */
    .settings-page {
        display: block;
    }

    .settings-tabs {
        flex-direction: row;
        position: static;
        gap: 4px;
        padding: 4px;
        background: color-mix(in srgb, var(--foreground) 4%, transparent);
        border-radius: var(--st-radius-md);
        margin-bottom: 24px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
        scroll-padding-left: 4px;
    }

    .settings-tabs::-webkit-scrollbar {
        display: none;
    }

    .settings-tab {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
}

@media (max-width: 640px) {
    .settings-tab {
        padding: 8px 12px;
        font-size: 13px;
        gap: 6px;
    }

    .settings-tab svg {
        width: 16px;
        height: 16px;
    }

    .card-actions {
        flex-direction: column;
    }

    .integrations-grid {
        grid-template-columns: 1fr;
    }
}

/* Voice Settings Styles */
.voice-settings-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Toggle rows that follow a form grid inside the same card (AI tab). */
.settings-rows {
    margin-top: 20px;
    border-top: 1px solid var(--border);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-info .form-label {
    margin-bottom: 0;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--input-border);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.form-input-sm {
    width: auto;
    min-width: 140px;
    padding: 6px 12px;
    font-size: 0.875rem;
}

.voice-status-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: color-mix(in srgb, var(--st-copper-raw) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--st-copper-raw) 30%, transparent);
    border-radius: var(--st-radius-sm);
    color: var(--st-copper);
    font-size: 0.875rem;
}

.voice-status-box.hidden {
    display: none;
}

/* Usage meters — label + count line, slim bar, remaining note. Rows inside
   one card instead of four boxed mini-cards. */
.usage-meter-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px 36px;
}

.usage-meter {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.usage-meter-muted {
    opacity: 0.75;
}

.usage-meter-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.usage-meter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
}

.usage-meter-muted .usage-meter-label {
    color: var(--foreground-secondary);
    font-weight: 500;
}

.usage-meter-count {
    font-size: 12px;
    color: var(--foreground-secondary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums lining-nums;
}

.usage-meter-count strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
}

.usage-meter-foot {
    font-size: 11.5px;
    color: var(--foreground-secondary);
    margin: 0;
}

.usage-meter-foot-warning { color: var(--st-copper); }
.usage-meter-foot-danger { color: var(--danger); }

.usage-meter .usage-progress {
    height: 6px;
}

.usage-progress-empty {
    background: color-mix(in srgb, var(--foreground) 5%, transparent);
}

.usage-progress {
    height: 0.5rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--foreground) 10%, transparent);
    overflow: hidden;
}

.usage-progress-fill {
    height: 100%;
    border-radius: inherit;
}

.usage-progress-fill-normal {
    background: var(--st-jade);
}

.usage-progress-fill-warning {
    background: var(--st-copper-raw);
}

.usage-progress-fill-danger {
    background: var(--danger);
}

/* ==========================================================================
   Usage & Billing — simplified, role-aware surface
   Hero + conditional alerts + quota grid + (admin) plans / manage
   ========================================================================== */

/* --- Hero --- */
.billing-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    margin-top: 0.25rem;
    border: 1px solid var(--surface-border);
    border-radius: var(--st-radius-lg);
    background: var(--surface);
    box-shadow: var(--st-shadow-card);
    flex-wrap: wrap;
}

.billing-hero-main {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.billing-hero-eyebrow {
    font-size: var(--fs-eyebrow-sm);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--st-jade);
    font-weight: 600;
}

.billing-hero-row {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.billing-hero-plan {
    font-family: var(--st-display);
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: var(--tracking-tight);
    color: var(--foreground);
    line-height: var(--leading-tight);
    margin: 0;
}

.billing-hero-meta {
    font-size: 0.88rem;
    color: var(--foreground-secondary);
    font-weight: 500;
}

.billing-hero-sub {
    font-size: 0.85rem;
    color: var(--foreground-secondary);
    line-height: 1.4;
    margin: 0;
}

.billing-hero-action .btn-primary,
.billing-hero-action .btn-secondary {
    white-space: nowrap;
}

/* --- Alerts --- */
.billing-alert-stack {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
}

.billing-alert {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    flex-wrap: wrap;
}

.billing-alert-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1 1 260px;
    min-width: 0;
}

.billing-alert-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--foreground);
}

.billing-alert-text {
    font-size: 0.82rem;
    color: var(--foreground-secondary);
    line-height: 1.4;
}

.billing-alert-action {
    padding: 0.5rem 0.9rem;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: inherit;
}

.billing-alert-warning {
    border-color: color-mix(in srgb, var(--st-copper-raw) 40%, transparent);
    background: color-mix(in srgb, var(--st-copper-raw) 8%, var(--surface));
    color: var(--st-copper);
}

.billing-alert-warning .billing-alert-title { color: var(--st-copper); }
.billing-alert-warning .billing-alert-text { color: var(--st-copper); }

.billing-alert-info {
    border-color: color-mix(in srgb, var(--st-steel) 35%, transparent);
    background: color-mix(in srgb, var(--st-steel) 7%, var(--surface));
    color: var(--st-steel-deep);
}

.billing-alert-info .billing-alert-title { color: var(--st-steel-deep); }
.billing-alert-info .billing-alert-text { color: var(--st-steel); }

.billing-alert-internal {
    border-color: color-mix(in srgb, var(--st-steel) 45%, transparent);
    background: color-mix(in srgb, var(--st-steel) 12%, var(--surface));
    color: var(--st-steel-deep);
}

.billing-alert-internal .billing-alert-title { color: var(--st-steel-deep); }
.billing-alert-internal .billing-alert-text { color: var(--st-steel); }

/* --- Included in your plan — quiet definition grid, no inner boxes --- */
.billing-included-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px 32px;
}

.billing-included-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.billing-included-label {
    font-size: var(--fs-eyebrow-sm);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--foreground-secondary);
}

.billing-included-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--foreground);
    font-variant-numeric: tabular-nums lining-nums;
}

.billing-included-help {
    font-size: 12px;
    color: var(--foreground-secondary);
    line-height: 1.4;
}

/* --- Section blocks --- */
.billing-block {
    padding: 1.5rem;
}

.billing-block + .billing-block {
    margin-top: 1rem;
}

.billing-block-head {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 1rem;
}

.billing-block-head-inline {
    margin: 0 0 0.85rem 0;
}

.billing-block-head-with-icon {
    flex-direction: row;
    align-items: center;
    gap: 14px;
}

.billing-block-head-with-icon .card-header-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.billing-block-head-with-icon h3 {
    margin: 0;
}

.billing-block-head-with-icon p {
    margin: 0;
}

.billing-block-head h3 {
    font-family: var(--st-display);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: var(--tracking-snug);
    color: var(--foreground);
    margin: 0;
}

.billing-block-head p {
    font-size: 0.85rem;
    color: var(--foreground-secondary);
    margin: 0;
}

/* --- Plan rows (Plans + Overage bundles) --- */
.billing-plans-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.billing-plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    background: var(--surface);
    flex-wrap: wrap;
}

.billing-plan-row-main {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1 1 260px;
    min-width: 0;
}

.billing-plan-row-head {
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.billing-plan-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--foreground);
}

.billing-plan-price {
    font-size: 0.88rem;
    color: var(--foreground-secondary);
    font-weight: 500;
    font-variant-numeric: tabular-nums lining-nums;
}

.billing-plan-desc {
    font-size: 0.82rem;
    color: var(--foreground-secondary);
    line-height: 1.4;
    margin: 0;
}

.billing-plan-reason {
    font-size: 0.76rem;
    color: var(--st-copper);
    background: color-mix(in srgb, var(--st-copper-raw) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--st-copper-raw) 22%, transparent);
    border-radius: var(--st-radius-sm);
    padding: 0.35rem 0.6rem;
    margin: 0.2rem 0 0 0;
    display: inline-block;
    align-self: flex-start;
}

.billing-plan-row-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    flex: 0 0 180px;
}

.billing-plan-row-action > button {
    width: 100%;
    min-width: 180px;
    max-width: 180px;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box;
    justify-content: center;
}

/* --- Plan cards — pricing grid inside the Plans block --- */
.plan-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.plan-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--st-radius-md);
    background: var(--background);
}

.plan-card-current {
    border-color: color-mix(in srgb, var(--st-jade) 40%, transparent);
    background: color-mix(in srgb, var(--st-jade) 5%, var(--background));
}

.plan-card-name {
    font-size: var(--fs-eyebrow-sm);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--foreground-secondary);
}

.plan-card-current .plan-card-name {
    color: var(--st-jade);
}

.plan-card-price {
    font-family: var(--st-display);
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: var(--tracking-snug);
    line-height: var(--leading-tight);
    color: var(--foreground);
    font-variant-numeric: tabular-nums lining-nums;
    margin: 0;
}

.plan-card-desc {
    font-size: 0.8rem;
    color: var(--foreground-secondary);
    line-height: 1.45;
    margin: 0;
    flex-grow: 1;
}

.plan-card-reason {
    font-size: 0.74rem;
    color: var(--st-copper);
    background: color-mix(in srgb, var(--st-copper-raw) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--st-copper-raw) 22%, transparent);
    border-radius: var(--st-radius-sm);
    padding: 0.35rem 0.6rem;
    margin: 0;
}

.plan-card-action {
    margin-top: 4px;
}

.plan-card-action > button,
.plan-card-action > .plan-card-badge {
    width: 100%;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    justify-content: center;
    box-sizing: border-box;
}

.plan-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--foreground-secondary);
    background: color-mix(in srgb, var(--foreground) 7%, transparent);
    border-radius: var(--st-radius-sm);
    min-height: 38px;
}

.plan-card-badge-current {
    background: color-mix(in srgb, var(--st-jade) 13%, transparent);
    color: var(--st-jade);
}

/* Quiet steel note above the plan cards: Stripe is running on a test key. */
.billing-test-note {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--st-steel-deep);
    background: color-mix(in srgb, var(--st-steel) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--st-steel) 24%, transparent);
    border-radius: var(--st-radius-sm);
    padding: 0.45rem 0.7rem;
    margin: 0 0 0.9rem 0;
}

/* --- Action tiles (Billing manage block) --- */
.billing-action-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.7rem;
}

.billing-action-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    background: var(--surface);
}

.billing-action-tile-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.billing-action-tile-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--foreground);
}

.billing-action-tile-help {
    font-size: 0.76rem;
    color: var(--foreground-secondary);
    line-height: 1.35;
}

.billing-action-tile-disabled {
    background: var(--st-surface-muted);
    opacity: 0.85;
}

.billing-action-tile-disabled .billing-action-tile-label {
    color: var(--foreground-secondary);
    font-weight: 500;
}

.billing-action-tile button {
    white-space: nowrap;
}

/* --- Spend cap --- */
.billing-spend-cap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.1rem;
    margin-top: 0.7rem;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    background: var(--surface);
    flex-wrap: wrap;
}

.billing-spend-cap-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1 1 260px;
    min-width: 0;
}

.billing-spend-cap-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--foreground);
}

.billing-spend-cap-help {
    font-size: 0.78rem;
    color: var(--foreground-secondary);
    line-height: 1.4;
}

.billing-spend-cap-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.billing-spend-cap-input .form-input {
    width: 130px;
    max-width: 130px;
}

/* --- Diagnostics foldout --- */
.billing-diagnostics {
    margin-top: 0.9rem;
    border-top: 1px solid var(--border);
    padding-top: 0.9rem;
}

.billing-diagnostics > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--foreground-secondary);
    padding: 0.2rem 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.billing-diagnostics > summary::before {
    content: '▸';
    font-size: 0.7rem;
    color: var(--foreground-secondary);
    transition: transform 0.15s ease;
}

.billing-diagnostics[open] > summary::before {
    transform: rotate(90deg);
}

.billing-diagnostics > summary::marker,
.billing-diagnostics > summary::-webkit-details-marker {
    display: none;
}

.billing-diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.6rem 1.25rem;
    margin-top: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    background: var(--st-surface-muted);
    border: 1px solid var(--border);
}

.billing-diagnostics-grid > div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.82rem;
    color: var(--foreground);
}

.billing-diagnostics-label {
    font-size: var(--fs-eyebrow-sm);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--foreground-secondary);
}

/* --- Member footer note --- */
.billing-member-note {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.2rem;
    border-radius: 12px;
}

.billing-member-note-icon {
    flex-shrink: 0;
    color: var(--foreground-secondary);
    margin-top: 2px;
}

.billing-member-note-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0 0 0.2rem 0;
}

.billing-member-note-text {
    font-size: 0.82rem;
    color: var(--foreground-secondary);
    line-height: 1.45;
    margin: 0;
}

/* --- Plan CTA: solid jade button with arrow, used for Get Pro / Get Business / Manage billing / View plans --- */
.btn-plan-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-foreground, #ffffff);
    background: var(--primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(28, 27, 24, 0.15);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-plan-cta:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 30%, transparent);
    color: var(--primary-foreground, #ffffff);
}

.btn-plan-cta:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(28, 27, 24, 0.15);
}

.btn-plan-cta:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--st-jade) 55%, transparent);
    outline-offset: 2px;
}

.btn-plan-cta-arrow {
    display: inline-flex;
    transition: transform 0.2s ease;
    line-height: 1;
}

.btn-plan-cta:hover .btn-plan-cta-arrow {
    transform: translateX(3px);
}

/* --- Disabled and in-flight billing controls ---
   Buttons are disabled while a checkout / portal / save request is running,
   so a second click cannot start a second one. */
#usage-tab .btn-plan-cta:disabled,
#usage-tab .btn-secondary:disabled,
#usage-tab .billing-alert-action:disabled,
#usage-tab .billing-inline-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

#usage-tab .btn-plan-cta:disabled,
#usage-tab .btn-plan-cta:disabled:hover {
    background: var(--primary);
    transform: none;
    box-shadow: none;
}

#usage-tab .btn-plan-cta:disabled:hover .btn-plan-cta-arrow {
    transform: none;
}

#usage-tab .btn-secondary:disabled:hover {
    background: var(--surface-strong);
    border-color: var(--border);
}

#usage-tab [data-billing-busy] {
    cursor: progress;
}

/* Small outlined action inside a banner or error line (Try again). */
.billing-inline-action {
    flex-shrink: 0;
    margin-left: auto;
    padding: 0.35rem 0.75rem;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: var(--st-radius-sm);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    color: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.billing-inline-action:hover {
    background: color-mix(in srgb, currentColor 10%, transparent);
}

.billing-inline-action:focus-visible,
.billing-alert-action:focus-visible {
    outline: 2px solid color-mix(in srgb, currentColor 55%, transparent);
    outline-offset: 2px;
}

/* The return banner changes variant in place (confirming, then confirmed or
   not). Its text and inline action take the banner's colour directly; with a
   colour transition of their own they would trail a step behind it. */
#billing-return-banner > span,
#billing-return-banner > .billing-inline-action {
    transition: none;
}

/* --- Reusable section-heading glyph — bare, in jade, token-driven for both themes --- */
.header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--st-jade);
}

.header-icon svg {
    width: 22px;
    height: 22px;
}

/* Children too: a stroke-width attribute on a path beats the inherited value. */
.header-icon svg,
.header-icon svg * {
    stroke-width: 1.6;
}

.card-header-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.card-header-row .card-header-text {
    min-width: 0;
}

.card-header-row h2,
.card-header-row h3 {
    margin: 0;
}

.card-header-row p {
    margin: 2px 0 0 0;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .billing-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .billing-plan-row {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Stacked, the row's flex-basis values (260px / 180px) would become
       heights and leave tall empty gaps. Size by content instead. */
    .billing-plan-row-main,
    .billing-plan-row-action,
    .billing-spend-cap-meta {
        flex: 0 0 auto;
    }

    .billing-plan-row-action {
        width: 100%;
        justify-content: flex-end;
    }

    .billing-action-tile {
        flex-direction: column;
        align-items: flex-start;
    }

    .billing-action-tile button {
        width: 100%;
    }

    .billing-spend-cap {
        flex-direction: column;
        align-items: stretch;
    }

    .billing-spend-cap-input {
        width: 100%;
    }

    .billing-spend-cap-input .form-input {
        flex: 1;
        width: auto;
        max-width: none;
    }
}
