/* ===== 配色 =====
   色は「重点」だけに使う：丸ボタン（操作）と結果（正常／注意／エラー）。それ以外は無彩色。
   浅色が既定、システムが深色なら自動で深色に切り替える。 */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f7f8;
  --surface-3: #e8eaed;
  --text: #16181d;
  --muted: #6b7079;
  --line: #e8eaed;
  --link: #1a56db;
  --accent: #1f8f5f;
  --accent-hover: #1a7c52;
  --accent-ink: #ffffff;
  --accent-ring: rgba(31, 143, 95, .14);
  --ok: #1f8f5f;
  --ok-soft: #e9f6ef;
  --warn: #b45309;
  --warn-soft: #fef4e2;
  --error: #c2261d;
  --error-soft: #fdecea;
  --rec: #dc2f2f;
  --rec-soft: #fdecec;
  --rec-ring: rgba(220, 47, 47, .18);
  --wave: #3b3f47;
  --on: #16181d;
  --radius: 16px;
  --shadow: none;
  color-scheme: light;
}
/* 深色（システム設定に合わせる） */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1012;
    --surface: #16181b;
    --surface-2: #1d2024;
    --surface-3: #2b2f35;
    --text: #eceef1;
    --muted: #9aa0a8;
    --line: #26292e;
    --link: #7aa7ff;
    --accent: #24a06b;
    --accent-hover: #2bb37a;
    --accent-ink: #ffffff;
    --accent-ring: rgba(36, 160, 107, .2);
    --ok: #3ccf8e;
    --ok-soft: rgba(60, 207, 142, .12);
    --warn: #f5b84a;
    --warn-soft: rgba(245, 184, 74, .12);
    --error: #ff7b72;
    --error-soft: rgba(255, 123, 114, .12);
    --rec: #ff6b6b;
    --rec-soft: rgba(255, 107, 107, .14);
    --rec-ring: rgba(255, 107, 107, .22);
    --wave: #d7dbe0;
    --on: #eceef1;
    --knob: #16181b;
    color-scheme: dark;
  }
}
/* ===== ベース ===== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}
a { color: var(--link); }
img, canvas { max-width: 100%; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--text); color: var(--surface); display: inline-grid; place-items: center; }
.brand-mark svg { width: 16px; height: 16px; display: block; }
.site-nav { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 14px; }
.site-nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
@media (max-width: 639px) {
  .site-header .wrap { padding-top: 8px; gap: 2px; }
  .site-nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 8px; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
}

main { padding: 24px 0 48px; }
h1 { font-size: clamp(24px, 4.5vw, 32px); line-height: 1.4; margin: 8px 0 8px; }
.lead { color: var(--muted); margin: 0 0 20px; }
h2 { font-size: 22px; line-height: 1.5; margin: 40px 0 12px; padding-top: 8px; border-top: 1px solid var(--line); }
h3 { font-size: 18px; margin: 24px 0 8px; }
p, ul, ol { margin: 0 0 14px; }
li { margin-bottom: 6px; }
.note { font-size: 14px; color: var(--muted); }
.crumbs { font-size: 13px; color: var(--muted); margin: 0; }
.crumbs a { color: var(--muted); }

/* ===== ツール ===== */
.mt {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px 20px;
  margin: 8px 0 12px;
}
.mt svg { display: block; }
.mt-grid { display: grid; gap: 24px; }
.mt-main { min-width: 0; }
@media (min-width: 760px) {
  .mt { padding: 28px; }
  .mt-grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; }
  .mt-side { border-left: 1px solid var(--line); padding-left: 28px; }
}

.mt-stage { display: flex; flex-direction: column; align-items: center; text-align: center; padding-bottom: 16px; }
.mt-orb { position: relative; width: 128px; height: 128px; border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex: none; -webkit-tap-highlight-color: transparent; }
.mt-orb:focus-visible { outline: none; }
.mt-orb:focus-visible .mt-orb-core { outline: 3px solid var(--accent); outline-offset: 5px; }
.mt-orb-level { position: absolute; inset: 6px; border-radius: 50%; background: var(--accent-ring); transform: scale(var(--s, 1)); }
.mt:not(.is-running):not(.is-pending) .mt-orb-level { animation: mt-breathe 2.4s ease-in-out infinite; }
.mt-orb-core { position: relative; width: 96px; height: 96px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 8px 24px var(--accent-ring); transition: transform .12s, background-color .2s; }
.mt-orb:hover .mt-orb-core { background: var(--accent-hover); }
.mt-orb:active .mt-orb-core { transform: scale(.94); }
.mt-i-mic { width: 40px; height: 40px; }
.mt-i-stop { width: 34px; height: 34px; }
.mt-i-stop, .mt-spinner, .is-running .mt-i-mic, .is-pending .mt-i-mic { display: none !important; }
.is-running .mt-i-stop { display: block !important; }
.is-pending .mt-spinner { display: block !important; }
.mt-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: mt-spin .8s linear infinite; }

