/* 音の大きさと高さ（じぶんの聞こえプロジェクトの色にそろえる） */
:root {
  --primary: #3ABCB1; --primary-dark: #2da99e; --primary-light: #E8F7F6;
  --ink: #1F2D3A; --muted: #566676; --line: #D3DCE3; --paper: #F4F7F8; --panel: #FFFFFF; --chip: #E9EEF2;
  --right: #D93025; --left: #1A63D8; --aided: #1F2D3A;
  --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "BIZ UDPゴシック", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px; line-height: 1.75;
}
body.big { font-size: 20px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
ruby rt { font-size: 0.55em; color: var(--muted); }

.top {
  position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between;
  padding: .6rem 1rem;
}
.back { font-size: .85rem; font-weight: 700; color: var(--primary-dark); text-decoration: none; }
.back:hover { text-decoration: underline; }
.top h1 { margin: 0; font-size: 1.4rem; line-height: 1.5; }
.lead { margin: 0; font-size: .85rem; color: var(--muted); max-width: 46em; }
.modes { display: flex; gap: 4px; background: var(--chip); border-radius: 12px; padding: 4px; }
.modes button {
  border: none; background: transparent; border-radius: 9px; min-height: 44px; padding: .2rem .9rem;
  font-weight: 700; color: var(--muted);
}
.modes button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }

.grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 1rem; align-items: start;
  padding: 1rem; max-width: 1400px; margin: 0 auto;
}
.left { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }

.settings summary { font-weight: 700; cursor: pointer; }
.toggles { display: flex; flex-wrap: wrap; gap: .1rem 1.2rem; margin: .3rem 0; }
.toggles label { display: flex; align-items: center; gap: .4rem; min-height: 40px; }
.toggles input, .check input { width: 22px; height: 22px; accent-color: var(--primary); }
.check { display: flex; align-items: center; gap: .45rem; min-height: 40px; font-weight: 700; }
.model-note { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: .6rem; margin: 0; }

/* 記号 */

