/*
 *配色と寸法はデザイン(Figma: Ticket / Smart Pass)に合わせている
 *ライトテーマのみ。ダークモードの指定はデザイン側に無いので追わない
 */
:root {
    color-scheme: light;

    /* 系列サイトの地の色。列の外と同じにして、白い面だけが浮いて見えるようにする */
    --bg: #f4f5f9;
    --surface: #ffffff;
    --band: #f5f5f5;
    --border: #e6e6e6;

    --text: #111111;
    --text-label: #464646;
    --text-muted: #6d6d6d;
    --text-footer: #4b4b4f;
    --text-copyright: #959598;

    --primary: #3892f3;
    --on-primary: #ffffff;
    --disabled-bg: #b1b1b1;
    --disabled-text: #e6e6e6;
    --error: #ea3829;
    /* アイコンバッジ専用。ボタンには使わない */
    --badge: #f5ff00;

    --radius: 4px;
    /* 系列サイトと同じく、PCでもスマホの最大幅の列で見せる */
    --page-width: 440px;
    --gutter: 16px;
    /* 列の外側。テーマに関係なく無地にして、列だけが画面として見えるようにする */
    --backdrop: #f4f5f9;
    --page-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

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

body {
    /* Pretendard JPはGoogle Fontsに無い。導入するまでは端末のフォントに落とす */
    font-family: "Pretendard JP", "Pretendard", -apple-system, BlinkMacSystemFont,
    "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.4px;
    color: var(--text);
    background: var(--bg);
    margin: 0 auto;
    width: 100%;
    max-width: var(--page-width);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    /* 画面端で親要素まで引っ張られるのを止める */
    overscroll-behavior-y: contain;
    -webkit-tap-highlight-color: transparent;
}

/* 列より広い画面でだけ縁を付ける。スマホで付けると端に線が出る */
@media (min-width: 441px) {
    body {
        border-inline: 1px solid var(--border);
        box-shadow: var(--page-shadow);
    }
}

img {
    max-width: 100%;
}

/* タップ後の300ms待ちを無くす */
a,
button,
input,
label {
    touch-action: manipulation;
}

.icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

/* ---- nav ---- */

.site-header {
    /* 配色によってはmainに重なり順を奪われる。ドロップダウンのために常に上へ置く */
    position: relative;
    z-index: 2;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--gutter);
    background: var(--surface);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

/* デザインの実寸105.24 x 14.52 */
.brand-name {
    width: 105px;
    height: 15px;
    flex: 0 0 auto;
}

.nav-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    /* バーの高さいっぱいを押せるようにする */
    height: 48px;
    padding: 0 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.3px;
    color: var(--text);
    background: none;
    border: none;
    cursor: pointer;
}

/* ---- page ---- */

main {
    flex: 1 0 auto;
}

/* 内容が画面より短いと、最後の面の下からフッターまで地の色がのぞく。最後の面を画面の下端まで伸ばす */
main.is-fill {
    display: flex;
    flex-direction: column;
}

main.is-fill > :last-child {
    flex: 1 0 auto;
}

.container {
    padding: 32px var(--gutter) 60px;
}

.badge {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 9999px;
    background: var(--badge);
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge img {
    /* グリフの実寸30 x 33.44 */
    width: 30px;
    height: 34px;
}

.badge img[src$="ticket.svg"] {
    width: 40px;
    height: 40px;
}

/* イントロは要素が少ないので、画面の中央に寄せる */
.intro {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px var(--gutter) 60px;
}

.intro .page-title {
    margin-bottom: 16px;
}

.subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 24px;
    font-weight: 400;
    letter-spacing: 0.4px;
    text-align: center;
}

.intro .button {
    margin-top: 32px;
}

/* 認証の画面では見出しの下に添える。見出しとの間は詰め、カードとの間は見出しと同じだけ空ける */
.container > .subtitle {
    margin: -16px 0 32px;
}

/* ---- error ----
 *イントロと同じく要素が少ないので、画面の中央に寄せる
 */
.error-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px var(--gutter) 60px;
}

.error-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 24px;
    text-align: center;
}

.error-icon {
    display: block;
}

.error-heading {
    margin: 0;
    font-size: 18px;
    line-height: 28px;
    font-weight: 600;
}

/* 文面はth:textで丸ごと差し替わるので、テンプレートの改行が漏れる心配はない */
.error-message {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    white-space: pre-line;
    color: var(--text-muted);
}

