/* ==========================================================================
   購入者の座席図（docs/seat-system-design.md 12.3・12.6）。手書きの CSS（style.scss には足さない）。
   - 購入フォーム（reservation/index.blade.php）の「座席表」の欄・チケットカードの座席の決め方・座席を選ぶ全画面のダイアログ、
     予約の詳細（reservation/show.blade.php）の「座席の位置を見る」。座席図そのものの見た目は seating.css。
   - サイトの既存の見た目に合わせる：地は #111・カードは #222、白の文字、細い線、アクセントは #0092ca。
     金色・グラデーションは使わない。動きは控えめ（prefers-reduced-motion では付けない）。まずスマートフォンの幅。
   - 状態は色だけに頼らない（文字・枠・×・✓）。押す所は 44px 以上。
   ========================================================================== */

/* 日本語の行の折り返しを文節で（対応していないブラウザは今までどおり） */
.seat-picker,
.seat-pick,
.seat-dialog,
.rd-seat-view { word-break: auto-phrase; }

/* ボタンの文字は中央に（ダイアログの左寄せ・ページの既定を受けない） */
.seat-picker__expand,
.seat-picker__retry,
.seat-view__retry,
.seat-pick__mode-btn,
.seat-pick__open,
.seat-pick__change,
.seat-dialog__view-btn,
.seat-dialog__cancel,
.seat-dialog__confirm,
.rd-seat-view__actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* --- 座席表の欄（チケットの一覧の上） --------------------------------------- */
.seat-picker {
    margin: 0 0 24px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: #181818;
    color: #eef0f4;
}
.seat-picker__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.seat-picker__title {
    margin: 0;
    font-size: 1em;
    font-weight: 700;
    letter-spacing: .04em;
}
.seat-picker__expand,
.seat-picker__retry,
.seat-view__retry {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: .85em;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}
.seat-picker__expand:hover,
.seat-picker__retry:hover,
.seat-view__retry:hover { border-color: rgba(255, 255, 255, .6); }
.seat-picker__expand:focus-visible,
.seat-picker__retry:focus-visible,
.seat-view__retry:focus-visible { outline: 2px solid #79d2f4; outline-offset: 2px; }
.seat-picker__legend { margin-bottom: 12px; }
.seat-picker__legend .seat-map__legend,
.seat-dialog__legend .seat-map__legend,
.rd-seat-view .seat-map__legend { gap: 6px 14px; font-size: 12px; }
.seat-picker__overview { min-height: 120px; }
.seat-picker__overview .seat-map { --sm-min-height: 200px; --sm-max-height: 56vh; }
.seat-picker__loading,
.seat-picker__error,
.seat-view__loading,
.seat-view__error {
    margin: 0;
    padding: 24px 0;
    color: #a3acb8;
    font-size: .85em;
    text-align: center;
}
.seat-picker__error,
.seat-view__error { color: #ffc9cf; }
.seat-picker__hint,
.seat-picker__noscript {
    margin: 12px 0 0;
    color: #a3acb8;
    font-size: .75em;
    line-height: 1.7;
}

/* --- チケットカード：エリアの印・座席の決め方 ----------------------------------- */
.checkout-tickets .ticket-card[data-seat-ticket] { flex-wrap: wrap; }
.checkout-tickets .ticket-card[data-seat-ticket] > noscript { flex: 0 0 100%; }
.seat-pick-area {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: -4px 0 8px;
    color: #d6dae0;
    font-size: .75em;
    line-height: 1.5;
}
.seat-pick-area__item { display: inline-flex; align-items: center; gap: 6px; }
.seat-pick-area__swatch {
    flex: none;
    width: 12px;
    height: 12px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 3px;
    background: var(--seat-area-color, #737b87);
}
.seat-pick {
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .85em;
    line-height: 1.6;
}
.seat-pick[hidden],
.seat-pick [hidden] { display: none !important; }
/* hidden の seat_ids を入れるだけの箱（display: none でも送信される）。空の箱で行間を空けない */
.seat-pick__inputs { display: none; }
.seat-pick__auto,
.seat-pick__note { margin: 0; color: #c9ced6; }
/* 連席・おまかせの残りの案内（色だけに頼らず、左の線で区切る） */
.seat-pick__note { padding-left: 10px; border-left: 3px solid #0092ca; color: #e6f4fa; }
.seat-pick__mode {
    display: inline-flex;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 10px;
    overflow: hidden;
}
.seat-pick__mode-btn {
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    background: transparent;
    color: #eef0f4;
    font: inherit;
    line-height: 1.3;
    cursor: pointer;
}
.seat-pick__mode-btn + .seat-pick__mode-btn { border-left: 1px solid rgba(255, 255, 255, .3); }
/* 選んでいる方：地と文字を入れ替える（色だけでなく、塗りと太さで分かる） */
.seat-pick__mode-btn[aria-pressed="true"] { background: #eef0f4; color: #111; font-weight: 700; }
.seat-pick__mode-btn:focus-visible,
.seat-pick__open:focus-visible,
.seat-pick__change:focus-visible { outline: 2px solid #79d2f4; outline-offset: 2px; }
.seat-pick__open {
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: #0092ca;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.seat-pick__open:hover { background: #0a83b3; }
.seat-pick__chosen {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    background: rgba(255, 255, 255, .03);
}
.seat-pick__chosen-text { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.seat-pick__chosen-label { color: #a3acb8; font-size: .85em; }
.seat-pick__chosen-seats { color: #fff; font-weight: 700; overflow-wrap: anywhere; }
.seat-pick__chosen-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.seat-pick__timer {
    color: #c9ced6;
    font-family: "Thasadith", "Seat Map Thasadith", "Helvetica Neue", Arial, sans-serif;
    font-variant-numeric: tabular-nums;
}
.seat-pick__change {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: .9em;
    cursor: pointer;
}
.seat-pick__message {
    margin: 0;
    padding: 8px 10px;
    border-left: 3px solid #0092ca;
    background: rgba(0, 146, 202, .08);
    color: #e6f4fa;
    outline: none;
}
.seat-pick__message[data-kind="error"] {
    border-left-color: #d63447;
    background: rgba(214, 52, 71, .1);
    color: #ffd8dc;
}
.seat-pick__noscript { margin: 8px 0 0; color: #ffd8dc; font-size: .8em; }

/* --- 座席を選ぶ（全画面のダイアログ） ------------------------------------------ */
html.seat-dialog-open { overflow: hidden; }
.seat-dialog {
    position: fixed;
    text-align: left;
    inset: 0;
    width: 100%;
    max-width: 100vw;
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: #111;
    color: #eef0f4;
    overscroll-behavior: contain;
    /* <dialog> の無いブラウザ（iOS Safari 15.3 まで）では最前面（top layer）に出ないので、固定のヘッダー（9999）・
       チャット（9999）・特権ログインの帯（10000）より上に置く（× が隠れないように）。showModal で開いたときは効かない */
    z-index: 10001;
}
/* 閉じているときは出さない。<dialog> の無いブラウザでは、ただの要素として open 属性が無くても表示されるため（<dialog> は元から隠れる） */
.seat-dialog:not([open]) { display: none; }
.seat-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.seat-dialog [hidden] { display: none !important; }
.seat-dialog__inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1100px;
    height: 100%;
    margin: 0 auto;
}
.seat-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: max(10px, env(safe-area-inset-top)) 16px 8px;
}
.seat-dialog__titles { min-width: 0; }
.seat-dialog__title { margin: 0; font-size: 1.05em; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.seat-dialog__status { margin: 2px 0 0; color: #c9ced6; font-size: .85em; line-height: 1.5; }
.seat-dialog__close {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.seat-dialog__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 0 16px 8px;
}
.seat-dialog__views { display: inline-flex; border: 1px solid rgba(255, 255, 255, .3); border-radius: 10px; overflow: hidden; }
.seat-dialog__view-btn {
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    background: transparent;
    color: #eef0f4;
    font: inherit;
    font-size: .85em;
    cursor: pointer;
}
.seat-dialog__view-btn + .seat-dialog__view-btn { border-left: 1px solid rgba(255, 255, 255, .3); }
.seat-dialog__view-btn[aria-pressed="true"] { background: #eef0f4; color: #111; font-weight: 700; }
.seat-dialog__legend { flex: 1 1 260px; min-width: 0; font-size: .85em; }
.seat-dialog__legend > summary {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    color: #c9ced6;
    cursor: pointer;
    list-style: none;
}
.seat-dialog__legend > summary::-webkit-details-marker { display: none; }
.seat-dialog__legend > summary::before { content: "＋"; margin-right: 6px; }
.seat-dialog__legend[open] > summary::before { content: "−"; }
.seat-dialog__legend-body { padding: 4px 0 2px; }
.seat-dialog__notice {
    margin: 0 16px 8px;
    padding: 8px 10px;
    border-left: 3px solid #0092ca;
    background: rgba(0, 146, 202, .08);
    color: #e6f4fa;
    font-size: .85em;
    line-height: 1.6;
}
.seat-dialog__notice[data-kind="error"] { border-left-color: #d63447; background: rgba(214, 52, 71, .12); color: #ffd8dc; }
.seat-dialog__body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 8px;
}
.seat-dialog__map { flex: 1 1 auto; min-height: 0; display: flex; }
.seat-dialog__map > .seat-map { flex: 1 1 auto; min-width: 0; min-height: 0; }
.seat-dialog__list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 4px 8px 16px;
    -webkit-overflow-scrolling: touch;
}
.seat-dialog__foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 16px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, .1);
    background: #111;
}
.seat-dialog__chosen { margin: 0; font-size: .85em; line-height: 1.6; overflow-wrap: anywhere; }
.seat-dialog__actions { display: flex; gap: 10px; }
.seat-dialog__cancel,
.seat-dialog__confirm {
    flex: 1 1 0;
    min-height: 48px;
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.seat-dialog__cancel { border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: #fff; }
.seat-dialog__confirm { border: 0; background: #0092ca; color: #fff; }
.seat-dialog__confirm:disabled { background: #3a3d42; color: #a3acb8; cursor: default; }
.seat-dialog :is(.seat-dialog__close, .seat-dialog__view-btn, .seat-dialog__cancel, .seat-dialog__confirm, summary):focus-visible {
    outline: 2px solid #79d2f4;
    outline-offset: 2px;
}

/* 一覧から選ぶ（階 → 区画 → 列。状態は文字でも示す） */
.seat-list__floor + .seat-list__floor { margin-top: 20px; }
.seat-list__floor-title { margin: 0 0 8px; font-size: .95em; font-weight: 700; }
.seat-list__block + .seat-list__block { margin-top: 14px; }
.seat-list__block-title { margin: 0 0 6px; color: #c9ced6; font-size: .85em; font-weight: 700; }
.seat-list__row {
    display: grid;
    grid-template-columns: 3.4em 1fr;
    align-items: start;
    gap: 6px;
    padding: 6px 0;
    border-top: 1px solid rgba(255, 255, 255, .06);
}
.seat-list__row-label { padding-top: 12px; color: #a3acb8; font-size: .8em; }
.seat-list__seats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.seat-list__seat {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 48px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 8px;
    background: #1d1f23;
    color: #fff;
    font: inherit;
    line-height: 1.2;
    cursor: pointer;
}
.seat-list__number { font-family: "Thasadith", "Seat Map Thasadith", "Helvetica Neue", Arial, sans-serif; font-size: 1em; font-weight: 700; }
.seat-list__state { margin-top: 2px; color: #a3acb8; font-size: .65em; }
.seat-list__seat[aria-pressed="true"] { border: 2px solid #fff; background: #0092ca; }
.seat-list__seat[aria-pressed="true"] .seat-list__state { color: #fff; }
.seat-list__seat:disabled { border-style: dashed; background: transparent; color: #7d8693; cursor: default; }
.seat-list__seat:disabled .seat-list__number { text-decoration: line-through; }
.seat-list__seat:focus-visible { outline: 2px solid #79d2f4; outline-offset: 2px; }
.seat-list__empty { margin: 24px 0; color: #a3acb8; font-size: .85em; text-align: center; }

/* スマートフォンの幅：欄の拡大縮小のボタンは出さない（2 本指か「拡大して見る」で大きく見る） */
@media (max-width: 599px) {
    .seat-picker { padding: 12px; }
    .seat-picker__overview .seat-map__zoom { display: none; }
}
@media (min-width: 768px) {
    .seat-picker { padding: 20px; }
    .seat-dialog__head { padding: 16px 24px 10px; }
    .seat-dialog__tools { padding: 0 24px 10px; }
    .seat-dialog__notice { margin: 0 24px 10px; }
    .seat-dialog__body { padding: 0 16px; }
    .seat-dialog__foot { flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 24px 16px; }
    .seat-dialog__actions { flex: none; }
    .seat-dialog__cancel,
    .seat-dialog__confirm { flex: none; min-width: 160px; }
}

/* --- 予約の詳細：座席の位置を見る ------------------------------------------------ */
.rd-seat-view { margin-top: 16px; padding: 0 20px; }
.rd-seat-view > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 16px 0;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}
.rd-seat-view > summary::-webkit-details-marker { display: none; }
.rd-seat-view > summary svg { width: 16px; height: 16px; flex: none; color: #a3acb8; }
.rd-seat-view[open] > summary svg { transform: rotate(180deg); }
.rd-seat-view > summary:focus-visible { outline: 2px solid #79d2f4; outline-offset: 2px; }
/* 列は 1 本（minmax(0, 1fr)）。auto だと、座席図の枠の縦横比と最小の高さから決まる幅で、スマートフォンの幅をはみ出す */
.rd-seat-view__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0 0 20px; border-top: 1px solid rgba(255, 255, 255, .08); }
.rd-seat-view__body > * { min-width: 0; }
/* 960px 未満の詳細は縦に並べ替えている（reservation-detail.css）。入場の集計（order: 1）の後ろに置く */
@media (max-width: 959.98px) {
    .rd-admission > .rd-seat-view { order: 1; }
}
.rd-seat-view__seats { margin: 12px 0 0; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.rd-seat-view__map .seat-map { --sm-min-height: 220px; --sm-max-height: 60vh; }
.rd-seat-view__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rd-seat-view__actions button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.rd-seat-view__actions button:focus-visible { outline: 2px solid #79d2f4; outline-offset: 2px; }
.rd-seat-view__noscript { margin: 0; color: #a3acb8; font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
    .rd-seat-view > summary svg { transition: none; }
}
@media (forced-colors: active) {
    .seat-pick__mode-btn[aria-pressed="true"],
    .seat-dialog__view-btn[aria-pressed="true"],
    .seat-list__seat[aria-pressed="true"] { outline: 2px solid Highlight; }
}
