:root {
  --bg: #f6f5f1; --card: #ffffff; --ink: #1d232b; --sub: #5d6773; --line: #e3e1da;
  --accent: #2f6f6a; --accent2: #c2662d; --bp: #8a4fbf; --dep: #3c6fb0; --man: #c2662d;
  --band: #e9e7e1; --band2: #cfd8d6; --err: #b3261e;
  --r: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif; padding-bottom: env(safe-area-inset-bottom); }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(246,245,241,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: .02em; }
.tag { font-size: 11px; font-weight: 600; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: 2px; }
main { max-width: 640px; margin: 0 auto; padding: 12px 14px 40px; }
.notice { background: #fff8ec; border: 1px solid #f0d9b5; border-radius: var(--r); padding: 12px 14px; font-size: 14px; margin-bottom: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
h2 { font-size: 17px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 15px; margin: 18px 0 4px; }
.num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; }
.hidden { display: none !important; }
button, .filebtn { font: inherit; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 10px 14px; cursor: pointer; }
button:active { transform: scale(.98); }
.ghost { background: #fff; }
.small { padding: 6px 10px; font-size: 14px; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.filebtn { display: inline-block; position: relative; overflow: hidden; font-size: 14px; }
.filebtn input { position: absolute; inset: 0; opacity: 0; }
.seg { display: flex; background: #f0efe9; border-radius: 12px; padding: 3px; gap: 3px; margin-bottom: 10px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 4px; font-size: 14px; }
.seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 600; }
.prompt { font-size: 17px; background: #f3f7f6; border-left: 4px solid var(--accent); padding: 10px 12px; border-radius: 8px; margin: 0 0 8px; }
.hint { font-size: 13px; color: var(--sub); margin: 10px 0 0; }
.recrow { display: flex; gap: 16px; align-items: center; }
.rec { width: 108px; height: 108px; border-radius: 50%; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px solid #e8c8c4; background: #fff; font-size: 13px; }
.rec .dot { width: 30px; height: 30px; border-radius: 50%; background: #d23b30; transition: all .2s; }
.rec.on { border-color: #d23b30; }
.rec.on .dot { border-radius: 6px; width: 26px; height: 26px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.recinfo { flex: 1; min-width: 0; }
.speech { margin-bottom: 6px; }
.speechtxt { font-size: 15px; color: var(--sub); line-height: 1.2; }
.speechtxt b { font-size: 34px; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 700; }
.speechtxt .lbl { font-weight: 600; }
.spbar { position: relative; height: 12px; background: var(--band); border-radius: 6px; overflow: hidden; margin: 6px 0 3px; }
.spbar div { height: 100%; width: 0; background: #c99a2e; border-radius: 6px; transition: width .25s, background .3s; }
.spmsg { font-size: 13px; color: var(--sub); min-height: 1.4em; }
.speech.ok .spbar div { background: #2e8b57; }
.speech.ok .speechtxt b, .speech.ok .spmsg { color: #2e7d4f; }
.speech.ok .spmsg { font-weight: 600; }
.timerow { display: flex; align-items: center; gap: 8px; }
.timerow .timer { font-size: 18px; }
.timerow .tlbl { font-size: 12px; color: var(--sub); }
.timerow .meter { flex: 1; margin: 0; }
.clip { font-size: 11px; color: #fff; background: var(--err); border-radius: 999px; padding: 1px 7px; }
.timer { font-size: 34px; font-variant-numeric: tabular-nums; font-weight: 600; line-height: 1.1; }
.meter { height: 8px; background: var(--band); border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.meter div { height: 100%; width: 0; background: var(--accent); transition: width .1s; }
.sub { font-size: 13px; color: var(--sub); }
.filerow { margin-top: 14px; }
.progress { position: relative; height: 26px; background: var(--band); border-radius: 8px; overflow: hidden; margin-top: 12px; }
.progress div { height: 100%; width: 0; background: var(--band2); transition: width .2s; }
.progress span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; }
.err { color: var(--err); font-size: 14px; background: #fdecea; border-radius: 10px; padding: 8px 10px; }
.scorebox { display: flex; align-items: center; gap: 16px; }
.gauge { width: 120px; height: 120px; flex: none; }
.big { font-size: 46px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.big small { font-size: 16px; color: var(--sub); font-weight: 500; margin-left: 2px; }
.scoretext .label { font-size: 14px; color: var(--sub); }
.explain { font-size: 13px; color: var(--sub); }
.explain.small { font-size: 12px; }
.subs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.subcard { border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.subcard .t { font-size: 13px; color: var(--sub); }
.subcard .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.subcard .bar { height: 6px; border-radius: 3px; background: var(--band); overflow: hidden; }
.subcard .bar div { height: 100%; }
.subcard .p { font-size: 12px; color: var(--sub); margin-top: 4px; }
.quality { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 12px 0; font-size: 14px; }
.quality summary { font-weight: 600; cursor: pointer; }
.quality .warn { color: var(--err); }
#vadCanvas { width: 100%; height: 36px; display: block; margin-top: 6px; }
.legend { font-size: 12px; color: var(--sub); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin: 0 2px 0 8px; }
.sw.act { background: var(--accent); } .sw.sil { background: var(--band); }
.feat { border-top: 1px solid var(--line); padding: 10px 0; }
.feat .h { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.feat .h b { font-weight: 600; }
.feat .val { font-variant-numeric: tabular-nums; color: var(--sub); white-space: nowrap; font-size: 13px; }
.feat .track { position: relative; height: 16px; margin: 6px 0 2px; }
.feat .b1, .feat .b2 { position: absolute; top: 5px; height: 6px; border-radius: 3px; }
.feat .b1 { background: var(--band); } .feat .b2 { background: var(--band2); }
.feat .pt { position: absolute; top: 1px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ink); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--ink); }
.feat .paper { font-size: 12px; color: var(--sub); }
.feat .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.chip { font-size: 11px; border-radius: 999px; padding: 1px 7px; border: 1px solid; }
.chip.bp { color: var(--bp); border-color: var(--bp); } .chip.dep { color: var(--dep); border-color: var(--dep); } .chip.manic { color: var(--man); border-color: var(--man); } .chip.ref { color: var(--sub); border-color: var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.hist { margin: 8px 0; font-size: 14px; }
.hist .it { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 6px 0; font-variant-numeric: tabular-nums; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
select { font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: #fff; max-width: 60%; }
.modelinfo { font-size: 13px; color: var(--sub); background: #f6f5f1; border-radius: 10px; padding: 8px 10px; margin-top: 10px; }
.foot { font-size: 12px; color: var(--sub); text-align: center; margin-top: 18px; }
.foot a { color: var(--accent); }
dialog { border: 0; border-radius: var(--r); max-width: 560px; width: calc(100% - 28px); padding: 18px; }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog ul { padding-left: 18px; font-size: 14px; }
.feat .edge { position: absolute; top: 3px; width: 4px; height: 10px; border-radius: 2px; }
.feat .edge.low { left: 0; } .feat .edge.high { right: 0; }
.feat .sidelbl { font-size: 11px; } .feat .sidelbl.high { text-align: right; }

/* v3: recording guide + reverb label */
.guide { margin: 10px 0 0; background: #f3f6fb; border: 1px solid #d9e2ef; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.guide summary { font-weight: 600; cursor: pointer; }
.guide ul { margin: 6px 0 4px; padding-left: 18px; }
.guide li { margin: 3px 0; line-height: 1.45; }
.guide p { margin: 4px 0 0; color: var(--sub); }
.rv-ok { color: #2e7d32; } .rv-warn { color: #b26a00; } .rv-bad { color: #c62828; }

/* v5: personal baseline */
.blstatus { font-size: 14px; background: #f3f7f6; border-radius: 10px; padding: 8px 10px; }
.blstatus b { font-variant-numeric: tabular-nums; }
.bllist summary { cursor: pointer; font-size: 14px; margin-top: 10px; }
.bllist .it { align-items: center; gap: 8px; }
.bllist .it .q { font-size: 12px; color: var(--sub); }
.armbanner { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #eaf3f1; border: 1px solid #bcd6d2; border-radius: 10px; padding: 8px 10px; font-size: 14px; margin-bottom: 10px; }
.personal .pmsg { font-size: 14px; background: #f3f7f6; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
.personal .pwarn { font-size: 14px; color: var(--err); background: #fdf0ef; border: 1px solid #f1c9c5; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
.pg { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.pg .t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.pg .t b { font-size: 22px; font-variant-numeric: tabular-nums; }
.pg .lv { font-size: 13px; color: var(--sub); }
.pg .lv.big { color: var(--err); font-weight: 600; }
.pg .trk { position: relative; height: 14px; margin: 8px 0 2px; border-radius: 7px; background: linear-gradient(90deg, #e9e7e1 0%, #e9e7e1 16.7%, #dfe9e7 33.3%, #cfe0dc 50%, #dfe9e7 66.7%, #e9e7e1 83.3%, #e9e7e1 100%); }
.pg .trk .c { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: #888; }
.pg .trk .m { position: absolute; top: -4px; width: 14px; height: 22px; margin-left: -7px; border-radius: 6px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.pg .ax { display: flex; justify-content: space-between; font-size: 11px; color: var(--sub); font-variant-numeric: tabular-nums; }
.pg .s100 { font-size: 12px; color: var(--sub); }

/* v6: 3 tabs + paper-mode notice */
.seg3 button { font-size: 13px; padding: 8px 2px; line-height: 1.25; }
.seg3 .sm { font-size: 11px; }
@media (max-width: 440px) { .seg3 .sm { display: block; } }
.paperwarn { background: #fff4e0; border: 1px solid #f0c987; color: #7a4b00; border-radius: 10px; padding: 8px 10px; font-size: 13px; margin: 6px 0 10px; }

/* v7: speech-level guide while recording */
.lvguide { margin: 8px 0 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; }
.lvhead { font-size: 13px; color: var(--sub); display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.lvhead > * { white-space: nowrap; }
.lvhead .lbl { font-weight: 600; }
.lvhead b { font-size: 18px; color: var(--ink); }
.lvval { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; }
.lvmeter { position: relative; height: 14px; background: var(--band); border-radius: 7px; margin: 5px 0 2px; overflow: hidden; }
.lvband { position: absolute; top: 0; bottom: 0; background: #a9d8b8; border-left: 2px solid #2e8b57; border-right: 2px solid #2e8b57; }
.lvpt { position: absolute; top: -1px; width: 6px; height: 16px; margin-left: -3px; border-radius: 3px; background: var(--ink); transition: left .25s; }
.lvscale { display: flex; justify-content: space-between; gap: 4px; font-size: 11px; color: var(--sub); white-space: nowrap; }
.lvscale span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
.lvhint { font-size: 13px; color: var(--sub); min-height: 1.4em; }
.lvedge { font-size: 12px; color: #7a4b00; }
.lvguide.lv-ok { border-color: #8fcaa3; }
.lvguide.lv-ok .lvhead b, .lvguide.lv-ok .lvhint { color: #2e7d4f; font-weight: 600; }
.lvguide.lv-low, .lvguide.lv-high, .lvguide.lv-clip { border-color: #f0c987; background: #fff8ec; }
.lvguide.lv-low .lvhead b, .lvguide.lv-high .lvhead b, .lvguide.lv-clip .lvhead b, .lvguide.lv-low .lvhint, .lvguide.lv-high .lvhint, .lvguide.lv-clip .lvhint { color: #a0521a; font-weight: 600; }
.lvguide.lv-clip .lvpt { background: var(--err); }
.levelnote { border-radius: 10px; padding: 8px 10px; font-size: 13px; margin: 6px 0 10px; background: #eef6f1; border: 1px solid #b9dcc6; color: #22563a; }
.levelnote.warn { background: #fdecea; border-color: #f2b8b2; color: #8c1d18; }
.levelnote .lw { font-weight: 700; }
