/**
 * キオスク共有（/ · /a · /approve）— テーマ E ライト
 * セレクタ・class 名は既存 JS 参照のため維持。色は theme.css トークンのみ。
 */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.5;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

h1 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
}

.sub {
  color: var(--sub);
  font-size: 0.92rem;
  margin: 0 0 24px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.user-code {
  font-size: 2.2rem;
  letter-spacing: 0.18em;
  font-weight: 700;
  text-align: center;
  padding: 12px 0 4px;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

.hint {
  color: var(--sub);
  font-size: 0.85rem;
  text-align: center;
}

#qr {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: fit-content;
  min-width: 244px;
  min-height: 244px;
  margin: 12px auto;
  box-shadow: var(--shadow);
}

#qr img,
#qr canvas {
  display: block;
  width: 220px;
  height: 220px;
}

/* ---- 受付画面 CHK-01 F案（#venue-view） ---- */
/* 二面構成: 左=ブランド / 右=動作。分割線なし・左色が右へ薄まるグラデ */
/* 会場表示中はページ見出し・フッタを隠し、画面全体を受付に使う */
main:has(#venue-view:not(.hidden)) {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main:has(#venue-view:not(.hidden)) > #page-title,
main:has(#venue-view:not(.hidden)) > #page-sub,
main:has(#venue-view:not(.hidden)) > footer {
  display: none;
}

#venue-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: linear-gradient(
    90deg,
    var(--venue-bg-left) 0%,
    var(--venue-bg-left) 42%,
    var(--venue-bg-mid) 62%,
    var(--venue-bg-right) 82%,
    var(--card) 100%
  );
  color: var(--ink);
}

#venue-view.hidden {
  display: none !important;
}

.venue-shell {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  position: relative;
  box-sizing: border-box;
}

/* 左: ブランド面 — 背景は #venue-view のグラデに任せ、装飾グロウのみ */
.venue-brand-side {
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.venue-brand-side::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--venue-glow-orange), transparent 70%);
  top: 6%;
  left: 0;
  pointer-events: none;
}

.venue-brand-side::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--venue-glow-green), transparent 70%);
  bottom: 6%;
  right: -20px;
  pointer-events: none;
}

/* 日時: 左面最上段・52px 級 */
.venue-clock {
  position: relative;
  z-index: 1;
  margin-bottom: 28px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--logo-ink);
}

.venue-clock-time {
  display: block;
  font-size: 52px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--primary);
}

.venue-clock-date {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  font-weight: 500;
  color: var(--sub);
  letter-spacing: 0.04em;
}

.venue-brand-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 420px;
}

.venue-logo-mark {
  width: 420px;
  max-width: 100%;
}

.venue-logo {
  width: 100%;
  height: auto;
  display: block;
}

.venue-site-block {
  position: relative;
  z-index: 1;
  margin-top: 36px;
  text-align: center;
  width: 100%;
  max-width: 420px;
  padding: 0 12px;
  min-height: 2.8em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
}

/* 記録先が空なら非表示（架空名を焼き込まない） */
.venue-site-name:empty {
  display: none;
}

/*
  記録先（事業所 · 拠点）= API 値。clamp + 最大2行 + 超過省略で長名に耐える（M-05）
  例: 「サンプル放課後等デイサービス · おひさま教室」
*/
.venue-site-name {
  font-size: clamp(16px, 2.8vw, 28px);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/*
  ::before の attr(data-site-name) による描画は廃止（2026-08-06 · #197）。
  属性を埋める実装が無く、常に空のままだった（＝記録先が一度も出ていない）。
  描画は kiosk.js の textContent へ一本化する。読み上げにも確実に載る。
*/

/* 右: 動作面 */
.venue-action-side {
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 40px 80px;
  min-width: 0;
  box-sizing: border-box;
  text-align: center;
}

.venue-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--secondary);
  margin-bottom: 10px;
}

.venue-action-title {
  margin: 0 0 28px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.02em;
  line-height: 1.45;
}

#venue-view #venue-status {
  margin: 12px 0 0;
  font-size: 15px;
  min-height: 1.4em;
}

#venue-view #venue-status:empty {
  display: none;
}

/* QR: 白カードのみ強調。タップで 60 秒キープ */
#venue-view #venue-qr {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  box-shadow: var(--venue-shadow);
  box-sizing: border-box;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#venue-view #venue-qr:hover {
  border-color: rgba(255, 135, 79, 0.45);
}

#venue-view #venue-qr:focus-visible {
  outline: 3px solid rgba(255, 135, 79, 0.55);
  outline-offset: 3px;
}

/* キープ中: 枠を強調して「止まっている」ことを示す */
#venue-view #venue-qr.is-held {
  border-color: #ff874f;
  box-shadow:
    var(--venue-shadow),
    0 0 0 4px rgba(255, 135, 79, 0.22);
}

/* #505 D-CR(5): カメラ待機（出席カードで出席）。
   #venue-view.is-camera で会場 QR を隠し、前面カメラ枠を出す。
   色・角丸・影はトークンのみ。表示切替は kiosk.js。既定は hidden。 */
