#self-hosted-plan-page {
    --self-hosted-ink: #101b79;
    --self-hosted-muted: #62739f;
    --self-hosted-blue: #087cf0;
    --self-hosted-cyan: #04b5d0;
    --self-hosted-border: #d8effc;
    min-height: calc(100vh - 140px);
    padding: 13px clamp(12px, calc((100vw - 1180px) / 2), 48px) 0;
    color: var(--self-hosted-ink);
    background: linear-gradient(135deg, #f6fcff 0%, #edf9ff 50%, #f8fcff 100%);
    font-family: Arial, Helvetica, sans-serif;
}

#self-hosted-plan-page *,
#self-hosted-plan-page *::before,
#self-hosted-plan-page *::after {
    box-sizing: border-box;
}

#self-hosted-plan-page .plan-highlights[hidden] {
    display: none !important;
}

#self-hosted-plan-page.top-up-mode .top-up-locked {
    opacity: .58;
}

#self-hosted-plan-page.top-up-mode .top-up-locked button,
#self-hosted-plan-page.top-up-mode .top-up-locked .duration-control {
    cursor: not-allowed;
}

#self-hosted-plan-page .plan-hero {
    text-align: center;
    padding: 0 0 9px;
}

#self-hosted-plan-page .plan-hero h1 {
    margin: 0;
    color: #121575;
    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.18;
}

#self-hosted-plan-page .plan-hero h1 span {
    color: var(--self-hosted-blue);
}

#self-hosted-plan-page .hero-accent {
    width: 34px;
    height: 2px;
    margin: 5px auto 5px;
    background: #ffab22;
}

#self-hosted-plan-page .plan-hero p {
    max-width: 820px;
    margin: 0 auto;
    color: var(--self-hosted-muted);
    font-size: .75rem;
    line-height: 1.5;
}

#self-hosted-plan-page .plan-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    max-width: 780px;
    margin: 12px auto 10px;
}

#self-hosted-plan-page .highlight-card {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    padding: 8px 14px;
    border: 1px solid var(--self-hosted-border);
    border-radius: 7px;
    background: rgba(255, 255, 255, .72);
}

#self-hosted-plan-page .highlight-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 50%;
    background: #e6f8ff;
    color: var(--self-hosted-cyan);
    font-size: 1.05rem;
}

#self-hosted-plan-page .highlight-copy strong,
#self-hosted-plan-page .highlight-copy span {
    display: block;
}

#self-hosted-plan-page .highlight-copy strong span {
    display: inline;
    font-size: inherit;
    font-weight: inherit;
}

#self-hosted-plan-page .highlight-copy strong {
    font-size: .9rem;
    font-weight: 800;
}

#self-hosted-plan-page .highlight-copy span {
    margin-top: 2px;
    color: var(--self-hosted-muted);
    font-size: .8rem;
}

#self-hosted-plan-page .plan-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.62fr) minmax(285px, 1fr);
    gap: 10px;
    align-items: stretch;
}

#self-hosted-plan-page .plan-card {
    min-width: 0;
    padding: 6px;
    border: 1px solid var(--self-hosted-border);
    border-radius: 9px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 5px 18px rgba(26, 127, 175, .08);
}

#self-hosted-plan-page .card-heading {
    display: flex;
    min-height: 39px;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 5px 9px;
    border-radius: 6px;
    background: linear-gradient(100deg, #eaf8ff, #f4fbff);
}

#self-hosted-plan-page .card-heading-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border-radius: 50%;
    background: #dff5ff;
    color: var(--self-hosted-cyan);
    font-size: 1rem;
}

#self-hosted-plan-page .card-heading h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

#self-hosted-plan-page .configure-content {
    padding: 0 12px 3px;
}

#self-hosted-plan-page .setting-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(140px, 294px);
    column-gap: 14px;
    align-items: center;
    padding: 10px 0 11px;
    border-bottom: 1px solid #e7f0fa;
}

#self-hosted-plan-page .setting-row:last-child {
    border-bottom: 0;
    padding-bottom: 6px;
}

#self-hosted-plan-page fieldset.os-setting {
    min-width: 0;
    margin: 0;
    padding-right: 0;
    padding-left: 0;
    border-top: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
}

#self-hosted-plan-page fieldset.os-setting legend {
    float: none;
    width: auto;
    padding: 0;
}

#self-hosted-plan-page .setting-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-bottom: 0;
    font-size: .75rem;
    font-weight: 800;
}

#self-hosted-plan-page .setting-label .help-icon {
    color: #aebbd1;
    font-size: .9rem;
}

