* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --navy: #08376f;
    --navy-deep: #062957;
    --blue: #1261a8;
    --cyan: #078aa3;
    --ink: #17202a;
    --muted: #64717e;
    --line: #d8e0e7;
    --surface: #ffffff;
    --canvas: #eef3f6;
    --soft-blue: #edf6fb;
    --soft-green: #eaf7ef;
    --green: #16784b;
    --orange: #d86400;
    --yellow: #e5b700;
    --danger: #a12622;
    --shadow: 0 18px 44px rgba(18, 44, 68, 0.12);
    --shadow-small: 0 8px 20px rgba(18, 44, 68, 0.09);
}

body {
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
    letter-spacing: 0;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--navy-deep);
    color: #fff;
    border-bottom: 3px solid var(--cyan);
}

.topbar-inner {
    max-width: 1160px;
    min-height: 72px;
    margin: 0 auto;
    padding: 10px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-block {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
}

.brand-block img {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.84);
    border-radius: 8px;
}

.brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-block strong {
    font-size: 17px;
    line-height: 1.1;
}

.brand-block span {
    color: #c9e6f1;
    font-size: 12px;
}

.brand-copy strong {
    color: #fff;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-button {
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.text-button:hover,
.text-button:focus-visible {
    background: rgba(255, 255, 255, 0.12);
}

.app-shell {
    width: min(1160px, calc(100% - 32px));
    margin: 30px auto 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    align-items: start;
}

.conversation-view,
.receipt-view {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.conversation-heading {
    min-height: 108px;
    padding: 24px 26px 20px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    margin-bottom: 5px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.conversation-heading h1 {
    max-width: 470px;
    font-size: 24px;
    line-height: 1.25;
}

.accepted-methods {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.method-mark {
    min-width: 58px;
    padding: 6px 8px;
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.mark-wave { background: #079ed1; }
.mark-orange { background: var(--orange); }
.mark-mtn { background: var(--yellow); color: #151515; }

.progress {
    width: 100%;
    height: 5px;
    overflow: hidden;
    background: #e9eef2;
}

.progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--cyan);
    transition: width 0.25s ease;
}

.progress-steps {
    min-height: 54px;
    padding: 0 26px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfd;
    list-style: none;
}

.progress-steps li {
    position: relative;
    padding-left: 19px;
    color: #7a8793;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.progress-steps li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 10px;
    height: 10px;
    border: 2px solid #b5c1cb;
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%);
}

.progress-steps li.is-active {
    color: var(--navy);
}

.progress-steps li.is-active::before {
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(7, 138, 163, 0.13);
}

.progress-steps li.is-complete {
    color: var(--green);
}

.progress-steps li.is-complete::before {
    border-color: var(--green);
    background: var(--green);
}

.messages {
    min-height: 0;
    height: clamp(280px, 45vh, 500px);
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-color: #aebbc6 transparent;
}

.message {
    display: flex;
    width: 100%;
}

.message.user {
    justify-content: flex-end;
}

.message-bubble {
    max-width: min(82%, 520px);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.message.assistant .message-bubble {
    background: var(--soft-blue);
    border-left: 3px solid var(--cyan);
    color: #203b4c;
}

.message.user .message-bubble {
    background: var(--navy-deep);
    color: #fff;
}

.message-bubble p + p,
.message-bubble strong + p {
    margin-top: 7px;
}

.message-bubble small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.message-summary {
    min-width: min(390px, 72vw);
}

.message-summary div {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #d5e3eb;
}

.message-summary div:last-child {
    border-bottom: 0;
}

.message-summary dt {
    color: var(--muted);
    font-size: 12px;
}

.message-summary dd {
    font-size: 13px;
    font-weight: 750;
    text-align: right;
    overflow-wrap: anywhere;
}

.inline-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-link,
.inline-button {
    min-height: 36px;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--blue);
    border-radius: 5px;
    background: #fff;
    color: var(--blue);
    text-decoration: none;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.inline-link:hover,
.inline-button:hover {
    background: #e6f0f7;
}

.composer {
    min-height: 102px;
    padding: 20px 26px;
    border-top: 1px solid var(--line);
    background: #fafcfd;
}

.composer-form,
.upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 10px;
    align-items: stretch;
}

.composer input,
.file-picker {
    width: 100%;
    min-height: 52px;
    padding: 11px 12px;
    border: 1px solid #bfcbd5;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 15px;
}

.composer input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(18, 97, 168, 0.13);
}

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

.method-choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-button {
    min-height: 52px;
    padding: 11px 13px;
    border: 1px solid #bfcbd5;
    border-radius: 8px;
    background: #fff;
    color: #263744;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.choice-button:hover,
.choice-button:focus-visible,
.choice-button[data-saved="true"] {
    border-color: var(--blue);
    background: var(--soft-blue);
    color: var(--navy);
}

.choice-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-small);
}

.method-choice {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 11px;
    text-align: left;
}

.method-choice-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    font-size: 17px;
    font-weight: 900;
}

.method-choice-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.method-choice-copy strong {
    color: var(--ink);
    font-size: 13px;
    line-height: 1.2;
}

.method-choice-copy small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.method-choice[data-method="wave"] .method-choice-mark { background: #079ed1; }
.method-choice[data-method="orange"] .method-choice-mark { background: #ed6a00; }
.method-choice[data-method="mtn"] .method-choice-mark { background: #f4c400; color: #191919; }
.method-choice[data-method="wave"]:hover { border-color: #079ed1; background: #f0fbff; }
.method-choice[data-method="orange"]:hover { border-color: #ed6a00; background: #fff7f0; }
.method-choice[data-method="mtn"]:hover { border-color: #d5aa00; background: #fffbea; }

.choice-button[data-action="reference"],
.choice-button[data-action="screenshot"] {
    min-height: 62px;
    border-style: dashed;
}

.choice-button[data-action="skip"] {
    min-height: 44px;
    color: var(--muted);
    background: transparent;
}

.secondary-choice {
    grid-column: 1 / -1;
}

.primary-button,
.secondary-button {
    min-height: 52px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.primary-button {
    border: 1px solid var(--navy);
    background: var(--navy);
    color: #fff;
    box-shadow: 0 10px 20px rgba(6, 41, 87, 0.18);
}

.primary-button:hover,
.primary-button:focus-visible {
    background: var(--blue);
    border-color: var(--blue);
    transform: translateY(-1px);
}

.primary-button:disabled {
    border-color: #9aa6b1;
    background: #9aa6b1;
    cursor: wait;
}

.secondary-button {
    border: 1px solid var(--blue);
    background: #fff;
    color: var(--blue);
}

.secondary-button:hover,
.secondary-button:focus-visible,
.secondary-button.copied,
.inline-button.copied {
    background: var(--soft-green);
    border-color: var(--green);
    color: var(--green);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.choice-button:focus-visible,
.text-button:focus-visible,
.inline-button:focus-visible,
.inline-link:focus-visible {
    outline: 3px solid rgba(7, 138, 163, 0.22);
    outline-offset: 2px;
}

.review-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.file-picker {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--muted);
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.file-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.error {
    margin: 0 24px 20px;
    padding: 12px 14px;
    border: 1px solid #e1aaa7;
    border-radius: 6px;
    background: #fdeceb;
    color: var(--danger);
    font-size: 13px;
    line-height: 1.45;
}

.live-summary {
    position: sticky;
    top: 90px;
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--cyan);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-small);
}

.summary-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--line);
}

.summary-heading h2 {
    font-size: 16px;
}

.summary-heading span {
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
}

.summary-note {
    margin: 12px 0 2px;
    color: var(--muted);
    font-size: 11px;
}

.live-summary dl div {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.live-summary dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
}

.live-summary dd {
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.receipt-view {
    grid-column: 1 / -1;
    width: min(680px, 100%);
    margin: 0 auto;
    scroll-margin-top: 88px;
    padding: 40px;
    text-align: center;
}

.receipt-mark {
    width: 74px;
    height: 74px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 38px;
    font-weight: 800;
}

.receipt-kicker {
    margin-bottom: 6px;
    color: var(--green);
    font-size: 12px;
    font-weight: 850;
}

.receipt-view h1 {
    margin-bottom: 10px;
    font-size: 38px;
    line-height: 1.15;
}

.receipt-intro {
    margin: 0 auto 24px;
    color: var(--muted);
    font-size: 14px;
}

.receipt-payment-block {
    margin-bottom: 22px;
    padding: 22px;
    border: 1px solid #b8d3f4;
    border-radius: 8px;
    background: #f1f7ff;
    text-align: left;
}

.receipt-payment-block h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.receipt-payment-block p {
    margin: 7px 0;
    color: #405064;
    font-size: 13px;
}

.receipt-payment-amount {
    display: block;
    margin-bottom: 10px;
    color: var(--blue);
    font-size: 26px;
}

.receipt-payment-details {
    color: var(--ink) !important;
    font-weight: 750;
}

.receipt-payment-actions {
    margin: 14px 0;
}

.receipt-payment-note {
    margin-bottom: 0 !important;
    padding-top: 12px;
    border-top: 1px solid #cadcf2;
    font-weight: 650;
}

.receipt-id-block {
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid #a8d8bb;
    background: var(--soft-green);
}

.receipt-id-block span {
    display: block;
    margin-bottom: 6px;
    color: #466352;
    font-size: 12px;
}

.receipt-id-block strong {
    display: block;
    margin-bottom: 12px;
    color: #0e5c38;
    font-family: "Courier New", monospace;
    font-size: 21px;
    overflow-wrap: anywhere;
}

.receipt-id-block .secondary-button {
    min-height: 38px;
    padding: 7px 12px;
    font-size: 12px;
}

.receipt-summary {
    margin-bottom: 24px;
    border-top: 1px solid var(--line);
    text-align: left;
}

.receipt-summary div {
    display: grid;
    grid-template-columns: minmax(135px, 40%) 1fr;
    gap: 16px;
    padding: 13px 4px;
    border-bottom: 1px solid var(--line);
}

.receipt-summary dt {
    color: var(--muted);
    font-size: 13px;
}

.receipt-summary dd {
    font-size: 14px;
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
}

.footer {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 30px;
    color: #46525e;
    text-align: center;
    font-size: 12px;
}

.contact-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 14px;
}

.contact-info a {
    color: var(--navy);
}

.legal-toggle {
    border: 0;
    background: transparent;
    color: var(--navy);
    text-decoration: underline;
    font-size: 12px;
    cursor: pointer;
}

.legal-text {
    max-width: 760px;
    margin: 16px auto 0;
    padding: 18px;
    border: 1px solid var(--line);
    background: #fff;
    text-align: left;
    line-height: 1.55;
}

.legal-text h2 {
    margin-bottom: 7px;
    font-size: 14px;
}

.legal-text p {
    margin-bottom: 10px;
    color: var(--muted);
}

[hidden] {
    display: none !important;
}

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .live-summary {
        position: static;
        padding: 18px 20px;
        border: 1px solid var(--line);
        border-top: 4px solid var(--cyan);
        border-radius: 7px;
        background: #fff;
    }

    .live-summary dl {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 18px;
    }
}

@media (max-width: 560px) {
    .topbar-inner {
        min-height: 60px;
        padding: 9px 16px;
    }

    .brand-block img {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .brand-block strong {
        font-size: 14px;
    }

    .brand-block span {
        font-size: 10px;
    }

    .topbar-actions .text-button:first-child {
        display: none;
    }

    .app-shell {
        width: 100%;
        margin: 0;
        gap: 0;
    }

    .conversation-view,
    .receipt-view {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .conversation-heading {
        min-height: 92px;
        padding: 18px 16px 14px;
        flex-direction: column;
        gap: 12px;
    }

    .progress-steps {
        min-height: 62px;
        padding: 0 10px;
        gap: 2px;
    }

    .progress-steps li {
        min-width: 0;
        padding: 23px 2px 0;
        font-size: 9px;
        line-height: 1.1;
        text-align: center;
        white-space: normal;
    }

    .progress-steps li::before {
        left: 50%;
        top: 12px;
        transform: translate(-50%, -50%);
    }

    .conversation-heading h1 {
        font-size: 19px;
    }

    .accepted-methods {
        justify-content: flex-start;
    }

    .messages {
        min-height: 0;
        height: clamp(300px, 48vh, 430px);
        max-height: none;
        padding: 18px 14px;
    }

    .message-bubble {
        max-width: 90%;
    }

    .message-summary {
        min-width: 0;
    }

    .message-summary div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .message-summary dd {
        text-align: left;
    }

    .composer {
        min-height: 104px;
        padding: 14px;
    }

    .composer-form,
    .upload-form,
    .review-actions {
        grid-template-columns: 1fr;
    }

    .method-choices,
    .choice-grid,
    .edit-grid {
        grid-template-columns: 1fr;
    }

    .method-choice {
        min-height: 68px;
    }

    .secondary-choice {
        grid-column: auto;
    }

    .live-summary {
        margin: 0;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    .live-summary dl {
        grid-template-columns: 1fr;
    }

    .receipt-view {
        padding: 34px 18px 28px;
    }

    .receipt-view h1 {
        font-size: 32px;
    }

    .receipt-summary div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .receipt-summary dd {
        text-align: left;
    }

    .footer {
        width: 100%;
        padding: 22px 16px 28px;
        border-top: 1px solid var(--line);
        background: #fff;
    }

    .contact-info {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