/* ---------- 右のパネル ---------- */
.panel {
  position: sticky; top: 5.5rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .7rem; max-height: calc(100vh - 6.5rem); overflow: auto;
}
.panel h2 { margin: 0; font-size: 1.25rem; line-height: 1.6; }
.panel p { margin: 0; }
.hint { font-size: .88rem; color: var(--muted); margin: 0; }
.err { color: #b3261e; font-weight: 700; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: .45rem .9rem; min-height: 44px; }
.btn.small { min-height: 36px; padding: .2rem .8rem; font-size: .88rem; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.btn:disabled { opacity: .45; cursor: default; }
.btnrow { display: flex; gap: .5rem; }
.btnrow .btn { flex: 1; }
.steps { display: flex; gap: .35rem; flex-wrap: wrap; }
.sdot { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); font-weight: 700; }
.sdot[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-no { font-size: .85rem; color: var(--primary-dark); font-weight: 700; }
.note { font-size: .9rem; background: var(--primary-light); border-radius: 10px; padding: .6rem .8rem; }
.privacy { font-size: .85rem; color: var(--muted); }

.part-btns { display: flex; flex-wrap: wrap; gap: .35rem; }
.pbtn { border: 2px solid var(--line); background: var(--panel); border-radius: 10px; min-height: 44px; padding: .1rem .7rem; }
.pbtn[aria-pressed="true"] { background: #FFC83D; border-color: #E0A800; font-weight: 700; }
.detail { display: flex; flex-direction: column; gap: .5rem; }
.short { font-weight: 700; color: var(--primary-dark); }
.fact { display: grid; grid-template-columns: auto 1fr; gap: .1rem .8rem; margin: 0; }
.fact dt { font-weight: 700; color: var(--muted); }
.fact dd { margin: 0; }
.loss-dl { margin: 0; }
.loss-dl dt { font-size: .82rem; font-weight: 700; color: var(--muted); margin-top: .4rem; }
.loss-dl dd { margin: 0 0 .2rem; }



.loss-tabs { display: flex; gap: .35rem; }
.lbtn { flex: 1; min-height: 46px; border-radius: 10px; border: 2px solid var(--line); background: var(--panel); font-weight: 700; }
.lbtn[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.choices { display: flex; flex-direction: column; gap: .4rem; }
.choice { text-align: left; border: 2px solid var(--line); background: var(--panel); border-radius: 10px; min-height: 48px; padding: .3rem .8rem; }
.choice:not(:disabled):hover { border-color: var(--primary); }
.choice.right { background: #DFF3E8; border-color: #0B7A5E; font-weight: 700; }
.choice.wrong { background: #FBE3E1; border-color: #b3261e; }
.choice:disabled { cursor: default; }
.fb { font-weight: 800; font-size: 1.05rem; }
.fb.ok { color: #0B7A5E; } .fb.ng { color: #b3261e; }
.explain { background: #F4F7F8; border-radius: 10px; padding: .6rem .8rem; }

@media (max-width: 1050px) {
  .grid { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; }
}
@media (max-width: 560px) {
  .grid { padding: .6rem; }
  .top { padding: .5rem .7rem; }
  .top h1 { font-size: 1.2rem; }
  .modes { width: 100%; }
  .modes button { flex: 1; padding: .2rem .3rem; font-size: .85rem; }
  .tools { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 波 ---------- */
.stage { display: flex; flex-direction: column; gap: .7rem; }
.wave-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: .5rem .6rem .7rem; display: flex; flex-direction: column; gap: .5rem; }
.wave-svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; cursor: grab; }
.wave-svg.dragging { cursor: grabbing; }
.wave-svg text { font-family: "BIZ UDPゴシック", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", sans-serif; }
.wave-svg .tick { font-size: 13px; fill: #3d4a58; }
.wave-svg .axis-sub { font-size: 13px; font-weight: 700; fill: #566676; }
.wave-svg .wave-name { font-size: 18px; font-weight: 800; }
.wave-svg .guide-label { font-size: 15px; font-weight: 800; fill: #FFC83D; stroke: #0F2A33; stroke-width: 4px; stroke-linejoin: round; }
.wave-svg .guide-label.small { font-size: 13px; fill: #9FE6FF; }
.ctrls { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1rem; }
.slider { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; font-weight: 700; font-size: .92rem; }
.slider input { width: 100%; accent-color: var(--primary); min-height: 36px; }
.slider output { min-width: 4.2em; text-align: right; font-variant-numeric: tabular-nums; }
.play { align-self: flex-start; font-weight: 700; }
.play[aria-pressed="true"] { background: #FFF4CC; border-color: #E0A800; }
.hint.drag { background: #FFF7E0; border-radius: 10px; padding: .5rem .8rem; color: var(--ink); }

.readout dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: 0; }
.readout dt { font-weight: 700; color: var(--muted); font-size: .9rem; }
.readout dd { margin: 0; }
.readout b { font-size: 1.25rem; }
.words { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem !important; }
.words span { padding: .05rem .7rem; border-radius: 999px; font-weight: 700; font-size: .9rem; }
.w-pitch { background: #DDF3FA; } .w-loud { background: #FFEACC; }
.mini-ag { border: 1px solid var(--line); border-radius: 10px; padding: .4rem .6rem; }
.mini-ag svg { display: block; width: 100%; height: auto; }
.mini-t, .sub-t { font-weight: 700; font-size: .88rem; }
.preset-text { font-size: .92rem; margin-top: .3rem !important; min-height: 1.5em; }
.point { border: 1px solid var(--line); border-radius: 10px; padding: .3rem .7rem; }
.point summary { font-weight: 700; cursor: pointer; }
.point p { margin: .3rem 0 .2rem !important; font-size: .95rem; }
.points { display: flex; flex-direction: column; gap: .4rem; }
.picon { display: inline-block; width: 1.6em; }
.cmp table { border-collapse: collapse; margin-bottom: .4rem; }
.cmp th, .cmp td { padding: .15rem .6rem .15rem 0; text-align: left; }
.cmp .ta { color: #B36B00; font-size: 1.1rem; } .cmp .tb { color: #6A4BC4; font-size: 1.1rem; }
.cmp p { margin: .2rem 0 !important; }
.choices.two { flex-direction: row; }
.choices.two .choice { flex: 1; text-align: center; font-size: 1.3rem; font-weight: 800; }
.reveal { font-size: .9rem; color: var(--muted); }
@media (max-width: 700px) { .ctrls { grid-template-columns: 1fr; } }
