:root {
    --checkout-ink: #173f35;
    --checkout-muted: #596b64;
    --checkout-paper: #fffefa;
    --checkout-line: #d8ddd5;
    --checkout-green: #356a57;
    --checkout-soft: #eef5ed;
    --checkout-warn: #fff7e7;
    --checkout-danger: #8a3939;
}

* { box-sizing: border-box; }

body.checkout-page {
    margin: 0;
    background: #f7f5ee;
    color: var(--checkout-ink);
    font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
    font-size: 16px;
    line-height: 1.8;
}

.checkout-page a { color: #245f4c; text-underline-offset: .18em; }
.checkout-page button,
.checkout-page input,
.checkout-page select,
.checkout-page textarea { font: inherit; }
.checkout-page button,
.checkout-page label,
.checkout-page summary { touch-action: manipulation; }
.checkout-page :focus-visible { outline: 3px solid #9b5d08; outline-offset: 3px; }

.checkout-shell {
    width: min(920px, calc(100% - 28px));
    margin: 0 auto;
    padding: 26px 0 70px;
}

.checkout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--checkout-line);
}

.checkout-brand {
    color: var(--checkout-ink);
    font-family: Georgia, "Yu Mincho", serif;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: .12em;
    text-decoration: none;
}

.checkout-brand small {
    margin-left: 8px;
    font-family: system-ui, sans-serif;
    font-size: 10px;
    letter-spacing: .1em;
}

.checkout-heading { margin: 30px 0 22px; }
.checkout-heading .eyebrow {
    margin: 0 0 5px;
    color: #536c60;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
}
.checkout-heading h1 {
    margin: 0 0 10px;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
    font-size: clamp(27px, 5vw, 38px);
    line-height: 1.45;
}
.checkout-heading p { margin: 0; color: var(--checkout-muted); }

.checkout-card {
    margin-bottom: 20px;
    padding: clamp(20px, 4vw, 34px);
    border: 1px solid var(--checkout-line);
    border-radius: 20px;
    background: var(--checkout-paper);
    box-shadow: 0 13px 36px rgba(40, 58, 51, .05);
}

.checkout-card h2 { margin: 0 0 18px; font-size: 22px; line-height: 1.55; }
.checkout-card h3 { margin: 20px 0 10px; font-size: 17px; }
.checkout-card p { margin: 10px 0; }

