/* LifeOS Subscription & Plans UI — design tokens; dark/light via body.light-theme */

[hidden] { display: none !important; }

body.lifeos-plans-page .launch-main {
    max-width: 960px;
}

.lifeos-plans-hero {
    margin-bottom: 28px;
}

.lifeos-plans-hero h1 {
    margin: 0 0 8px;
}

.lifeos-plans-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0 28px;
}

.lifeos-ea-banner {
    margin: 12px 0 8px;
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.08);
}

.lifeos-ea-banner-note {
    margin: 0;
    font-size: 0.9rem;
    color: var(--lifeos-text-muted, #94a3b8);
    line-height: 1.45;
}

.lifeos-ea-launch-points {
    margin: 0;
    padding: 0 0 0 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.92rem;
    color: var(--lifeos-text, #e2e8f0);
    line-height: 1.4;
}

.lifeos-upgrade-targets {
    margin: 0 0 12px;
    padding: 0 0 0 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--lifeos-text, #e2e8f0);
    line-height: 1.45;
}

body.light-theme .lifeos-ea-banner,
html.lifeos-theme-light .lifeos-ea-banner {
    background: rgba(251, 191, 36, 0.12);
}

.lifeos-plan-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 16px;
    border-radius: var(--lifeos-radius-lg, 14px);
    border: 1px solid var(--lifeos-border, rgba(255, 255, 255, 0.1));
    background: rgba(0, 0, 0, 0.22);
    min-height: 100%;
}

body.light-theme .lifeos-plan-card,
html.lifeos-theme-light .lifeos-plan-card {
    background: rgba(15, 23, 42, 0.03);
}

.lifeos-plan-card.is-current {
    border-color: rgba(var(--lifeos-accent-rgb, 0, 242, 254), 0.55);
}

.lifeos-plan-card.is-featured {
    border-color: rgba(var(--lifeos-accent-rgb, 0, 242, 254), 0.35);
}

.lifeos-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--lifeos-cyan, #00f2fe);
}

.lifeos-plan-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--lifeos-text, #e2e8f0);
}

body.light-theme .lifeos-plan-name,
html.lifeos-theme-light .lifeos-plan-name {
    color: var(--lifeos-text, #0f172a);
}

.lifeos-plan-price {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--lifeos-text, #e2e8f0);
}

.lifeos-plan-price span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--lifeos-text-muted, #94a3b8);
}

.lifeos-plan-meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--lifeos-text-muted, #94a3b8);
    line-height: 1.45;
}

.lifeos-plan-list {
    margin: 0;
    padding: 0 0 0 1.1rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--lifeos-text, #e2e8f0);
    flex: 1;
}

