:root {
    --am-bg: #fff8ff;
    --am-bg-2: #f6f1ff;
    --am-card: rgba(255, 255, 255, 0.82);
    --am-card-strong: rgba(255, 255, 255, 0.94);
    --am-line: rgba(84, 62, 132, 0.12);
    --am-line-strong: rgba(143, 104, 255, 0.22);
    --am-text: #241c38;
    --am-muted: #766d91;
    --am-faint: #9d93b4;
    --am-violet: #7d5cff;
    --am-lilac: #b783ff;
    --am-pink: #ee72bd;
    --am-blue: #3f83ff;
    --am-green: #22b47a;
    --am-yellow: #d79a1f;
    --am-red: #e65778;
    --am-radius: 28px;
    --am-shadow: 0 24px 70px rgba(109, 80, 156, 0.18);
    --am-shadow-soft: 0 14px 34px rgba(109, 80, 156, 0.12);
    --am-space-1: 4px;
    --am-space-2: 8px;
    --am-space-3: 12px;
    --am-space-4: 16px;
    --am-space-5: 20px;
    --am-ease: cubic-bezier(.22, 1, .36, 1);
    --am-ease-pop: cubic-bezier(.2, 1.5, .3, 1);
    --am-dur-fast: .16s;
    --am-dur: .28s;
    --am-z-base: 1;
    --am-z-sticky: 20;
    --am-z-nav: 30;
    --am-z-sheet: 70;
    --am-z-toast: 90;
    font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    background: var(--am-bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 143, 206, 0.38), transparent 28%),
        radial-gradient(circle at 96% 8%, rgba(136, 104, 255, 0.32), transparent 31%),
        linear-gradient(180deg, #fff8ff 0%, #f7f2ff 46%, #fff 100%);
    color: var(--am-text);
    font-family: var(--am-font, "Manrope", system-ui, sans-serif);
}

body::before,
body::after {
    content: "✦";
    position: fixed;
    z-index: 0;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: rgba(125, 92, 255, 0.52);
    background: rgba(255, 255, 255, 0.56);
    box-shadow: 0 14px 30px rgba(109, 80, 156, 0.12);
    animation: am-float 5.6s ease-in-out infinite;
    pointer-events: none;
}

body::before {
    left: max(12px, calc(50% - 245px));
    top: 132px;
}

body::after {
    right: max(14px, calc(50% - 246px));
    top: 50vh;
    content: "♡";
    color: rgba(238, 114, 189, 0.58);
    animation-delay: -2s;
}

@keyframes am-float {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-5deg); }
    50% { transform: translate3d(0, -12px, 0) rotate(7deg); }
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.am-app {
    position: relative;
    z-index: 1;
    width: min(100%, 480px);
    min-height: 100vh;
    margin: 0 auto;
    overflow-x: hidden;
}

.am-state {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    text-align: center;
}

.am-state h1 {
    margin: 14px 0 8px;
    color: var(--am-text);
    font-size: 1.58rem;
    line-height: 1.06;
    letter-spacing: 0;
}

.am-state p {
    margin: 0;
    color: var(--am-muted);
    line-height: 1.5;
}

.am-loader {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.am-loader span {
    width: 13px;
    height: 13px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--am-violet), var(--am-pink));
    box-shadow: 0 10px 22px rgba(125, 92, 255, 0.26);
    animation: am-loader 1s ease-in-out infinite;
}

.am-loader span:nth-child(2) { animation-delay: .14s; }
.am-loader span:nth-child(3) { animation-delay: .28s; }

@keyframes am-loader {
    0%, 100% { transform: translateY(0) scale(.82); opacity: .55; }
    50% { transform: translateY(-8px) scale(1); opacity: 1; }
}

.am-icon {
    width: 66px;
    height: 66px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    background: rgba(230, 87, 120, 0.12);
    color: var(--am-red);
    font-size: 1.8rem;
    font-weight: 900;
}

.am-lock-card {
    width: 100%;
    display: grid;
    gap: 14px;
    padding: 24px;
    border-radius: 34px;
    border: 1px solid var(--am-line);
    background: var(--am-card);
    box-shadow: var(--am-shadow);
    backdrop-filter: blur(20px);
}

.am-chip {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(125, 92, 255, 0.18);
    background: rgba(125, 92, 255, 0.09);
    color: var(--am-violet);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.am-shell {
    min-height: 100vh;
    padding: calc(14px + env(safe-area-inset-top)) 12px calc(98px + env(safe-area-inset-bottom));
}

.am-top {
    position: sticky;
    top: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--am-line);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(22px);
    box-shadow: 0 18px 42px rgba(109, 80, 156, 0.14);
}

.am-top h1 {
    margin: 7px 0 0;
    color: var(--am-text);
    font-size: 1.42rem;
    line-height: 1.05;
}