.error-box + .button {
    margin-top: 32px;
}

.button.is-outline {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--text);
}

.error-ref {
    margin-top: 24px;
    padding: 12px var(--gutter);
    font-size: 12px;
    line-height: 18px;
    color: var(--text-muted);
    text-align: center;
    background: var(--band);
    border-radius: var(--radius);
}

.error-ref code {
    display: block;
    margin-top: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: var(--text-label);
    /* 長押しで丸ごと選べるようにする */
    user-select: all;
    word-break: break-all;
}

.page-title {
    margin: 0 0 32px;
    font-size: 18px;
    line-height: 28px;
    font-weight: 600;
    text-align: center;
}

/* ---- card ---- */

.card {
    padding: 32px var(--gutter);
    /* 地は塗らず、枠と影だけで面を区切る。どの画面も同じ地の色で揃える */
    border: 1px solid var(--border);
    border-radius: var(--radius);
    /* ぼかしの無いオフセット影。デザインの指定どおり */
    box-shadow: 0 3px 0 var(--band);
}

.card > * + * {
    margin-top: 24px;
}

.card > .caution {
    margin-top: 32px;
}

.lead {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
}

.lead strong {
    font-weight: 600;
}

/* ---- form ---- */

label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: var(--text-label);
}

input[type="email"],
input[type="text"] {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    /* デザインは14pxだが、iOSが入力時に勝手に拡大するので16pxにしている */
    font-size: 16px;
    font-family: inherit;
    letter-spacing: 0.4px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--text);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 146, 243, 0.16);
}

/* 入力中の項目がどれか分かるようにラベルも連動させる */
.field:focus-within label {
    color: var(--primary);
}

input.is-invalid {
    border-color: var(--error);
}

input.code {
    height: 48px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-indent: 0.4em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* 文面側の改行位置をデザインどおりに保つ。中身はth:errorsで差し込まれるので、
   テンプレートのインデントが紛れ込む心配はない */
.field-error {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 18px;
    color: var(--error);
    white-space: pre-line;
}

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 48px;
    margin-top: 24px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--on-primary);
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.08s ease;
}

.button:active {
    transform: scale(0.99);
}

.button:disabled {
    background: var(--disabled-bg);
    color: var(--disabled-text);
    cursor: default;
}

.text-link {
    display: block;
    width: 100%;
    /* 指で押せる高さを確保する。見た目の間隔は24pxのまま */
    padding: 12px 0;
    margin-top: 12px;
    font-size: 14px;
    line-height: 20px;
    color: var(--primary);
    text-align: center;
    text-decoration: underline;
    background: none;
    border: none;
    font-family: inherit;
    letter-spacing: 0.4px;
    cursor: pointer;
}

/* 入力欄どうしの間隔。カード直下の要素間(24px)とは別の値がデザインで指定されている */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 同意欄が2つになったので、デザインどおり左揃えで縦に並べる */
.agreement {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 24px 0;
}

.agreement-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: var(--text);
    cursor: pointer;
}

/* accent-colorを使うと、独自の描画をしなくてもテーマの色でチェックが入る */
.agreement-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--primary);
    cursor: pointer;
}

.agreement-link {
    color: var(--primary);
    text-decoration: underline;
}

.agreement .field-error {
    margin: 0;
}

/* 同意欄が送信ボタンとの間隔を持っているので、ボタン側の余白は消す */
.agreement + .button {
    margin-top: 0;
}

/*
 *未同意のうちは押せないことを見た目で示す。:has()が無い端末では常に押せるが、
 *実際に弾くのはサーバ側の検証なので動作は変わらない
 */
.auth-form:has(input[name="agreed"]:not(:checked), input[name="ageConsented"]:not(:checked)) .button {
    background: var(--disabled-bg);
    color: var(--disabled-text);
    pointer-events: none;
}

/* Googleが右下に固定で出すバッジ。クッキーの同意バナーと重なるので消し、代わりに.recaptcha-noticeを出す */
.grecaptcha-badge {
    visibility: hidden;
}

.recaptcha-notice {
    margin: 60px 0 0;
    font-size: 12px;
    line-height: 20px;
    color: var(--text-muted);
}

.recaptcha-notice a {
    color: inherit;
    text-decoration: underline;
}

.form-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 32px 0 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-muted);
}

.form-help a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}

.form-help span {
    text-decoration: underline;
}