.checkout-notice {
    margin-bottom: 20px;
    padding: 15px 18px;
    border: 1px solid #e3c36e;
    border-radius: 14px;
    background: var(--checkout-warn);
}
.checkout-notice.success { border-color: #aac9b2; background: var(--checkout-soft); }
.checkout-notice.error { border-color: #dcb8b8; background: #fff4f4; color: #702f2f; }
.checkout-notice strong { display: block; }

.checkout-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.checkout-fields .wide { grid-column: 1 / -1; }
.checkout-field { display: block; margin-bottom: 17px; font-weight: 700; }
.checkout-field small { display: block; color: var(--checkout-muted); font-weight: 400; }
.checkout-field input,
.checkout-field select,
.checkout-field textarea {
    display: block;
    width: 100%;
    min-height: 50px;
    margin-top: 7px;
    padding: 11px 13px;
    border: 1px solid #aebdb4;
    border-radius: 11px;
    background: #fff;
    color: var(--checkout-ink);
}
.checkout-field textarea { min-height: 105px; resize: vertical; }

.checkout-designs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.checkout-design {
    position: relative;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
    min-height: 112px;
    margin: 0;
    padding: 13px;
    border: 1px solid var(--checkout-line);
    border-radius: 15px;
    background: #fff;
    cursor: pointer;
}
.checkout-design:has(input:checked) { border: 2px solid var(--checkout-green); padding: 12px; background: var(--checkout-soft); }
.checkout-design input { position: absolute; top: 13px; right: 13px; width: 21px; height: 21px; accent-color: var(--checkout-green); }
.checkout-design img { width: 76px; height: 86px; border-radius: 10px; object-fit: cover; }
.checkout-design strong { display: block; padding-right: 26px; font-size: 17px; }
.checkout-design span { display: block; color: var(--checkout-muted); font-size: 13px; }
.checkout-design .design-total { color: var(--checkout-ink); font-weight: 700; }

.checkout-selection-help { margin: 14px 0 0; color: var(--checkout-muted); font-size: 14px; }
.checkout-selection-help.is-ready { color: var(--checkout-green); font-weight: 700; }

.checkout-summary { margin: 0; }
.checkout-summary > div {
    display: grid;
    grid-template-columns: minmax(130px, .75fr) minmax(0, 1.6fr);
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #e5e8e2;
}
.checkout-summary dt { color: var(--checkout-muted); }
.checkout-summary dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.checkout-summary .total dd { font-size: 24px; }

.checkout-items { margin: 0; padding: 0; list-style: none; }
.checkout-items li { display: flex; justify-content: space-between; gap: 18px; padding: 9px 0; border-bottom: 1px solid #edf0eb; }

.checkout-confirmations { margin: 22px 0; padding: 18px; border: 1px solid #c9d5cd; border-radius: 14px; background: #f8faf7; }
.checkout-check {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
    margin: 0 0 16px;
    cursor: pointer;
}
.checkout-check:last-child { margin-bottom: 0; }
.checkout-check input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--checkout-green); }

.checkout-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.checkout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 13px 22px;
    border: 1px solid var(--checkout-green);
    border-radius: 12px;
    background: var(--checkout-green);
    color: #fff;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.checkout-button.secondary { background: transparent; color: var(--checkout-green); }
.checkout-button.danger { border-color: #994747; background: #994747; }
.checkout-button:disabled,
.checkout-button[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.checkout-button[aria-busy="true"] { cursor: wait; }

.checkout-help { color: var(--checkout-muted); font-size: 13px; }
.checkout-help.important { color: var(--checkout-ink); font-size: 14px; }
.checkout-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }

.checkout-status {
    padding: 24px;
    border-left: 5px solid #a98345;
    border-radius: 12px;
    background: var(--checkout-warn);
}
.checkout-status.paid { border-color: var(--checkout-green); background: var(--checkout-soft); }
.checkout-status.problem { border-color: var(--checkout-danger); background: #fff4f4; }

.checkout-table-wrap { max-width: 100%; overflow-x: auto; }
.checkout-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.checkout-table th,
.checkout-table td { padding: 12px 10px; border-bottom: 1px solid var(--checkout-line); text-align: left; vertical-align: top; }
.checkout-table th { white-space: nowrap; }
.checkout-table td { overflow-wrap: anywhere; }
.checkout-badge { display: inline-block; padding: 3px 10px; border-radius: 99px; background: #ecefe9; font-size: 12px; font-weight: 700; white-space: nowrap; }
.checkout-badge.paid { background: #e1efe4; color: #24563f; }
.checkout-badge.problem { background: #f8dfdf; color: #793838; }
.checkout-badge.test { background: #fff0c8; color: #6d5215; }

.checkout-key-state { display: inline-block; margin-left: 8px; font-weight: 700; }
.checkout-readiness { margin: 0; padding-left: 1.4em; }
.checkout-readiness li { margin: 6px 0; }
.checkout-readiness .ok { color: #245f45; }
.checkout-readiness .ng { color: #853b3b; }
.checkout-code { padding: 2px 6px; border-radius: 5px; background: #edf0eb; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }

.checkout-footer { padding-top: 24px; color: var(--checkout-muted); font-size: 13px; text-align: center; }

@media (max-width: 680px) {
    .checkout-shell { width: min(100% - 20px, 920px); padding-top: 16px; }
    .checkout-header { align-items: flex-start; flex-direction: column; gap: 8px; }
    .checkout-fields,
    .checkout-designs { grid-template-columns: 1fr; }
    .checkout-summary > div { grid-template-columns: 1fr; gap: 3px; }
    .checkout-card { padding: 21px 17px; border-radius: 16px; }
    .checkout-actions { align-items: stretch; flex-direction: column; }
    .checkout-actions .checkout-button { width: 100%; }
    .checkout-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .checkout-table,
    .checkout-table tbody,
    .checkout-table tr,
    .checkout-table td { display: block; width: 100%; }
    .checkout-table tr { margin-bottom: 14px; padding: 8px 12px; border: 1px solid var(--checkout-line); border-radius: 12px; }
    .checkout-table td { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 8px; padding: 7px 0; border: 0; }
    .checkout-table td::before { content: attr(data-label); color: var(--checkout-muted); font-weight: 700; }
}

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