#venue-view.is-camera #venue-qr,
#venue-view.is-camera #venue-expires,
#venue-view.is-camera .venue-foot {
  display: none;
}

.card-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.card-stage-frame {
  position: relative;
  width: min(320px, 70vw);
  aspect-ratio: 1 / 1;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--venue-shadow);
  overflow: hidden;
  box-sizing: border-box;
}

.card-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.card-stage-guide {
  position: absolute;
  inset: 12%;
  border: 3px solid var(--secondary);
  border-radius: 16px;
  opacity: 0.75;
  pointer-events: none;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.card-stage-guide.is-hit {
  border-color: var(--ok-fg);
  opacity: 1;
}

.card-stage-lead {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}

.card-result,
.card-choice,
.card-fail,
.card-camera-fail {
  width: 100%;
  box-sizing: border-box;
  padding: 20px 20px 16px;
  border-radius: var(--radius);
  text-align: center;
}

.card-result {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.card-fail {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.card-choice {
  background: var(--card);
  border: 2px solid var(--line);
}

.card-camera-fail {
  background: var(--card);
  border: 2px solid var(--line);
  color: var(--ink);
}

.card-result-greeting {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.card-result-name {
  margin: 8px 0 0;
  font-size: 24px;
  font-weight: 700;
}

.card-result-meta {
  margin: 8px 0 0;
  font-size: 14px;
  opacity: 0.85;
}

/* ---- #532: 読み取り結果は 1 枚の面として画面いっぱいに見せる -------------------
   受付は離れた位置から見るので、結果はカメラ枠の中に収めず面ごと切り替える。
   カメラ映像・案内文は結果の間だけ退く。 */
.card-stage.is-result {
  max-width: none;
  width: 100%;
}

.card-stage.is-result .card-stage-frame,
.card-stage.is-result .card-stage-lead {
  display: none;
}

.card-stage.is-result .card-result {
  min-height: min(58vh, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 32px 24px 28px;
  cursor: pointer;
}

.card-stage.is-result .card-result-greeting {
  font-size: 28px;
}

.card-stage.is-result .card-result-name {
  font-size: 40px;
  line-height: 1.2;
}

.card-stage.is-result .card-result-meta {
  font-size: 16px;
}

/* 進む導線。押さなくても数秒で進むので、主張しすぎない */
.card-result-go {
  margin: 20px 0 0;
  min-height: 56px;
  padding: 0 40px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 999px;
  border: 2px solid currentColor;
  background: var(--card);
  color: var(--ok-fg);
  cursor: pointer;
}

/* #530: 次に何が起きるかの予告。結果と同じカードの中で、少し弱く */
.card-result-next {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid currentColor;
  font-size: 15px;
  font-weight: 600;
  opacity: 0.9;
}

/* #530: 読み取ってからサーバの応答が返るまでの手応え。
   受付は近づけてすぐ離す動きなので、点滅ではなく「進んでいる」形にする */
.card-reading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: var(--th-bg);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.card-reading-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--secondary);
  animation: card-reading-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes card-reading-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 動きを減らす設定では回さない（ADR 0001 の横断規律） */
@media (prefers-reduced-motion: reduce) {
  .card-reading-dot {
    animation: none;
    border-top-color: var(--secondary);
  }
}

.card-choice-lead {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.card-choice-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-choice-actions button {
  min-height: 56px;
  font-size: 17px;
}

.card-fail-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.card-fail-body {
  margin: 8px 0 0;
  font-size: 15px;
}

.card-camera-fail-lead {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.card-camera-fail-body {
  margin: 8px 0 12px;
  font-size: 14px;
  color: var(--sub);
}

.card-camera-fail button {
  min-height: 44px;
}

#venue-view #venue-qr img,
#venue-view #venue-qr canvas {
  display: block;
  width: 200px;
  height: 200px;
  max-width: min(200px, 56vw);
  max-height: min(200px, 56vw);
  pointer-events: none;
}

#venue-view .venue-expires {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--sub);
  text-align: center;
  max-width: 28rem;
}

#venue-view #venue-qr.is-held ~ .venue-expires {
  color: #c45a20;
  font-weight: 600;
}

#venue-view .venue-expires:empty {
  display: none;
}

/* QR 下の補助文: 主操作（QR）より一段落とす */
.venue-foot {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted, var(--sub));
  line-height: 1.55;
  max-width: 20rem;
  opacity: 0.9;
}

/* 手動記録: 短いラベル＋ hint。QR と競合しない副次帯 */
.venue-manual-block {
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.venue-manual-btn {
  min-height: 44px;
  min-width: 10rem;
  width: auto;
  max-width: 16rem;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 500;
}

.venue-manual-hint {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted, var(--sub));
  line-height: 1.4;
  opacity: 0.85;
}

/* #209: 後回しにした状態質問の再開帯（名前で記録と同列・副次） */

/* 互換: 旧 .venue-help が残る場合 */
.venue-help {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted, var(--sub));
  line-height: 1.55;
  max-width: 20rem;
}