.form-help .icon {
    width: 18px;
    height: 18px;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---- modal ---- */

/*
 * JavaScriptが無いので<dialog>は使わず、開いた状態のものを描く
 *背面のスクロールは止められないが、このモーダルの背面には操作できる物が無い
 */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--gutter);
    /* デザインの指定は#222の不透明度60% */
    background: rgba(34, 34, 34, 0.6);
}

.modal {
    width: 100%;
    max-width: 326px;
    overflow: hidden;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}

.modal-text {
    margin: 0;
    padding: 40px 32px;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    color: var(--text);
}

/* 本文ボタンと違い、デザイン上は太字にしない */
.modal-action {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
    letter-spacing: 0.4px;
    color: var(--on-primary);
    background: var(--primary);
    text-decoration: none;
}

/* ---- notices ---- */

/* 項目の間隔はgapで取る。marginで足すと.caution p側の指定に負けて潰れる */
.caution {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 12px;
    line-height: 18px;
    color: var(--text-muted);
}

.caution p {
    margin: 0;
}

.caution a {
    color: inherit;
    text-decoration: underline;
}

.caution-title {
    font-weight: 600;
    color: var(--text-label);
}

/* ---- qr page ---- */

.band-title {
    margin: 0;
    padding: 16px var(--gutter);
    background: var(--bg);
    font-size: 18px;
    line-height: 28px;
    font-weight: 600;
}

/* 文面の画面の見出し。系列サイトと同じく区切りを置かず、本文と同じ地に載せる */
.band-title.is-center {
    text-align: center;
    padding: 28px var(--gutter) 0;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 800;
    letter-spacing: 0.45px;
}

/* QR画面の見出し。系列サイトの見出し(CAPSULE TOYなど)と同じ大きさと字間にする */
.band-title.is-display {
    padding: 16px 20px 8px;
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.025em;
}

.qr-panel {
    padding: 32px var(--gutter);
    text-align: center;
}

/* QRの上に出す宛先 */
.qr-account {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
}

.qr {
    display: block;
    width: 100%;
    height: auto;
    /* 枠の内側の角丸。静寂域はQR画像自身が持っている */
    border-radius: 12px;
}

.qr-hint,
.qr-notes {
    margin: 16px 0 0;
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: 0.325px;
    color: var(--text-copyright);
    text-align: center;
}

.qr-notes p {
    margin: 0;
}

.qr-notes p + p {
    margin-top: 8px;
}

/* ---- footer ---- */

.site-footer {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* 余白と区切り線の色は系列サイトのフッターに揃える */
    gap: 24px;
    padding: 40px 24px 80px;
    background: var(--surface);
    border-top: 1px solid var(--band);
}

/* 幅が足りなければ折り返す。項目の途中で切れると読めないのでnowrapで固める */
.footer-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 0.3px;
    color: var(--text-footer);
}

.footer-menu li {
    white-space: nowrap;
}

.footer-ci {
    display: block;
    width: 90px;
    height: 12px;
    /* 系列サイトはロゴの上だけ余白が広い */
    margin-top: 8px;
}

/* 2行の間隔は系列サイトと同じく、行の高さ1.5に8pxを足して作る */
.footer-copyright {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
    letter-spacing: 0.275px;
    color: var(--text-copyright);
}

/* ---- motion ----
 *画面が切り替わったことが分かる程度に留める
 * OS側で動きを減らす設定にしている人には一切動かさない
 */
/*
 *同じ出所の移動をブラウザに渡して滑らかに切り替えてもらう
 *未対応のブラウザは今までどおり切り替わるだけで、壊れない
 */
@view-transition {
    navigation: auto;
}

/* 既定の250msはこの規模の画面には長い。切り替わったことが分かる最低限にする */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.18s;
}

/* 動きを減らす設定の端末では切り替えを演出しない */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}