#self-hosted-plan-page .quota-entry {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    justify-content: stretch;
}

#self-hosted-plan-page .quota-entry input {
    width: 100%;
    min-width: 0;
    height: 30px;
    padding: 4px 9px;
    border: 1px solid #d7e5f0;
    border-radius: 5px;
    background: #fff;
    color: var(--self-hosted-ink);
    font-size: .75rem;
}

#self-hosted-plan-page input:focus-visible,
#self-hosted-plan-page button:focus-visible,
#self-hosted-plan-page a:focus-visible {
    outline: 3px solid rgba(0, 130, 255, .35);
    outline-offset: 2px;
}

#self-hosted-plan-page .quota-slider {
    display: block;
    width: 100%;
    grid-column: 1 / -1;
    height: 16px;
    margin: 5px 0 0;
    accent-color: #087cff;
    cursor: pointer;
}

#self-hosted-plan-page .quota-range-labels {
    display: flex;
    grid-column: 1 / -1;
    justify-content: space-between;
    color: #596990;
    font-size: .75rem;
    line-height: 1.45;
}

#self-hosted-plan-page .quota-range-labels span:last-child {
    text-align: right;
}

#self-hosted-plan-page .choice-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    grid-column: 2;
    width: 100%;
    max-width: none;
    margin: 0;
}

#self-hosted-plan-page .os-choice {
    display: flex;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 5px 10px;
    border: 1px solid #dce7f2;
    border-radius: 5px;
    background: #fff;
    color: var(--self-hosted-ink);
    font-size: .72rem;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

#self-hosted-plan-page .os-choice i {
    font-size: 1.2rem;
}

#self-hosted-plan-page .os-choice[aria-pressed="true"] {
    border-color: #158bff;
    background: #f0f8ff;
    box-shadow: inset 0 0 0 1px rgba(21, 139, 255, .12);
}

#self-hosted-plan-page .os-choice[aria-pressed="true"]::after {
    content: "\f058";
    color: #087cff;
    font-family: FontAwesome;
    font-size: 1.1rem;
}

#self-hosted-plan-page .os-choice[aria-pressed="false"]::after {
    content: "";
    width: 1.1rem;
}

#self-hosted-plan-page .duration-control {
    display: flex;
    min-height: 34px;
    align-items: center;
    gap: 10px;
    grid-column: 2;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 5px 12px;
    border: 1px solid #e1e6ee;
    border-radius: 5px;
    background: #f2f4f7;
    color: #8794ad;
    font-size: .72rem;
    font-weight: 700;
}

#self-hosted-plan-page .duration-note {
    grid-column: 2;
    margin: 5px 0 0;
    color: var(--self-hosted-muted);
    font-size: .63rem;
}

#self-hosted-plan-page .summary-card {
    padding: 6px;
}

#self-hosted-plan-page .summary-content {
    padding: 0 13px 7px;
}

#self-hosted-plan-page .summary-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #edf2f8;
    font-size: .71rem;
}

#self-hosted-plan-page .summary-line strong {
    text-align: right;
}

#self-hosted-plan-page .summary-total {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 0 7px;
    font-size: .78rem;
    font-weight: 800;
}

#self-hosted-plan-page .summary-total output {
    color: var(--self-hosted-blue);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
}

#self-hosted-plan-page .buy-button {
    display: flex;
    width: 100%;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 5px;
    padding: 0 12px;
    background: linear-gradient(100deg, #05b7ce, #0669bc);
    color: white;
    font-family: inherit;
    font-size: .75rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s ease, transform .15s ease;
}

#self-hosted-plan-page .buy-button:hover {
    color: #fff;
    filter: brightness(1.06);
    transform: translateY(-1px);
}

#self-hosted-plan-page .checkout-note {
    min-height: 29px;
    margin: 7px 5px 0;
    color: var(--self-hosted-muted);
    font-size: .62rem;
    line-height: 1.4;
    text-align: center;
}

#self-hosted-plan-page .plan-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 11px calc(-1 * clamp(12px, calc((100vw - 1180px) / 2), 48px)) 0;
    padding: 10px clamp(16px, calc((100vw - 1180px) / 2), 48px);
    border-top: 1px solid #d9effb;
    background: rgba(242, 251, 255, .75);
}

#self-hosted-plan-page .feature-item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 0 14px;
    border-right: 1px solid #d7eef9;
}

#self-hosted-plan-page .feature-item:last-child {
    border-right: 0;
}

#self-hosted-plan-page .feature-item > i {
    color: var(--self-hosted-cyan);
    font-size: 1.45rem;
}