/* 職員導線: 右下固定の歯車 → ポップオーバー（44px 以上・M-06） */
.venue-staff {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* venue-view が hidden のときは歯車も出さない */
body:not(:has(#venue-view:not(.hidden))) .venue-staff {
  display: none;
}

.venue-staff-trigger {
  width: 44px;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--venue-staff-muted);
  box-shadow: none;
  flex: none;
  opacity: 0.55;
}

.venue-staff-trigger::after {
  display: none;
}

.venue-staff-trigger:hover:not(:disabled) {
  filter: none;
  opacity: 0.95;
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink);
  border: none;
}

.venue-staff-icon {
  display: block;
}

.venue-staff-popover {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
  max-width: min(280px, calc(100vw - 32px));
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.venue-staff-popover.hidden {
  display: none !important;
}

.venue-staff-popover > button {
  flex: none;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.venue-staff-popover .venue-device-meta {
  margin: 4px 0 0;
  font-size: 12px;
  word-break: break-all;
  text-align: left;
}

/* タブレット横 1024 未満〜狭幅: 縦積み（375px で横スクロールなし） */
@media (max-width: 900px) {
  #venue-view {
    background: linear-gradient(
      180deg,
      var(--venue-bg-left) 0%,
      var(--venue-bg-left) 38%,
      var(--venue-bg-mid) 58%,
      var(--venue-bg-right) 78%,
      var(--card) 100%
    );
  }

  .venue-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .venue-brand-side {
    padding: 28px 20px 16px;
  }

  .venue-brand-side::before,
  .venue-brand-side::after {
    width: 220px;
    height: 220px;
  }

  .venue-clock {
    margin-bottom: 16px;
  }

  .venue-clock-time {
    font-size: 40px;
  }

  .venue-clock-date {
    font-size: 16px;
  }

  .venue-logo-mark {
    width: min(320px, 88vw);
  }

  .venue-site-block {
    margin-top: 20px;
  }

  .venue-action-side {
    padding: 24px 20px 88px;
  }

  .venue-action-title {
    font-size: 20px;
    margin-bottom: 20px;
  }
}

@media (max-width: 400px) {
  .venue-brand-side {
    padding: 20px 16px 12px;
  }

  .venue-clock-time {
    font-size: 36px;
  }

  .venue-clock-date {
    font-size: 14px;
  }

  .venue-action-side {
    padding: 16px 14px 88px;
  }

  .venue-action-title {
    font-size: 18px;
  }

  #venue-view #venue-qr {
    padding: 14px;
  }

  #venue-view #venue-qr img,
  #venue-view #venue-qr canvas {
    width: 180px;
    height: 180px;
    max-width: min(180px, 70vw);
    max-height: min(180px, 70vw);
  }

  .venue-foot {
    font-size: 12px;
  }

  .venue-manual-btn {
    font-size: 0.9rem;
  }

  .venue-help {
    font-size: 11px;
  }
}

.status {
  text-align: center;
  font-size: 0.95rem;
  color: var(--sub);
}

.status.ok {
  color: var(--ok-fg);
}

.status.err {
  color: var(--danger-fg);
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--sub);
  margin-bottom: 6px;
  font-weight: 500;
}

input {
  width: 100%;
  min-height: var(--btn-min);
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--btn-bd);
  background: var(--card);
  color: var(--ink);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  font-family: inherit;
  font-weight: 400;
}

input:focus-visible,
button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

button {
  appearance: none;
  border: 0;
  border-radius: var(--radius);
  min-height: var(--btn-min);
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: var(--primary);
  color: var(--navon-fg);
}

/* 主 CTA の強調帯（1画面1箇所想定） */
button:not(.secondary):not(.att-opt) {
  box-shadow: none;
  position: relative;
}

button:not(.secondary):not(.att-opt)::after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--aline);
  pointer-events: none;
}

button.secondary {
  background: var(--card);
  border: 1px solid var(--btn-bd);
  color: var(--ink);
  font-weight: 500;
  box-shadow: none;
}

button.secondary::after {
  display: none;
}

button.secondary:hover:not(:disabled) {
  border-color: var(--btn-hover-bd);
}