@media (prefers-reduced-motion: no-preference) {
    /*
     *登場の演出は入口の画面だけにする
     *フォームの画面に付けると、送信のたびに中身が一旦消えて
     * 0.6秒かけて戻ってくる。これが点滅して見える正体だった
     */
    .intro .badge {
        animation: badge-in 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    }

    .intro .page-title {
        animation: rise 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s both;
    }

    .intro .button {
        animation: rise 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) 0.16s both;
    }

    /* 背面は先に暗くし、ダイアログを少し遅らせて出す */
    .modal-overlay {
        animation: fade 0.2s ease both;
    }

    .modal {
        animation: modal-in 0.28s cubic-bezier(0.22, 0.61, 0.36, 1) 0.06s both;
    }

    .message {
        animation: drop 0.24s ease both;
    }

    .qr-figure img {
        animation: qr-in 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    }

    /* 読み取り待ちであることが伝わるよう、表示直後に一度だけ走らせる */
    .qr-figure::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg,
        transparent 0%,
        rgba(56, 146, 243, 0.16) 45%,
        transparent 90%);
        animation: qr-scan 1.6s cubic-bezier(0.4, 0, 0.2, 1) 0.45s 1 both;
        pointer-events: none;
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

@keyframes badge-in {
    from {
        opacity: 0;
        transform: scale(0.84);
    }
}

@keyframes qr-in {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
}

@keyframes drop {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}

@keyframes qr-scan {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(100%);
    }
}

/* デザインどおりQRを色の枠で囲む
   静寂域は枠ではなくQR画像の内側(MARGIN=4モジュール)が持つので、枠の色は配色に追従してよい */
.qr-figure {
    position: relative;
    overflow: hidden;
    width: 280px;
    max-width: 100%;
    margin: 0 auto;
    padding: 6px;
    background: var(--primary);
    border-radius: 16px;
}

/* ---- themes ----
 *既定はsystemで、端末の設定に従ってライトとダークを切り替える
 *明示的に選ばれた場合はdata-themeがそれを上書きする
 *ダークの値を2か所に書いているのは、メディアクエリ内と外を1つの規則にまとめられないため
 */
:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #121215;
    --surface: #1c1c21;
    --backdrop: #0a0a0c;
    --page-shadow: none;
    --band: #26262c;
    --border: #32323a;

    --text: #f2f2f4;
    --text-label: #b9b9c2;
    --text-muted: #8e8e97;
    --text-footer: #9a9aa4;
    --text-copyright: #6e6e78;

    --primary: #5aa5f7;
    --on-primary: #0d1117;
    --disabled-bg: #3a3a42;
    --disabled-text: #6e6e78;
    --error: #ff7a70;
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] {
        color-scheme: dark;

        --bg: #121215;
        --surface: #1c1c21;
        --backdrop: #0a0a0c;
        --page-shadow: none;
        --band: #26262c;
        --border: #32323a;

        --text: #f2f2f4;
        --text-label: #b9b9c2;
        --text-muted: #8e8e97;
        --text-footer: #9a9aa4;
        --text-copyright: #6e6e78;

        --primary: #5aa5f7;
        --on-primary: #0d1117;
        --disabled-bg: #3a3a42;
        --disabled-text: #6e6e78;
        --error: #ff7a70;
    }
}

/*
 *背景に装飾を持つ配色(popの光、sparkleの網点と星)では、見出しの帯も地を抜いて装飾を見せる
 * QRや文面の面はどの配色でも地を塗らない。QRの枠の内側は.qr-figureが白地を持つ
 */
:root[data-theme="pop"] .band-title,
:root[data-theme="sparkle"] .band-title {
    background: transparent;
}

:root[data-theme="pop"] {
    --bg: #fff7fb;
    --surface: #ffffff;
    --band: #ffe3f1;
    --border: #ffd3e8;

    --text: #241a2d;
    --text-label: #7b4f73;
    --text-muted: #9a7694;
    --text-footer: #7b4f73;
    --text-copyright: #b08fab;

    --primary: #e4408f;
    --on-primary: #ffffff;
    --error: #e02f55;

    --radius: 14px;
}