.mt-stage-text { margin-top: 12px; }
.mt-status { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.5; }
.mt-status[data-kind="ok"] { color: var(--ok); }
.mt-status[data-kind="warn"] { color: var(--warn); }
.mt-status[data-kind="error"] { color: var(--error); }
.mt-sub { margin: 2px 0 0; max-width: 34em; font-size: 13px; color: var(--muted); }
.mt-sub:empty { display: none; }

.mt-meter-row { display: flex; align-items: center; gap: 12px; }
.mt-meter { position: relative; flex: 1; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.mt-meter-fill {
  --lvl: 0%;
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--ok) 0 68%, #e2a93c 84%, #e5484d);
  clip-path: inset(0 calc(100% - var(--lvl)) 0 0 round 999px);
}
.mt-meter-peak { position: absolute; top: 0; bottom: 0; width: 2px; left: 0%; background: var(--text); opacity: .45; }
.mt:not(.is-running) .mt-meter-peak { display: none; }
.mt-db { min-width: 56px; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mt-wave { display: block; width: 100%; height: 72px; margin-top: 12px; border-radius: 12px; background: var(--surface-2); color: var(--surface-3); }
.mt.is-running .mt-wave { color: var(--wave); }

.mt-actions { display: flex; align-items: center; justify-content: center; gap: 12px 22px; flex-wrap: wrap; margin-top: 16px; }
.mt-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s, color .15s, border-color .15s, transform .08s; }
.mt-btn:hover:not(:disabled) { background: var(--surface-2); }
.mt-btn:active:not(:disabled) { transform: scale(.97); }
.mt-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-btn:disabled { opacity: .4; cursor: not-allowed; }
.mt-rec { min-width: 150px; }
.mt-rec-ico { position: relative; width: 20px; height: 20px; display: grid; place-items: center; }
.mt-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); transition: border-radius .15s, width .15s, height .15s; }
.mt-ring { position: absolute; inset: 0; width: 20px; height: 20px; transform: rotate(-90deg); }
.mt-ring circle { fill: none; stroke-width: 2.2; }
.mt-ring-bg { stroke: transparent; }
.mt-ring-fg { stroke: var(--rec); stroke-linecap: round; }
.mt-rec-label { font-variant-numeric: tabular-nums; }
.mt.is-recording .mt-rec, .mt.is-recording .mt-rec:hover { background: var(--rec-soft); color: var(--rec); border-color: transparent; }
.mt.is-recording .mt-ring-bg { stroke: var(--rec-ring); }
.mt.is-recording .mt-rec-dot { width: 8px; height: 8px; border-radius: 2px; }

.mt-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.mt-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mt-track { position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px; background: var(--surface-3); transition: background-color .2s; }
.mt-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--knob, #fff); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .22s cubic-bezier(.3,.7,.4,1); }
.mt-switch input:checked + .mt-track { background: var(--on); }
.mt-switch input:checked + .mt-track .mt-knob { transform: translateX(16px); }
.mt-switch input:focus-visible + .mt-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-switch:has(input:disabled) { cursor: not-allowed; opacity: .4; }
.mt-sw-text { font-size: 15px; font-weight: 600; line-height: 1.35; text-align: left; }
.mt-sw-text small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }

