/* 音声会話「ドパガキと話す」（2026-10-14 本人承認）の会話欄。試作 tools/voice-trial/client.css の写しで、クラス名の dpg-voice-trial を dpg-voice-chat に替えただけ
   （見た目は試作のまま）。変えたのは、試作の円の1行（__cost）の代わりの「今月の残り N分」（__remaining）と「あと30秒」（__notice）の2行だけ。 */
.dpg-voice-chat__trigger, .dpg-voice-chat button { font: inherit; font-size: 16px; border-radius: 10px; border: 1px solid #ad8973; cursor: pointer; }
.dpg-voice-chat__trigger { display: block; margin: 16px 0; padding: 10px 16px; color: #fff; background: #6535b5; border-color: #6535b5; }
.dpg-voice-chat__trigger:hover, .dpg-voice-chat__primary:hover { filter: brightness(.95); }
.dpg-voice-chat { box-sizing: border-box; color: #292622; background: #fff; border: 1px solid #eadfcf; border-radius: 18px; font-family: Hiragino Sans, Yu Gothic UI, Yu Gothic, Meiryo, sans-serif; font-size: 16px; line-height: 1.5; }
.dpg-voice-chat *, .dpg-voice-chat *::before, .dpg-voice-chat *::after { box-sizing: border-box; }
.dpg-voice-chat [hidden] { display: none !important; }
.dpg-voice-chat__panel { display: flex; flex-direction: column; min-height: 0; height: 100%; padding: 22px 18px 16px; }
.dpg-voice-chat__header { position: relative; display: flex; align-items: flex-start; flex: none; gap: 9px; min-height: 56px; }
.dpg-voice-chat__mascot { flex: none; width: 56px; height: 56px; border: 1px solid #ab84ec; border-radius: 50%; object-fit: contain; }
.dpg-voice-chat__heading { flex: 1; min-width: 0; }
.dpg-voice-chat h2 { margin: 0; font-size: 18px; line-height: 1.35; }
.dpg-voice-chat .dpg-voice-chat__header-action { flex: none; width: 44px; height: 44px; margin: -4px -4px 0 0; padding: 0; border: 0; background: transparent; color: #65594d; font-size: 26px; line-height: 1; }
.dpg-voice-chat__header-action:hover { background: #f2ebfb; }
.dpg-voice-chat__question-title { margin: 3px 0 0; color: #65594d; font-size: 14px; overflow-wrap: anywhere; }
.dpg-voice-chat__presence { position: absolute; right: 0; bottom: 0; display: flex; align-items: center; gap: 9px; min-height: 26px; }
.dpg-voice-chat__active-badge { width: 10px; height: 10px; margin: 5px; border-radius: 50%; background: #2fa76a; box-shadow: 0 0 0 5px #e9f8ee; }
.dpg-voice-chat__wave { display: block; width: 34px; height: 18px; opacity: 0; background: repeating-linear-gradient(90deg, transparent 0 3px, #a879df 3px 5px, transparent 5px 8px); clip-path: polygon(0 44%, 8% 35%, 16% 65%, 24% 14%, 32% 82%, 40% 26%, 48% 58%, 56% 34%, 64% 72%, 72% 18%, 80% 65%, 88% 38%, 100% 46%, 100% 54%, 88% 62%, 80% 35%, 72% 82%, 64% 28%, 56% 66%, 48% 42%, 40% 74%, 32% 18%, 24% 86%, 16% 35%, 8% 65%, 0 56%); }
.dpg-voice-chat--active .dpg-voice-chat__wave { opacity: .72; }
.dpg-voice-chat__status { flex: none; margin: 4px 0 10px; color: #65594d; font-size: 14px; }
.dpg-voice-chat--active .dpg-voice-chat__status:not(.dpg-voice-chat__error) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.dpg-voice-chat__error { color: #9e2f2f; }
.dpg-voice-chat__conversation { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 2px 12px; }
.dpg-voice-chat__transcript { margin: 0; padding: 0; list-style: none; }
.dpg-voice-chat__transcript:empty { display: none; }
.dpg-voice-chat__line { display: flex; align-items: flex-start; gap: 7px; margin: 0 0 18px; line-height: 1.5; overflow-wrap: anywhere; }
.dpg-voice-chat__line--user { justify-content: flex-end; }
.dpg-voice-chat__line-avatar { flex: none; width: 32px; height: 32px; border: 1px solid #ab84ec; border-radius: 50%; object-fit: contain; }
.dpg-voice-chat__user-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; color: #65594d; background: #f1f2f4; }
.dpg-voice-chat__user-icon svg { width: 22px; height: 22px; }
.dpg-voice-chat__line-content { display: flex; flex-direction: column; max-width: calc(100% - 40px); }
.dpg-voice-chat__line--user .dpg-voice-chat__line-content { align-items: flex-end; }
.dpg-voice-chat__bubble { width: fit-content; padding: 10px 12px; border: 0; border-radius: 14px; background: #f3ecfc; }
.dpg-voice-chat__line--user .dpg-voice-chat__bubble { background: #f1f2f4; }
.dpg-voice-chat__speaker { display: block; margin-bottom: 3px; color: #6535b5; font-size: 14px; font-weight: 600; }
.dpg-voice-chat__line--user .dpg-voice-chat__speaker { color: #65594d; text-align: left; }
.dpg-voice-chat__message { display: block; white-space: pre-wrap; }
.dpg-voice-chat__time { display: block; margin: 4px 4px 0; color: #65594d; font-size: 14px; line-height: 1.2; }
.dpg-voice-chat__empty { margin: 0; padding: 16px 12px; color: #65594d; font-size: 14px; }
.dpg-voice-chat__actions { display: flex; flex: none; flex-wrap: wrap; gap: 10px; margin: 0; padding: 14px 0 10px; border-top: 1px solid #eadfcf; background: #fff; }
.dpg-voice-chat__actions button { min-height: 44px; }
.dpg-voice-chat .dpg-voice-chat__primary { flex: 1; padding: 9px 16px; color: #fff; background: #6535b5; border-color: #6535b5; border-radius: 999px; font-weight: 700; }
.dpg-voice-chat .dpg-voice-chat__stop { display: flex; align-items: center; justify-content: center; gap: 9px; }
.dpg-voice-chat__stop-icon { width: 12px; height: 12px; border-radius: 2px; background: currentColor; }
.dpg-voice-chat .dpg-voice-chat__mute { display: grid; place-items: center; flex: none; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; color: #6535b5; background: #f3ecfc; }
.dpg-voice-chat__mute svg { width: 23px; height: 23px; }
.dpg-voice-chat .dpg-voice-chat__mute[aria-pressed="true"] { color: #fff; background: #6535b5; border-color: #6535b5; }
.dpg-voice-chat__secondary { padding: 9px 12px; color: #6535b5; background: #fff; border-color: #6535b5; }
.dpg-voice-chat__actions .dpg-voice-chat__secondary { flex: 1; border: 2px solid #6535b5; border-radius: 999px; font-weight: 600; }
.dpg-voice-chat button:disabled { cursor: not-allowed; opacity: .5; }
.dpg-voice-chat__hint, .dpg-voice-chat__remaining { color: #65594d; font-size: 14px; }
.dpg-voice-chat__hint { flex: none; margin: 8px 0 0; }
/* 試作の円の1行（margin 6px 0 0 を直接書いていた）と同じ位置・大きさ。 */
.dpg-voice-chat__remaining { flex: none; margin: 6px 0 0; }
.dpg-voice-chat__notice { flex: none; margin: 6px 0 0; color: #6535b5; font-size: 14px; font-weight: 700; }
.dpg-voice-chat__compact { position: relative; width: 120px; height: 84px; }
.dpg-voice-chat .dpg-voice-chat__orb { position: absolute; left: 23px; top: 2px; display: block; width: 68px; height: 68px; overflow: hidden; padding: 0; border: 2px solid #8559d0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgb(101 53 181 / 12%), 0 4px 12px rgb(41 38 34 / 16%); touch-action: none; user-select: none; }
.dpg-voice-chat__orb-mascot { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.dpg-voice-chat--active .dpg-voice-chat__orb { box-shadow: 0 0 0 5px rgb(101 53 181 / 32%), 0 4px 12px rgb(41 38 34 / 20%); }
.dpg-voice-chat .dpg-voice-chat__orb-action { position: absolute; left: 71px; top: 41px; width: 44px; height: 44px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: #6535b5; color: #fff; font-size: 18px; line-height: 1; box-shadow: 0 3px 8px rgb(41 38 34 / 25%); }
.dpg-voice-chat__compact-waves { position: absolute; inset: 17px 0 auto; height: 25px; opacity: 0; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 4px, #9e69dc 4px 6px, transparent 6px 9px); clip-path: polygon(0 35%, 8% 60%, 16% 15%, 24% 80%, 76% 80%, 84% 15%, 92% 60%, 100% 35%, 100% 65%, 92% 40%, 84% 85%, 76% 20%, 24% 20%, 16% 85%, 8% 40%, 0 65%); }
.dpg-voice-chat--active .dpg-voice-chat__compact-waves { opacity: .75; }
.dpg-voice-chat__compact-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.dpg-voice-chat.dpg-voice-chat--collapsed { position: fixed; z-index: 2147483000; right: auto; bottom: auto; width: 120px; height: 84px; margin: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
.dpg-voice-chat.dpg-voice-chat--collapsed::before { display: none; }
@media (min-width: 1200px) {
  html.has-voice-chat .qz-app[data-screen="quiz"] { margin-right: 364px; }
  html.has-voice-chat:not(.has-voice-chat-collapsed) .dpgk-hint { right: 364px; }
  .dpg-voice-chat { position: fixed; z-index: 60; top: 8px; right: 8px; width: 340px; height: calc(100dvh - 16px); overflow: hidden; border-radius: 18px; box-shadow: -4px 0 16px rgb(41 38 34 / 12%); }
}
@media (max-width: 1199px) {
  .dpg-voice-chat { width: min(100% - 32px, 700px); margin: 16px auto 32px; border-radius: 16px; }
  .dpg-voice-chat__panel { height: auto; }
  .dpg-voice-chat__conversation { flex: none; max-height: 38vh; overflow-y: auto; }
  .dpg-voice-chat.dpg-voice-chat--collapsed { width: 120px; margin: 0; }
}
@media (max-width: 1023.98px) {
  .dpg-voice-chat:not(.dpg-voice-chat--collapsed) {
    margin-bottom: calc(32px + var(--dpg-nav-h, 58px) + var(--dpg-nav-gap, 10px) + env(safe-area-inset-bottom, 0px));
    scroll-margin-bottom: calc(var(--dpg-nav-h, 58px) + var(--dpg-nav-gap, 10px) + 16px + env(safe-area-inset-bottom, 0px));
  }
  .dpg-voice-chat__panel { scroll-margin-bottom: calc(var(--dpg-nav-h, 58px) + var(--dpg-nav-gap, 10px) + 16px + env(safe-area-inset-bottom, 0px)); }
  .dpg-voice-chat__actions { scroll-margin-bottom: calc(var(--dpg-nav-h, 58px) + var(--dpg-nav-gap, 10px) + 16px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 480px) {
  .dpg-voice-chat__panel { padding: 14px; }
  .dpg-voice-chat h2 { font-size: 16px; }
  .dpg-voice-chat__header { gap: 4px; }
  .dpg-voice-chat .dpg-voice-chat__header-action { width: 44px; margin-right: -8px; }
}

/* ===========================================================================
   音声で学ぶモード（2026-10-21 本人決定。assets/voice-chat-control.js）
   上の枠の［声］（案A）: 聞いている間は名前を紫・太字にし、絵の右上に小さな緑の点。一時停止・使えないときは絵を薄く。
   聞き取った言葉の札は上の枠のすぐ下の真ん中（位置は JS が上の枠から決める）。2.4秒で消える。
   =========================================================================== */
.qz-voice-btn .qz-sound-btn__icon { position: relative; }
.qz-voice-btn[data-voice="listening"] .qz-sound-btn__icon::after,
.qz-voice-btn[data-voice="ptt-listening"] .qz-sound-btn__icon::after {
  content: ""; position: absolute; top: -1px; right: -5px; width: 8px; height: 8px; border-radius: 50%;
  background: #22a35a; box-shadow: 0 0 0 2px var(--surface, #fff);
}
:root[data-quiz-theme] .qz-quiz-head .qz-voice-btn[data-voice="listening"]:not(#_),
:root[data-quiz-theme] .qz-quiz-head .qz-voice-btn[data-voice="ptt-listening"]:not(#_) { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
:root[data-quiz-theme] .qz-quiz-head .qz-voice-btn[data-voice="listening"] .qz-sound-btn__name:not(#_),
:root[data-quiz-theme] .qz-quiz-head .qz-voice-btn[data-voice="ptt-listening"] .qz-sound-btn__name:not(#_),
.qz-quiz-head .qz-voice-btn[data-voice="listening"] .qz-sound-btn__name,
.qz-quiz-head .qz-voice-btn[data-voice="ptt-listening"] .qz-sound-btn__name { color: var(--accent); font-weight: 800; }
/* 2026-10-28 区間T4 直し係A: 聞いていない間はマイクの絵に［音］の消音と同じ赤い斜線を重ねる（quiz.css の .qz-sound-btn[data-off] と同じ規則）。
   絵を薄くするのは今までどおり。斜線（絵の入れ物の ::after）まで薄くならないよう、薄くするのは絵（svg）だけにした（絵の見え方は前と同じ）。 */
.qz-voice-btn[data-voice="paused"] .qz-sound-btn__icon > svg,
.qz-voice-btn[data-voice="denied"] .qz-sound-btn__icon > svg,
.qz-voice-btn[data-voice="unsupported"] .qz-sound-btn__icon > svg { opacity: .5; }
.dpg-voice-chip {
  position: fixed; z-index: 70; left: 50%; top: 8px; transform: translate(-50%, -4px);
  max-width: calc(100vw - 32px); padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft, #f1eafa); color: var(--accent, #6d28d9);
  font-size: 13px; font-weight: 700; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgb(0 0 0 / .12); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.dpg-voice-chip.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .dpg-voice-chip { transition: none; } }

/* 言える言葉のシート（2026-10-23 本人決定: 案C。voice-chat-control.js の openHelp）。色はアプリの札（ダークでも切り替わる）から */
[data-role="voice-toggle"] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.dpg-voice-help { position: fixed; inset: 0; z-index: 80; }
.dpg-voice-help__backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .32); }
.dpg-voice-help__sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: min(78vh, 760px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface, #fff); color: var(--text, #1d1d1f); border-radius: 22px 22px 0 0; box-shadow: 0 -6px 24px rgb(0 0 0 / .18);
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.dpg-voice-help__grip { width: 40px; height: 5px; border-radius: 999px; background: var(--separator, rgb(0 0 0 / .12)); margin: 0 auto 8px; }
.dpg-voice-help__head { display: flex; align-items: center; gap: 10px; }
.dpg-voice-help__ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft, #f1eafa); color: var(--accent, #6535b5); flex: none; }
.dpg-voice-help__title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 18px; font-weight: 800; }
.dpg-voice-help__close { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2, #6e6e73); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.dpg-voice-help__x { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2, #f4f4f7); font-size: 13px; }
.dpg-voice-help__tip { margin: 10px 0 12px; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft, #f1eafa); color: var(--accent, #6535b5); font-size: 13px; font-weight: 700; line-height: 1.55; }
.dpg-voice-help__h { margin: 4px 0 8px; font-size: 15px; font-weight: 800; }
.dpg-voice-help__top, .dpg-voice-help__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dpg-voice-help__top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dpg-voice-help__list { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); flex: 1 1 auto; min-width: 0; }
.dpg-voice-help__card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; padding: 8px 6px; border: 1px solid color-mix(in srgb, var(--accent, #6535b5) 35%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--accent-soft, #f1eafa) 45%, var(--surface, #fff)); text-align: center; }
.dpg-voice-help__card.is-big { min-height: 64px; }
.dpg-voice-help__say { color: var(--accent, #6535b5); font-size: 14px; font-weight: 800; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }
.dpg-voice-help__card.is-big .dpg-voice-help__say { font-size: 16px; }
.dpg-voice-help__does { color: var(--text-2, #6e6e73); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.dpg-voice-help__more { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; margin: 14px 0 6px; padding: 0 4px; border: 0; border-top: 1px solid var(--separator, rgb(0 0 0 / .08)); background: transparent; color: var(--text, #1d1d1f); font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; }
.dpg-voice-help__chev { color: var(--accent, #6535b5); }
.dpg-voice-help__others { display: grid; gap: 10px; }
.dpg-voice-help__others[hidden] { display: none; }
.dpg-voice-help__row { display: flex; gap: 8px; align-items: stretch; }
.dpg-voice-help__label { flex: none; display: grid; place-items: center; width: 64px; padding: 6px 4px; border-radius: 12px; background: var(--accent-soft, #f1eafa); color: var(--accent, #6535b5); font-size: 13px; font-weight: 800; text-align: center; }
.dpg-voice-help__close:focus-visible, .dpg-voice-help__more:focus-visible { outline: 3px solid var(--accent, #6535b5); outline-offset: 2px; }
@media (max-width: 359px) { .dpg-voice-help__top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
