/* 面接練習 体験版 — 見た目はすべて仮 */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --text: #22201c;
  --muted: #6b675e;
  --line: #dcd8ce;
  --accent: #2f6d5f;
  --accent-text: #ffffff;
  --ok: #2e7d4f;
  --ok-bg: #e2f2e8;
  --bad: #b3372d;
  --bad-bg: #fbe5e2;
  --warn: #9a6400;
  --warn-bg: #fff1d6;
  --hl-el: #d6e6ff;
  --hl-plus: #d4f0dc;
  --hl-minus: #ffe0b8;
  --hl-ng: #ffc9c4;
  --hl-adv: #eadcff;
  --hl-exempt: #e6e6e6;
  --skin: #f3d3b6;
  --hair: #3a2f28;
  --suit: #34495e;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171714;
    --surface: #22221e;
    --surface-2: #2c2c27;
    --text: #ecebe6;
    --muted: #a7a398;
    --line: #3b3a34;
    --accent: #5fb3a0;
    --accent-text: #10201c;
    --ok: #7fd09c;
    --ok-bg: #1d3226;
    --bad: #ff8f84;
    --bad-bg: #3a1f1c;
    --warn: #f0c060;
    --warn-bg: #3a2f17;
    --hl-el: #23395e;
    --hl-plus: #1f4a2c;
    --hl-minus: #5a3d14;
    --hl-ng: #6a2621;
    --hl-adv: #3f2d61;
    --hl-exempt: #3a3a3a;
    --skin: #e8c3a2;
    --hair: #1d1814;
    --suit: #6e8aa6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171714; --surface: #22221e; --surface-2: #2c2c27; --text: #ecebe6; --muted: #a7a398; --line: #3b3a34;
  --accent: #5fb3a0; --accent-text: #10201c; --ok: #7fd09c; --ok-bg: #1d3226; --bad: #ff8f84; --bad-bg: #3a1f1c;
  --warn: #f0c060; --warn-bg: #3a2f17; --hl-el: #23395e; --hl-plus: #1f4a2c; --hl-minus: #5a3d14; --hl-ng: #6a2621;
  --hl-adv: #3f2d61; --hl-exempt: #3a3a3a; --skin: #e8c3a2; --hair: #1d1814; --suit: #6e8aa6; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