button:hover:not(:disabled):not(.secondary):not(.att-opt) {
  filter: brightness(1.05);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.row button {
  flex: 1;
  min-width: 120px;
}

.hidden {
  display: none !important;
}

/* ---- 状態質問 CHK-04（モック 260725_3問画面 キオスク枠準拠） ---- */
/* 会場表示と同様、質問中は見出し・フッタを隠し全画面にする */
main:has(#questions-view:not(.hidden)) {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main:has(#questions-view:not(.hidden)) > #page-title,
main:has(#questions-view:not(.hidden)) > #page-sub,
main:has(#questions-view:not(.hidden)) > footer {
  display: none;
}

#questions-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fff9f1 100%);
  color: #333;
}

#questions-view.hidden {
  display: none !important;
}

/* #209: 上部 chrome — 主質問と分離。戻るは手動打刻と同語彙・同重さ */
.att-chrome {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  padding: 12px 16px 4px;
  min-height: 48px;
  box-sizing: border-box;
  z-index: 6;
}
.att-chrome .att-site {
  grid-column: 2;
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--sub);
  text-align: center;
  justify-self: center;
}
.att-chrome .att-queue {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  font-size: 0.75rem;
  color: var(--sub);
  opacity: 0.9;
  justify-self: start;
}
.att-chrome .att-queue.hidden {
  display: none !important;
}
.att-chrome .att-back {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  min-height: 44px;
  min-width: 44px;
  margin: 0;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--sub, #5c6570);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.att-chrome .att-back:hover:not(:disabled) {
  color: var(--ink, #333);
  background: rgba(0, 0, 0, 0.04);
}
.att-chrome .att-back:focus-visible {
  outline: 2px solid var(--primary, #e8913a);
  outline-offset: 2px;
}
.att-chrome .att-back:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.att-chrome .att-back.hidden {
  visibility: hidden;
  pointer-events: none;
}
@media (max-width: 520px) {
  .att-chrome {
    padding: 10px 12px 2px;
    gap: 4px 8px;
  }
  .att-chrome .att-back {
    font-size: 0.8rem;
    padding: 8px 10px;
  }
}

/* #209: 無操作の段階的案内（下部・主選択肢と被らない） */
.att-idle-banner {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(420px, calc(100% - 32px));
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(232, 145, 58, 0.28);
  box-shadow: 0 10px 28px rgba(156, 87, 22, 0.12);
  box-sizing: border-box;
  text-align: center;
}
.att-idle-banner.hidden {
  display: none !important;
}
.att-idle-msg {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink, #333);
  line-height: 1.45;
}
.att-idle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}
.att-idle-actions > button {
  flex: 1 1 auto;
  min-width: 7.5rem;
  min-height: 44px;
  margin: 0;
}
@media (max-width: 520px) {
  .att-idle-banner {
    bottom: 88px;
    width: calc(100% - 24px);
  }
}
/* トレイ非表示時は idle を少し下げる */
#questions-view:has(.att-tray.hidden) .att-idle-banner {
  bottom: 24px;
}

/* 状態質問（CHK-04）— タブレット・引き算寄り */
.att-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 24px 36px;
  text-align: center;
  position: relative;
  min-height: 0;
  box-sizing: border-box;
}

/* kicker: chrome 外に残る場合の互換（#questions-site は chrome 内） */
.att-site {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--sub);
}

.att-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 920px;
}

.att-body.hidden {
  display: none !important;
}

/* 誰か — 質問より一段手前で識別 */
.att-who {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0;
}

.att-q {
  margin: 0;
  font-size: clamp(1.45rem, 3.2vw, 1.85rem);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0;
  text-wrap: balance;
  line-height: 1.4;
  /* 製品本文と同じスタック。階層は weight・色で出す（教科書体・丸ゴに頼らない） */
  font-family: inherit;
}

.att-opts {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
}

.att-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 132px;
  min-height: 156px;
  padding: 16px 12px 12px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  box-shadow: none;
  /* 動きは最小: 枠と面だけ */
  transition: border-color 0.12s ease, background 0.12s ease, opacity 0.2s ease;
  position: relative;
}

.att-opt::after {
  display: none !important;
}

.att-opt:hover:not(:disabled) {
  border-color: var(--secondary);
  background: var(--th-bg);
  filter: none;
}

.att-opt:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
}

.att-opt:disabled {
  cursor: default;
  opacity: 1;
}

.att-opt img,
.att-opt .att-opt-icon {
  width: 112px;
  height: 112px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.att-opt.att-opt-tall img,
.att-opt.att-opt-tall .att-opt-icon {
  width: 96px;
  height: 140px;
}

.att-opt .att-lbl {
  /* 製品本文と同じスタック。見出し(.att-q)より weight と色を一段落とす */
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--sub);
}

/* 選択時: 拡大・多重影はしない。面と枠だけ */
.att-opts.picked .att-opt {
  opacity: 0.45;
}

.att-opts.picked .att-opt.sel {
  opacity: 1;
  border-color: var(--warm);
  background: var(--add-bg);
  box-shadow: none;
}

.att-opt.sel {
  border-color: var(--warm);
  background: var(--add-bg);
}

.att-opt.sel .att-lbl {
  color: var(--ink);
}

.att-prog {
  margin: 4px 0 0;
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: var(--secondary);
  font-weight: 600;
}

.att-prog .cur {
  color: var(--warm);
}

.att-status {
  min-height: 1.25em;
  margin: 0;
}

.att-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.att-done.hidden {
  display: none !important;
}

.att-done-title {
  font-size: clamp(1.5rem, 3.5vw, 1.9rem);
}

/* オーバーレイ: ピル＋強影をやめて控えめに */
.att-overlay {
  position: absolute;
  inset: 0;
  background: rgba(44, 62, 107, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 4;
}

.att-overlay.show {
  opacity: 1;
}

.att-overlay span {
  background: var(--card);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-app);
  box-shadow: var(--shadow);
  border: 1.5px solid var(--line);
  font-family: inherit;
}

/* ステップ切替は #175 の落下もちっ遷移（att-drop-* / att-toss-up / att-rise-in）が担う */

@media (prefers-reduced-motion: reduce) {
  .att-opt,
  .att-overlay {
    transition: none;
  }
}

