:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --text: #1d2420;
  --muted: #5d6862;
  --line: #dfe4e0;
  --accent: #2f7d5b;
  --accent-ink: #ffffff;
  --accent-soft: #e5f2eb;
  --warn: #9a6400;
  --warn-soft: #fff4dc;
  --error: #b3261e;
  --error-soft: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .05);
  --surface-2: #f1f4f2;
  --surface-3: #e5eae7;
  --accent-hover: #286c4f;
  --accent-ring: rgba(47, 125, 91, .16);
  --rec: #d93f3f;
  --rec-soft: #fdeceb;
  --rec-ring: rgba(217, 63, 63, .18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1311;
    --surface: #171d1a;
    --surface-2: #1f2724;
    --surface-3: #2a3430;
    --text: #e9eeeb;
    --muted: #98a49e;
    --line: #27302c;
    --accent: #4cc08b;
    --accent-hover: #62d19e;
    --accent-ink: #06140d;
    --accent-soft: #173226;
    --accent-ring: rgba(76, 192, 139, .2);
    --rec: #ff6b6b;
    --rec-soft: #3a1e1e;
    --rec-ring: rgba(255, 107, 107, .2);
    --warn: #f0c060;
    --warn-soft: #3a2f17;
    --error: #ff8a80;
    --error-soft: #3b1e1c;
    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(--accent); }
img, canvas { max-width: 100%; }

.wrap { max-width: 860px; 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 svg { width: 16px; height: 16px; display: block; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-size: 15px; }
.site-nav { display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: 14px; }
.site-nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
@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; }
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }

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); }

/* ツール本体（A：中央の丸ボタン） */
.mt {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 24px 20px 18px;
  margin: 8px 0 12px;
}
.mt svg { display: block; }
.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; -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: inset 0 1px 0 rgba(255,255,255,.18), 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-status { margin: 12px 0 0; font-size: 19px; font-weight: 700; line-height: 1.5; }
.mt-status[data-kind="ok"] { color: var(--accent); }
.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, #3aa66f 0 68%, #e2b33c 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(--accent); }

.mt-actions { display: flex; align-items: center; justify-content: center; gap: 12px 22px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.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-2); 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-3); }
.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); border: 1px solid var(--line); transition: background-color .2s, border-color .2s; }
.mt-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #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(--accent); border-color: var(--accent); }
.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); border: 1px solid var(--line); animation: mt-rise .25s ease-out; }
.mt-play { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; transition: transform .08s, background-color .15s; }
.mt-play:hover { background: var(--accent-hover); }
.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(--accent); border-radius: inherit; }
.mt-p-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mt-player audio { display: none; }

.mt-settings { margin: 14px 0 0; padding: 0; border: 0; background: none; text-align: center; }
.mt-settings summary { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 400; color: var(--muted); cursor: pointer; list-style: none; }
.mt-settings summary::-webkit-details-marker { display: none; }
.mt-settings summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 4px; transition: transform .2s; }
.mt-settings[open] summary { margin-bottom: 0; }
.mt-settings[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.mt-settings-body { display: grid; gap: 12px; margin-top: 12px; text-align: left; }
.mt-field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.mt-field select { width: 100%; font: inherit; font-size: 15px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.mt-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.mt-check input { margin-top: 4px; }
.mt-info { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; font-size: 12.5px; color: var(--muted); margin: 0; }
.mt-info:empty { display: none; }
.mt-info dt { font-weight: 700; }
.mt-info dd { margin: 0; overflow-wrap: anywhere; }
.mt-privacy { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }

@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; } }
@media (min-width: 640px) { .mt { padding: 28px 28px 20px; } }

/* 本文 */
.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(--accent-soft); color: var(--accent); 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(--accent-soft); 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(--accent); }
.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); }