:root[data-theme="pop"] main {
    background:
            radial-gradient(90% 40% at 10% 0%, #ffe9f4 0%, transparent 60%),
            radial-gradient(80% 35% at 95% 8%, #e8f1ff 0%, transparent 60%),
            var(--bg);
}

:root[data-theme="pop"] .button {
    background: linear-gradient(100deg, #e4408f 0%, #8b5cf6 100%);
}

/* 上の勾配は.button全体に掛かるので、枠線だけの副ボタンまで塗り潰してしまう
   文字色が--primaryのままだと地と同系色になって読めない */
:root[data-theme="pop"] .button.is-secondary {
    color: var(--primary);
    background: var(--surface);
    border: 1px solid var(--primary);
}

:root[data-theme="pop"] .card {
    box-shadow: 0 4px 0 var(--band);
}

@media (prefers-reduced-motion: no-preference) {
    /* ファンモードだけ、バッジをゆっくり上下させる */
    /* 継続的な揺れだけは全画面で。登場の演出は入口に限る */
    :root[data-theme="pop"] .badge {
        animation: float 3.2s ease-in-out 0.6s infinite;
    }

    :root[data-theme="pop"] .intro .badge {
        animation: badge-in 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both,
        float 3.2s ease-in-out 0.6s infinite;
    }
}

@keyframes fade {
    from {
        opacity: 0;
    }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }
}

@keyframes float {
    50% {
        transform: translateY(-5px);
    }
}

/* ---- theme menu ---- */

.nav-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.theme-menu {
    position: relative;
}

.theme-menu > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 48px;
    color: var(--text);
    cursor: pointer;
    /* 既定の三角マーカーを消す */
    list-style: none;
}

.theme-menu > summary::-webkit-details-marker {
    display: none;
}

.theme-menu[open] > summary {
    color: var(--primary);
}

.theme-menu-panel {
    position: absolute;
    top: 44px;
    right: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 150px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.theme-menu-panel button {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.4px;
    text-align: left;
    color: var(--text);
    background: transparent;
    border: none;
    border-radius: calc(var(--radius) - 1px);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.theme-menu-panel button.is-active {
    color: var(--on-primary);
    background: var(--primary);
}

/* ワードマークとCIマークは黒で書き出されているので、暗い面では反転させる
   ロゴマークは青のグラデーションでそのまま見えるため触らない */
:root[data-theme="dark"] .brand-name,
:root[data-theme="dark"] .footer-ci {
    filter: invert(1);
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] .brand-name,
    :root[data-theme="system"] .footer-ci {
        filter: invert(1);
    }
}

/* ---- scan ----
 *読み取り専用の全画面表示。配色テーマに関係なく白と黒で固定する
 *屋外では対比が落ちるほど読み取りに失敗するため、ここだけはトークンを使わない
 */
.scan-body {
    display: block;
    max-width: none;
    background: #ffffff;
}

.scan {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    min-height: 100dvh;
    padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
    background: #ffffff;
}

.scan-qr {
    /* 縦横どちらの向きでも画面いっぱいまで使う */
    width: min(92vw, 68vh);
    height: auto;
}

.scan-close {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 22px;
    font-size: 13px;
    letter-spacing: 0.4px;
    color: #6d6d6d;
    text-decoration: none;
    border: 1px solid #e6e6e6;
    border-radius: 999px;
}

.button.is-secondary {
    color: var(--primary);
    background: transparent;
    border: 1px solid var(--primary);
}

/* ---- sparkle ----
 *ポップアート寄りの配色。明るい地に網点、太い黒の輪郭、ずらした影で組む
 *動きはすべてprefers-reduced-motionの内側に置き、切っても配色だけで成立するようにしている
 */
:root[data-theme="sparkle"] {
    color-scheme: light;

    --bg: #fff4d6;
    --surface: #ffffff;
    --band: #ffd93d;
    /* 輪郭線は黒。ポップアートの骨格になる */
    --border: #111111;

    --text: #111111;
    --text-label: #d6006e;
    --text-muted: #6b5300;
    --text-footer: #6b5300;
    --text-copyright: #9a8440;

    --primary: #ff1f8f;
    --on-primary: #ffffff;
    --disabled-bg: #d8d8d8;
    --disabled-text: #8a8a8a;
    --error: #e60012;

    --radius: 14px;
}

:root[data-theme="sparkle"] main {
    /* 網点と紙吹雪をmainの中に閉じ込める。isolationで重なりの基準をmainに作り、本文の下へ敷く */
    position: relative;
    isolation: isolate;
    background:
            radial-gradient(70% 40% at 12% 2%, rgba(0, 194, 255, 0.35) 0%, transparent 60%),
            radial-gradient(60% 35% at 92% 10%, rgba(255, 31, 143, 0.3) 0%, transparent 60%),
            var(--bg);
}

/* ベンデイ・ドット。本文の下に敷く */
:root[data-theme="sparkle"] main::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(#111111 1.4px, transparent 1.5px);
    background-size: 12px 12px;
    opacity: 0.12;
}

/* 星と球。漫画のコマに出てくるような、太い黒の輪郭と白のハイライトで描く
   要素を増やさずに済むようインラインSVGを背景に重ねている */
:root[data-theme="sparkle"] main::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.00 2.40L14.47 8.60L21.13 9.03L15.99 13.30L17.64 19.77L12.00 16.20L6.36 19.77L8.01 13.30L2.87 9.03L9.53 8.60Z' fill='%23ffd93d' stroke='%23111111' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E"),
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9.3' fill='%23ff1f8f' stroke='%23111111' stroke-width='2.2'/%3E%3Cellipse cx='8.6' cy='8.2' rx='2.8' ry='1.9' fill='%23ffffff' opacity='0.9' transform='rotate(-32 8.6 8.2)'/%3E%3C/svg%3E"),
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.00 2.40L14.47 8.60L21.13 9.03L15.99 13.30L17.64 19.77L12.00 16.20L6.36 19.77L8.01 13.30L2.87 9.03L9.53 8.60Z' fill='%2300c2ff' stroke='%23111111' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E"),
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9.3' fill='%237a5cff' stroke='%23111111' stroke-width='2.2'/%3E%3Cellipse cx='8.6' cy='8.2' rx='2.8' ry='1.9' fill='%23ffffff' opacity='0.9' transform='rotate(-32 8.6 8.2)'/%3E%3C/svg%3E"),
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.00 2.40L14.47 8.60L21.13 9.03L15.99 13.30L17.64 19.77L12.00 16.20L6.36 19.77L8.01 13.30L2.87 9.03L9.53 8.60Z' fill='%23ff1f8f' stroke='%23111111' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E"),
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9.3' fill='%2300c2ff' stroke='%23111111' stroke-width='2.2'/%3E%3Cellipse cx='8.6' cy='8.2' rx='2.8' ry='1.9' fill='%23ffffff' opacity='0.9' transform='rotate(-32 8.6 8.2)'/%3E%3C/svg%3E"),
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.00 2.40L14.47 8.60L21.13 9.03L15.99 13.30L17.64 19.77L12.00 16.20L6.36 19.77L8.01 13.30L2.87 9.03L9.53 8.60Z' fill='%237a5cff' stroke='%23111111' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position:
            6% 9%, 92% 13%, 49% 3%, 4% 51%,
            95% 57%, 11% 91%, 87% 87%;
    background-size:
            38px 38px, 30px 30px, 26px 26px, 24px 24px,
            32px 32px, 28px 28px, 22px 22px;
    opacity: 1;
}

:root[data-theme="sparkle"] .site-header,
:root[data-theme="sparkle"] .site-footer {
    border-bottom: 2px solid var(--border);
}

:root[data-theme="sparkle"] .site-footer {
    border-bottom: none;
    border-top: 2px solid var(--border);
}

/* 漫画のコマのように、太い輪郭とずらした影を付ける */
:root[data-theme="sparkle"] .card,
:root[data-theme="sparkle"] .theme-menu-panel {
    border: 2px solid var(--border);
    box-shadow: 5px 5px 0 var(--border);
}

:root[data-theme="sparkle"] .badge {
    border: 2px solid var(--border);
}

:root[data-theme="sparkle"] .page-title,
:root[data-theme="sparkle"] .band-title {
    /* 文字をずらして重ねると、刷りずれのような見え方になる */
    text-shadow: 2px 2px 0 #00c2ff, 4px 4px 0 rgba(17, 17, 17, 0.18);
}

:root[data-theme="sparkle"] input[type="email"],
:root[data-theme="sparkle"] input[type="text"] {
    border-width: 2px;
}

:root[data-theme="sparkle"] .button {
    background: linear-gradient(100deg, #ff1f8f, #ffd93d, #00c2ff, #ff1f8f);
    background-size: 300% 100%;
    color: #111111;
    border: 2px solid var(--border);
    box-shadow: 4px 4px 0 var(--border);
}

:root[data-theme="sparkle"] .button.is-secondary {
    background: var(--surface);
    box-shadow: 4px 4px 0 var(--border);
}

:root[data-theme="sparkle"] .button:active {
    /* 押し込んだぶん影を詰める */
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--border);
}

@media (prefers-reduced-motion: no-preference) {
    :root[data-theme="sparkle"] main::after {
        animation: confetti 3.2s ease-in-out infinite;
    }

    :root[data-theme="sparkle"] main::before {
        animation: halftone 9s linear infinite;
    }

    :root[data-theme="sparkle"] .button {
        animation: hue-slide 5s linear infinite;
    }

    :root[data-theme="sparkle"] .badge {
        animation: wobble 3.6s ease-in-out 0.6s infinite;
    }

    :root[data-theme="sparkle"] .intro .badge {
        animation: badge-in 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both,
        wobble 3.6s ease-in-out 0.6s infinite;
    }
}

@keyframes confetti {
    50% {
        opacity: 0.45;
        transform: translateY(5px);
    }
}

@keyframes halftone {
    to {
        background-position: 12px 12px;
    }
}

@keyframes hue-slide {
    to {
        background-position: 300% 0;
    }
}

@keyframes wobble {
    25% {
        transform: rotate(-6deg);
    }
    75% {
        transform: rotate(6deg);
    }
}

/* ---- cookie consent ----
 *系列サイト(cookie-policy.css)と同じ寸法と配色。配色は系列サイトに揃えてテーマでは変えない
 *開閉はスクリプトを使わず、設定画面は:target、説明はdetailsで開く
 */
#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    /* 本文の列からはみ出さない */
    max-width: var(--page-width);
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    padding: 16px;
    overflow-y: auto;
}