@media (max-width: 720px) {
  .att-stage {
    padding: 20px 14px 28px;
    gap: 10px;
  }
  .att-body {
    gap: 14px;
  }
  .att-opt {
    min-width: 108px;
    min-height: 140px;
    padding: 14px 10px 12px;
  }
  .att-opt img,
  .att-opt .att-opt-icon {
    width: 88px;
    height: 88px;
  }
  .att-opt.att-opt-tall img,
  .att-opt.att-opt-tall .att-opt-icon {
    width: 80px;
    height: 120px;
  }
}

@media (min-width: 900px) and (min-height: 600px) {
  .att-stage {
    gap: 14px;
    padding: 32px 32px 40px;
  }
  .att-body {
    gap: 18px;
  }
  .att-who {
    font-size: 1.25rem;
  }
  .att-opt {
    min-width: 148px;
    min-height: 176px;
    padding: 18px 14px 14px;
    gap: 12px;
  }
  .att-opt img,
  .att-opt .att-opt-icon {
    width: 124px;
    height: 124px;
  }
  .att-opt .att-lbl {
    font-size: 1.1rem;
  }
  .att-q {
    font-size: clamp(1.55rem, 2.8vw, 1.95rem);
  }
  .att-prog {
    font-size: 1.1rem;
  }
}

select {
  width: 100%;
  min-height: var(--btn-min);
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--btn-bd);
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 400;
}

footer {
  margin-top: 28px;
  color: var(--sub);
  font-size: 0.78rem;
  text-align: center;
}

/* ---- 生徒チェックイン /a ---- */
.checkin-main {
  max-width: 480px;
  padding-top: 36px;
}

.checkin-panel {
  text-align: center;
  padding: 28px 20px 32px;
}

/* A3: パネル見出し（画面の仕事）。スタッフ呼びかけは .checkin-sublead */
.checkin-lead {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 8px;
  color: var(--ink);
}

/* #41 token 無し案内（#43 W-01 までの暫定） */
.checkin-guide-list {
  text-align: left;
  margin: 12px 0 0;
  padding-left: 1.35em;
  line-height: 1.55;
  font-size: 0.95rem;
  color: var(--ink-muted, var(--ink));
}

.checkin-guide-list li {
  margin-bottom: 0.75em;
}

.checkin-input {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 0.2em;
  padding: 16px 14px;
  margin-bottom: 4px;
}

.checkin-row {
  margin-top: 18px;
}

.checkin-btn {
  min-height: 56px;
  font-size: 1.2rem;
  padding: 16px 22px;
  border-radius: var(--radius);
  width: 100%;
}

/* CA-001: 未接続のパスキー入口。primary に見せず disabled 風（押下で準備中案内は維持） */
.checkin-btn-deferred {
  opacity: 0.55;
  cursor: default;
  font-weight: 500;
}

.checkin-btn-deferred:hover,
.checkin-btn-deferred:focus-visible {
  filter: none;
  border-color: var(--btn-bd);
}

.checkin-msg {
  margin-top: 18px;
  font-size: 1.1rem;
}

/* 結果の状態は色クラス＋文言。絵文字装飾は使わない */
.checkin-emoji {
  display: none;
}

.checkin-greeting {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 4px 0 10px;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.checkin-name {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 12px;
}

.checkin-detail {
  color: var(--sub);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
}

/* S11 CHK-03: 完了カードの時刻・入退表示 */
.checkin-meta {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.checkin-tap-hint {
  margin: 16px 0 0;
  font-size: 0.88rem;
  color: var(--sub);
}

/* A3: 2 行目 sub（スタッフ呼びかけ等）。見出しより一段落とす */
.checkin-sublead {
  margin: 0 0 8px;
  font-size: 0.98rem;
  font-weight: 400;
  color: var(--sub);
  line-height: 1.45;
}

/* S11 CHK-03: 完了カードはタップで即戻り */
.result-done-tap {
  cursor: pointer;
}

.result-done-tap:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 4px;
}

/* S11 CHK-07: スタッフ向け折りたたみ（生エラー格納） */
.staff-detail {
  margin-top: 14px;
  text-align: left;
  font-size: 0.82rem;
  color: var(--sub);
}

.staff-detail summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  min-height: 44px; /* CA-008: タッチ目安 44px */
  display: flex;
  align-items: center;
}

.staff-detail summary::-webkit-details-marker {
  display: none;
}

.staff-detail summary::before {
  content: "▸ ";
  color: var(--sub);
}

.staff-detail[open] summary::before {
  content: "▾ ";
}

.staff-detail-body {
  margin: 6px 0 0;
  padding: 10px 12px;
  background: var(--muted-bg, var(--th-bg));
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--ink);
  max-height: 8em;
  overflow: auto;
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 12px auto 0;
  border: 4px solid var(--line);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: checkin-spin 0.8s linear infinite;
}

@keyframes checkin-spin {
  to {
    transform: rotate(360deg);
  }
}

.result-enter .checkin-greeting,
.result-enter .checkin-name {
  color: var(--ok-fg);
}

.result-exit .checkin-greeting,
.result-exit .checkin-name {
  color: var(--primary);
}

.result-warn .checkin-greeting {
  color: var(--warn-fg);
}

.result-error .checkin-greeting {
  color: var(--danger-fg);
}

