.portal {
    width: min(1120px, calc(100% - 32px));
    margin: 34px auto 70px;
    color: #161225;
}

.portal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 22px;
    padding: 5px;
    border: 1px solid #e8defc;
    border-radius: 999px;
    background: #faf8ff;
}

.portal-tabs a {
    padding: 10px 16px;
    border-radius: 999px;
    color: #655b75;
    text-decoration: none;
    font-weight: 800;
    white-space: nowrap;
}

.portal-tabs a.is-active {
    color: #fff;
    background: #7c3aed;
}

.portal-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.portal-kicker {
    margin: 0 0 6px;
    color: #7c3aed;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.portal h1,
.portal h2,
.portal h3 {
    margin: 0;
    letter-spacing: -.035em;
}

.portal h1 {
    font-size: clamp(30px, 4.2vw, 44px);
    line-height: 1.05;
}

.portal h2 {
    font-size: 22px;
}

.portal h3 {
    font-size: 18px;
}

.portal-muted {
    margin: 8px 0 0;
    color: #6b647a;
    line-height: 1.55;
}

.portal-card,
.portal-order-card {
    background: #fff;
    border: 1px solid #e8defc;
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(46, 27, 97, .08);
}

.portal-card {
    padding: 24px;
}

.portal-login {
    max-width: 560px;
    margin: 0 auto;
    padding: 30px;
}

.portal-login-page {
    width: min(650px, calc(100% - 32px));
}

.portal-account-list {
    width: min(980px, calc(100% - 32px));
}

.portal-login h1 {
    font-size: clamp(34px, 5.8vw, 46px);
    line-height: 1.02;
    max-width: 460px;
}

.portal-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.portal-register-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.portal-register-fields[hidden] {
    display: none;
}

.portal-auth-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 20px;
    padding: 6px;
    border: 1px solid #eadfff;
    border-radius: 999px;
    background: #faf8ff;
}

.portal-auth-switch button {
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #6b647a;
    padding: 11px 14px;
    font-weight: 900;
    cursor: pointer;
}

.portal-auth-switch button.is-active {
    background: #7c3aed;
    color: #fff;
    box-shadow: 0 10px 22px rgba(124, 58, 237, .22);
}

.portal-form label {
    font-weight: 800;
}

.portal-form input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d9d1ea;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 17px;
}

.portal-form input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, .14);
}

.portal-code-step {
    display: grid;
    gap: 12px;
}

.portal-code-step .portal-button {
    width: fit-content;
    min-width: 170px;
}

.portal-button,
.portal-order-side a,
.portal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: #7c3aed;
    color: #fff;
    padding: 13px 20px;
    text-decoration: none;
    font-weight: 900;
    cursor: pointer;
}

.portal-button:disabled {
    opacity: .55;
    cursor: default;
}

.portal-button-inline {
    margin-top: 18px;
}

.portal-link {
    background: #f3edff;
    color: #5b21b6;
}

.portal-message {
    border-radius: 14px;
    padding: 12px 14px;
    background: #effaf2;
    color: #166534;
    font-weight: 700;
}

.portal-message.is-error {
    background: #fff1f2;
    color: #be123c;
}

.portal-auth-note {
    margin: 0;
    color: #6b647a;
    font-size: 14px;
    line-height: 1.45;
}

.portal-orders {
    display: grid;
    gap: 12px;
}

.portal-order-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 26px;
    padding: 24px;
}

.portal-order-main {
    min-width: 0;
}

.portal-order-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-order-title-row .portal-badge {
    margin-bottom: 0;
}

.portal-order-side {
    display: grid;
    justify-items: end;
    gap: 10px;
    min-width: 140px;
}

.portal-order-side strong {
    font-size: 22px;
    letter-spacing: -.03em;
}

.portal-badge {
    display: inline-flex;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 10px;
}

.portal-badge-large {
    margin-bottom: 0;
    font-size: 14px;
    padding: 10px 14px;
}

.portal-back {
    display: inline-flex;
    margin-bottom: 14px;
    color: #5b21b6;
    font-weight: 900;
    text-decoration: none;
}

.portal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.portal-address-card {
    margin-bottom: 16px;
}

.portal-address-card p {
    margin: 12px 0 0;
    color: #342b44;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.45;
}

.portal-timeline {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.portal-step {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6b647a;
    font-weight: 700;
}

.portal-step span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d8ccec;
}

.portal-step.is-current {
    color: #161225;
}

.portal-step.is-current span {
    background: #7c3aed;
    box-shadow: 0 0 0 6px #f0e9ff;
}

.portal-summary {
    display: grid;
    gap: 12px;
    margin: 18px 0 0;
}

.portal-summary div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #efe8fb;
    padding-bottom: 10px;
}

.portal-summary dt {
    color: #6b647a;
}

.portal-summary dd {
    margin: 0;
    font-weight: 900;
    text-align: right;
}

.portal-summary .portal-summary-total {
    border-bottom: 0;
    border-top: 2px solid #e8defc;
    padding-top: 12px;
    padding-bottom: 0;
}

.portal-summary .portal-summary-total dt,
.portal-summary .portal-summary-total dd {
    color: #161225;
    font-size: 18px;
}

.portal-items {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.portal-item {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 18px;
    border: 1px solid #efe8fb;
    border-radius: 18px;
    padding: 14px;
}

.portal-media {
    min-height: 130px;
    border-radius: 14px;
    background: #f7f2ff;
    overflow: hidden;
}

.portal-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portal-order-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.portal-order-options > div {
    background: #faf8ff;
    border-radius: 12px;
    padding: 12px;
}

.portal-order-options span {
    display: block;
    color: #7b728f;
    font-size: 12px;
    margin-bottom: 4px;
}

.portal-order-options strong {
    word-break: break-word;
}

.portal-order-colors {
    grid-column: 1 / -1;
}

.portal-color-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.portal-color-pill {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 0 !important;
    padding: 8px 10px;
    border: 1px solid #e8defc;
    border-radius: 999px;
    background: #fff;
    color: #251b36 !important;
    font-size: 13px !important;
    font-weight: 800;
}

.portal-color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(22, 18, 37, .22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
    margin: 0 !important;
}

@media (max-width: 760px) {
    .portal-tabs {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        border-radius: 18px;
    }

    .portal-tabs a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        flex: initial !important;
        text-align: center;
        white-space: normal;
        line-height: 1.15;
        padding: 10px 8px;
    }

    .portal-head,
    .portal-order-card {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .portal-head {
        flex-direction: column;
    }

    .portal-order-side {
        justify-items: start;
        min-width: 0;
    }

    .portal-grid,
    .portal-item,
    .portal-register-fields {
        grid-template-columns: 1fr;
    }

    .portal-login {
        padding: 24px;
    }

    .portal-login h1 {
        font-size: clamp(32px, 10vw, 42px);
    }
}
