.am-template-shell {
    color: var(--am-text);
}

.am-frontend {
    --am-accent: var(--am-brand-override, #17324d);
    --am-accent-2: #2b5d86;
    --am-text: #132231;
    --am-muted: #627485;
    --am-border: rgba(23, 50, 77, 0.12);
    --am-soft: #f4f7fa;
    --am-surface: #ffffff;
    --am-surface-2: #f8fbfd;
    --am-shadow: rgba(19, 34, 49, 0.08);
    color: var(--am-text);
}

.am-template-shell {
    padding: 32px 0 56px;
}

.am-frontend {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 18px;
}

.am-frontend,
.am-frontend *,
.am-frontend *::before,
.am-frontend *::after {
    box-sizing: border-box;
}

.am-frontend .am-panel,
.am-frontend .am-card-plan,
.am-frontend .am-field {
    min-width: 0;
    overflow-wrap: anywhere;
}

.am-theme-atlas {
    --am-accent: var(--am-brand-override, #17324d);
    --am-accent-2: #2b5d86;
    --am-text: #132231;
    --am-muted: #627485;
    --am-border: rgba(23, 50, 77, 0.12);
    --am-surface: #ffffff;
    --am-surface-2: #f8fbfd;
    --am-shadow: rgba(19, 34, 49, 0.08);
}

.am-theme-linen {
    --am-accent: var(--am-brand-override, #8a5d3b);
    --am-accent-2: #bb7f5f;
    --am-text: #3c261b;
    --am-muted: #866b5a;
    --am-border: rgba(138, 93, 59, 0.16);
    --am-surface: #fff9f3;
    --am-surface-2: #fff3e6;
    --am-shadow: rgba(83, 50, 23, 0.10);
}

.am-theme-mint {
    --am-accent: var(--am-brand-override, #0d6c62);
    --am-accent-2: #17a090;
    --am-text: #0f2f2b;
    --am-muted: #5b7773;
    --am-border: rgba(13, 108, 98, 0.15);
    --am-surface: #f5fffd;
    --am-surface-2: #ebfaf7;
    --am-shadow: rgba(7, 65, 58, 0.10);
}

.am-theme-ember {
    --am-accent: var(--am-brand-override, #8f3f2d);
    --am-accent-2: #c7684f;
    --am-text: #351b16;
    --am-muted: #7a5a50;
    --am-border: rgba(143, 63, 45, 0.14);
    --am-surface: #fff7f4;
    --am-surface-2: #ffefe7;
    --am-shadow: rgba(92, 36, 25, 0.10);
}

.am-theme-mono {
    --am-accent: var(--am-brand-override, #22252c);
    --am-accent-2: #4e5664;
    --am-text: #1d2127;
    --am-muted: #656d79;
    --am-border: rgba(34, 37, 44, 0.12);
    --am-surface: #ffffff;
    --am-surface-2: #f3f5f8;
    --am-shadow: rgba(24, 26, 31, 0.08);
}

.am-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
    gap: 28px;
    align-items: start;
    margin: 30px 0;
}

.am-panel,
.am-card-plan,
.am-status-box {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--am-accent) 12%, transparent), transparent 34%),
        linear-gradient(180deg, var(--am-surface), var(--am-surface-2));
    border: 1px solid var(--am-border);
    border-radius: 26px;
    box-shadow: 0 18px 46px var(--am-shadow);
}

.am-panel,
.am-status-box {
    padding: 24px;
    margin-bottom: 22px;
}

.am-card-plan {
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.am-card-plan.is-current {
    border-color: rgba(23, 50, 77, 0.28);
}

.am-plan-flag,
.am-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 6px 12px;
    background: rgba(23, 50, 77, 0.08);
    color: var(--am-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.am-plan-flag {
    margin-bottom: 12px;
}

.am-kicker {
    margin: 0 0 8px;
    color: var(--am-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    font-weight: 700;
}

.am-panel-head,
.am-inline-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.am-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: 14px;
    margin: 18px 0;
}

.am-facts div {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--am-border);
    border-radius: 18px;
    padding: 14px;
}

.am-facts strong,
.am-field span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--am-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.am-facts span {
    font-size: 16px;
    font-weight: 600;
}

.am-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 18px;
    align-items: stretch;
}

.am-card-plan h3 {
    margin: 0 0 10px;
    font-size: 28px;
    line-height: 1.15;
}

.am-card-plan {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.am-price {
    font-size: 34px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.am-interval,
.am-desc,
.am-note,
.am-muted,
.am-meta li {
    color: var(--am-muted);
}

.am-desc {
    flex: 1 1 auto;
    min-height: 72px;
}

.am-plan-form {
    display: grid;
    gap: 12px;
    margin-top: auto;
}

.am-billing-form {
    display: grid;
    gap: 16px;
}

.am-billing-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 12px;
}

.am-billing-details {
    padding: 12px 14px;
    border: 1px solid var(--am-border);
    border-radius: 14px;
    background: var(--am-surface-2, #f8fbfd);
}

.am-billing-details summary {
    cursor: pointer;
    color: var(--am-accent);
    font-weight: 700;
}

.am-billing-details[open] summary {
    margin-bottom: 14px;
}

.am-billing-note {
    margin: 10px 0 0;
    font-size: 13px;
}

.am-billing-error[hidden] {
    display: none !important;
}

.am-frontend .am-billing-error.am-alert.error {
    margin: 0 0 14px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--am-text);
    background: rgba(215, 90, 90, 0.12);
    border: 1px solid rgba(215, 90, 90, 0.45);
}

.am-frontend .am-billing-fields [aria-invalid="true"] {
    border-color: #d75a5a;
    box-shadow: 0 0 0 1px #d75a5a;
    scroll-margin-block: 100px;
}

.am-field input,
.am-field select {
    width: 100%;
    min-width: 0;
    border-radius: 14px;
    border: 1px solid var(--am-border);
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.9);
}

.am-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--am-accent), var(--am-accent-2));
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.am-btn:hover,
.am-btn:focus {
    color: #ffffff;
    filter: brightness(1.04);
}

