:root {
    color-scheme: light;
    --bg: #f4f7fc;
    --surface: #fbfcff;
    --surface-strong: #ffffff;
    --text: #162033;
    --muted: #6e788a;
    --line: #dce4ef;
    --accent: #339cff;
    --accent-bright: #62b3ff;
    --accent-soft: #e9effa;
    --danger: #a33c34;
    --danger-soft: #f8e7e3;
    --shadow: 0 24px 70px rgba(64, 91, 142, .09);
    --radius-lg: 32px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --sans: Inter, "Noto Sans JP", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", sans-serif;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1020;
    --surface: #11182b;
    --surface-strong: #18213a;
    --text: #f4f7ff;
    --muted: #9ca9c2;
    --line: #293653;
    --accent: #339cff;
    --accent-bright: #62b3ff;
    --accent-soft: #192c55;
    --danger: #f09288;
    --danger-soft: #432723;
    --shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { font-family: var(--sans); background: var(--bg); color: var(--text); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background:
    radial-gradient(circle at 82% -8%, color-mix(in srgb, var(--accent) 10%, transparent) 0, transparent 31rem),
    radial-gradient(circle at 12% 38%, color-mix(in srgb, var(--accent) 4%, transparent) 0, transparent 24rem),
    var(--bg); }
::selection { color: var(--text); background: var(--accent-soft); }
button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.hidden { display: none !important; }
.sr-only, .sr-only:focus:not(:focus-visible) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { max-width: 1120px; margin: 0 auto; padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; }
.site-header.compact { padding-bottom: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 800; text-decoration: none; letter-spacing: -.045em; }
.brand span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: linear-gradient(145deg, var(--accent-bright), var(--accent)); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 24%, transparent); font-family: Arial, Helvetica, sans-serif; font-size: 19px; font-weight: 900; letter-spacing: -.02em; }
.theme-toggle { width: 40px; height: 40px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--text); cursor: pointer; font-size: 18px; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.theme-toggle:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--surface); transform: translateY(-1px); }

.page-shell { width: min(1040px, calc(100% - 40px)); margin: 38px auto 96px; }
.hero { text-align: center; max-width: 880px; margin: 92px auto 0; }
.eyebrow { margin: 0 0 18px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(50px, 7.2vw, 82px); line-height: 1.02; letter-spacing: -.065em; font-weight: 850; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { max-width: 620px; margin: 30px auto 36px; color: var(--muted); font-size: clamp(15px, 1.8vw, 18px); line-height: 1.9; }

.primary-button, .secondary-button, .danger-button, .text-button { border: 0; border-radius: 999px; min-height: 52px; padding: 0 26px; font-weight: 750; cursor: pointer; transition: transform .18s ease, opacity .18s ease, border-color .18s ease, box-shadow .18s ease; }
.primary-button { background: var(--text); color: var(--bg); box-shadow: 0 13px 34px color-mix(in srgb, var(--text) 18%, transparent); }
.primary-button span { display: inline-block; margin-left: 5px; transition: transform .18s ease; }
.primary-button:hover span { transform: translateX(3px); }
.primary-button:hover, .secondary-button:hover, .danger-button:hover { transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { opacity: .5; cursor: wait; transform: none; }
.secondary-button { color: var(--text); background: var(--surface-strong); border: 1px solid var(--line); }
.danger-button { color: var(--danger); background: var(--danger-soft); }
.text-button { color: var(--muted); background: transparent; }
.full-width { grid-column: 1 / -1; width: 100%; }

.feature-strip { max-width: 760px; list-style: none; padding: 0; margin: 76px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature-strip li { padding: 23px 16px; display: flex; gap: 8px; align-items: baseline; justify-content: center; border-right: 1px solid var(--line); }
.feature-strip li:last-child { border-right: 0; }
.feature-strip strong { font-size: 18px; letter-spacing: -.03em; }
.feature-strip span { color: var(--muted); font-size: 13px; }

.transfer-card, .notice-card, .send-card, .legal-card { background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius-lg); backdrop-filter: blur(16px); }
.transfer-card { max-width: 860px; margin: 46px auto 0; padding: clamp(26px, 5vw, 52px); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: clamp(24px, 4vw, 36px); letter-spacing: -.04em; }
.timer { flex: 0 0 auto; padding: 10px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-family: var(--mono); font-size: 17px; font-weight: 800; }
.waiting-layout { padding: 40px 0 25px; display: grid; grid-template-columns: minmax(240px, 310px) 1fr; align-items: center; gap: 50px; }
.qr-frame { padding: 18px; background: #fff; border: 1px solid #dce4ef; border-radius: 24px; box-shadow: 0 18px 50px rgba(64, 91, 142, .10); }
.qr-frame img { display: block; width: 100%; aspect-ratio: 1; image-rendering: pixelated; transition: opacity .2s ease, filter .2s ease; }
.qr-frame img.qr-disabled { opacity: .22; filter: grayscale(1); }
.step-list { display: grid; gap: 18px; }
.step-list p { margin: 0; display: flex; align-items: center; gap: 14px; color: var(--muted); line-height: 1.55; }
.step-list p span { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; background: var(--surface-strong); border: 1px solid var(--line); color: var(--text); font-weight: 800; font-size: 13px; }
.status-pill { margin-top: 10px; display: inline-flex; width: fit-content; align-items: center; gap: 9px; padding: 11px 15px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 750; }
.status-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
.status-pill i.connected { animation: none; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.8); } }
.panel-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.error-message { margin: 20px 0 0; padding: 13px 16px; background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); line-height: 1.6; }

