/* Extracted from ecosystem.css — checkout / billing / AML / personal. */
/* Load after ecosystem.css and before ecosystem_dashboard.css. */

/* Migrated from legacy app.css (dual-era): checkout/billing/AML/personal. */
 /* Unified billing checkout: one exact-payment sheet shared by every paid product. */
 #unified-checkout-modal .modal { width:min(460px,calc(100vw - 24px)); min-width:0; }
    .unified-checkout { display:flex; flex-direction:column; gap:12px; padding:14px; }
    .checkout-status {
        display:flex; align-items:center; gap:9px; min-height:32px; padding:8px 10px;
        border-radius:12px; background:var(--tg-theme-secondary-bg-color,#f1f1f1);
    }
    .checkout-status-dot { width:9px; height:9px; flex:0 0 auto; border-radius:50%; background:#d98600; }
    .checkout-status-paid .checkout-status-dot { background:var(--pos,#1a8d3e); }
    .checkout-status-expired .checkout-status-dot,
    .checkout-status-unmatched .checkout-status-dot { background:var(--neg,#d11); }
    .checkout-breakdown { display:flex; flex-direction:column; gap:6px; margin:0; }
    .checkout-breakdown > div { display:flex; justify-content:space-between; gap:16px; }
    .checkout-breakdown dt { color:var(--tg-theme-hint-color,#68717d); font-size:12px; }
    .checkout-breakdown dd { margin:0; text-align:right; font-weight:650; overflow-wrap:anywhere; }
    .checkout-exact {
        display:grid; grid-template-columns:1fr auto auto; align-items:baseline; gap:6px;
        padding:14px; border:1px solid var(--ui-border,rgba(128,128,128,.22));
        border-radius:14px; background:var(--tg-theme-secondary-bg-color,#f1f1f1);
    }
    .checkout-exact span { grid-column:1 / -1; color:var(--tg-theme-hint-color,#68717d); font-size:12px; }
    .checkout-exact b { font-size:clamp(22px,7vw,30px); line-height:1.1; overflow-wrap:anywhere; }
    .checkout-exact small { color:var(--tg-theme-hint-color,#68717d); font-weight:700; }
    .checkout-primary { width:100%; min-height:48px; }
    .checkout-detail {
        display:grid; grid-template-columns:minmax(72px,auto) minmax(0,1fr) auto;
        align-items:center; gap:8px; min-height:44px;
    }
    .checkout-detail > span { color:var(--tg-theme-hint-color,#68717d); font-size:12px; }
    .checkout-detail code, .checkout-detail time {
        min-width:0; overflow-wrap:anywhere; color:var(--tg-theme-text-color,#111); font-size:12px;
    }
    .checkout-copy-wallet, .checkout-refresh { min-width:44px; min-height:44px; }
    .checkout-refresh { align-self:center; }
    .checkout-hint { margin:0; color:var(--tg-theme-hint-color,#68717d); font-size:12px; line-height:1.4; }
    html[data-theme="dark"] .checkout-exact {
        border-color:rgba(255,255,255,.13); background:rgba(255,255,255,.045);
    }
    @media (max-width:480px) {
 #unified-checkout-modal .modal { width:100%; }
        .unified-checkout { padding:12px; }
        .checkout-detail { grid-template-columns:72px minmax(0,1fr) auto; }
    }

 /* Subscription workspace: one decision, three fixed plans, no constructor noise. */
    .cab-billing-workspace { display:flex; flex-direction:column; gap:14px; }
    .billing-status-card {
        display:flex; justify-content:space-between; align-items:flex-start; gap:16px;
        padding:16px; border:1px solid var(--ui-border,rgba(128,128,128,.2));
        border-radius:16px; background:var(--tg-theme-bg-color,#fff);
    }
    .billing-status-card h2, .billing-status-card p { margin:3px 0 0; }
    .billing-status-formula {
        margin:6px 0 0; font-size:12px; color:var(--tg-theme-hint-color,#68717d); line-height:1.4;
    }
    .billing-seats.ecosystem-card, .billing-metered.ecosystem-card {
        padding:0; overflow:hidden;
    }
    .billing-seats .billing-section-head, .billing-metered .billing-section-head {
        padding:13px 14px 0;
    }
    .billing-metered-list {
        list-style:none; margin:0; padding:4px 14px 14px; display:flex; flex-direction:column; gap:8px;
    }
    .billing-metered-list li {
        display:flex; flex-direction:column; gap:2px; padding:10px 12px; border-radius:12px;
        background:var(--tg-theme-secondary-bg-color,#f4f4f5);
    }
    .billing-metered-list span { font-size:12px; color:var(--tg-theme-hint-color,#68717d); line-height:1.4; }
    .billing-seats-price { margin:0; font-size:12px; font-weight:650; }
    .billing-status-limits {
        color:var(--tg-theme-hint-color,#68717d); font-size:12px; line-height:1.35;
    }
    .billing-eyebrow { color:var(--pos,#1a8d3e); font-size:12px; font-weight:750; }
    .billing-status-card[data-tone="expired"] .billing-eyebrow { color:var(--neg,#d11); }
    .billing-status-price { display:flex; flex-direction:column; align-items:flex-end; white-space:nowrap; }
    .billing-status-price b { font-size:22px; }
    .billing-status-price span { color:var(--tg-theme-hint-color,#68717d); font-size:11px; }
    .billing-section-head { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; }
    .billing-section-head h2, .billing-section-head p { margin:0 0 4px; }
    .billing-section-head p, .billing-disclosure summary small {
        color:var(--tg-theme-hint-color,#68717d); font-size:12px;
    }
    .billing-period-switch {
        display:flex; gap:3px; padding:3px; border-radius:12px;
        background:var(--tg-theme-secondary-bg-color,#f1f1f1);
    }
    .billing-period-switch button {
        min-height:36px; padding:6px 14px; border:0; border-radius:9px; background:transparent;
        color:var(--tg-theme-hint-color,#68717d);
    }
    .billing-period-switch button.active {
        background:var(--tg-theme-bg-color,#fff); color:var(--tg-theme-text-color,#111);
        box-shadow:0 1px 5px rgba(0,0,0,.09);
    }
    .cab-plan-quota {
        display:grid; grid-template-columns:1fr 1fr; gap:6px; margin:12px 0 8px;
    }
    .cab-plan-quota span {
        display:flex; flex-direction:column; min-width:0; padding:9px;
        border-radius:11px; background:var(--tg-theme-secondary-bg-color,#f1f1f1);
    }
    .cab-plan-quota b { font-size:20px; line-height:1; }
    .cab-plan-quota small {
        margin-top:4px; color:var(--tg-theme-hint-color,#68717d); font-size:9.5px; line-height:1.25;
    }
    .cab-plan-modules { display:flex; flex-direction:column; flex:1; gap:5px; margin:5px 0 12px; font-size:11.5px; }
    .cab-plan-saving { margin:0 0 10px; color:var(--pos,#1a8d3e); font-size:10.5px; }
    .cab-plan-price i { font-style:normal; }
    .billing-plan-options { display:flex; gap:8px; flex-wrap:wrap; }
    .billing-plan-options label, .billing-seats-body label {
        display:flex; flex-direction:column; gap:4px; color:var(--tg-theme-hint-color,#68717d); font-size:11px;
    }
    .billing-plan-options select, .billing-plan-options input, .billing-seats-body input {
        min-height:40px; min-width:92px;
    }
    .billing-disclosure {
        border:1px solid var(--ui-border,rgba(128,128,128,.2)); border-radius:14px; overflow:hidden;
    }
    .billing-disclosure > summary {
        display:flex; flex-direction:column; gap:2px; padding:13px 14px; cursor:pointer; font-weight:700;
    }
    .billing-disclosure[open] > summary { border-bottom:1px solid var(--ui-border,rgba(128,128,128,.2)); }
    .billing-seats-body { display:flex; align-items:flex-end; gap:10px; flex-wrap:wrap; padding:14px; }
    .billing-seats-body p { flex:1 1 100%; margin:0; color:var(--tg-theme-hint-color,#68717d); }
    .inactive-billing { display:flex; flex-direction:column; align-items:center; max-width:480px; text-align:center; }
    .inactive-billing-icon { display:grid; place-items:center; width:64px; height:64px; border-radius:20px;
        background:var(--tg-theme-secondary-bg-color,#f1f1f1); font-size:30px; }
    .inactive-billing h2 { margin:12px 0 4px; }
    .inactive-billing p { color:var(--tg-theme-hint-color,#68717d); line-height:1.45; }
    .inactive-billing-actions { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }
    @media (max-width:640px) {
        .billing-status-card, .billing-section-head { align-items:stretch; flex-direction:column; }
        .billing-status-price { align-items:flex-start; }
        .billing-plan-options > label { flex:1 1 120px; }
    }
    .mk-audience-row {
        display:flex; align-items:center; gap:8px; min-width:0;
    }
    .mk-audience-row > .mk-audience-tabs { flex:1 1 auto; min-width:0; }
    .mk-audience-tabs {
        display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; padding:4px;
        border-radius:14px; background:var(--tg-theme-secondary-bg-color,#f1f1f1);
    }
    .mk-audience-tab { min-height:42px; }
    .mk-audience-tab.active {
        background:var(--tg-theme-bg-color,#fff); color:var(--tg-theme-text-color,#111);
        box-shadow:0 1px 5px rgba(0,0,0,.09);
    }
    .mk-boost-outcomes {
        display:flex; justify-content:space-between; gap:12px; padding:9px 10px;
        border-radius:10px; background:var(--tg-theme-secondary-bg-color,#f1f1f1); font-size:12px;
    }
    .mk-boost-outcomes span { color:var(--tg-theme-hint-color,#68717d); text-align:right; }
    .aml-hub { display:flex; flex-direction:column; gap:14px; }
    .aml-hub section h3, .aml-hub section p { margin:0 0 8px; }
    .aml-hub-balance {
        display:grid; grid-template-columns:1fr auto; gap:2px 10px; padding:14px;
        border-radius:14px; background:var(--tg-theme-secondary-bg-color,#f1f1f1);
    }
    .aml-hub-balance b { grid-row:1 / 3; grid-column:2; align-self:center; font-size:30px; }
    .aml-hub-balance small { color:var(--tg-theme-hint-color,#68717d); }
    .aml-pack-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:8px; }
    .aml-pack-card {
        display:flex; justify-content:space-between; align-items:center; gap:10px; padding:11px;
        border:1px solid var(--ui-border,rgba(128,128,128,.2)); border-radius:12px;
    }
    .aml-pack-card div { display:grid; grid-template-columns:auto 1fr; align-items:baseline; gap:0 5px; }
    .aml-pack-card b { font-size:20px; }
    .aml-pack-card small { grid-column:1 / -1; color:var(--tg-theme-hint-color,#68717d); }
    .personal-cabinet { width:min(760px,100%); text-align:left; }
    .personal-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
    .personal-head span { color:var(--tg-theme-button-color,#3390ec); font-size:12px; font-weight:750; }
    .personal-head h1 { margin:3px 0 0; }
    .personal-tabs {
        display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; margin:12px 0;
        padding:4px; border-radius:14px; background:var(--tg-theme-secondary-bg-color,#f1f1f1);
    }
    .personal-tab { min-height:40px; padding:6px; }
    .personal-tab.active { background:var(--tg-theme-bg-color,#fff); box-shadow:0 1px 5px rgba(0,0,0,.09); }
    .personal-pane { display:none; flex-direction:column; gap:10px; }
    .personal-pane.active { display:flex; }
    .personal-quota-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
    .personal-quota-grid article {
        display:flex; flex-direction:column; padding:12px; border-radius:13px;
        background:var(--tg-theme-secondary-bg-color,#f1f1f1);
    }
    .personal-quota-grid b { margin-top:6px; font-size:24px; }
    .personal-quota-grid small { color:var(--tg-theme-hint-color,#68717d); }
    .personal-history-row {
        display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:8px; padding:9px 0;
        border-bottom:1px solid var(--ui-border,rgba(128,128,128,.18));
    }
    .personal-history-row code { overflow-wrap:anywhere; }
    .personal-history-row time { color:var(--tg-theme-hint-color,#68717d); }
    .personal-trade-form > * { min-width:0; flex:1 1 100px; }
    .personal-footer-actions { display:flex; gap:8px; flex-wrap:wrap; }
    .personal-tier { width:100%; margin-top:6px; min-height:44px; }
    .personal-premium-includes {
        display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:12px 0;
    }
    .personal-premium-includes span {
        display:flex; flex-direction:column; padding:12px; border-radius:12px;
        background:var(--tg-theme-secondary-bg-color,#f1f1f1);
    }
    .personal-premium-includes b { font-size:24px; line-height:1; }
    .personal-premium-includes small { margin-top:5px; color:var(--tg-theme-hint-color,#68717d); }
    .personal-premium-tiers { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
    .personal-premium-tiers .personal-tier {
        display:flex; flex-direction:column; align-items:flex-start; gap:2px; margin:0; padding:11px;
    }
    .personal-premium-tiers .personal-tier b { font-size:18px; }
    .personal-premium-tiers .personal-tier small { opacity:.72; }
    @media (max-width:560px) {
        .personal-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
        .personal-premium-tiers { grid-template-columns:1fr; }
        .personal-history-row { grid-template-columns:1fr auto; }
        .personal-history-row time { grid-column:1 / -1; }
    }

/* Extracted from ecosystem.css — personal helpers. */
/* --- from ecosystem.css L3885-3891 --- */
/* Personal cabinet helpers */
.shell-textarea { flex: 1; font: inherit; min-height: 5em; resize: vertical; }
.pc-ticket-in { opacity: .8; }
.pc-ticket-body { white-space: pre-wrap; }
.pw-event-row { padding-left: 14px; }
.pw-event-empty { padding-left: 14px; opacity: .6; }
.pc-trade-sep { border: none; border-top: 1px solid #8883; margin: 8px 0; }

/* Extracted from ecosystem.css — subscription module picker. */
 /* §billing: subscription module picker */
    .bill-mod { padding:9px 0; border-bottom:1px solid #8881; }
    .bill-mod:last-of-type { border-bottom:none; }
    .bill-h { display:flex; align-items:flex-start; gap:8px; }
    .bill-sw {
        display:flex; align-items:center; justify-content:center;
        min-width:44px; min-height:44px; margin:-8px 0;
    }
    .bill-sw input { width:20px; height:20px; }
    .bill-total { margin-top:10px; padding-top:8px; border-top:1px solid var(--tg-theme-hint-color,#ccc);
        font-size:15px; text-align:right; }

/* Extracted from ecosystem.css — personal trade + referral ledger forms. */
.personal-trade-form.ecosystem-field-row {
  flex-wrap: wrap;
}

.ref-ledger-history,
.ref-ledger-form {
  display: grid;
  gap: 8px;
}

.ref-ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
}

.ref-ledger-row small {
  grid-column: 1 / -1;
  color: var(--ui-muted-strong, color-mix(in srgb, var(--tg-theme-text-color,#111) 90%, #1f2937));
}

.ref-ledger-form {
  grid-template-columns: minmax(6rem, .6fr) minmax(5rem, .4fr) minmax(12rem, 1.3fr);
  margin-top: 10px;
}

.ref-ledger-form .ui-actions {
  grid-column: 1 / -1;
}
.ref-ledger-form .ui-actions .ecosystem-action {
  min-height: 44px;
}
.personal-trade-form.ecosystem-field-row > * {
  flex: 1 1 8rem;
  min-width: 0;
}

@media (max-width: 700px) {
  .ref-ledger-form { grid-template-columns: 1fr; }
  .ref-ledger-form .ui-actions { grid-column: auto; }
}