body.light-theme .lifeos-plan-list,
html.lifeos-theme-light .lifeos-plan-list {
    color: var(--lifeos-text, #334155);
}

.lifeos-plan-list li { margin: 0 0 4px; }

.lifeos-plan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.lifeos-plan-btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 10px;
    border: 1px solid var(--lifeos-border, rgba(255, 255, 255, 0.14));
    background: transparent;
    color: var(--lifeos-text, #e2e8f0);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 650;
    padding: 10px 12px;
    min-height: 42px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.light-theme .lifeos-plan-btn,
html.lifeos-theme-light .lifeos-plan-btn {
    color: var(--lifeos-text, #0f172a);
}

.lifeos-plan-btn:hover,
.lifeos-plan-btn:focus-visible {
    outline: none;
    box-shadow: var(--lifeos-focus-ring, 0 0 0 3px rgba(var(--lifeos-accent-rgb, 0, 242, 254), 0.35));
    text-decoration: none;
}

.lifeos-plan-btn-primary {
    border: 0;
    background: var(--lifeos-btn-primary, linear-gradient(135deg, var(--lifeos-cyan, #00f2fe), var(--lifeos-cyan-deep, #4facfe)));
    color: var(--lifeos-btn-primary-text, #0b0d16);
}

.lifeos-plan-btn-ghost {
    border-color: transparent;
    color: var(--lifeos-text-muted, #94a3b8);
}

.lifeos-plan-manager {
    margin: 28px 0;
    padding: 18px 16px;
    border-radius: var(--lifeos-radius-lg, 14px);
    border: 1px solid var(--lifeos-border, rgba(255, 255, 255, 0.1));
    background: rgba(0, 0, 0, 0.18);
}

body.light-theme .lifeos-plan-manager,
html.lifeos-theme-light .lifeos-plan-manager {
    background: rgba(15, 23, 42, 0.03);
}

.lifeos-plan-manager h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    color: var(--lifeos-cyan, #00f2fe);
}

.lifeos-plan-manager-lead {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--lifeos-text-muted, #94a3b8);
}

.lifeos-plan-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.lifeos-plan-stat {
    padding: 12px;
    border-radius: var(--lifeos-radius-md, 12px);
    border: 1px solid var(--lifeos-border, rgba(255, 255, 255, 0.08));
    background: rgba(0, 0, 0, 0.16);
}

body.light-theme .lifeos-plan-stat,
html.lifeos-theme-light .lifeos-plan-stat {
    background: #fff;
}

.lifeos-plan-stat-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--lifeos-text-muted, #94a3b8);
    margin-bottom: 6px;
}

.lifeos-plan-stat-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--lifeos-text, #e2e8f0);
}

body.light-theme .lifeos-plan-stat-value,
html.lifeos-theme-light .lifeos-plan-stat-value {
    color: var(--lifeos-text, #0f172a);
}

.lifeos-usage {
    display: grid;
    gap: 14px;
    margin: 8px 0 16px;
}

.lifeos-usage-row {
    display: grid;
    gap: 6px;
}

.lifeos-usage-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.86rem;
    color: var(--lifeos-text, #e2e8f0);
}

body.light-theme .lifeos-usage-head,
html.lifeos-theme-light .lifeos-usage-head {
    color: var(--lifeos-text, #0f172a);
}

.lifeos-usage-track {
    position: relative;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.22);
}

.lifeos-usage-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--lifeos-cyan, #00f2fe), var(--lifeos-cyan-deep, #4facfe));
    transition: width 0.8s var(--lifeos-ease, cubic-bezier(0.4, 0, 0.2, 1));
}

.lifeos-compare-wrap {
    overflow-x: auto;
    margin: 12px 0 8px;
    border-radius: var(--lifeos-radius-md, 12px);
    border: 1px solid var(--lifeos-border, rgba(255, 255, 255, 0.1));
}

.lifeos-compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
    font-size: 0.86rem;
}

.lifeos-compare-table th,
.lifeos-compare-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--lifeos-border, rgba(255, 255, 255, 0.08));
    text-align: left;
    vertical-align: middle;
}

.lifeos-compare-table th {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--lifeos-text-muted, #94a3b8);
    background: rgba(0, 0, 0, 0.2);
}

body.light-theme .lifeos-compare-table th,
html.lifeos-theme-light .lifeos-compare-table th {
    background: rgba(15, 23, 42, 0.04);
}

.lifeos-compare-table td {
    color: var(--lifeos-text, #e2e8f0);
}

body.light-theme .lifeos-compare-table td,
html.lifeos-theme-light .lifeos-compare-table td {
    color: var(--lifeos-text, #334155);
}

.lifeos-compare-table tr:last-child td { border-bottom: 0; }

.lifeos-compare-mark {
    font-weight: 700;
}

.lifeos-compare-mark.is-yes { color: var(--lifeos-green, #26de81); }
.lifeos-compare-mark.is-premium { color: #fbbf24; }
.lifeos-compare-mark.is-pro { color: #a78bfa; }
.lifeos-compare-mark.is-no {
    color: var(--lifeos-text-subtle, #64748b);
    font-weight: 600;
}

/* Plan Manager extensions — add-ons & support (no layout change to cards/compare) */
.lifeos-section-heading {
    margin: 22px 0 8px;
    font-size: 0.98rem;
    font-weight: 750;
    color: var(--lifeos-cyan, #00f2fe);
}

.lifeos-addon-lead,
.lifeos-addon-note {
    margin: 0 0 12px;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--lifeos-text-muted, #94a3b8);
}

.lifeos-addon-note { margin-top: 12px; font-size: 0.8rem; }

.lifeos-suggestions {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: var(--lifeos-radius-md, 12px);
    border: 1px solid rgba(var(--lifeos-accent-rgb, 0, 242, 254), 0.28);
    background: rgba(var(--lifeos-accent-rgb, 0, 242, 254), 0.06);
}

.lifeos-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.lifeos-suggestion-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--lifeos-border, rgba(255, 255, 255, 0.08));
}

.lifeos-suggestion-item:last-child { border-bottom: 0; padding-bottom: 0; }

.lifeos-suggestion-copy {
    flex: 1;
    min-width: 180px;
}

.lifeos-suggestion-copy strong {
    display: block;
    font-size: 0.9rem;
    color: var(--lifeos-text, #e2e8f0);
    margin-bottom: 2px;
}

body.light-theme .lifeos-suggestion-copy strong,
html.lifeos-theme-light .lifeos-suggestion-copy strong {
    color: var(--lifeos-text, #0f172a);
}

.lifeos-suggestion-copy span {
    font-size: 0.8rem;
    color: var(--lifeos-text-muted, #94a3b8);
}

.lifeos-addon-block,
.lifeos-support-block {
    margin-top: 8px;
}

.lifeos-addon-grid,
.lifeos-coffee-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.lifeos-coffee-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.lifeos-coffee-custom-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lifeos-coffee-custom-wrap input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--lifeos-border, rgba(255, 255, 255, 0.1));
    background: rgba(0, 0, 0, 0.2);
    color: var(--lifeos-text, #e2e8f0);
    font-size: 0.9rem;
}

body.light-theme .lifeos-coffee-custom-wrap input,
html.lifeos-theme-light .lifeos-coffee-custom-wrap input {
    background: #fff;
    color: #0f172a;
}

.lifeos-addon-card-custom {
    grid-column: 1 / -1;
}

.lifeos-addon-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 12px;
    border-radius: var(--lifeos-radius-md, 12px);
    border: 1px solid var(--lifeos-border, rgba(255, 255, 255, 0.1));
    background: rgba(0, 0, 0, 0.16);
    min-height: 100%;
}

body.light-theme .lifeos-addon-card,
html.lifeos-theme-light .lifeos-addon-card {
    background: rgba(15, 23, 42, 0.03);
}

.lifeos-addon-card-label {
    margin: 0;
    font-size: 1rem;
    font-weight: 750;
    color: var(--lifeos-text, #e2e8f0);
}

body.light-theme .lifeos-addon-card-label,
html.lifeos-theme-light .lifeos-addon-card-label {
    color: var(--lifeos-text, #0f172a);
}

.lifeos-addon-card-price {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--lifeos-cyan, #00f2fe);
}

.lifeos-support-emoji {
    margin: 4px 0 12px;
    font-size: 1.8rem;
    line-height: 1;
}

@media (max-width: 900px) {
    .lifeos-addon-grid,
    .lifeos-coffee-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .lifeos-addon-grid,
    .lifeos-coffee-grid {
        grid-template-columns: 1fr;
    }
}

/* Upgrade coming-soon dialog */
#lifeosUpgradeModal.modal {
    z-index: 12100;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(5, 7, 14, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.light-theme #lifeosUpgradeModal.modal {
    background: rgba(15, 23, 42, 0.45);
}

.lifeos-upgrade-panel {
    width: min(420px, 100%);
    padding: 22px 20px 18px;
    border-radius: var(--lifeos-radius-xl, 16px);
    border: 1px solid var(--lifeos-border, rgba(255, 255, 255, 0.1));
    background: var(--lifeos-card, rgba(23, 27, 43, 0.98));
    color: var(--lifeos-text, #e2e8f0);
    box-shadow: var(--lifeos-shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.45));
}

body.light-theme .lifeos-upgrade-panel {
    background: #fff;
    color: #0f172a;
}

.lifeos-upgrade-panel h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.lifeos-upgrade-panel p {
    margin: 0 0 12px;
    color: var(--lifeos-text-muted, #94a3b8);
    line-height: 1.55;
    font-size: 0.92rem;
}

.lifeos-upgrade-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

/* Settings plan panel compact meters */
#settings-storage .lifeos-usage,
#settings-plan .lifeos-usage {
    margin-top: 4px;
}

.lifeos-billing-section {
    margin: 28px 0;
}

.lifeos-billing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.lifeos-billing-panel {
    padding: 16px;
    border-radius: var(--lifeos-radius-lg, 14px);
    border: 1px solid var(--lifeos-border, rgba(255, 255, 255, 0.1));
    background: rgba(0, 0, 0, 0.18);
}

.lifeos-billing-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lifeos-billing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--lifeos-border, rgba(255, 255, 255, 0.08));
    background: rgba(255, 255, 255, 0.02);
}

.lifeos-billing-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lifeos-billing-meta {
    font-size: 0.85rem;
    color: var(--lifeos-text-muted, #94a3b8);
}

.lifeos-billing-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lifeos-billing-status {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--lifeos-border, rgba(255, 255, 255, 0.12));
}

.lifeos-billing-status.is-paid {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.35);
}

.lifeos-billing-status.is-pending,
.lifeos-billing-status.is-draft {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.35);
}

.lifeos-billing-empty,
.lifeos-billing-empty-row {
    margin: 0;
    color: var(--lifeos-text-muted, #94a3b8);
    font-size: 0.92rem;
}

@media (max-width: 900px) {
    .lifeos-plans-grid,
    .lifeos-plan-stats,
    .lifeos-billing-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .lifeos-plan-actions .lifeos-plan-btn {
        width: 100%;
    }
}