/* バナーがQR画面の下端や電話表示のボタンに被らないよう、出ている間だけ下に逃がす */
body:has(#cookie-consent-banner) {
    padding-bottom: 136px;
}

.cookie-banner-container {
    display: flex;
    flex-direction: column;
    gap: 13px;
    justify-content: center;
}

.cookie-text {
    font-size: 0.875rem;
    color: #000;
    text-align: center;
    margin: 0;
}

.cookie-link {
    text-decoration: underline;
    color: #000;
    font-size: 0.875rem;
}

.cookie-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.cookie-buttons {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.cookie-button-outline,
.cookie-button-solid {
    display: inline-flex;
    align-items: center;
    padding: 4px 20px;
    height: 32px;
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 400;
    margin: 0;
    text-decoration: none;
}

.cookie-button-outline {
    background: #fff;
    border: 1px solid #000;
    color: #000;
}

.cookie-button-solid {
    background: #000;
    border: 1px solid #000;
    color: #fff;
}

.cookie-button-link {
    background: none;
    border: none;
    padding: 0;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    text-decoration: underline;
    color: #000;
}

.cookie-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2100;
    justify-content: center;
    align-items: center;
}

.cookie-modal:target {
    display: flex;
}

/* 開いている間は背面をスクロールさせない */
html:has(#cookie-settings:target) {
    overflow: hidden;
}