/* /a ヘッダー: wordmark（28–40px 帯） */
.checkin-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 16px;
  min-height: 40px;
}

.checkin-logo {
  display: block;
  height: 36px;
  width: auto;
  max-width: min(160px, 46vw);
  object-fit: contain;
}

.checkin-footer {
  margin-top: 28px;
  text-align: center;
}

.checkin-footer-brand {
  margin: 0;
  color: var(--muted, var(--sub));
  font-size: 0.7rem;
  opacity: 0.7;
}

/* 目立たない解除導線（主導線は QR → 入退室） */
.checkin-unlink {
  display: inline-block;
  margin-top: 10px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--sub);
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
  min-height: 44px;
}

.checkin-unlink:hover,
.checkin-unlink:focus-visible {
  color: var(--ink);
}

/* ---- スペーシング（CSP で inline style 排除） ---- */
.mt-4 {
  margin-top: 4px;
}
.mt-8 {
  margin-top: 8px;
}
.mt-10 {
  margin-top: 10px;
}
.mt-12 {
  margin-top: 12px;
}
.mt-14 {
  margin-top: 14px;
}
.mt-16 {
  margin-top: 16px;
}
.mb-14 {
  margin-bottom: 14px;
}
.tracking-code {
  letter-spacing: 0.12em;
}

/* D-W / D-X: 受付端末の手動打刻（名前選択 + 二段階確認） */
.manual-panel {
  position: relative;
}

.manual-title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
}

.manual-hint {
  margin: 0 0 4px;
  font-size: 1.05rem;
  line-height: 1.5;
}

.manual-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 16px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 2px;
}

.manual-list button,
.manual-name-btn {
  /* タブレット親指操作: 最低 56px 超 */
  min-height: 56px;
  padding: 18px 16px;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  /* 名前は選択対象なので primary 帯ではなくカード面 */
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--btn-bd);
  border-radius: 12px;
  box-shadow: none;
}

.manual-list button::after,
.manual-name-btn::after {
  display: none;
}

.manual-list button:hover:not(:disabled),
.manual-name-btn:hover:not(:disabled) {
  border-color: var(--secondary);
  filter: none;
  background: var(--muted-bg);
}

.manual-list button:focus-visible,
.manual-name-btn:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

/* 処理中: 一覧・モーダル操作の視覚 */
#manual-view.manual-busy .manual-list button,
#manual-view.manual-busy .manual-name-btn,
#manual-view.manual-busy .manual-modal-panel button {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---- 確認モーダル ---- */
.manual-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.manual-modal.hidden {
  display: none !important;
}

.manual-modal-scrim {
  position: absolute;
  inset: 0;
  background: var(--dialog-scrim);
}

.manual-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  /* タブレット横持ちでも 9 択が窮屈にならない */
  max-width: min(640px, 92vw);
  max-height: min(92vh, 860px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-app);
  box-shadow: var(--shadow);
  padding: 28px 24px 22px;
}

.manual-modal-title {
  margin: 0 0 10px;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  line-height: 1.35;
}

.manual-modal-lead {
  margin: 0 0 20px;
  font-size: 1.05rem;
  text-align: center;
  line-height: 1.5;
}

.manual-modal-actions {
  margin-top: 12px;
  gap: 12px;
}

.manual-modal-actions button {
  flex: 1;
  min-width: 140px;
  min-height: 52px;
  font-size: 1.1rem;
  font-weight: 600;
}

/* 暗証番号のテンキー（#505 PR 5）: 目印ボタン .manual-mark-btn と同じトーン · 3 列 · 指で押せる 64px */
.manual-pinpad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 320px;
  margin: 12px auto 0;
}
.manual-pinpad-key {
  min-height: 64px;
  font-size: 24px;
  font-weight: 600;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
}
/* 受付 button 既定の橙下線ピルを打ち消す（目印ボタンと同じ） */
.manual-pinpad-key::after {
  display: none;
}
.manual-pinpad-key:active {
  background: var(--th-bg, var(--bg));
}
.manual-pinpad-clear,
.manual-pinpad-back {
  font-size: 18px;
  font-weight: 500;
  color: var(--sub);
}

#manual-modal-status.hidden {
  display: none !important;
}

/* 動物マーク 9択 — タブレット前提の大きめタップ面 */
.manual-mark-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 4px;
}

.manual-mark-btn {
  min-height: 120px;
  min-width: 0;
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--th-bg);
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.manual-mark-btn::after {
  display: none;
}

.manual-mark-btn:hover:not(:disabled) {
  border-color: var(--secondary);
  filter: none;
  background: var(--card);
}

.manual-mark-btn:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
}

.manual-mark-btn:active:not(:disabled) {
  border-color: var(--warm);
  background: var(--add-bg);
}

.manual-mark-svg {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  pointer-events: none;
}

.manual-mark-btn .manual-mark-label {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--sub);
  text-align: center;
}

.manual-mark-fallback {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--sub);
}

/* 誕生日 3択 */
.manual-birthday-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.manual-birthday-btn {
  width: 100%;
  min-height: 56px;
  padding: 18px 16px;
  font-size: 1.2rem;
  font-weight: 600;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--btn-bd);
  box-shadow: none;
}