.am-btn-secondary {
    width: auto;
    background: #eef4f8;
    color: var(--am-accent);
}

.am-btn-secondary:hover,
.am-btn-secondary:focus {
    color: var(--am-accent);
}

.am-btn-disabled {
    background: #edf1f4;
    color: #6d7d8b;
    cursor: default;
}

.am-btn:disabled {
    background: #edf1f4;
    color: #6d7d8b;
    cursor: not-allowed;
    filter: none;
}

.am-invoice-list {
    display: grid;
    gap: 10px;
}

.am-invoice-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid var(--am-border);
    border-radius: 14px;
    color: var(--am-text);
    text-decoration: none;
    background: var(--am-surface-2);
}

.am-invoice-row:hover,
.am-invoice-row:focus {
    color: var(--am-accent);
    border-color: var(--am-accent);
}

.am-alert {
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: 16px;
    font-weight: 600;
}

.am-alert.success {
    background: #e6f5ed;
    color: #1d6a47;
}

.am-alert.error {
    background: #f9e8e8;
    color: #9a3131;
}

@media (max-width: 860px) {
    .am-hero {
        grid-template-columns: 1fr;
    }

    .am-panel-head,
    .am-inline-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

.am-subscription-history summary{cursor:pointer;font-size:13px;color:var(--am-muted)}
.am-subscription-history ol{margin:12px 0;padding-left:22px}.am-subscription-history li{padding:6px 0}

/* One product card, with its billing periods kept together. */
.am-plan-group{min-width:0;padding:22px;border:1px solid var(--am-border);border-radius:18px;background:var(--am-surface);display:flex;flex-direction:column;gap:16px}
.am-plan-group-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px}
.am-plan-group-head h3{margin:0;font-size:22px;line-height:1.3}
.am-plan-group-current{font-size:11px;color:var(--am-accent);background:var(--am-soft);border-radius:6px;padding:4px 8px;white-space:nowrap}
.am-plan-group-description{color:var(--am-muted);font-size:14px;line-height:1.5;margin:0;min-height:42px}
.am-plan-period{display:grid;gap:6px;margin:0}
.am-plan-period>span{font-size:12px;color:var(--am-muted)}
.am-plan-period select{width:100%;height:44px;min-height:44px;padding:8px 30px 8px 12px;border:1px solid var(--am-border);border-radius:9px;background:var(--am-surface-2);color:var(--am-text);font:inherit;font-size:13px}
.am-plan-period[hidden],.am-plan-variant[hidden]{display:none!important}
.am-plan-group .am-card-plan{border:0;border-radius:0;padding:0;background:none;box-shadow:none;overflow:visible}
.am-plan-group.is-enhanced .am-card-plan h3,.am-plan-group .am-card-plan .am-desc{display:none}
.am-plan-group .am-price{font-size:30px;line-height:1.2}
.am-plan-group .am-interval{font-size:13px;margin:3px 0 18px}
.am-plan-group .am-note{font-size:13px;line-height:1.5;padding:10px 12px;border-radius:8px;background:var(--am-soft);margin:0 0 16px}
.am-plan-group .am-plan-flag{font-size:11px;padding:3px 8px;letter-spacing:0;text-transform:none;align-self:flex-start}
.am-plan-group .am-card-plan>.am-btn{margin-top:auto}
.am-plan-group .am-plan-variant{flex:1;min-width:0}
.am-plan-group.is-current-group{border-color:var(--am-accent)}
.am-plan-variant+.am-plan-variant{margin-top:20px}
.am-plan-group.is-enhanced .am-plan-variant{margin-top:0}
.am-facts small{display:block;font-size:12px;color:var(--am-muted);margin-top:3px}
.am-picker-caption{font-size:13px;font-weight:400;color:var(--am-muted);margin-left:12px}
.am-frontend .am-plan-period select:focus-visible{outline:2px solid var(--am-accent);outline-offset:3px}
@media(max-width:600px){.am-plan-group{padding:18px}.am-picker-caption{display:block;margin:4px 0 0 18px}.am-plan-group-description{min-height:0}}
.am-plan-group.is-enhanced .am-plan-flag{display:none}
.am-frontend .am-plan-selection-title{margin-bottom:20px}

