:root {
    color-scheme: light;
    --ink: #172321;
    --muted: #60706d;
    --line: #dfe8e6;
    --surface: #ffffff;
    --canvas: #edf3f2;
    --soft: #effbf8;
    --accent: #00a98f;
    --accent-dark: #087a69;
    --danger: #9b2c2c;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

html { background: var(--canvas); }

body {
    min-height: 100vh;
    margin: 0;
    padding: 32px 20px;
    display: grid;
    place-items: start center;
    background: var(--canvas);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[hidden] { display: none !important; }

::selection {
    background: #9ff1e3;
    color: #073e35;
}

button,
input { font: inherit; }

button:focus-visible,
input:focus-visible,
summary:focus-visible,
label:has(input:focus-visible) {
    outline: 3px solid rgba(0, 169, 143, 0.28);
    outline-offset: 3px;
}

.payment-shell {
    width: min(100%, 454px);
    padding: 24px;
    overflow: hidden;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: left;
}

.brand-logo {
    display: block;
    width: 138px;
    height: auto;
    margin: 0 auto 14px;
    object-fit: contain;
}

h1 {
    max-width: 15ch;
    margin: 0 auto 8px;
    color: var(--ink);
    font-size: clamp(1.55rem, 7vw, 2rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
    text-align: center;
    text-wrap: balance;
}

.receiver-name { color: var(--accent-dark); }

.intro {
    max-width: 34ch;
    margin: 0 auto 24px;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.45;
    text-align: center;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    color: #314542;
    font-size: 0.82rem;
    font-weight: 700;
}

.amount-wrap {
    display: flex;
    align-items: center;
    min-height: 58px;
    border: 1px solid #bfcfcb;
    border-radius: 12px;
    background: var(--surface);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.amount-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 169, 143, 0.1);
}

.currency {
    padding-left: 16px;
    color: var(--muted);
    font-size: 1.15rem;
    font-weight: 700;
}

#amountInput {
    width: 100%;
    min-width: 0;
    padding: 12px 16px 12px 8px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 1.45rem;
    font-weight: 760;
    font-variant-numeric: tabular-nums;
    text-align: left;
}

.presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.preset {
    min-height: 38px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f7faf9;
    color: #39514d;
    font-size: 0.83rem;
    font-weight: 700;
    cursor: pointer;
}

.preset:hover { background: #eef7f5; }

.preset.active {
    border-color: #66cfbd;
    background: #dff7f2;
    color: #086c5e;
}

.channels {
    min-width: 0;
    margin: 28px 0 0;
    padding: 0;
    border: 0;
}

.channels legend {
    padding: 0;
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 780;
    letter-spacing: -0.015em;
}

.channel-help {
    margin: 5px 0 13px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.channel-status {
    padding: 18px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fbfa;
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
}

.channel-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.channel-row {
    position: relative;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    min-height: 88px;
    padding: 13px 14px;
    background: var(--surface);
    cursor: pointer;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.channel-row + .channel-row { border-top: 1px solid var(--line); }
.channel-row:hover { background: #f8fcfb; }

.channel-row.selected {
    z-index: 1;
    background: #eafaf6;
    box-shadow: inset 0 0 0 2px var(--accent);
}

.channel-row.recommended:not(.selected) { background: #f8fcfb; }

.channel-row input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
}

.channel-name-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.channel-name {
    color: inherit;
    font-size: 0.94rem;
    font-weight: 760;
    line-height: 1.25;
}

.recommendation-badge {
    display: inline-flex;
    padding: 2px 6px;
    border-radius: 999px;
    background: #c9f2e9;
    color: #075e51;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.channel-detail,
.channel-receiver {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.3;
}

.channel-price {
    min-width: 94px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.channel-total {
    display: block;
    font-size: 0.96rem;
    font-weight: 800;
}

.channel-fee {
    display: block;
    margin-top: 3px;
    color: var(--accent-dark);
    font-size: 0.72rem;
    font-weight: 700;
}

details.more-methods { border-top: 1px solid var(--line); }

details.more-methods summary {
    padding: 12px 14px;
    background: #f7faf9;
    color: #31544e;
    font-size: 0.82rem;
    font-weight: 760;
    cursor: pointer;
    list-style-position: inside;
}

details.more-methods[open] summary { border-bottom: 1px solid var(--line); }

.validation {
    display: none;
    margin: 10px 0 0;
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: 650;
}

.validation.visible { display: block; }

.summary {
    margin-top: 22px;
    padding: 17px;
    border-radius: 14px;
    background: #183c36;
    color: #effbf8;
}

.summary-title {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 780;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 7px;
    color: #c7e2dc;
    font-size: 0.8rem;
}

.summary-row span:last-child {
    color: #ffffff;
    font-weight: 720;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.summary-total {
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
}

.sender-section { margin-top: 20px; }

#senderName {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #bfcfcb;
    border-radius: 10px;
    color: var(--ink);
    background: var(--surface);
}

#senderName::placeholder { color: #74817f; }

.optional {
    color: var(--muted);
    font-weight: 500;
}

#continueButton {
    width: 100%;
    min-height: 54px;
    margin-top: 16px;
    padding: 13px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 160ms ease, transform 160ms ease;
}

#continueButton:hover:not(:disabled) { background: #008f79; }
#continueButton:active:not(:disabled) { transform: translateY(1px); }

#continueButton:disabled {
    background: #c8d2d0;
    color: #65716f;
    cursor: not-allowed;
}

.footer {
    margin: 18px 0 0;
    color: #7a8986;
    font-size: 0.72rem;
    line-height: 1.45;
    text-align: center;
}

.error {
    margin: 0 0 16px;
    padding: 11px 13px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.82rem;
    line-height: 1.4;
}

.state-panel {
    padding: 36px 8px 28px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

.state-panel h2 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 1.3rem;
}

.state-panel p { margin: 0; }

.spinner {
    width: 28px;
    height: 28px;
    margin: 0 auto 14px;
    border: 3px solid #e4e6eb;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.find-link {
    display: inline-block;
    margin-top: 20px;
    padding: 11px 18px;
    border-radius: 10px;
    background: var(--accent);
    color: #ffffff;
    font-weight: 750;
    text-decoration: none;
}

@media (max-width: 500px) {
    body { padding: 0; background: var(--surface); }
    .payment-shell { min-height: 100vh; border-radius: 0; box-shadow: none; }
    .payment-shell { padding: 22px 18px 30px; }
    .channel-row { padding-inline: 12px; }
}

@media (max-width: 370px) {
    .channel-row {
        grid-template-columns: 20px minmax(0, 1fr);
    }
    .channel-price {
        grid-column: 2;
        min-width: 0;
        margin-top: 3px;
        text-align: left;
    }
    .channel-total,
    .channel-fee { display: inline; }
    .channel-fee { margin-left: 8px; }
}

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