.manual-birthday-btn::after {
  display: none;
}

.manual-birthday-btn:hover:not(:disabled) {
  border-color: var(--secondary);
  filter: none;
  background: var(--muted-bg);
}

/* 結果ステップ */
#manual-step-result .status {
  margin: 8px 0 16px;
  font-size: 1.02rem;
  line-height: 1.5;
}

/* S11 CHK-03: キオスク手動登録の完了カード */
.manual-done-card {
  text-align: center;
  padding: 8px 4px 4px;
  cursor: pointer;
  border-radius: var(--radius-app, 12px);
}

.manual-done-card:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 4px;
}

.manual-done-card.hidden,
.manual-fail-card.hidden {
  display: none !important;
}

.manual-done-greeting {
  margin: 0 0 12px;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ok-fg, var(--primary));
  letter-spacing: 0.02em;
}

.manual-done-name {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
}

.manual-done-meta {
  margin: 0 0 18px;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
}

.manual-done-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--sub);
}

/* S11 CHK-07: 失敗時の案内カード */
.manual-fail-card {
  text-align: center;
}

.manual-fail-lead {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
}

/* CHK-08: 端末停止ビュー */
.revoked-panel {
  max-width: 28rem;
  margin: 2rem auto;
  text-align: center;
  padding: 2rem 1.5rem;
}

.revoked-lead {
  margin: 0 0 12px;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.revoked-body {
  margin: 0;
  font-size: 1.05rem;
  color: var(--sub);
  line-height: 1.5;
}

/* S11 CHK-07: 会場側の参加者向け案内 */
.venue-guide-card {
  margin: 12px 0 8px;
  padding: 16px 14px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-app, 12px);
  text-align: center;
}

.venue-guide-card.hidden {
  display: none !important;
}

.venue-guide-lead {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

.venue-guide-body {
  margin: 0;
  font-size: 0.98rem;
  color: var(--sub);
  line-height: 1.5;
}

@media (min-width: 640px) {
  .manual-list {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .manual-list button,
  .manual-name-btn {
    min-height: 64px;
    font-size: 1.28rem;
    padding: 20px 18px;
  }

  .manual-modal-panel {
    padding: 32px 28px 24px;
  }

  .manual-modal-title {
    font-size: 1.6rem;
  }

  .manual-mark-btn {
    min-height: 140px;
    padding: 16px 12px 14px;
    gap: 0.55rem;
  }

  .manual-mark-svg {
    width: 84px;
    height: 84px;
  }

  .manual-mark-btn .manual-mark-label {
    font-size: 1.1rem;
  }
}

/* タブレット横持ち（受付の主戦場） */
@media (min-width: 900px) and (min-height: 600px) {
  .manual-mark-grid {
    gap: 16px;
  }

  .manual-mark-btn {
    min-height: 152px;
  }

  .manual-mark-svg {
    width: 96px;
    height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* =========================================================
   #175 状態質問アニメーション（東城承認: lab v4 確定仕様）
   もちもち + 落下もちっ遷移 + トレイ収集ナビ + ふわふわヒント + 確認カード
   すべて transform / opacity / box-shadow（CSP 適合・GPU 合成）。
   reduced-motion は上の全体上書き（animation-duration 0.01ms）で自動停止する。
   ========================================================= */

/* --- もちもち: 選択肢ボタン --- */
#questions-view .att-opt {
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(200, 150, 90, 0.14);
  transform-origin: 50% 100%;
  transition: border-color 0.15s ease, background 0.15s ease,
    transform 0.18s ease, box-shadow 0.18s ease, opacity 0.2s ease;
}
#questions-view .att-opt:hover:not(:disabled) {
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(200, 150, 90, 0.22);
}
#questions-view .att-opt:active:not(:disabled) {
  transform: scale(1.08, 0.8);
  transition: transform 0.06s;
}
@keyframes att-jelly-pop {
  0%   { transform: scale(1.08, 0.8); }
  30%  { transform: scale(0.9, 1.16); }
  52%  { transform: scale(1.08, 0.92); }
  74%  { transform: scale(0.97, 1.05); }
  100% { transform: scale(1); }
}
#questions-view .att-opt.jelly { animation: att-jelly-pop 0.55s linear 1; }

/* --- もちもち: 進捗ドット（span 化した現在ドットが跳ねる） --- */
.att-prog span { display: inline-block; }
@keyframes att-dot-hop {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-12px) scale(1.35, 0.85); }
  70% { transform: translateY(2px) scale(0.9, 1.15); }
  100% { transform: translateY(0) scale(1); }
}
.att-prog span.hop { animation: att-dot-hop 0.5s ease-out 1; }

/* --- 落下もちっ遷移（質問 → 質問 / 確認） --- */
@keyframes att-drop-out {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(110%); opacity: 0; }
}
.att-body.att-drop-out, .att-confirm.att-drop-out {
  animation: att-drop-out 0.32s cubic-bezier(0.5, 0, 0.85, 0.4) forwards;
}
@keyframes att-drop-in {
  0%   { transform: translateY(-120%) scale(1, 1); }
  55%  { transform: translateY(0) scale(1, 1); }
  68%  { transform: translateY(0) scale(1.05, 0.84); }   /* もちっと着地 */
  82%  { transform: translateY(-2.5%) scale(0.97, 1.07); }
  92%  { transform: translateY(0) scale(1.015, 0.97); }
  100% { transform: translateY(0) scale(1, 1); }
}
.att-body.att-drop-in, .att-confirm.att-drop-in {
  transform-origin: 50% 100%;
  animation: att-drop-in 0.7s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}