.am-icon-btn {
    width: 48px;
    height: 48px;
    border: 1px solid var(--am-line);
    border-radius: 19px;
    background: #fff;
    color: var(--am-violet);
    font-weight: 900;
    box-shadow: var(--am-shadow-soft);
}

.am-content {
    padding-top: 14px;
}

.am-screen {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.am-screen.is-active {
    display: flex;
}

.am-screen.is-active > * {
    animation: am-rise .34s cubic-bezier(.2, .95, .25, 1) both;
}

@keyframes am-rise {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to { opacity: 1; transform: none; }
}

.am-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.am-card,
.am-metric,
.am-row,
.am-hero-card,
.am-soon {
    border: 1px solid var(--am-line);
    border-radius: var(--am-radius);
    background: var(--am-card);
    box-shadow: var(--am-shadow-soft);
    backdrop-filter: blur(18px);
}

.am-card {
    padding: 15px;
    display: grid;
    gap: 12px;
}

.am-card h2,
.am-row strong,
.am-metric strong,
.am-hero-card h2,
.am-soon strong {
    margin: 0;
    color: var(--am-text);
}

.am-card p,
.am-row small,
.am-metric small,
.am-hero-card p,
.am-soon p {
    margin: 0;
    color: var(--am-muted);
    line-height: 1.42;
}

.am-hero-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 12px;
    padding: 18px;
    min-height: 178px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 245, 255, 0.78)),
        radial-gradient(circle at 88% 12%, rgba(238, 114, 189, 0.22), transparent 34%),
        radial-gradient(circle at 18% 96%, rgba(125, 92, 255, 0.14), transparent 35%);
}

.am-hero-card::after {
    content: "✦";
    position: absolute;
    right: 20px;
    top: 20px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    color: var(--am-pink);
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 14px 34px rgba(238, 114, 189, 0.16);
    animation: am-float 5s ease-in-out infinite;
}

.am-hero-card h2 {
    max-width: 86%;
    font-size: 1.55rem;
    line-height: 1.08;
    letter-spacing: 0;
}

.am-hero-card--compact {
    min-height: 142px;
}

.am-skeleton-card {
    min-height: 180px;
    align-content: center;
    text-align: center;
}

.am-metric {
    padding: 14px;
    min-height: 108px;
    display: grid;
    align-content: space-between;
    background: rgba(255, 255, 255, 0.72);
}

.am-metric span {
    font-size: 1.22rem;
}

.am-metric strong {
    font-size: 1.7rem;
    line-height: 1;
}

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

.am-row {
    padding: 13px;
    display: grid;
    gap: 8px;
    color: var(--am-text);
    text-decoration: none;
}

button.am-row {
    width: 100%;
    border: 1px solid var(--am-line);
    text-align: left;
}

.am-row__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.am-badge {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(125, 92, 255, 0.1);
    color: var(--am-violet);
    font-size: .72rem;
    font-style: normal;
    font-weight: 900;
}

.am-badge--green { background: rgba(34, 180, 122, 0.12); color: var(--am-green); }
.am-badge--yellow { background: rgba(215, 154, 31, 0.13); color: var(--am-yellow); }
.am-badge--red { background: rgba(230, 87, 120, 0.12); color: var(--am-red); }

.am-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.am-btn {
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    padding: 11px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
    font-weight: 900;
    color: var(--am-text);
    cursor: pointer;
    transition: transform .18s cubic-bezier(.2, 1.45, .32, 1), box-shadow .18s ease;
}

.am-btn:active {
    transform: scale(.97);
}

.am-btn--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--am-violet), var(--am-pink));
    box-shadow: 0 16px 30px rgba(125, 92, 255, 0.24);
}

.am-btn--soft {
    color: var(--am-violet);
    background: rgba(125, 92, 255, 0.1);
    border: 1px solid rgba(125, 92, 255, 0.16);
}

.am-btn--ghost {
    color: var(--am-muted);
    background: #fff;
    border: 1px solid var(--am-line);
}

.am-empty {
    padding: 24px 16px;
    text-align: center;
    border-radius: var(--am-radius);
    border: 1px dashed var(--am-line-strong);
    color: var(--am-muted);
    background: rgba(255, 255, 255, 0.58);
}

.am-soon {
    display: grid;
    gap: 8px;
    padding: 16px;
    background:
        radial-gradient(circle at 92% 12%, rgba(238, 114, 189, 0.14), transparent 32%),
        rgba(255, 255, 255, 0.72);
}

.am-soon span {
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(238, 114, 189, 0.12);
    color: var(--am-pink);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

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

.am-profile__head {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 12px;
    align-items: center;
}

.am-avatar {
    width: 58px;
    height: 58px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--am-violet), var(--am-pink));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
}

.am-wizard-entry {
    position: relative;
    overflow: hidden;
}