#self-hosted-plan-page .feature-item strong,
#self-hosted-plan-page .feature-item span {
    display: block;
}

#self-hosted-plan-page .feature-item strong {
    font-size: .65rem;
}

#self-hosted-plan-page .feature-item span {
    margin-top: 3px;
    color: var(--self-hosted-muted);
    font-size: .58rem;
    line-height: 1.4;
}

#self-hosted-plan-page .plan-error {
    min-height: 1.2rem;
    margin: 3px 0 0;
    color: #bd2736;
    font-size: .65rem;
}

@media (max-width: 760px) {
    #self-hosted-plan-page {
        padding-top: 17px;
    }

    #self-hosted-plan-page .plan-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    #self-hosted-plan-page .highlight-card {
        padding: 7px 9px;
    }

    #self-hosted-plan-page .configure-card,
    #self-hosted-plan-page .summary-card {
        width: 100%;
    }
}

@media (max-width: 620px) {
    #self-hosted-plan-page {
        padding-right: 14px;
        padding-left: 14px;
    }

    #self-hosted-plan-page .plan-highlights {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        max-width: none;
    }

    #self-hosted-plan-page .highlight-card {
        padding: 7px 9px;
    }

    #self-hosted-plan-page .highlight-card:first-child {
        grid-column: 1 / -1;
    }

    #self-hosted-plan-page .plan-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    #self-hosted-plan-page .summary-card {
        order: 2;
    }

    #self-hosted-plan-page .configure-content {
        padding: 0 9px 3px;
    }

    #self-hosted-plan-page .setting-row {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 8px;
    }

    #self-hosted-plan-page .quota-entry,
    #self-hosted-plan-page .choice-options,
    #self-hosted-plan-page .duration-control,
    #self-hosted-plan-page .duration-note {
        grid-column: 1;
    }

    #self-hosted-plan-page .quota-entry {
        grid-row: auto;
    }

    #self-hosted-plan-page .quota-slider,
    #self-hosted-plan-page .quota-range-labels,
    #self-hosted-plan-page .plan-error {
        grid-column: 1;
    }

    #self-hosted-plan-page .os-setting legend {
        grid-column: 1;
    }

    #self-hosted-plan-page .choice-options {
        max-width: none;
    }

    #self-hosted-plan-page .plan-features {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-right: -14px;
        margin-left: -14px;
        padding: 12px 20px;
    }

    #self-hosted-plan-page .feature-item {
        border-right: 0;
        padding: 4px 8px;
    }
}

@media (max-width: 420px) {
    #self-hosted-plan-page .plan-hero h1 {
        font-size: 1.5rem;
    }

    #self-hosted-plan-page .card-heading h2 {
        font-size: .92rem;
    }

    #self-hosted-plan-page .plan-highlights {
        grid-template-columns: minmax(0, 1fr);
    }

    #self-hosted-plan-page .highlight-card:first-child {
        grid-column: auto;
    }

    #self-hosted-plan-page .summary-line {
        gap: 8px;
        font-size: .68rem;
    }

    #self-hosted-plan-page .summary-line strong {
        max-width: 58%;
        overflow-wrap: anywhere;
    }

    #self-hosted-plan-page .summary-total output {
        font-size: 1.65rem;
    }
}

@media (min-width: 761px) and (max-width: 1024px) {
    #self-hosted-plan-page .plan-layout {
        grid-template-columns: minmax(0, 1.45fr) minmax(270px, 1fr);
    }

    #self-hosted-plan-page .configure-content {
        padding-right: 8px;
        padding-left: 8px;
    }

    #self-hosted-plan-page .setting-row {
        grid-template-columns: minmax(0, 1fr) minmax(120px, 44%);
        column-gap: 10px;
    }
}

@media (min-width: 1200px) {
    #self-hosted-plan-page .plan-layout {
        grid-template-columns: minmax(0, 1.62fr) minmax(320px, 1fr);
    }
}

@media (max-width: 360px) {
    #self-hosted-plan-page {
        padding-right: 9px;
        padding-left: 9px;
    }

    #self-hosted-plan-page .plan-card {
        padding: 5px;
    }

    #self-hosted-plan-page .card-heading {
        gap: 7px;
        padding-right: 6px;
        padding-left: 6px;
    }

    #self-hosted-plan-page .card-heading h2 {
        font-size: .86rem;
    }

    #self-hosted-plan-page .summary-content {
        padding-right: 8px;
        padding-left: 8px;
    }

    #self-hosted-plan-page .plan-features {
        margin-right: -9px;
        margin-left: -9px;
        padding-right: 13px;
        padding-left: 13px;
    }
}
