.amb-shell,
.amb-code-panel {
    --amb-ink: var(--ht-text-body, #003A51);
    --amb-navy: var(--ht-primary, #004965);
    --amb-navy-deep: var(--ht-primary-darker, #002F42);
    --amb-muted: var(--ht-primary-light, #336D84);
    --amb-sand: var(--ht-primary-200, #EBD8C3);
    --amb-wash: var(--ht-primary-50, #FAF4EC);
    --amb-rule: var(--ht-border, #E8DACB);
    --amb-gold: var(--ht-gold, #D99757);
    --amb-space: 1.5rem;
    --amb-radius: var(--ht-radius-sm, 10px);
}

.innermaincontarea.amb-shell {
    padding-top: calc(132px + 24px);
}

.amb-shell .myaccountmenu {
    margin-bottom: 24px;
}

.amb-page {
    color: var(--amb-ink);
}

.amb-page :focus-visible {
    outline: 2px solid var(--amb-navy);
    outline-offset: 2px;
}

.amb-kicker {
    color: var(--amb-muted);
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.amb-invite {
    max-width: 64ch;
}

.amb-invite h1 {
    margin: 0 0 0.75rem;
    color: var(--amb-navy);
    font-size: clamp(1.75rem, 1.25rem + 1.8vw, 2.5rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.amb-lead {
    margin: 0;
    max-width: 60ch;
    font-size: 1.0625rem;
    line-height: 1.7;
}

.amb-invite h2,
.amb-reward h2 {
    margin: 1.5rem 0 0.25rem;
    color: var(--amb-navy);
    font-size: 1.25rem;
    font-weight: 600;
}

.amb-steps {
    margin: 0;
    padding-inline-start: 1.75rem;
}

.amb-steps li {
    padding-block: 0.75rem;
    border-bottom: 1px solid var(--ht-border-subtle, #F0E6DA);
    line-height: 1.7;
}

.amb-steps li::marker {
    color: var(--amb-navy);
    font-weight: 600;
}

.amb-decide {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem 1.25rem;
    background: var(--amb-wash);
    border: 1px solid var(--amb-rule);
    border-radius: var(--amb-radius);
}

.amb-field {
    display: block;
    margin-bottom: 0.375rem;
    color: var(--amb-navy);
    font-size: 0.9375rem;
    font-weight: 600;
}

.amb-decide .form-select {
    width: 100%;
    max-width: 20rem;
    min-height: 48px;
    border-radius: var(--amb-radius);
}

.amb-accept {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-height: 48px;
    margin: 1rem 0;
    cursor: pointer;
}

.amb-accept input {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    accent-color: var(--amb-navy);
}

.amb-page .primarybtn:disabled,
.amb-page .primarybtnol:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.amb-note {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: var(--amb-wash);
    border-radius: var(--amb-radius);
}

.amb-ticket {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 208px;
    background: var(--amb-navy);
    color: #fff;
    border-radius: var(--ht-radius-lg, 20px);
    box-shadow: var(--ht-shadow-md, 0 6px 20px rgba(0, 73, 101, 0.08));
}

.amb-ticket :focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.amb-ticket-face {
    padding: 1.75rem 2rem;
    min-width: 0;
}

.amb-ticket-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin: 0;
    font-size: 0.9375rem;
}

.amb-ticket-kicker span:first-child {
    font-weight: 600;
}

.amb-ticket-kicker span:last-child {
    color: var(--amb-sand);
    font-weight: 400;
}

.amb-code {
    display: inline-block;
    margin-top: 0.85rem;
    padding: 0.4rem 0.9rem;
    background: var(--amb-navy-deep);
    color: var(--amb-gold);
    border-radius: var(--amb-radius);
    font-family: Poppins, sans-serif;
    font-size: clamp(2rem, 1.4rem + 2.2vw, 3.25rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.06em;
    direction: ltr;
    unicode-bidi: isolate;
}

.amb-link {
    margin: 0.75rem 0 0;
    max-width: 100%;
    overflow: hidden;
    color: var(--amb-sand);
    font-size: 0.9375rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    direction: ltr;
    unicode-bidi: isolate;
}

.amb-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1.25rem;
    margin-top: 1rem;
}

.amb-copy-primary {
    min-height: 44px;
    padding: 0 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--amb-sand);
    color: var(--amb-navy-deep);
    font-weight: 600;
}

.amb-actions a,
.amb-actions .amb-copy:not(.amb-copy-primary) {
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.amb-progress {
    margin: 1rem 0 0;
    font-size: 0.9375rem;
}

.amb-meter {
    height: 6px;
    margin-top: 0.5rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 3px;
}

.amb-meter span {
    display: block;
    height: 100%;
    background: var(--amb-gold);
}

.amb-ticket-stub {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-block: 1.25rem;
    padding-inline: 1rem;
    border-inline-start: 2px dashed rgba(235, 216, 195, 0.55);
}

.amb-badge.gold {
    display: inline-block;
    max-width: 11rem;
    background: var(--amb-gold);
    color: var(--amb-navy-deep);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
}

.amb-qr {
    background: #fff;
    border-radius: var(--amb-radius);
    padding: 10px;
}

.amb-qr svg {
    display: block;
    width: 148px;
    height: 148px;
}

.amb-money {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    align-items: start;
    margin-block: var(--amb-space);
    padding-block: 1.25rem;
    border-block: 1px solid var(--amb-rule);
}

.amb-money > div + div {
    padding-inline-start: 1.25rem;
    border-inline-start: 1px solid var(--ht-border-subtle, #F0E6DA);
}

.amb-money small,
.amb-funnel small {
    display: block;
    color: var(--amb-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.amb-money strong {
    display: block;
    color: var(--amb-navy);
    font-size: 1.25rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.amb-money-lead strong {
    font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
    font-weight: 600;
}

.amb-money-lead a {
    display: inline-block;
    margin-top: 0.25rem;
    color: var(--amb-navy);
    font-weight: 600;
}

.amb-funnel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    margin: 0 0 var(--amb-space);
}

.amb-funnel strong {
    color: var(--amb-navy);
    font-size: 1.0625rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.amb-panel {
    margin-bottom: 2rem;
    padding: 1.25rem 0 0;
    background: none;
    border: 0;
    border-top: 1px solid var(--amb-rule);
    border-radius: 0;
}

.amb-panel h2 {
    margin: 0 0 0.75rem;
    color: var(--amb-navy);
    font-size: 1.125rem;
    font-weight: 600;
}

.amb-withdraw {
    padding: 1.25rem;
    background: var(--amb-wash);
    border: 0;
    border-radius: var(--amb-radius);
}

.amb-panel .form-control,
.amb-panel .form-select {
    min-height: 48px;
    border-radius: var(--amb-radius);
}

.amb-messages {
    margin: 0;
    padding: 0;
    list-style: none;
}

.amb-messages li {
    margin-bottom: 0.75rem;
    padding-inline-start: 0.75rem;
    border-inline-start: 2px solid var(--amb-sand);
    line-height: 1.7;
}

.amb-table-wrap {
    overflow-x: auto;
}

.amb-table {
    width: 100%;
    border-collapse: collapse;
}

.amb-table th,
.amb-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--ht-border-subtle, #F0E6DA);
    text-align: start;
    vertical-align: top;
}

.amb-table th {
    color: var(--amb-muted);
    font-size: 0.875rem;
    font-weight: 600;
}

.amb-table td:last-child,
.amb-table th:last-child {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    text-align: end;
}

.amb-chip {
    display: inline-block;
    padding: 2px 8px;
    background: var(--ht-primary-100, #F4E9DB);
    color: var(--ht-primary-dark, #003A51);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.amb-history-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

.amb-reward h1 {
    margin: 0 0 0.5rem;
    color: var(--amb-navy);
    font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
    font-weight: 600;
}

.amb-code-panel {
    max-width: 32rem;
    margin-top: 1rem;
    padding: 0.875rem 1rem 1rem;
    background: var(--amb-wash);
    border: 1px solid var(--amb-sand);
    border-radius: var(--amb-radius);
}

.amb-code-box {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.amb-code-field {
    flex: 1 1 12rem;
    min-width: 0;
}

.amb-code-box label {
    display: block;
    margin-bottom: 0.375rem;
    color: var(--amb-navy);
    font-size: 0.9375rem;
    font-weight: 600;
}

.amb-code-box input {
    min-height: 48px;
    border-radius: var(--amb-radius);
    letter-spacing: 0.04em;
    direction: ltr;
    text-align: start;
}

.amb-code-box .primarybtnol {
    min-height: 48px;
}

.ambassador-banner:not([hidden]),
.ambassador-discount-line:not([hidden]) {
    margin: 0.75rem 0 0;
    padding: 0.625rem 0.875rem;
    background: var(--amb-wash, #FAF4EC);
    color: var(--amb-ink, #003A51);
    border-inline-start: 3px solid var(--amb-navy, #004965);
    border-radius: 10px;
}

.amb-live {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html[dir="rtl"] .amb-invite h1 {
    letter-spacing: 0;
    line-height: 1.4;
}

html[dir="rtl"] .amb-lead,
html[dir="rtl"] .amb-steps li {
    font-size: 1.0625rem;
    line-height: 1.9;
}

@media (max-width: 992px) {
    .innermaincontarea.amb-shell {
        padding-top: calc(108px + 20px);
    }
}

@media (max-width: 640px) {
    .amb-ticket {
        grid-template-columns: 1fr;
    }

    .amb-ticket-face {
        padding: 1.25rem;
    }

    .amb-ticket-stub {
        align-items: flex-start;
        margin: 0 1.25rem 1.25rem;
        padding: 1rem 0 0;
        border-inline-start: 0;
        border-top: 2px dashed rgba(235, 216, 195, 0.55);
    }

    .amb-qr svg {
        width: 112px;
        height: 112px;
    }

    .amb-money {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem 0.5rem;
    }

    .amb-money-lead {
        grid-column: 1 / -1;
        padding-inline-start: 0;
        border: 0;
    }

    .amb-money > div + div {
        padding-inline-start: 0;
        border-inline-start: 0;
    }
}

@media (max-width: 991.98px) {
    .amb-column-side {
        order: -1;
    }
}

@media (max-width: 576px) {
    .amb-decide .form-select,
    .amb-page .primarybtn {
        max-width: none;
        width: 100%;
    }

    .amb-code-box {
        flex-direction: column;
        align-items: stretch;
    }

    .amb-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .amb-table,
    .amb-table tbody,
    .amb-table tr,
    .amb-table td {
        display: block;
        width: 100%;
    }

    .amb-table tr {
        padding-block: 0.5rem;
        border-bottom: 1px solid var(--ht-border-subtle, #F0E6DA);
    }

    .amb-table td {
        border: 0;
        padding: 0.15rem 0;
        text-align: start;
    }

    .amb-table td::before {
        content: attr(data-label);
        display: block;
        color: var(--amb-muted);
        font-size: 0.875rem;
        font-weight: 500;
    }

    .amb-table td:last-child {
        text-align: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .amb-page *,
    .amb-page *::before,
    .amb-page *::after,
    .amb-code-panel *,
    .amb-code-panel *::before,
    .amb-code-panel *::after {
        transition: none !important;
        animation: none !important;
    }

    .amb-page .primarybtn:hover,
    .amb-page .primarybtnol:hover {
        transform: none;
    }
}