/* トレイから戻るとき: 上へ放り出し / 下から跳ね上がり */
@keyframes att-toss-up {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-120%); opacity: 0; }
}
.att-body.att-toss-up, .att-confirm.att-toss-up {
  animation: att-toss-up 0.32s cubic-bezier(0.5, 0, 0.85, 0.4) forwards;
}
@keyframes att-rise-in {
  0%   { transform: translateY(110%) scale(1, 1); }
  55%  { transform: translateY(0) scale(1, 1); }
  68%  { transform: translateY(0) scale(1.05, 0.86); }
  84%  { transform: translateY(-2%) scale(0.97, 1.06); }
  100% { transform: translateY(0) scale(1, 1); }
}
.att-body.att-rise-in {
  transform-origin: 50% 0%;
  animation: att-rise-in 0.7s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

/* --- 確認カード（送信前・最後の直しチャンス） --- */
.att-confirm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 920px;
}
.att-confirm.hidden { display: none !important; }
.att-confirm-title { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.att-confirm-icons {
  display: flex;
  gap: 26px;
  justify-content: center;
  min-height: 88px;
}
.att-confirm-icons img { width: 84px; height: 84px; object-fit: contain; }
.att-confirm-sub { margin: 0; font-size: 1rem; color: var(--sub); }
@keyframes att-card-spring {
  0% { transform: scale(0.6); opacity: 0; }
  55% { transform: scale(1.08); opacity: 1; }
  75% { transform: scale(0.96); }
  100% { transform: scale(1); }
}
.att-confirm.att-spring, .att-done.att-spring {
  animation: att-card-spring 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) 1;
}
@keyframes att-icon-leap {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-22px) scale(1.2) rotate(-5deg); }
  75% { transform: translateY(3px) scale(0.94, 1.05); }
  100% { transform: translateY(0) scale(1); }
}
.att-confirm-icons img.leap { animation: att-icon-leap 0.55s ease-out 1; }

/* --- トレイ（くぼみ・収集・ナビ） --- */
.att-tray {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 20;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.25), bottom 0.4s ease;
}
.att-tray.hidden { display: none !important; }
/* 確認カード表示中: ヒントと一体でトレイ（アイコン込み）が大きくなる */
.att-tray.big { transform: translateX(-50%) scale(1.18); bottom: 26px; }
.att-tray-slot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: #f3e9d8;
  box-shadow: inset 0 3px 7px rgba(180, 140, 90, 0.28); /* くぼみ = 置き場所 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: default;
  font-family: inherit;
  transition: box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.att-tray-slot img { width: 40px; height: 40px; object-fit: contain; pointer-events: none; }
.att-tray-slot.filled {
  background: var(--card, #fff);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(232, 145, 58, 0.28);
}
.att-tray-slot.filled:hover { transform: translateY(-4px) scale(1.08); box-shadow: 0 8px 18px rgba(232, 145, 58, 0.35); }
.att-tray-slot.current { box-shadow: 0 0 0 3px rgba(232, 145, 58, 0.45), 0 4px 12px rgba(232, 145, 58, 0.2); }
@keyframes att-slot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 145, 58, 0.55); }
  100% { box-shadow: 0 0 0 16px rgba(232, 145, 58, 0); }
}
.att-tray-slot.pulse { animation: att-slot-pulse 0.5s ease-out 1; }

/* 回答アイコンの飛翔クローン（座標は JS が CSSOM で与える） */
.att-fly-icon { position: absolute; z-index: 40; width: 72px; height: 72px; pointer-events: none; }

/* --- ふわふわヒント --- */
.att-tray-hint {
  position: absolute;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.8rem;
  font-weight: 400;
  color: #a97b46;
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 16px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(232, 145, 58, 0.22);
  z-index: 20;
  transition: font-size 0.25s ease, padding 0.25s ease;
  animation: att-hint-float 3s ease-in-out infinite;
}
.att-tray-hint.hidden { display: none !important; }
@keyframes att-hint-float {
  0%, 100% { transform: translateX(-50%) translateY(0); box-shadow: 0 6px 16px rgba(232, 145, 58, 0.22); }
  50% { transform: translateX(-50%) translateY(-6px); box-shadow: 0 12px 20px rgba(232, 145, 58, 0.16); }
}
.att-tray-hint.big {
  font-size: 1rem;
  padding: 8px 20px;
  animation: att-hint-float-big 2.6s ease-in-out infinite;
}
@keyframes att-hint-float-big {
  0%, 100% { transform: translateX(-50%) translateY(0); box-shadow: 0 6px 18px rgba(232, 145, 58, 0.26); }
  50% { transform: translateX(-50%) translateY(-9px); box-shadow: 0 16px 24px rgba(232, 145, 58, 0.16); }
}