.cookie-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}

.cookie-modal__content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: calc(100% - 64px);
    max-width: 320px;
    max-height: 70vh;
    margin: 0;
    overflow: hidden;
    background: #fff;
    color: #171717;
    border-radius: 16px;
}

.cookie-modal__header {
    position: relative;
    flex-shrink: 0;
    padding: 16px 20px;
    text-align: center;
}

.cookie-modal__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #171717;
}

.cookie-modal__close {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    display: flex;
    fill: #0000008a;
}

.cookie-modal__body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 24px 24px;
    font-size: 0.75rem;
    line-height: 1.4;
}

.cookie-modal__body > p {
    margin: 0;
}

.cookie-modal__divider {
    height: 0.8px;
    background-color: #000;
    border: none;
    margin: 16px 0;
}

.cookie-modal-accordion {
    position: relative;
    padding: 4px 0;
}

.cookie-modal-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 24px;
    /* 説明を開く矢印の分だけ右を空ける */
    padding-right: 32px;
    cursor: pointer;
}

.cookie-modal-accordion-label {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
}

/* 矢印だけをsummaryにする。チェック欄までsummaryに入れると、チェックで説明も開閉してしまう */
.cookie-modal-accordion summary {
    position: absolute;
    top: 4px;
    right: 0;
    display: flex;
    list-style: none;
    fill: #0000008a;
    cursor: pointer;
}

.cookie-modal-accordion summary::-webkit-details-marker {
    display: none;
}

.cookie-modal-accordion details[open] summary {
    transform: scaleY(-1);
}

.cookie-modal-accordion-content {
    margin: 0;
    padding-top: 16px;
    font-size: 0.75rem;
}

.cookie-modal input[type="checkbox"].custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 2px solid #000;
    background: #fff center / 12px 12px no-repeat;
    cursor: pointer;
}

/*
 *「すべて同意」に付いている間は各欄も付いて見せる。送信を受けたサーバが全項目に広げるので見た目と結果は一致する
 *個別の欄は外せないように押せなくする
 */