.success-mark, .error-mark { display: grid; place-items: center; width: 70px; height: 70px; margin: 35px auto 18px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 34px; font-weight: 900; }
.error-mark { color: var(--danger); background: var(--danger-soft); }
.received-label { text-align: center; font-weight: 800; font-size: 20px; }
.received-text { min-height: 180px; max-height: 420px; overflow: auto; margin: 26px 0 10px; padding: 22px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); background: var(--surface-strong); border: 1px solid var(--line); border-radius: var(--radius-md); font: 15px/1.75 var(--mono); }
.text-meta, .composer-meta { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 13px; }
.button-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); padding: 12px 20px; border-radius: 999px; color: #fff; background: #17213a; box-shadow: var(--shadow); font-weight: 750; z-index: 20; }

.notice-card { max-width: 860px; margin: 28px auto 0; padding: 28px 34px; background: color-mix(in srgb, var(--surface) 58%, transparent); box-shadow: none; }
.notice-card h2 { margin: 0 0 12px; font-size: 16px; letter-spacing: -.02em; }
.notice-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.85; }
.notice-card .privacy-note { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

.site-footer { max-width: 1040px; margin: 0 auto; padding: 30px 20px 46px; display: flex; justify-content: space-between; gap: 25px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 22px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

.send-page { min-height: 100dvh; }
.mobile-shell { width: min(560px, calc(100% - 28px)); margin: 18px auto 60px; }
.send-card { padding: clamp(25px, 6vw, 42px); text-align: center; }
.send-card h1 { margin: 0; font-size: clamp(27px, 7vw, 38px); letter-spacing: -.045em; }
.send-card > p:not(.eyebrow, .privacy-note) { color: var(--muted); line-height: 1.7; }
.send-instruction { margin: 12px 0 20px; }
.send-card textarea { display: block; width: 100%; min-height: 260px; resize: vertical; padding: 18px; color: var(--text); background: var(--surface-strong); border: 1px solid var(--line); border-radius: var(--radius-md); font-size: 16px; line-height: 1.65; outline: none; }
.send-card textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.composer-meta { margin-top: 10px; }
.mobile-buttons { grid-template-columns: 1fr 1fr; }
.compact-note { margin: 22px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.over-limit { color: var(--danger); }
.inline-error { color: var(--danger) !important; background: var(--danger-soft); padding: 10px; border-radius: var(--radius-sm); }
.spinner { width: 45px; height: 45px; margin: 10px auto 28px; border: 4px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.legal-shell { width: min(820px, calc(100% - 36px)); margin: 30px auto 80px; }
.legal-card { padding: clamp(28px, 6vw, 58px); }
.legal-card h1 { margin-top: 0; font-size: clamp(34px, 6vw, 52px); letter-spacing: -.05em; }
.legal-card h2 { margin-top: 38px; font-size: 20px; }
.legal-card p, .legal-card li { color: var(--muted); line-height: 1.9; }
.legal-card .updated { font-size: 13px; }

@media (max-width: 680px) {
    .site-header { padding: 18px 20px; }
    .page-shell { width: min(100% - 24px, 1080px); margin-top: 15px; }
    .hero { margin-top: 52px; }
    .hero h1 { font-size: clamp(43px, 13vw, 62px); }
    .lead { line-height: 1.75; }
    .feature-strip { margin-top: 54px; grid-template-columns: 1fr; }
    .feature-strip li { border-right: 0; border-bottom: 1px solid var(--line); }
    .feature-strip li:last-child { border-bottom: 0; }
    .panel-heading { align-items: center; }
    .waiting-layout { grid-template-columns: 1fr; gap: 30px; padding-top: 28px; }
    .qr-frame { width: min(100%, 300px); justify-self: center; }
    .panel-actions { justify-content: space-between; }
    .button-grid { grid-template-columns: 1fr; }
    .mobile-buttons { grid-template-columns: 1fr 1fr; }
    .site-footer { flex-direction: column; }
}

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