/* Dedicated tariff pages: pricing and booking share the available width. */
.am-template-shell.am-template-shell--plan {
    padding: 56px 0 64px;
}

.am-route-page {
    max-width: 1240px;
}

.am-checkout-page-head {
    margin: 0 0 24px;
}

.am-checkout-page-head h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.am-checkout-page-head > .am-muted {
    margin: 10px 0 0;
    line-height: 1.5;
}

.am-plan-group.am-plan-group--checkout {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    gap: 20px;
}

.am-checkout-options {
    max-width: 340px;
}

.am-card-plan.am-card-plan--checkout {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.4fr);
    align-items: start;
    gap: 24px;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
}

.am-checkout-summary,
.am-checkout-booking {
    min-width: 0;
    margin: 0;
    padding: 28px;
    border-radius: 18px;
}

.am-checkout-summary .am-price {
    font-size: clamp(32px, 4vw, 44px);
    line-height: 1.15;
}

.am-checkout-summary .am-interval {
    margin: 6px 0 20px;
    line-height: 1.5;
}

.am-checkout-page .am-checkout-summary .am-desc {
    display: block;
    flex: none;
    min-height: 0;
    margin: 0;
    line-height: 1.6;
}

.am-checkout-page .am-checkout-summary .am-plan-flag {
    display: inline-flex;
}

.am-checkout-summary .am-note {
    margin: 18px 0 0;
}

.am-checkout-booking > h2 {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}

.am-checkout-booking .am-plan-form,
.am-checkout-booking .am-billing-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.am-checkout-booking .am-plan-form > :is(.am-billing-details, .am-btn, .am-alert, .am-coupon-preview),
.am-checkout-booking .am-plan-form > .am-field:only-of-type {
    grid-column: 1 / -1;
}

.am-checkout-booking > .am-btn + .am-btn {
    margin-top: 12px;
}

@media (max-width: 900px) {
    .am-card-plan.am-card-plan--checkout {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
}

@media (max-width: 620px) {
    .am-template-shell.am-template-shell--plan {
        padding: 32px 0 40px;
    }
    .am-checkout-options {
        max-width: none;
    }
    .am-checkout-summary,
    .am-checkout-booking {
        padding: 20px;
    }
    .am-checkout-booking .am-plan-form,
    .am-checkout-booking .am-billing-fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

.am-plan-selection{scroll-margin-top:110px}

/* Verified coupon summary stays within its booking form on small screens. */
.am-coupon-preview { min-width:0; border:1px solid currentColor; border-color:color-mix(in srgb,currentColor 18%,transparent); border-radius:10px; padding:15px 16px; margin:0; font-size:14px; line-height:1.5; }
.am-coupon-preview[hidden] { display:none!important; }
.am-coupon-preview dl { margin:0; }
.am-coupon-preview dl > div { display:flex; justify-content:space-between; align-items:baseline; gap:16px; padding:4px 0; }
.am-coupon-preview dt { min-width:0; overflow-wrap:anywhere; font-weight:400; }
.am-coupon-preview dd { margin:0; white-space:nowrap; font-variant-numeric:tabular-nums; }
.am-coupon-preview .am-coupon-total { border-top:1px solid currentColor; border-color:color-mix(in srgb,currentColor 18%,transparent); margin-top:8px; padding-top:10px; font-size:16px; font-weight:700; }
.am-coupon-preview .am-coupon-total dt { font-weight:700; }
.am-coupon-preview p { margin:10px 0 0; font-size:13px; }
.am-coupon-preview.is-error { border-color:#b95845; }

/* Theme defaults must leave enough room for the selected option's text. */
.am-plan-form .am-field select { height:52px; min-height:52px; padding:12px 14px; line-height:1.25; }