.cookie-modal input[type="checkbox"].custom-checkbox:checked,
.cookie-modal:has(input[name="agreeAll"]:checked) .cookie-modal-accordion .custom-checkbox {
    background-color: #000;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
}

.cookie-modal:has(input[name="agreeAll"]:checked) .cookie-modal-accordion .custom-checkbox {
    pointer-events: none;
}

.cookie-modal input[type="checkbox"].custom-checkbox:disabled {
    cursor: default;
}

.cookie-modal__footer {
    display: flex;
    flex-shrink: 0;
    height: 48px;
}

.cookie-modal-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.cookie-modal-btn-cancel {
    background-color: rgba(0, 0, 0, 0.1);
    color: #171717;
}

.cookie-modal-btn-confirm {
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
}

/* ---- terms, privacy, cookie policy ---- */

/* 寸法は系列サイトの規約画面に揃える。節の中は見出しと段落を詰めて並べる */
.policy {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 30px 22px 40px;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0.35px;
    overflow-wrap: anywhere;
}

.policy h2 {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
}

.policy p {
    margin: 0;
}

.policy ul {
    margin: 0;
    padding-left: 1.2em;
}

.policy li + li {
    margin-top: 4px;
}

/* 項番を本文に「(1)」と書いているので記号は付けない */
.policy .policy-items {
    padding-left: 0;
    list-style: none;
}

.policy .policy-items li + li {
    margin-top: 0;
}

.policy a {
    color: var(--primary);
    text-decoration: underline;
}

.policy-signature {
    font-weight: 600;
}

.policy-table-wrap {
    overflow-x: auto;
}

/* 本文の長いURL用の折り返しが効くと、クッキー名が途中で割れて列が詰まる */
.policy-table {
    overflow-wrap: normal;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 18px;
}

.policy-table th,
.policy-table td {
    padding: 8px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.policy-table th {
    background: var(--band);
    font-weight: 600;
    white-space: nowrap;
}

.policy-note,
.policy-updated {
    font-size: 12px;
    color: var(--text-muted);
}

.policy-updated {
    text-align: right;
}

.footer-menu a {
    color: inherit;
    text-decoration: none;
}

/* ---- faq ----
 *系列サイトと同じ、質問だけのカードを並べて押すと開く形
 *開閉はdetailsに任せる。キーボード操作と検索時の自動展開もブラウザがやってくれる
 */

.faq {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 30px 12px 40px;
}

.faq-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-section h2 {
    margin: 0;
    padding: 0 4px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
    letter-spacing: 0.35px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    overflow: hidden;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.08);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0.35px;
}

.faq-item summary {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

/* Safariは三角の印をlist-styleでは消せない */
.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-q {
    flex: 0 0 auto;
    color: var(--primary);
}

.faq-question {
    flex: 1 1 auto;
}

.faq-item summary .icon {
    margin-top: 2px;
    color: var(--text-copyright);
}

.faq-item[open] summary .icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 8px 16px 16px;
    color: var(--text-footer);
}

.faq-answer p {
    margin: 0;
}

.faq-answer p + p {
    margin-top: 6px;
}

@media (prefers-reduced-motion: no-preference) {
    .faq-item summary .icon {
        transition: transform 0.2s;
    }

    .faq-item[open] .faq-answer {
        animation: fade 0.2s ease-out;
    }
}

/* ---- guide ---- */

.guide {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 32px var(--gutter) 60px;
    list-style: none;
}

.guide-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0 16px;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.4px;
    text-align: center;
}

/* 手順の間をつなぐ縦線 */
.guide-step + .guide-step::before {
    content: "";
    width: 1px;
    height: 24px;
    margin: 32px 0;
    background: var(--border);
}

/* 配色に関わらず同じ見え方にするため、テーマの色ではなくデザインの値をそのまま使う */
.guide-step-label {
    padding: 2px 8px;
    border-radius: 9999px;
    background: #222222;
    color: var(--badge);
}

.guide-step h2 {
    margin: 8px 0 12px;
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
}

/* アイコンは黒線で描かれているので、暗い配色でも見えるよう白地を敷く */
.guide-icon {
    display: block;
    border-radius: 12px;
    background: #ffffff;
}

.guide-step p {
    margin: 12px 0 0;
}

.guide-step p + p {
    margin-top: 20px;
}