.am-wizard-card {
    gap: 14px;
    animation: am-rise .32s cubic-bezier(.2, .95, .25, 1) both;
}

.am-wizard-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.am-wizard-card > header h2,
.am-wizard-card h2 {
    margin: 6px 0 0;
    color: var(--am-text);
    font-size: 1.4rem;
    line-height: 1.08;
}

.am-wizard-form,
.am-method-form {
    display: grid;
    gap: 13px;
}

.am-wizard-form label,
.am-method-form label {
    display: grid;
    gap: 7px;
    color: var(--am-muted);
    font-size: .78rem;
    font-weight: 900;
}

.am-wizard-form input,
.am-wizard-form textarea,
.am-wizard-form select,
.am-method-form input,
.am-method-form textarea,
.am-method-form select {
    width: 100%;
    border: 1px solid var(--am-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--am-text);
    padding: 12px 13px;
    outline: none;
    resize: vertical;
}

.am-wizard-form textarea {
    min-height: 96px;
    line-height: 1.42;
}

.am-wizard-form input:focus,
.am-wizard-form textarea:focus,
.am-wizard-form select:focus,
.am-method-form input:focus,
.am-method-form textarea:focus,
.am-method-form select:focus {
    border-color: rgba(125, 92, 255, 0.5);
    box-shadow: 0 0 0 4px rgba(125, 92, 255, 0.1);
}

.am-wizard-form input[type="file"] {
    padding: 10px;
    cursor: pointer;
}

.am-wizard-form small,
.am-method-form small {
    color: var(--am-muted);
    line-height: 1.35;
}

.am-wizard-dots {
    display: grid;
    grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr));
    gap: 7px;
}

.am-wizard-dots span {
    min-height: 8px;
    border-radius: 999px;
    background: rgba(125, 92, 255, 0.1);
    overflow: hidden;
    font-size: 0;
}

.am-wizard-dots span::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--am-violet), var(--am-pink));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .26s ease;
}

.am-wizard-dots span.is-active::before,
.am-wizard-dots span.is-done::before {
    transform: scaleX(1);
}

.am-segment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 4px;
    border-radius: 18px;
    border: 1px solid var(--am-line);
    background: rgba(255, 255, 255, 0.66);
}

.am-segment label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 14px;
    color: var(--am-text);
    background: rgba(255, 255, 255, 0.4);
}

.am-segment input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.am-segment label:has(input:checked) {
    color: #fff;
    background: linear-gradient(135deg, var(--am-violet), var(--am-pink));
    box-shadow: 0 12px 24px rgba(125, 92, 255, 0.18);
}

.am-switch {
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--am-line);
    background: rgba(255, 255, 255, 0.66);
    color: var(--am-text) !important;
}

.am-switch input {
    appearance: none;
    width: 48px;
    height: 28px;
    padding: 0;
    border-radius: 999px;
    background: rgba(125, 92, 255, 0.16);
    position: relative;
}

.am-switch input::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(36, 28, 56, 0.12);
    transition: transform .2s cubic-bezier(.2, 1.5, .3, 1);
}

.am-switch input:checked {
    background: linear-gradient(135deg, var(--am-violet), var(--am-pink));
}

.am-switch input:checked::after {
    transform: translateX(20px);
}

[data-wizard-preview] {
    display: grid;
    gap: 8px;
}

[data-wizard-preview] b {
    color: var(--am-text);
}

[data-wizard-preview] pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid var(--am-line);
    background: rgba(255, 255, 255, 0.76);
    color: var(--am-text);
    line-height: 1.45;
    font-size: .84rem;
}

.am-form-status {
    min-height: 20px;
    color: var(--am-muted);
    font-size: .82rem;
    font-weight: 800;
}

.am-form-status.is-ok { color: var(--am-green); }
.am-form-status.is-error { color: var(--am-red); }

.am-wallet-grid,
.am-wallet-strip {
    display: grid;
    gap: 10px;
}

.am-wallet-strip {
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 86%);
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
}

.am-wallet {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 10px;
    min-height: 162px;
    padding: 16px;
    border: 1px solid rgba(125, 92, 255, 0.18);
    border-radius: 27px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(248, 242, 255, 0.82)),
        radial-gradient(circle at 12% 4%, rgba(238, 114, 189, 0.16), transparent 34%);
    box-shadow: var(--am-shadow-soft);
    scroll-snap-align: start;
}

.am-wallet.is-selected {
    border-color: rgba(238, 114, 189, 0.42);
    box-shadow: 0 20px 48px rgba(125, 92, 255, 0.2);
}

.am-wallet__shine {
    position: absolute;
    inset: -40% auto auto -20%;
    width: 70%;
    height: 150%;
    transform: rotate(24deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.62), transparent);
    animation: am-shine 4.4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes am-shine {
    0%, 45% { translate: -120% 0; opacity: 0; }
    60% { opacity: 1; }
    100% { translate: 260% 0; opacity: 0; }
}