.mt-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.mt-player { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 14px 10px 10px; border-radius: 14px; background: var(--surface-2); animation: mt-rise .25s ease-out; }
.mt-play { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--text); color: var(--surface); display: grid; place-items: center; cursor: pointer; transition: transform .08s, opacity .15s; }
.mt-play:hover { opacity: .85; }
.mt-play:active { transform: scale(.94); }
.mt-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-play svg { width: 16px; height: 16px; }
.mt-i-pause, .is-playing .mt-i-play { display: none !important; }
.is-playing .mt-i-pause { display: block !important; }
.mt-p-body { flex: 1; min-width: 0; }
.mt-p-title { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.mt-p-track { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.mt-p-fill { height: 100%; width: 0; background: var(--text); border-radius: inherit; }
.mt-p-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mt-player audio { display: none; }

/* マイク情報 */
.mt-side-title { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.mt-field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.mt-field select { width: 100%; font: inherit; font-size: 14px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.mt-field.is-attn select { outline: 2px solid var(--warn); outline-offset: 1px; }
.mt-info { margin: 12px 0; }
.mt-info div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.5; }
.mt-info dt { color: var(--muted); }
.mt-info dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.mt-check { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.mt-check input { margin-top: 2px; }

/* プライバシー */
.mt-privacy { margin-top: 22px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); }
.mt-privacy-title { margin: 0 0 2px; font-size: 14px; font-weight: 700; }
.mt-privacy-text { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.7; }

@keyframes mt-spin { to { transform: rotate(360deg); } }
@keyframes mt-rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes mt-breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .mt-orb-level { animation: none !important; } }

/* ===== 本文 ===== */
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; margin-bottom: 12px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line); font-weight: 700; display: grid; place-items: center; font-size: 14px;
}
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 0 0 16px; background: var(--surface); }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--surface-2); white-space: nowrap; }
.phrase { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; }
.phrase strong { display: block; font-size: 17px; }
.phrase span { font-size: 14px; color: var(--muted); }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; }
details summary { cursor: pointer; font-weight: 700; }
details[open] summary { margin-bottom: 6px; }
.related { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 0; list-style: none; }
.related a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--text); }
.related a:hover { border-color: var(--text); }
.related small { display: block; color: var(--muted); }
@media (min-width: 640px) { .related { grid-template-columns: 1fr 1fr; } }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted); }
.site-footer .wrap { padding-top: 20px; padding-bottom: 28px; display: flex; gap: 8px 16px; flex-wrap: wrap; justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* ===== セリフ・プロンプター（ツールの「セリフを見ながら録音」から開く全画面） ===== */
.mt-pr svg { width: 18px; height: 18px; }
.pr-go { display: flex; width: fit-content; align-items: center; gap: 6px; margin-top: 8px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pr-go:hover { background: var(--surface-2); }
.pr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rec); display: inline-block; flex: none; }
html.pr-lock { overflow: hidden; }
.pr-ov { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; flex-direction: column; padding: 16px 20px calc(20px + env(safe-area-inset-bottom)); animation: mt-rise .2s ease-out; }
.pr-top { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 860px; margin: 0 auto; font-size: 13px; color: var(--muted); }
.pr-x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.pr-x svg { width: 18px; height: 18px; }
.pr-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 8px 4px; }
.pr-text { margin: 0; max-width: 18em; font-size: clamp(24px, 6.5vw, 46px); font-weight: 700; line-height: 1.55; letter-spacing: .02em; }
.pr-desc { margin: 14px 0 0; max-width: 34em; font-size: 14px; color: var(--muted); }
.pr-ctl { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 520px; margin: 0 auto; }
.pr-status { margin: 0; min-height: 1.6em; font-size: 14px; color: var(--muted); text-align: center; }
.pr-status[data-kind="rec"] { color: var(--rec); font-weight: 600; }
.pr-status[data-kind="error"] { color: var(--error); }
.pr-meter-row { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 12px; color: var(--muted); }
.pr-meter { position: relative; flex: 1; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.pr-meter i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--ok) 0 68%, #e2a93c 84%, #e5484d); clip-path: inset(0 calc(100% - var(--lvl, 0%)) 0 0 round 999px); }
.pr-rec { position: relative; width: 96px; height: 96px; border: 0; background: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pr-ring { position: absolute; inset: 0; width: 96px; height: 96px; transform: rotate(-90deg); }
.pr-ring circle { fill: none; stroke-width: 5; }
.pr-ring-bg { stroke: var(--surface-3); }
.pr-ring-fg { stroke: var(--rec); stroke-linecap: round; }
.pr-core { position: absolute; inset: 12px; border-radius: 50%; background: var(--rec); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; transition: background-color .2s, color .2s; }
.pr-ov.is-rec .pr-core { background: var(--surface); color: var(--rec); border: 2px solid var(--rec); }
.pr-ov.is-pending .pr-core { opacity: .55; }
.pr-rec:focus-visible { outline: none; }
.pr-rec:focus-visible .pr-core { outline: 3px solid var(--rec); outline-offset: 4px; }
.pr-after { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; min-height: 96px; }
.pr-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.pr-btn:hover { background: var(--surface-2); }
.pr-btn svg { width: 14px; height: 14px; }
.pr-nav { display: flex; justify-content: space-between; width: 100%; }
.pr-nav button { border: 0; background: none; color: var(--link); font: inherit; font-size: 14px; cursor: pointer; padding: 8px 4px; }
.pr-nav button:disabled { opacity: .35; cursor: default; }