.wide { max-width: 1100px; }
h1 { font-size: 1.45rem; line-height: 1.35; margin: 8px 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
p { margin: 0 0 10px; }
a { color: var(--accent); }
small, .muted { color: var(--muted); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
button, .btn {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
}
button.primary, .btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
button.big { font-size: 1.15rem; padding: 14px 32px; width: 100%; }
button:disabled { opacity: .5; cursor: default; }
button.link { border: 0; background: none; color: var(--accent); padding: 4px 6px; min-height: 44px; text-decoration: underline; } /* スマホで指が届くように44px */
.hidden { display: none !important; }

/* スイッチ */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; padding: 4px 0; min-height: 44px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { left: 21px; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.privacy { font-size: .85rem; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.linebox { font-size: .85rem; word-break: break-all; }

/* 面接画面 */
.stage { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; }
@media (max-width: 520px) { .stage { grid-template-columns: 96px minmax(0, 1fr); gap: 10px; } }
.avatar svg { width: 100%; height: auto; display: block; }
.avatar .eye, .avatar .mouth { transform-box: fill-box; transform-origin: center; transition: transform .08s; }
.avatar.blink .eye { transform: scaleY(.1); }
.avatar.talking .mouth { animation: talk .22s infinite alternate ease-in-out; }
.avatar.pulse .mouth { transform: scaleY(4.2); }
@keyframes talk { from { transform: scaleY(1); } to { transform: scaleY(3.6); } }
@media (prefers-reduced-motion: reduce) { .avatar.talking .mouth { animation-duration: .6s; } }
.bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 1.08rem;
  font-weight: 600;
  position: relative;
  min-height: 3.4em;
}
.bubble .kind { display: block; font-size: .75rem; font-weight: 400; color: var(--muted); }
.progress { font-size: .85rem; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.transcript {
  min-height: 7em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}
.transcript .interim { color: var(--muted); }
textarea {
  font: inherit;
  width: 100%;
  min-height: 9em;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 12px;
  resize: vertical;
}
.status { font-size: .85rem; color: var(--muted); min-height: 1.4em; }
/* v0.9 「話す」「続けて話す」:親指で押しやすい大きさ */
button.talk { width: 100%; min-height: 72px; font-size: 1.35rem; margin: 4px 0 6px; }
.recdot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: var(--bad); margin-right: 6px; vertical-align: -.05em; animation: recblink 1s infinite alternate; }
@keyframes recblink { from { opacity: 1; } to { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .recdot { animation: none; } }
.err { font-size: .78rem; color: var(--bad); }
.hint { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 8px 12px; font-size: .92rem; }

/* 計測(簡易表示) */
.sensors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: .82rem; }
@media (max-width: 520px) { .sensors { grid-template-columns: 1fr; } }
.sensor { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.meter { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin: 6px 0; }
.meter > div { height: 100%; width: 0; background: var(--accent); transition: width .08s linear; }
/* マイクチェック(最初の画面) */
.miccheck { padding: 4px 0 8px; }
.miccheck .meter.grow { flex: 1 1 120px; min-width: 0; margin: 0; }
.miccheck .status { margin: 6px 0 0; }
.cam { display: flex; gap: 10px; align-items: flex-start; }
.cam video { width: 96px; height: 72px; border-radius: 8px; background: var(--surface-2); object-fit: cover; transform: scaleX(-1); flex: none; }

/* 講評 */
.review-line { padding: 8px 10px; border-radius: 8px; margin: 4px 0; transition: background .2s; }
.review-line.now { background: var(--warn-bg); }
.tag { display: inline-block; font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin-right: 6px; vertical-align: middle; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.model { border-left: 4px solid var(--accent); padding: 6px 12px; background: var(--surface-2); border-radius: 0 8px 8px 0; }

/* 結果 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { font-size: .8rem; border-radius: 999px; padding: 2px 10px; border: 1px solid var(--line); background: var(--surface); }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.chip.opt { color: var(--muted); }
.answer { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin: 6px 0; word-break: break-all; }
table.score { border-collapse: collapse; width: 100%; font-size: .85rem; }
table.score td, table.score th { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
table.score td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dig { border-left: 3px solid var(--line); padding-left: 10px; margin: 10px 0 0; }
.juku { border: 2px dashed var(--accent); text-align: center; font-weight: 700; padding: 20px 16px; }

/* 色付け(どの言葉で判定したか) */
mark { color: inherit; border-radius: 3px; padding: 0 1px; }
mark.hl-el { background: var(--hl-el); }
mark.hl-plus { background: var(--hl-plus); }
mark.hl-minus { background: var(--hl-minus); }
mark.hl-ng { background: var(--hl-ng); }
mark.hl-adv { background: var(--hl-adv); }
mark.hl-exempt { background: var(--hl-exempt); text-decoration: line-through; }
mark.multi { box-shadow: inset 0 -2px 0 var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .78rem; color: var(--muted); }
.legend mark { padding: 0 6px; }

/* テストページ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat .v { font-size: 1.8rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .v.big { font-size: 2.4rem; color: var(--accent); }
.stat .l { font-size: .8rem; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; position: sticky; top: 0; background: var(--bg); padding: 10px 0; z-index: 2; border-bottom: 1px solid var(--line); }
.filters select, .filters input[type=search] { font: inherit; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); min-height: 40px; max-width: 100%; }
.case { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 760px) { .case { grid-template-columns: minmax(0, 1fr); } }
.case-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.case-head .id { font-weight: 700; }
.verdict { font-weight: 700; padding: 2px 10px; border-radius: 999px; font-size: .85rem; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); }
.checks { list-style: none; padding: 0; margin: 4px 0; font-size: .85rem; }
.checks li { padding: 2px 0; }
.checks li.bad { color: var(--bad); font-weight: 600; }
.expect { font-size: .82rem; color: var(--muted); }
.expect b { color: var(--text); font-weight: 600; }
.causes { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.causes li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.causes button { min-height: 0; padding: 0 10px; font-size: .8rem; }
.warnings { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 8px 12px; font-size: .85rem; }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; }
details summary::before { content: "▶"; font-size: .7em; transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }
details summary::-webkit-details-marker { display: none; }
details summary { list-style: none; }
/* ?debug=1 のときだけ出る音声認識の生の結果 */
.debuglog { margin: 16px; padding: 10px; font-size: .72rem; white-space: pre-wrap; word-break: break-all; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; max-height: 40vh; overflow-y: auto; }
