:root {
  /* 2010年頃の古めかしいWeb。灰色の地に白いパネル、青い下線リンク、ベベルのボタン。 */
  --page: #d7dade;
  --page-2: #cbcfd5;
  --panel: #ffffff;
  --panel-line: #b4bac2;
  --ink: #232629;
  --muted: #6c727b;
  --link: #123fae;
  --headbar-a: #5c7fb6;
  --headbar-b: #3d5c8e;
  --btn-a: #fbfbfc;
  --btn-b: #dfe1e5;
  --btn-line: #9aa0aa;
  --go-a: #86c552;
  --go-b: #579a2c;
  --go-line: #47821f;
  --warn: #c0392b;
  /* 未来からの通信＝冷たく無機質なスレート（ネオンではない） */
  --slate: #1b2530;
  --slate-2: #223041;
  --slate-line: #63748a;
  --slate-ink: #e3eaf2;
  --slate-dim: #93a2b5;
  --sans: "Meiryo", "MS PGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --serif: "MS PMincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --mono: "MS Gothic", "SFMono-Regular", "Osaka-Mono", monospace;
}

* { box-sizing: border-box; }

html, body { width: 100%; min-height: 100%; margin: 0; }

body {
  overflow: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  overscroll-behavior: none;
}

button { color: inherit; font: inherit; }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid #3d5c8e; outline-offset: 2px; }
a { color: var(--link); }
[hidden] { display: none !important; }

.app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--vvh, 100dvh);
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, #e6e8eb, #cfd3d9);
}

/* 旧背景（ネオン都市）は廃止。要素は残るが地味なテクスチャに。 */
.cityscape { position: absolute; inset: 0; z-index: -2; overflow: hidden; opacity: 0.5; }
.cityscape .skyline,
.cityscape .scanline { display: none; }
.neon { display: none; }