.am-progress {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(125, 92, 255, 0.1);
}

.am-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--am-green), var(--am-lilac));
}

.am-preview-card {
    border-color: rgba(215, 154, 31, 0.26);
    background:
        radial-gradient(circle at 100% 0%, rgba(215, 154, 31, 0.12), transparent 28%),
        var(--am-card);
}

.am-warning,
.am-note {
    padding: 12px;
    border-radius: 18px;
    line-height: 1.36;
    font-size: .84rem;
    font-weight: 800;
}

.am-warning {
    border: 1px solid rgba(215, 154, 31, 0.24);
    background: rgba(215, 154, 31, 0.1);
    color: #9c6b10;
}

.am-note {
    border: 1px solid rgba(34, 180, 122, 0.2);
    background: rgba(34, 180, 122, 0.09);
    color: var(--am-green);
}

.am-simulator {
    background:
        radial-gradient(circle at 0% 10%, rgba(34, 180, 122, 0.11), transparent 30%),
        var(--am-card);
}

.am-candidates {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.am-chip-btn {
    border: 1px solid rgba(125, 92, 255, 0.18);
    cursor: pointer;
}

.am-muted {
    color: var(--am-muted);
    font-size: .82rem;
}

.am-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    width: min(100%, 480px);
    margin: 0 auto;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    border-top: 1px solid rgba(125, 92, 255, 0.12);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(20px);
    box-shadow: 0 -18px 42px rgba(109, 80, 156, 0.12);
}

.am-nav button {
    min-width: 0;
    border: 0;
    border-radius: 18px;
    padding: 8px 4px;
    background: transparent;
    color: var(--am-muted);
    display: grid;
    gap: 3px;
    place-items: center;
    transition: transform .18s cubic-bezier(.2, 1.5, .3, 1), background .2s ease, color .2s ease;
}

.am-nav button.is-active {
    background: linear-gradient(180deg, rgba(238, 114, 189, 0.15), rgba(125, 92, 255, 0.12));
    color: var(--am-violet);
    box-shadow: inset 0 0 0 1px rgba(125, 92, 255, 0.12);
}

.am-nav button.is-bounce span {
    animation: am-nav-bounce .42s cubic-bezier(.2, 1.55, .32, 1);
}

.am-nav span {
    font-size: 1.18rem;
    line-height: 1;
}

.am-nav small {
    font-size: .62rem;
    font-weight: 900;
}

@keyframes am-nav-bounce {
    0% { transform: translateY(0) scale(1); }
    45% { transform: translateY(-5px) scale(1.12); }
    100% { transform: translateY(0) scale(1); }
}

.am-modal,
.am-action-sheet {
    position: fixed;
    z-index: var(--am-z-sheet);
    color: var(--am-text);
}

.am-modal[hidden],
.am-action-sheet[hidden],
.am-toast[hidden] {
    display: none !important;
}

.am-modal {
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(36, 28, 56, 0.22);
    backdrop-filter: blur(10px);
}

.am-modal__panel {
    width: min(100%, 420px);
    max-height: min(82vh, 680px);
    overflow-y: auto;
    padding: 18px;
    border: 1px solid var(--am-line);
    border-radius: 30px;
    background: var(--am-card-strong);
    box-shadow: var(--am-shadow);
    animation: am-rise .28s var(--am-ease) both;
}

.am-action-sheet {
    left: 8px;
    right: 8px;
    bottom: 8px;
    display: grid;
    gap: 8px;
    max-height: min(76vh, 620px);
    padding: 10px;
    border: 1px solid var(--am-line);
    border-radius: 30px;
    background: var(--am-card-strong);
    box-shadow: var(--am-shadow);
    overflow-y: auto;
}

.am-toast {
    position: fixed;
    left: 50%;
    bottom: calc(92px + env(safe-area-inset-bottom));
    z-index: var(--am-z-toast);
    max-width: min(90vw, 360px);
    padding: 11px 14px;
    border: 1px solid var(--am-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--am-text);
    box-shadow: var(--am-shadow-soft);
    transform: translateX(-50%);
    backdrop-filter: blur(18px);
}

.am-skeleton-line {
    position: relative;
    overflow: hidden;
    min-height: 16px;
    border-radius: 999px;
    background: rgba(125, 92, 255, 0.1);
}

.am-skeleton-line::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
    animation: am-shimmer 1.24s ease-in-out infinite;
}

@keyframes am-shimmer {
    to { transform: translateX(100%); }
}

[hidden] { display: none !important; }

@media (max-width: 370px) {
    .am-shell {
        padding-left: 8px;
        padding-right: 8px;
    }

    .am-grid {
        grid-template-columns: 1fr;
    }

    .am-nav small {
        font-size: .58rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