/* ===== 共通ラベル ===== */
.system-label {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* ===== ボタン（銀のベベル） ===== */
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid var(--btn-line);
  border-radius: 3px;
  background: linear-gradient(180deg, var(--btn-a), var(--btn-b));
  color: #2a2d31;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, 0.25);
}
.action-button:hover { background: linear-gradient(180deg, #ffffff, #e8eaee); }
.action-button:active { box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3); transform: translateY(1px); }

/* 主要導線＝緑の「進む/ダウンロード」風ボタン（旧CTAの定番） */
.action-button--neon {
  border-color: var(--go-line);
  background: linear-gradient(180deg, var(--go-a), var(--go-b));
  color: #fff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.action-button--neon:hover { background: linear-gradient(180deg, #93d15e, #62aa33); }

.text-button {
  min-height: 30px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--link);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

/* ===== タイトル / クリア（古い官公庁サイト風の白パネル） ===== */
.title-screen, .clear-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  /* 内容が画面高を超えたとき（購入ありのクリア画面＝叱責ブロック追加時など）に最下部まで届くよう、
     この画面自体をスクロール可能にする。safe center = 収まるときは中央、あふれるときは上寄せ
     （フレックスの上端クリップを避け、スクロールで全体を読める）。 */
  justify-content: safe center;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: max(20px, env(safe-area-inset-top)) clamp(16px, 6vw, 90px) max(20px, env(safe-area-inset-bottom));
}

.title-copy, .clear-screen > * { max-width: 640px; }

.title-copy {
  padding: 22px 24px 24px;
  border: 1px solid var(--panel-line);
  border-top: 3px solid #3d5c8e;
  border-radius: 3px;
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.title-copy h1, .clear-screen h2 {
  margin: 6px 0 14px;
  font-family: var(--serif);
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  color: #1c2430;
  border-bottom: 1px solid #dfe2e7;
  padding-bottom: 10px;
}

.title-copy .lead {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.9;
  color: #2c3138;
}

/* 未来からの通信ブロック＝冷たい無機質スレート（本文の白地に異物として載る） */
.title-copy .notice,
.clear-detail {
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--slate-line);
  border-left: 4px solid #8fa0b4;
  background: var(--slate);
  color: var(--slate-dim);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
}

.clear-screen > p:not(.system-label, .clear-detail, .clear-invite) {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.8;
}

.title-footnote {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.clear-note {
  max-width: 520px;
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid var(--slate-line);
  border-left: 4px solid #8fa0b4;
  background: var(--slate);
  color: var(--slate-dim);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
}

.clear-invite {
  max-width: 360px;
  margin: 2px 0 14px;
  color: #3a3f46;
  font-size: 12px;
  line-height: 1.7;
}
.clear-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }

/* ===== ゲーム画面 ===== */
.game-screen { position: absolute; inset: 0; overflow: hidden; }

/* 上部＝古い管理画面の見出しバー */
.status-bar {
  position: absolute;
  top: 0; right: 0; left: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(52px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  border-bottom: 1px solid #2c436b;
  background: linear-gradient(180deg, var(--headbar-a), var(--headbar-b));
  color: #fff;
}
.brand-lockup {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; line-height: 1.3;
  color: #d6e0f0;
}
.brand-lockup b { color: #fff; font-family: var(--sans); font-size: 12px; }
.brand-symbol {
  display: grid; width: 24px; height: 24px;
  border: 1px solid #cdd8ea; border-radius: 3px;
  background: rgba(255, 255, 255, 0.12); place-items: center; font-size: 13px;
}
.record-status { display: flex; align-items: flex-end; gap: 10px; font-family: var(--mono); text-align: right; }
.record-status span { color: #cdd8ea; font-size: 8px; }
.record-status strong { color: #ffe08a; font-size: 13px; }

/* ステージ＝白い本文領域（旧サイトのコンテンツ枠） */
.record-stage {
  position: absolute;
  inset: calc(52px + env(safe-area-inset-top)) 0 0;
  overflow: hidden;
  background:
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(0, 0, 0, 0.02) 27px 28px),
    var(--page-2);
}

/* 同意書＝未来の無機質スレート文書。広告に覆われて埋もれる（下層）。 */
.record-document {
  position: absolute;
  top: 50%; left: 50%;
  z-index: 2;
  width: min(86%, 430px);
  padding: clamp(16px, 4vw, 28px);
  border: 1px solid var(--slate-line);
  background: linear-gradient(180deg, var(--slate), var(--slate-2));
  color: var(--slate-ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
}
.record-document.dimmed { opacity: 0.3; filter: blur(1px); transition: opacity .5s, filter .5s; }
.record-document.revealed {
  border-color: #aab7c6;
  box-shadow: 0 0 0 2px rgba(150, 170, 195, 0.5), 0 12px 34px rgba(0, 0, 0, 0.5);
  transition: box-shadow .5s, border-color .5s;
}
.record-document.signed::after {
  position: absolute; top: 14px; right: 14px;
  padding: 3px 10px;
  border: 2px solid #d33; color: #e66; font-family: var(--serif); font-weight: 800; font-size: 15px;
  transform: rotate(-11deg); border-radius: 3px; content: "署名済";
}
.record-document header {
  display: flex; justify-content: space-between;
  padding-bottom: 10px; margin-bottom: 6px;
  border-bottom: 1px solid var(--slate-line);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--slate-dim);
}
.record-document header p { margin: 0; font-weight: 700; color: #cdd8e6; }
.record-document h2 {
  margin: 12px 0; font-family: var(--serif); font-size: clamp(26px, 6vw, 46px);
  font-weight: 700; line-height: 1.05; color: #f0f4f9;
}
.record-document dl { margin: 0; border-top: 1px solid rgba(120, 140, 165, 0.35); }
.record-document dl div {
  display: grid; grid-template-columns: 92px 1fr; padding: 7px 0;
  border-bottom: 1px solid rgba(120, 140, 165, 0.22);
}
.record-document dt { font-family: var(--mono); font-size: 9px; color: var(--slate-dim); }
.record-document dd { margin: 0; font-weight: 700; }
.record-note {
  min-height: 4.4em; margin: 14px 0 0;
  font-family: var(--mono); font-size: 12px; line-height: 1.7; white-space: pre-line; color: #dbe4ee;
}
.record-note.typing::after {
  content: "_"; margin-left: 1px; color: #9fb0c4; animation: caret-blink .9s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

/* ===== 広告の場 ===== */
.dialog-field { position: absolute; inset: 0; z-index: 10; overflow: hidden; pointer-events: none; }
.dialog-field .system-dialog { pointer-events: auto; }

/* 広告カード共通＝現実のうざいWeb広告。白/灰基調・小さな灰色の×・PR表記。 */
.system-dialog {
  --r: 0deg;
  --accent: #c0392b;
  position: absolute;
  width: min(66%, 300px);
  border: 1px solid #b9bcc2;
  border-radius: 3px;
  background: #fff;
  color: #222;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.3);
  transform-origin: center;
  user-select: none; -webkit-user-select: none; touch-action: none;
  will-change: transform;
  font-size: 13px;
}
.ad--lg { width: min(82%, 340px); }
.ad--md { width: min(62%, 275px); }
.ad--sm { width: min(46%, 205px); }

.system-dialog.appearing { animation: ad-pop 240ms ease-out; }
@keyframes ad-pop { from { opacity: 0; transform: translateY(-6px) rotate(var(--r)) scale(.96); } to { opacity: 1; } }

.system-dialog > header {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 22px; padding: 3px 6px;
  border-bottom: 1px solid #e2e2e2; background: #f2f3f5;
  font-size: 10px; color: #7a7f87;
}
.ad-badge {
  padding: 0 5px; border: 1px solid #cfcfcf; border-radius: 2px;
  background: #eceef1; color: #6a6f77; font-family: var(--mono); font-size: 9px; font-weight: 700;
}
.dialog-close {
  width: 20px; height: 18px; padding: 0; position: relative;
  border: 1px solid #cfcfcf; border-radius: 2px; background: #f6f6f6;
  color: #888; font-size: 12px; line-height: 1; cursor: pointer;
}
.dialog-close::after {
  position: absolute; top: 50%; left: 50%; width: 44px; height: 44px;
  transform: translate(-50%, -50%); content: "";
}
.system-dialog.manual-ready .dialog-close::after { display: none; }

.ad-body { display: flex; gap: 9px; align-items: center; padding: 9px 11px; }
.ad-body p { margin: 0; font-size: 13px; font-weight: 700; line-height: 1.4; color: #1d2024; }
.ad--sm .ad-body p { font-size: 12px; }
.ad-thumb { flex: 0 0 auto; width: 66px; height: 50px; overflow: hidden; border: 1px solid #ddd; background: #eee; }
.ad-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dialog-footer {
  display: flex; justify-content: space-between; padding: 3px 11px 7px;
  font-family: var(--mono); font-size: 8px; color: #a2a6ad;
}

/* --- 記事広告（chumbox: サムネ＋釣り見出し＋出所） --- */
.ad--article > header { background: #fafafa; }
.ad--article .ad-body { align-items: flex-start; }
.ad--article .ad-body p { color: #16305e; }           /* 見出しは青系リンク色 */
.ad--article .dialog-footer span:first-child { color: #7a7f87; }

/* --- 偽OS当選ポップアップ --- */
.ad--popup { border-color: #8b9099; border-radius: 5px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }
.ad--popup > header {
  background: linear-gradient(180deg, #6f7681, #565c66); color: #fff;
  border-bottom: 1px solid #444; min-height: 24px;
}
.ad--popup .ad-badge { background: rgba(255, 255, 255, 0.2); border-color: #888; color: #fff; }
.ad--popup .dialog-close { background: #d64; border-color: #a33; color: #fff; }
.ad--popup .ad-body p { color: #b8420f; font-size: 15px; }
.ad--popup .dialog-footer { justify-content: center; padding-bottom: 10px; }
.ad--popup .go {
  display: inline-block; margin: 0 auto; padding: 6px 18px;
  border: 1px solid var(--go-line); border-radius: 3px;
  background: linear-gradient(180deg, var(--go-a), var(--go-b)); color: #fff; font-weight: 800; font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* --- 偽ウイルス警告 --- */
.ad--warning { border: 2px solid var(--warn); }
.ad--warning > header { background: var(--warn); color: #fff; font-weight: 700; }
.ad--warning .ad-badge { background: #fff; color: var(--warn); border-color: #fff; }
.ad--warning .dialog-close { background: #fff; color: var(--warn); }
.ad--warning .ad-body p { color: #a3271b; }
.ad--warning .go {
  display: block; margin: 0 11px 9px; padding: 7px; text-align: center;
  border: 1px solid #a33; border-radius: 3px; background: linear-gradient(180deg, #e74c3c, #c0392b);
  color: #fff; font-weight: 800;
}

/* --- Cookie同意バナー風 --- */
.ad--cookie { background: #2b2f36; color: #e6e8ea; border-color: #1a1d22; }
.ad--cookie > header { display: none; }
.ad--cookie .ad-body { flex-direction: column; align-items: stretch; gap: 7px; padding: 11px; }
.ad--cookie .ad-body p { color: #dfe2e6; font-weight: 400; font-size: 11px; }
.ad--cookie .go {
  align-self: flex-end; padding: 5px 16px; border: 1px solid var(--go-line); border-radius: 3px;
  background: linear-gradient(180deg, var(--go-a), var(--go-b)); color: #fff; font-weight: 800; font-size: 12px;
}
.ad--cookie .dialog-close { border-color: #555; background: #3a3f47; color: #aaa; }

/* --- 緑ダウンロードボタン広告 --- */
.ad--download .ad-body { flex-direction: column; align-items: stretch; gap: 8px; }
.ad--download .ad-body p { text-align: center; color: #2a2d31; }
.ad--download .go {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px;
  border: 1px solid var(--go-line); border-radius: 4px;
  background: linear-gradient(180deg, var(--go-a), var(--go-b)); color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.ad--download .go::before { content: "▼"; font-size: 11px; }

/* --- 黄色い煽りバナー --- */
.ad--banner { background: #fff3b0; border-color: #e0c34a; }
.ad--banner > header { background: #ffe479; border-bottom: 1px solid #e0c34a; color: #7a5b00; }
.ad--banner .ad-badge { background: #fff; border-color: #e0c34a; color: #9a7400; }
.ad--banner .ad-body p { color: #8a1f00; }
.ad--banner .dialog-footer { display: none; }

/* --- 画像広告（写真＋赤枠煽り。chumboxのサムネ大） --- */
.ad--image { overflow: hidden; }
.ad--image > header { background: #fafafa; }
.ad--image .ad-image { position: relative; line-height: 0; }
.ad--image .ad-image img { display: block; width: 100%; height: auto; }
.ad--image .ad-caption {
  position: absolute; right: 0; bottom: 0; left: 0; padding: 5px 8px 6px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
  color: #fff; font-size: 12px; font-weight: 800; line-height: 1.3;
}

.system-dialog.flying { opacity: 0; transition: opacity 420ms ease; pointer-events: none; }
.system-dialog.manual-ready { cursor: grab; }
.system-dialog.manual-ready::after {
  position: absolute; right: 7px; bottom: 5px; color: #999; font-family: var(--mono); font-size: 7px; content: "HOLD+SWIPE";
}
.system-dialog.manual-hold { box-shadow: 0 0 0 3px #f0a020, 0 6px 16px rgba(0, 0, 0, 0.4); cursor: grabbing; }

/* 反応中フィードバックは点滅（brightness明滅）を廃止。光感受性配慮＋「点滅がしんどい」対策として
   常時明滅は行わない。届いているかは JS の極小な位置揺れ（reduced-motion時は無し）とマイク
   インジケータのレベルメーターで示す。胡散臭さは点滅ではなく文言・レイアウト・物量で出す。 */

.pressure-wave { display: none; }

/* ===== 下部コンソール（旧サイトのフッター/操作バー） ===== */
.record-console {
  position: absolute; right: 0; bottom: 0; left: 0; z-index: 80;
  min-height: calc(140px + env(safe-area-inset-bottom));
  padding: 12px 14px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid #b0b4bb;
  background: linear-gradient(180deg, #f4f5f7, #e6e8ec);
}
.console-kicker { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; }
.console-kicker.alert { color: var(--warn); font-weight: 700; }
.record-console h2 { margin: 4px 0 6px; font-family: var(--serif); font-size: clamp(18px, 3vw, 26px); font-weight: 700; color: #232629; }
.record-console > p:not(.console-kicker) { max-width: 520px; margin: 0 0 12px; color: #3a3f46; font-size: 12px; line-height: 1.7; }
.record-console > .action-button { min-height: 40px; }
.record-mic-slot { margin-top: 4px; }

/* ===== マイク回線（操作卓） ===== */
.mic-console {
  display: grid; grid-template-columns: minmax(0, 1fr) 78px; align-items: center; gap: 14px;
  width: 100%; padding: 10px 12px;
  border: 1px solid #b6bac1; border-radius: 4px; background: #fbfbfc;
  box-shadow: inset 0 1px 0 #fff;
}
.mic-readout { min-width: 0; }
.mic-readout span { display: block; margin-bottom: 3px; color: #3d5c8e; font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; }
.mic-console.mic-live .mic-readout span::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%;
  background: #c0392b; vertical-align: middle; animation: mic-live 1.4s ease-in-out infinite;
}
@keyframes mic-live { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.mic-readout strong { display: block; min-height: 2.6em; font-size: 12px; line-height: 1.4; color: #232629; }
.breath-progress { height: 8px; margin-top: 8px; overflow: hidden; border: 1px solid #b7bbc2; border-radius: 3px; background: #e9eaed; }
.breath-progress i {
  display: block; width: calc(var(--progress, 0) * 100%); height: 100%;
  background: linear-gradient(180deg, #86c552, #579a2c); transition: width 60ms linear, background-color 90ms;
}
.mic-console.detecting .breath-progress i { background: linear-gradient(180deg, #ffb347, #e8830f); }
.mic-button {
  position: relative; display: grid; width: 74px; height: 74px; padding: 0;
  border: 1px solid #8f959e; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fdfdfd, #d7dade);
  color: #3a3f46; cursor: pointer; place-items: center; touch-action: none;
  box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: box-shadow 90ms, transform 90ms;
}
.mic-console .mic-button {
  transform: scale(calc(1 + var(--level, 0) * 0.06));
  box-shadow: inset 0 1px 0 #fff, 0 0 calc(var(--level, 0) * 22px) rgba(232, 131, 15, calc(var(--level, 0) * 0.7)), 0 2px 4px rgba(0, 0, 0, 0.25);
}
.mic-button > span { position: absolute; top: 13px; width: 10px; height: 16px; border: 2px solid currentColor; border-radius: 6px; }
.mic-button > span::after {
  position: absolute; right: -6px; bottom: -7px; left: -6px; height: 9px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor;
  border-radius: 0 0 8px 8px; content: "";
}
.mic-button b { margin-top: 38px; font-size: 8px; }
.mic-button.listening { border-color: #e8830f; color: #b8420f; background: radial-gradient(circle at 50% 35%, #fff2e0, #ffd9a8); }

/* ヘッダーに紛れ込ませる環境ヒント（ローマ字 FUKITOBASU＝吹き飛ばす）。目立たせない。 */
.build-tag {
  display: inline-block; margin-top: 1px;
  color: #cdd8ea; font-family: var(--mono); font-style: normal; font-size: 7px; letter-spacing: 0.14em;
  opacity: 0.72;
}

/* 常時マイク使用の小さなインジケータ（ボタンではない＝操作しない。使用中＋プライバシー注記＋レベル）。 */
/* プレイ中に「マイク使用中」が常時見えると仕掛け（息を吹きかける）のヒントになりすぎるため、常に非表示にする。
   JS側（elements.micIndicator の hidden/クラス切替）は変更せず、CSSで確実に隠す。 */
.mic-indicator {
  display: none !important;
  position: absolute; z-index: 88; right: 10px; top: calc(56px + env(safe-area-inset-top));
  align-items: center; gap: 7px; max-width: calc(100vw - 20px);
  padding: 4px 9px; border: 1px solid #b9c0ca; border-radius: 999px;
  background: rgba(255, 255, 255, 0.94); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  font-size: 10px; color: #4a4f57;
}
.mic-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #c0392b; }
/* 使用中ドットは常時点滅させない（静止した赤ドット）。「録音中」の示唆は文言で担保。 */
.mic-indicator.mic-live .mic-dot { opacity: 1; }
.mic-indicator-label { font-weight: 700; color: #2f3439; white-space: nowrap; }
.mic-indicator-note { color: #7a8089; font-size: 9px; white-space: nowrap; }
.mic-indicator-meter { flex: 0 0 auto; width: 42px; height: 6px; overflow: hidden; border: 1px solid #c2c7ce; border-radius: 3px; background: #eceef1; }
.mic-indicator-meter i { display: block; width: calc(var(--level, 0) * 100%); height: 100%; background: linear-gradient(90deg, #86c552, #579a2c); transition: width 60ms linear; }
.mic-indicator.detecting { border-color: #e8830f; }
.mic-indicator.detecting .mic-indicator-meter i { background: linear-gradient(90deg, #ffb347, #e8830f); }
@media (max-width: 760px) {
  .mic-indicator { top: calc(52px + env(safe-area-inset-top)); }
  .mic-indicator-note { display: none; }
  html.vvh-short .mic-indicator { top: calc(46px + env(safe-area-inset-top)); }
}

/* ===== 管理人（旧モーダルダイアログ） ===== */
.manager-overlay, .hint-overlay {
  position: absolute; inset: 0; z-index: 200; display: grid; place-items: center; padding: 22px;
  background: rgba(40, 44, 50, 0.55);
}
.hint-overlay { z-index: 205; }
.manager-card {
  width: min(430px, 100%); border: 1px solid #8b9099; border-radius: 5px; background: #fff;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5); overflow: hidden;
}
.manager-label {
  margin: 0; padding: 8px 14px;
  background: linear-gradient(180deg, #6f7681, #565c66); color: #fff;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
}
.manager-card p#manager-text { margin: 0; padding: 16px 18px; font-size: 14px; line-height: 1.8; color: #2a2d31; }
.manager-card .action-button { width: calc(100% - 28px); margin: 0 14px 16px; }

/* ヒント受信＝未来の無機質スレート（うざい広告の中で1個だけ官製っぽく浮く）。
   写真広告は前面ブースト（z ~60-71）されるため、進行保証としてヒントは全広告より上に置く
   （常に可視・タップ可能。オーバーレイ z=200 より下）。 */
.hint-dialog {
  position: absolute; z-index: 120; pointer-events: auto;
  width: min(52%, 216px); padding: 9px 11px 12px;
  border: 1px solid var(--slate-line); border-radius: 2px;
  background: linear-gradient(180deg, var(--slate), var(--slate-2)); color: var(--slate-ink);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4); cursor: pointer; text-align: left;
}
.hint-dialog .hint-tag { display: block; margin-bottom: 4px; color: var(--slate-dim); font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em; }
.hint-dialog .hint-body { font-size: 11px; font-weight: 700; line-height: 1.4; }
.hint-dialog::after { position: absolute; right: 8px; bottom: 5px; color: var(--slate-dim); font-family: var(--mono); font-size: 8px; content: "OPEN"; }

.hint-card {
  width: min(430px, 100%); border: 1px solid var(--slate-line); border-radius: 4px;
  background: linear-gradient(180deg, var(--slate), var(--slate-2)); color: var(--slate-ink);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55); overflow: hidden;
}
.hint-label { margin: 0; padding: 8px 14px; background: rgba(255, 255, 255, 0.06); border-bottom: 1px solid var(--slate-line); color: var(--slate-dim); font-family: var(--mono); font-size: 10px; }
.hint-card p#hint-text { margin: 0; padding: 16px 18px; font-family: var(--serif); font-size: 15px; line-height: 1.8; color: #eef3f8; }
.hint-actions { display: flex; gap: 10px; padding: 0 14px 14px; }
.hint-actions .action-button { flex: 1; min-height: 40px; }

/* ===== 緊急警告モーダル（氾濫直前の必須ビート＝旧OS風クリティカルアラート） ===== */
.alert-overlay {
  position: absolute; inset: 0; z-index: 210; display: grid; place-items: center; padding: 22px;
  background: rgba(28, 10, 10, 0.62);
}
.alert-card {
  width: min(400px, 100%); overflow: hidden;
  border: 1px solid #8a2b22; border-radius: 5px; background: #fff;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
}
.alert-titlebar {
  margin: 0; padding: 8px 14px;
  background: linear-gradient(180deg, #d64535, #b3271a); color: #fff;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
}
.alert-body { display: flex; gap: 13px; align-items: flex-start; padding: 17px 18px 8px; }
.alert-mark {
  flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px;
  color: #c0392b; font-size: 32px; line-height: 1;
  /* 単一要素・警告モーダル表示中のみ・低速低コントラスト（3秒以上周期）。3回/秒禁止に準拠。 */
  animation: alert-pulse 3.2s ease-in-out infinite;
}
@keyframes alert-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .82; } }
.alert-copy h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 19px; font-weight: 800; line-height: 1.3; color: #a3271b; }
.alert-copy p { margin: 0; font-size: 13px; line-height: 1.7; color: #2a2d31; }
.alert-actions { display: flex; justify-content: flex-end; padding: 8px 18px 16px; }
.alert-actions .action-button { min-width: 150px; min-height: 38px; }
.alert-actions .action-button:disabled { opacity: .5; cursor: default; box-shadow: inset 0 1px 0 #fff; transform: none; }

/* ===== 未来サービス詳細（広告クリックで開く胡散臭いLP × 未来SF） ===== */
.ad-detail-overlay {
  position: absolute; inset: 0; z-index: 215; display: grid; place-items: center; padding: 18px;
  background: rgba(20, 16, 12, 0.62);
}
.ad-detail-card {
  position: relative; width: min(460px, 100%); max-height: calc(var(--vvh, 100dvh) - 40px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid #b9bcc2; border-top: 4px solid #c0392b; border-radius: 4px;
  background: #fff; color: #222;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.55);
}
.ad-detail-close {
  position: sticky; top: 8px; left: calc(100% - 40px); z-index: 3;
  width: 30px; height: 30px; padding: 0; float: right;
  border: 1px solid #cfcfcf; border-radius: 3px; background: #f6f6f6;
  color: #666; font-size: 18px; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.ad-detail-close:hover { background: #fff; color: #222; }
.ad-detail-body { padding: 8px 20px 22px; }
.adx-kicker {
  margin: 0 0 6px; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em;
}
.ad-detail-body h2 {
  margin: 0 0 8px; font-family: var(--serif); font-size: clamp(20px, 5vw, 27px); font-weight: 800;
  line-height: 1.25; color: #16305e;
}
.adx-lead {
  margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px dashed #e0c34a;
  font-size: 15px; font-weight: 800; line-height: 1.6; color: #a3271b;
}
.adx-hero { position: relative; margin: 0 0 14px; line-height: 0; border: 1px solid #ddd; background: #eee; }
.adx-hero img { display: block; width: 100%; height: auto; }
.adx-hero-tag {
  position: absolute; left: 0; bottom: 0; padding: 3px 8px;
  background: rgba(0, 0, 0, 0.68); color: #ffe08a; font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
}
.adx-copy p { margin: 0 0 11px; font-size: 13px; line-height: 1.85; color: #2c3138; }
.adx-copy p:last-child { margin-bottom: 0; }

/* 料金対比（今のあなた ¥0 ／ 30年後のあなた 法外） */
.adx-price {
  margin: 16px 0 12px; border: 1px solid #d9dde3; border-radius: 4px; overflow: hidden;
  background: #f7f8fa;
}
.adx-price-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 11px 13px;
}
.adx-price-row span { font-size: 12px; font-weight: 700; color: #4a4f57; }
.adx-price-row b { font-family: var(--mono); font-weight: 800; }
.adx-now { border-bottom: 1px solid #e3e6ea; }
.adx-now b { color: #3a7d1f; font-size: 16px; }
.adx-future { background: #fff5f4; }
.adx-future span { color: #8a1f00; }
.adx-future b { color: #c0392b; font-size: clamp(15px, 4vw, 18px); text-align: right; }

.adx-terms {
  margin: 0 0 14px; padding: 10px 12px 10px 30px;
  border: 1px solid #e0c34a; border-left: 4px solid #e0c34a; border-radius: 3px; background: #fffdf0;
}
.adx-terms li { margin: 0 0 5px; font-size: 11px; line-height: 1.6; color: #6a5300; }
.adx-terms li:last-child { margin-bottom: 0; }

/* 合計請求額＝暗いスレート地に赤字（カウントアップ） */
.adx-total {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 12px; padding: 12px 14px; border-radius: 4px;
  background: linear-gradient(180deg, var(--slate), var(--slate-2)); color: var(--slate-dim);
}
.adx-total span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; }
.adx-total b {
  font-family: var(--mono); font-size: clamp(20px, 6vw, 28px); font-weight: 800; color: #ff6b5c;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(192, 57, 43, 0.35);
}
.adx-fine {
  margin: 0; font-family: var(--mono); font-size: 10px; line-height: 1.7; color: #8a8f97;
}

/* 偽CTA（今すぐ0円で受け取る）— 悪質LPの派手なボタン。押すと「契約成立」へ切り替わる。 */
.adx-cta-wrap { margin: 16px 0 4px; text-align: center; }
.adx-cta {
  display: block; width: 100%; min-height: 52px; padding: 14px 18px;
  border: 0; border-radius: 6px; cursor: pointer;
  font-size: clamp(16px, 4.6vw, 19px); font-weight: 900; letter-spacing: 0.02em; color: #fff;
  background: linear-gradient(180deg, #ff5a3c, #d81f00);
  box-shadow: 0 6px 0 #9c1600, 0 10px 20px rgba(216, 31, 0, 0.4);
  animation: adxCtaPulse 1.1s ease-in-out infinite;
}
.adx-cta:hover { filter: brightness(1.05); }
.adx-cta:active { transform: translateY(3px); box-shadow: 0 3px 0 #9c1600, 0 6px 12px rgba(216, 31, 0, 0.4); }
.adx-cta--done {
  background: linear-gradient(180deg, #4a4f57, #2c3138); color: #d7dae0;
  box-shadow: none; cursor: default; animation: none; transform: none;
}
.adx-cta--done:hover { filter: none; }
@keyframes adxCtaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
@media (prefers-reduced-motion: reduce) { .adx-cta { animation: none; } }
.adx-cta-note {
  margin: 8px 0 0; font-family: var(--mono); font-size: 10px; line-height: 1.7; color: #8a8f97;
}
.adx-cta-note--done { color: #c0392b; font-weight: 700; }

/* クリア後の叱責（未来のあなたからの追伸）— 購入があった場合のみ表示。 */
.clear-scold {
  width: min(560px, 100%); margin: 4px 0 16px; padding: 16px 18px;
  border: 1px solid rgba(255, 107, 92, 0.4); border-left: 4px solid #ff6b5c; border-radius: 6px;
  background: linear-gradient(180deg, rgba(28, 32, 38, 0.92), rgba(20, 23, 28, 0.92));
  text-align: left; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.scold-from {
  margin: 0 0 8px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; color: #ff9a8c;
}
.scold-lead { margin: 0 0 12px; font-size: clamp(16px, 4.4vw, 20px); font-weight: 800; color: #ffd9d2; }
.scold-list { margin: 0 0 12px; padding: 0; list-style: none; }
.scold-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}
.scold-name { font-size: 12px; color: #cfd3d9; line-height: 1.5; }
.scold-amount { font-family: var(--mono); font-weight: 800; color: #ff8a7a; white-space: nowrap; font-variant-numeric: tabular-nums; }
.scold-total {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 12px; padding: 11px 13px; border-radius: 4px; background: rgba(0, 0, 0, 0.35);
}
.scold-total span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; color: #9aa0a8; }
.scold-total b {
  font-family: var(--mono); font-size: clamp(19px, 5.5vw, 26px); font-weight: 800; color: #ff6b5c;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(192, 57, 43, 0.4);
}
.scold-tail { margin: 0; font-size: 13px; font-weight: 700; color: #ffb3a8; }

/* ===== 応答・救済・デバッグ ===== */
.response-panel {
  position: absolute; right: 14px; bottom: calc(154px + env(safe-area-inset-bottom)); z-index: 110;
  width: min(420px, calc(100vw - 28px)); padding: 12px 14px;
  border: 1px solid #b6bac1; border-radius: 4px; background: #fffef2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.response-panel span { color: var(--muted); font-family: var(--mono); font-size: 9px; }
.response-panel p { margin: 6px 0 12px; font-size: 13px; line-height: 1.6; color: #33270a; }
.response-panel button, .fallback-panel button {
  min-height: 32px; padding: 0 14px; border: 1px solid var(--btn-line); border-radius: 3px;
  background: linear-gradient(180deg, var(--btn-a), var(--btn-b)); font-size: 12px; cursor: pointer;
}
.fallback-panel {
  position: absolute; right: 14px; bottom: calc(154px + env(safe-area-inset-bottom)); left: 14px; z-index: 105;
  padding: 12px; border: 1px solid #b6bac1; border-left: 4px solid #e8830f; border-radius: 3px; background: #fff;
}
.fallback-panel p { margin: 0 0 8px; font-size: 12px; }
.debug-panel {
  position: absolute; top: calc(58px + env(safe-area-inset-top)); left: 8px; z-index: 150;
  padding: 6px; border: 1px solid #999; background: rgba(255, 255, 255, 0.94); color: #114; font-family: var(--mono); font-size: 8px; white-space: pre; pointer-events: none;
}

/* ===== レスポンシブ ===== */
@media (max-width: 760px) {
  .status-bar { height: calc(48px + env(safe-area-inset-top)); }
  .record-stage { inset: calc(48px + env(safe-area-inset-top)) 0 0; }
  .record-console h2 { display: inline; margin: 0 8px 0 0; font-size: 18px; }
  .record-console > p:not(.console-kicker) { display: inline; margin: 0; font-size: 11px; }
  .record-console > .action-button { display: block; width: 100%; margin-top: 10px; }
  .record-console:has(.mic-console:not([hidden])) h2,
  .record-console:has(.mic-console:not([hidden])) > p:not(.console-kicker) { display: none; }
  .response-panel { right: 14px; left: 14px; width: auto; }
}

/* R-7: 高さゲートは JS 付与クラス（visualViewport 追従）。幅は max-width。 */
@media (max-width: 760px) {
  html.vvh-short .status-bar { height: calc(42px + env(safe-area-inset-top)); }
  html.vvh-short .record-stage { inset: calc(42px + env(safe-area-inset-top)) 0 0; }
  html.vvh-short .record-console { min-height: calc(116px + env(safe-area-inset-bottom)); padding-top: 8px; }
  html.vvh-short .record-console h2 { font-size: 16px; }
  html.vvh-short .mic-console .mic-button { width: 60px; height: 60px; }
  html.vvh-short .record-document { padding: 14px; width: min(90%, 380px); }
  html.vvh-short .record-document h2 { margin: 9px 0; font-size: 30px; }
  html.vvh-short :is(.response-panel, .fallback-panel) { bottom: calc(124px + env(safe-area-inset-bottom)); }
  html.vvh-short :is(.title-screen, .clear-screen) { gap: 8px; padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  html.vvh-short .title-copy { padding: 14px 16px 16px; }
  html.vvh-short .title-copy h1, html.vvh-short .clear-screen h2 { margin: 2px 0 8px; font-size: clamp(24px, 6vw, 34px); padding-bottom: 7px; }
  html.vvh-short .title-copy .lead { margin-bottom: 10px; font-size: 13px; line-height: 1.6; }
  html.vvh-short .title-copy .notice { margin-bottom: 10px; }
  html.vvh-short .clear-invite { margin: 2px 0 8px; font-size: 11px; }
  html.vvh-short .clear-actions { margin-bottom: 8px; }
  html.vvh-short .title-footnote { font-size: 10px; }

  html.vvh-tiny .title-copy .lead { font-size: 12px; line-height: 1.5; }
  html.vvh-tiny .clear-invite, html.vvh-tiny .title-footnote { display: none; }
  html.vvh-tiny .title-copy h1, html.vvh-tiny .clear-screen h2 { font-size: clamp(20px, 6vw, 28px); margin: 0 0 6px; }
  html.vvh-tiny .clear-detail { margin-bottom: 8px; }
}

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