/* おとなりさん：明るい木の家のような配色。暗い客席用に切りかえられる */
:root {
  --bg: #F7F1E6; --card: #FFFDF8; --card2: #F1E9DA; --line: #E2D6C1; --ink: #2E2A26; --muted: #7A6F63;
  --accent: #E0733F; --accent-ink: #fff; --accent-soft: #FBE3D4;
  --go: #2E9467; --go-soft: #DDF1E6; --stop: #CF4B43; --stop-soft: #F9DFDC; --warn: #B7791F;
  --wave-on: #FBE3D4; --wave-off: #EEE6D8; --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 14px rgba(60, 40, 20, .06);
  --r: 12px; --font: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1B1A1E; --card: #25242A; --card2: #2E2D34; --line: #3A3842; --ink: #ECE6DA; --muted: #A59D90;
  --accent: #F08A55; --accent-ink: #1B1A1E; --accent-soft: #4A3226;
  --go: #3FB37F; --go-soft: #1F3A2E; --stop: #E3625A; --stop-soft: #46262A; --warn: #E0A84A;
  --wave-on: #4A3226; --wave-off: #2E2D34; --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); overflow: hidden; display: grid; grid-template-rows: auto 1fr; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.big { width: 44px; height: 44px; stroke-width: 1.4; color: var(--accent); }
kbd { font: 700 11px var(--font); padding: 1px 6px; border-radius: 5px; border: 1px solid currentColor; opacity: .75; margin-left: 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; justify-content: center; } .bad { color: var(--stop); }
.pad { padding: 14px; } .grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .row.end { justify-content: flex-end; margin-top: 16px; } .row.wrap { flex-wrap: wrap; }

/* ---- 上の帯 ---- */
.top { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--card); border-bottom: 1px solid var(--line); min-width: 0; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); flex: none; }
.logo svg { width: 34px; height: 34px; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.l-roof, .l-wall { stroke: var(--ink); } .l-door { fill: var(--accent); stroke: none; } .l-wave { stroke: var(--accent); }
.logo b { display: block; font-size: 18px; font-weight: 900; letter-spacing: .04em; line-height: 1.1; } .logo small { display: block; font-size: 10px; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.showbtn { min-width: 150px; display: flex; align-items: center; gap: 8px; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px; cursor: pointer; min-width: 0; max-width: 340px; margin-left: 10px; }
.showbtn .lbl { font-size: 11px; color: var(--muted); flex: none; } .showbtn #show-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved { font-size: 11px; color: var(--muted); white-space: nowrap; } .sp { flex: 1; }
.modesw { display: flex; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex: none; }
.modesw button { border: 0; background: none; padding: 5px 16px; border-radius: 999px; cursor: pointer; font-weight: 700; color: var(--muted); }
.modesw button.on { background: var(--ink); color: var(--bg); }
.modesw button[data-mode="live"].on { background: var(--go); color: #fff; }
.tbtn { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); padding: 6px 10px; border-radius: 10px; cursor: pointer; white-space: nowrap; flex: none; }
.tbtn.icon { width: 34px; justify-content: center; padding: 6px 0; font-weight: 700; }
.tbtn:hover, .showbtn:hover { border-color: var(--accent); }
.tbtn.on { border-color: var(--go); color: var(--go); background: var(--go-soft); }

/* ---- 本体：左右 ---- */
main { display: grid; grid-template-columns: minmax(0, 1fr) 370px; min-height: 0; }
.left { display: grid; grid-template-rows: auto 1fr; min-height: 0; min-width: 0; }
.tabs { display: flex; gap: 2px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { display: flex; align-items: center; gap: 6px; border: 1px solid transparent; border-bottom: 0; background: none; padding: 8px 14px; border-radius: 10px 10px 0 0; cursor: pointer; color: var(--muted); font-weight: 700; white-space: nowrap; margin-bottom: -1px; }
.tab.on { background: var(--bg); border-color: var(--line); color: var(--ink); } .tab:not(.on):hover { color: var(--ink); }
.cnt { font-size: 11px; background: var(--card2); border-radius: 999px; padding: 0 7px; } .tab.on .cnt { background: var(--accent-soft); }
.view { overflow: auto; padding: 14px; min-height: 0; }
.panel { background: var(--card); border-left: 1px solid var(--line); padding: 14px; overflow: auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.panel h4 { margin: 6px 0 0; font-size: 12px; color: var(--muted); letter-spacing: .05em; }

/* ---- ボタン ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); padding: 7px 14px; border-radius: 10px; cursor: pointer; font-weight: 700; white-space: nowrap; }
.btn:hover { border-color: var(--accent); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.go { background: var(--go); border-color: var(--go); color: #fff; }
.btn.danger { background: var(--stop); border-color: var(--stop); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: 13px; border-radius: 8px; } .btn.lg { padding: 12px 20px; font-size: 15px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); }
.ib { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 1px solid transparent; background: none; border-radius: 8px; cursor: pointer; color: var(--muted); flex: none; }
.ib:hover { background: var(--card2); color: var(--ink); } .ib.on { background: var(--accent); color: var(--accent-ink); }
.ib .ic { width: 16px; height: 16px; }

/* ---- 何もないとき ---- */
.empty { max-width: 560px; margin: 6vh auto; text-align: center; padding: 30px; background: var(--card); border: 1px dashed var(--line); border-radius: 18px; }
.empty h2 { font-size: 18px; margin: 10px 0 6px; } .empty p { color: var(--muted); margin: 0 0 18px; }

/* ---- きっかけ表 ---- */
.cue-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.cues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cue { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; cursor: pointer; position: relative; box-shadow: var(--shadow); }
.cue:hover { border-color: var(--accent); }
.cue.next { border-color: var(--go); box-shadow: 0 0 0 2px var(--go); }
.cue.next .no { background: var(--go); color: #fff; }
.cue.done { opacity: .55; }
.cue.is-stop { background: var(--stop-soft); }
.cue.end { box-shadow: none; border-style: dashed; padding: 6px 10px; }
.cue.dragging { opacity: .4; } .cue.over-top { box-shadow: 0 -3px 0 var(--accent); } .cue.over-bot { box-shadow: 0 3px 0 var(--accent); }
.grip { color: var(--muted); cursor: grab; display: grid; } .grip .ic { width: 16px; }
.no { min-width: 30px; height: 30px; border-radius: 9px; background: var(--card2); display: grid; place-items: center; font-weight: 900; font-size: 14px; flex: none; padding: 0 4px; }
.cmain { flex: 1; min-width: 0; }
.cname { font-weight: 700; font-size: 15px; } .cname small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
.cline { font-size: 13px; color: var(--accent); font-weight: 700; } .cmemo { font-size: 12px; color: var(--muted); }
.bds { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.bd { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--card2); color: var(--muted); white-space: nowrap; }
.bd .ic { width: 12px; height: 12px; } .bd.scr { background: #E3E8F4; color: #34508A; }
:root[data-theme="dark"] .bd.scr { background: #2A3350; color: #A9BBEA; }
.cue.is-screen { background: #EEF1F8; } :root[data-theme="dark"] .cue.is-screen { background: #262B3A; } .bd.warn { color: var(--warn); } .bd.go { background: var(--go-soft); color: var(--go); } .bd.stop { background: var(--stop); color: #fff; }
.cvol { display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 700; } .cvol .ic { width: 14px; }
.cact { display: flex; gap: 0; }
body.live .cue { cursor: pointer; }

/* ---- 音の倉庫 ---- */
.subtabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.subtabs button { border: 1px solid var(--line); background: var(--card); padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 700; color: var(--muted); }
.subtabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.lib-tools { margin-bottom: 10px; }
.search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 0 10px; flex: 1; max-width: 300px; }
.search input { border: 0; background: none; padding: 7px 0; outline: none; width: 100%; } .search .ic { color: var(--muted); width: 16px; }
.lib { display: flex; flex-direction: column; gap: 4px; }
.grp { margin: 10px 0 2px; font-size: 12px; color: var(--muted); }
.lrow { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; text-align: left; width: 100%; }
button.lrow { cursor: pointer; } button.lrow:hover { border-color: var(--accent); }
.lrow.cur { border-color: var(--go); }
.lname { flex: 1; min-width: 0; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .lname small { display: block; width: 100%; color: var(--muted); font-weight: 400; font-size: 12px; }
.ldur { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lact { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.drop { border: 2px dashed var(--line); border-radius: 16px; padding: 40px 20px; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--card); }
.drop:hover { border-color: var(--accent); } .drop span { color: var(--muted); font-size: 12px; }
.dropcover { display: none; position: fixed; inset: 0; background: rgba(224, 115, 63, .15); border: 4px dashed var(--accent); z-index: 50; place-items: center; pointer-events: none; }
.dropcover div { background: var(--card); padding: 14px 22px; border-radius: 12px; font-weight: 700; }
body.dropping .dropcover { display: grid; }

/* ---- キーボード ---- */
.pads { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.pad-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); position: relative; }
.pad-hit { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; padding: 12px; border: 0; background: none; cursor: pointer; text-align: left; border-radius: var(--r); }
.pad-hit b { font-size: 14px; } .pad-hit small { color: var(--muted); font-size: 11px; }
.pad-act { position: absolute; top: 6px; right: 6px; display: flex; }
.keycap { display: inline-grid; place-items: center; min-width: 30px; height: 28px; padding: 0 8px; border-radius: 7px; background: var(--card); border: 1px solid var(--line); border-bottom-width: 3px; font-weight: 900; font-size: 13px; white-space: nowrap; }
.flash { animation: flash .5s; } @keyframes flash { from { background: var(--accent-soft); border-color: var(--accent); } }

/* ---- 台本 ---- */
.pdf { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ppage { position: relative; background: #fff; box-shadow: var(--shadow); cursor: crosshair; }
.ppage canvas { width: 100%; height: 100%; display: block; }
body.live .ppage { cursor: default; }
.mlayer { position: absolute; inset: 0; pointer-events: none; }
.mk { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; display: inline-flex; align-items: center; gap: 3px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 900; padding: 3px 8px; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); font-size: 13px; white-space: nowrap; }
.mk span { font-weight: 500; font-size: 11px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.mk .ic { width: 12px; height: 12px; }
.mk.done { background: #9C9187; } .mk.next { background: var(--go); outline: 3px solid var(--go-soft); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { outline-color: transparent; } }
.script-text { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; max-width: 860px; margin: 0 auto; }
.sline { padding: 2px 6px; border-radius: 6px; cursor: crosshair; display: flex; gap: 8px; align-items: baseline; white-space: pre-wrap; }
.sline:hover { background: var(--card2); } .sline.has { background: var(--accent-soft); }
.sline .mk { position: static; transform: none; flex: none; }
body.live .sline { cursor: default; }

/* ---- つなげる ---- */
.tl { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; margin-bottom: 10px; }
.tlrow { display: flex; align-items: center; gap: 8px; height: 24px; } .tlname { width: 150px; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tlbar { flex: 1; position: relative; height: 14px; background: var(--card2); border-radius: 4px; } .tlbar i { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 4px; }
.tlscale { display: flex; justify-content: space-between; margin-left: 158px; font-size: 11px; color: var(--muted); }
.parts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.part { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; flex-wrap: wrap; }
.combo-end { margin-top: 16px; align-items: flex-end; }

/* ---- 操作盤 ---- */
.next-card { background: var(--go-soft); border-radius: 14px; padding: 12px 14px; min-height: 96px; }
.nlabel { font-size: 11px; color: var(--go); font-weight: 700; letter-spacing: .08em; }
.nno { font-size: 30px; font-weight: 900; line-height: 1.1; color: var(--go); } .nno small { font-size: 13px; color: var(--muted); margin-left: 4px; font-weight: 700; }
.nname { font-size: 17px; font-weight: 700; } .nline { color: var(--accent); font-weight: 700; font-size: 13px; }
.go-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 18px; border: 0; border-radius: 14px; background: var(--go); color: #fff; font-size: 22px; font-weight: 900; cursor: pointer; box-shadow: 0 4px 0 #1E6B49; transition: transform .05s; }
.go-btn .ic { width: 24px; height: 24px; fill: currentColor; }
.go-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #1E6B49; } .go-btn:disabled { opacity: .4; cursor: default; }
.go-btn kbd { color: #fff; }
.ctl { display: flex; gap: 6px; align-items: stretch; }
.cbtn { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 8px; cursor: pointer; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 2px; }
.cbtn:hover { border-color: var(--accent); } .cbtn.on { background: var(--accent-soft); border-color: var(--accent); }
.cbtn.fade { background: var(--accent-soft); border-color: var(--accent); } .cbtn.fade.on { background: var(--stop); color: #fff; border-color: var(--stop); }
.cbtn.stop { color: var(--stop); } .cbtn.stop:hover { background: var(--stop); color: #fff; border-color: var(--stop); }
.unit { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.unit input { width: 70px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); text-align: right; }
.unit.sec input { width: 54px; }
.master { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.master input { flex: 1; }
.meter { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; margin-top: -4px; }
.mrow { grid-column: 1; position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--go-soft) 0 75%, #F6E7C8 75% 92%, var(--stop-soft) 92%); overflow: hidden; }
.mrow i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--go) 0 75%, var(--warn) 75% 92%, var(--stop) 92%); clip-path: inset(0 100% 0 0); }
.mrow b { position: absolute; top: 0; bottom: 0; width: 2px; left: 0; background: var(--ink); opacity: .5; }
.mclip { grid-column: 2; grid-row: 1 / 3; font-size: 11px; font-weight: 900; padding: 1px 7px; border-radius: 6px; color: var(--muted); background: var(--card2); }
.mclip { visibility: hidden; } .meter.clip .mclip { visibility: visible; background: var(--stop); color: #fff; }
.volnum { min-width: 28px; text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; }
input[type="range"] { accent-color: var(--accent); }
.chk { display: flex; align-items: center; gap: 8px; cursor: pointer; } .chk input { width: 16px; height: 16px; accent-color: var(--accent); }
.voices { display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.voice { background: var(--card2); border-radius: 10px; padding: 7px 9px; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.voice.stopping { opacity: .55; } .voice.wait { opacity: .8; border: 1px dashed var(--line); }
.vname { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .vname small { margin-left: 6px; font-weight: 400; color: var(--muted); display: inline-flex; gap: 2px; align-items: center; } .vname .ic { width: 12px; height: 12px; }
.vtime { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.vbar { grid-column: 1 / -1; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; order: 3; } .vbar i { display: block; height: 100%; width: 0; background: var(--go); }
.voice.wait .vbar i { width: 100%; background: repeating-linear-gradient(90deg, var(--line) 0 6px, var(--muted) 6px 12px); }
.vctl { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; order: 4; } .vctl input { flex: 1; min-width: 60px; } .vvn { font-size: 12px; font-weight: 700; min-width: 24px; text-align: right; }
.mini-pads { display: flex; flex-wrap: wrap; gap: 5px; }
.mpad { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 9px; padding: 3px 9px 3px 4px; cursor: pointer; font-size: 12px; font-weight: 700; max-width: 100%; }
.mpad .keycap { min-width: 24px; height: 22px; font-size: 11px; padding: 0 5px; }
.mpad:hover { border-color: var(--accent); }

/* ---- 小窓 ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(30, 22, 15, .4); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: var(--card); border-radius: 16px; padding: 20px 22px; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; position: relative; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { width: min(820px, 100%); }
.modal h3 { margin: 0 0 12px; font-size: 17px; padding-right: 30px; }
.modal .x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.modal .x:hover { background: var(--card2); }
.f { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-weight: 700; font-size: 13px; }
.f > input:not([type]), .f > input[type="password"], .f > select, .f > input[type="file"], textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); font-weight: 400; font-size: 14px; }
textarea { width: 100%; resize: vertical; line-height: 1.6; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; } .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; font-weight: 400; }
.seg label { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 13px; }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.seg input { accent-color: var(--accent); margin: 0; }
.pill { background: var(--card2); border-radius: 8px; padding: 5px 10px; font-weight: 700; }
.wave { height: 90px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 6px; } .wave canvas { width: 100%; height: 100%; display: block; cursor: ew-resize; touch-action: none; }
.picklist { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; margin-bottom: 12px; }
.ask { font-size: 15px; margin: 4px 0 0; }
.note { background: var(--accent-soft); border-radius: 9px; padding: 8px 12px; font-size: 13px; }
.keywait { display: grid; place-items: center; padding: 20px; animation: pulse2 1.2s infinite; } @keyframes pulse2 { 50% { opacity: .4; } }
.check { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.check li b { display: block; } .check li span { display: block; color: var(--muted); font-size: 13px; } .check input { margin-top: 6px; width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.check .btn { margin-top: 6px; } .check .ic { width: 14px; height: 14px; color: var(--go); vertical-align: -2px; }
h4.sec { display: flex; align-items: center; gap: 6px; margin: 18px 0 8px; font-size: 14px; border-top: 1px solid var(--line); padding-top: 14px; } h4.sec:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
table.keys.midi td { padding: 4px 10px 4px 0; vertical-align: middle; }
.fx label { display: flex; flex-direction: column; gap: 2px; font-weight: 400; font-size: 12px; color: var(--muted); }
.thumb { width: 96px; height: 54px; object-fit: contain; background: #000; border-radius: 6px; }
.thumb:not([src]) { display: none; }
table.keys { border-collapse: collapse; margin-bottom: 14px; } table.keys td { padding: 5px 10px 5px 0; } table.keys .keycap { margin-right: 4px; }

/* ---- お知らせ ---- */
.toasts { position: fixed; bottom: 16px; left: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 60; max-width: min(460px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-weight: 700; font-size: 13px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); transition: opacity .4s, transform .4s; }
.toast.bad { background: var(--stop); color: #fff; } .toast.out { opacity: 0; transform: translateY(6px); }

/* ---- 本番モード ---- */
body.live .top { background: var(--go-soft); }
body.live .go-btn { padding: 26px; font-size: 26px; }

/* ---- せまい画面（スマホなど）：縦に並べる ---- */
@media (max-width: 900px) {
  body { overflow: auto; display: block; }
  main { display: flex; flex-direction: column-reverse; }
  .panel { border-left: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .view { overflow: visible; }
  .top { flex-wrap: wrap; } .saved { display: none; } .tbtn span { display: none; } .tbtn { padding: 6px 8px; }
  .showbtn { margin-left: 0; order: 9; max-width: none; flex: 1 1 100%; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .cact .ib[data-act="cue-up"], .cact .ib[data-act="cue-down"], .cact .ib[data-act="dup-cue"] { display: none; }
}
@media (max-width: 480px) { .logo small { display: none; } .modesw button { padding: 5px 12px; } }

/* ---- 追加：区切り・マイク・録音など ---- */
body.live .editonly { display: none; }
.tbtn:disabled { opacity: .35; cursor: default; }
.scene { list-style: none; display: flex; align-items: center; gap: 4px; margin: 10px 0 0; padding: 4px 10px; border-left: 5px solid var(--accent); background: var(--accent-soft); border-radius: 8px; cursor: pointer; }
.scene b { flex: 1; font-size: 14px; letter-spacing: .05em; }
.nscene { margin-left: 8px; background: var(--card); color: var(--accent); border-radius: 6px; padding: 0 6px; }
.bd.out { background: var(--accent-soft); color: var(--accent); }
.volnum.wide { min-width: 52px; font-size: 12px; }
.micrec { display: flex; flex-wrap: wrap; gap: 6px; } .micrec .cbtn { flex: 1 1 45%; gap: 6px; font-size: 13px; }
.micrec .master { flex: 1 1 100%; } .micrec .master input { min-width: 50px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--stop); display: inline-block; animation: pulse2 1s infinite; } .dot.off { animation: none; opacity: .6; }
.cbtn.rec { background: var(--stop-soft); border-color: var(--stop); color: var(--stop); }
.outrow { margin-bottom: 6px; } .outrow .oname { width: 130px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); } .outrow select { flex: 1; min-width: 0; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.unit select { padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.f select { padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); font-weight: 400; }
table.log { border-collapse: collapse; width: 100%; font-size: 13px; } table.log td { padding: 2px 8px 2px 0; border-bottom: 1px solid var(--line); } table.log td:first-child { white-space: nowrap; color: var(--muted); width: 90px; }
.qr { display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 10px; width: 200px; } .qr svg { width: 180px; height: 180px; }
.phones { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .phones > div { background: var(--card2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.linkbox { width: 100%; font-size: 11px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 4px; } .status-dot.on { background: var(--go); }
@media (max-width: 900px) { .phones { grid-template-columns: 1fr; } }

/* ---- プロモード：ミキサー・ロック・色分け・記録 ---- */
.liveonly { display: none !important; } body.live .liveonly { display: flex !important; }
.cbtn.lock { gap: 6px; } .cbtn.lock.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
body.locked main, body.locked header { pointer-events: none; }
body.locked #go, body.locked #btn-fade, body.locked [data-act="stopnow"], body.locked #btn-lock { pointer-events: auto; }
body.locked .left, body.locked .voices, body.locked .micrec, body.locked .master { opacity: .55; }
.cue.colored::before { content: ''; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 6px; border-radius: var(--r) 0 0 var(--r); background: var(--cc); }
.cue.colored { padding-left: 14px; }
.next-card { border-left: 6px solid var(--cc, transparent); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; display: grid; place-items: center; background: var(--card2); color: var(--muted); }
.sw.on { box-shadow: 0 0 0 2px var(--ink); } .sw .ic { width: 14px; height: 14px; }
.ib.rec { color: var(--stop); } .ib.rec.on { background: var(--stop); color: #fff; animation: pulse2 1s infinite; }
.strips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; align-items: stretch; }
.strip { flex: none; width: 112px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: var(--shadow); }
.strip.muted-ch { opacity: .6; }
.chname { width: 100%; text-align: center; font-weight: 700; font-size: 13px; border: 1px solid transparent; background: none; border-radius: 6px; padding: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input.chname:hover, input.chname:focus { border-color: var(--line); background: var(--bg); }
.eqs { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.eqk { display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 0 4px; font-size: 11px; color: var(--muted); width: 100%; }
.eqk input { width: 100%; min-width: 0; } .eqk span { grid-column: 2; text-align: center; font-size: 10px; margin-top: -4px; }
.fwrap { display: flex; gap: 6px; height: 190px; align-items: stretch; }
.fader { writing-mode: vertical-lr; direction: rtl; width: 28px; height: 100%; margin: 0; }
.chmeter { width: 8px; border-radius: 4px; background: var(--card2); position: relative; overflow: hidden; }
.chmeter i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(0deg, var(--go) 0 75%, var(--warn) 75% 92%, var(--stop) 92%); background-size: 100% 190px; background-position: bottom; }
.ms { display: flex; gap: 4px; }
.msb { width: 36px; height: 28px; border: 1px solid var(--line); background: var(--card2); border-radius: 7px; font-weight: 900; cursor: pointer; }
.msb.on { background: var(--stop); color: #fff; border-color: var(--stop); } .msb.solo.on { background: var(--warn); border-color: var(--warn); }
.strip select { width: 100%; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); font-size: 12px; }
.btn.xs { padding: 2px 8px; font-size: 11px; border-radius: 7px; }
.mems .lrow { padding: 6px 10px; }

/* =========================================================
   とっておきと同じ見た目：紺・白・金。舞台の写真の上に、すりガラスの紺の帯
   ========================================================= */
:root:not([data-theme="dark"]) {
  --bg: #eef4f7; --card: rgba(255, 255, 255, .96); --card2: #edf3f7; --line: rgba(15, 37, 51, .12); --ink: #0f2533; --muted: #5c7180;
  --accent: #0e4d73; --accent-ink: #fff; --accent-soft: #e4eef5; --gold: #b8955a;
  --go: #2c7a57; --go-soft: #e9f4ee; --stop: #b4473f; --stop-soft: #f8e9e7; --warn: #8a6320;
  --wave-on: #dbe8f1; --wave-off: #eef2f5; --shadow: 0 1px 2px rgba(15, 37, 51, .04), 0 10px 26px rgba(15, 37, 51, .07);
}
:root[data-theme="dark"] { --bg: #0d1a24; --card: #15242f; --card2: #1c2e3b; --line: rgba(255, 255, 255, .1); --ink: #e8eef2; --muted: #93a6b3; --accent: #6fa8cf; --accent-ink: #0d1a24; --accent-soft: #1e3647; --gold: #d2b27a; }
:root { --font: Meiryo, 'メイリオ', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif; }
body { letter-spacing: .02em; background: var(--bg) url(media/stage.jpg) center / cover fixed; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, rgba(238, 244, 247, .55) 0, rgba(238, 244, 247, .86) 240px, rgba(238, 244, 247, .93) 100%); }
:root[data-theme="dark"] body::before { background: rgba(13, 26, 36, .9); }
main { position: relative; }
/* 上の帯 */
.top { background: rgba(9, 30, 46, .78); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid rgba(255, 255, 255, .12); color: #fff; }
.top .logo, .top .logo small { color: #fff; } .top .l-roof, .top .l-wall { stroke: #fff; } .top .l-door { fill: var(--gold); } .top .l-wave { stroke: var(--gold); }
.top .logo b { font-weight: 700; letter-spacing: .12em; }
.top .tbtn, .top .showbtn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #fff; }
.top .tbtn:hover, .top .showbtn:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); }
.top .tbtn.on { background: rgba(255, 255, 255, .2); border-color: var(--gold); color: #fff; }
.top .showbtn .lbl, .top .saved { color: rgba(255, 255, 255, .7); }
.top .modesw { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); }
.top .modesw button { color: rgba(255, 255, 255, .7); } .top .modesw button.on { background: #fff; color: #0f2533; }
.top .modesw button[data-mode="live"].on { background: var(--go); color: #fff; }
body.live .top { background: rgba(9, 30, 46, .92); box-shadow: inset 0 -3px 0 var(--go); }
body.pro .logo b::after { content: 'PRO'; font-size: 9px; letter-spacing: .1em; margin-left: 6px; padding: 1px 5px; border: 1px solid var(--gold); color: var(--gold); border-radius: 4px; vertical-align: 3px; }
/* タブ：金の下線で今いる場所を示す */
.tabs { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .5); }
:root[data-theme="dark"] .tabs { background: transparent; }
.tab { border: 0; border-radius: 0; padding: 10px 14px; font-weight: 600; margin-bottom: 0; }
.tab.on { background: none; box-shadow: inset 0 -2px 0 var(--gold); color: var(--ink); }
/* ボタン */
.btn { border-radius: 10px; font-weight: 600; letter-spacing: .04em; background: rgba(255, 255, 255, .9); }
:root[data-theme="dark"] .btn { background: var(--card2); }
.btn:hover { border-color: rgba(15, 37, 51, .3); }
.btn.primary { background: linear-gradient(180deg, #165f8b, #0e4d73); border-color: #0e4d73; color: #fff; box-shadow: 0 6px 16px rgba(14, 77, 115, .22), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn.primary:hover { background: linear-gradient(180deg, #0f5179, #0a3954); }
.btn.go { background: linear-gradient(180deg, #34895f, #2c7a57); border-color: #2c7a57; }
/* 面 */
.panel { background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
:root[data-theme="dark"] .panel { background: rgba(21, 36, 47, .95); }
.cue, .pad-card, .lrow, .strip, .empty, .script-text, .tl, .part { border-color: rgba(255, 255, 255, .7); }
:root[data-theme="dark"] .cue, :root[data-theme="dark"] .pad-card, :root[data-theme="dark"] .lrow, :root[data-theme="dark"] .strip { border-color: var(--line); }
.cue:hover, .lrow:hover { border-color: rgba(14, 77, 115, .35); }
.cue.next { border-color: var(--go); }
.cue.is-screen { background: #f0f4fa; } .cue.is-stop { background: var(--stop-soft); }
.cline, .nline { color: var(--accent); }
.scene { border-left-color: var(--gold); background: rgba(184, 149, 90, .12); }
.nscene { color: var(--gold); }
.bd { border-radius: 6px; } .bd.out { background: var(--accent-soft); color: var(--accent); }
.next-card { background: var(--go-soft); border-radius: 14px; }
.go-btn { border-radius: 14px; background: linear-gradient(180deg, #34895f, #2c7a57); box-shadow: 0 4px 0 #1d5a3e, 0 10px 22px rgba(44, 122, 87, .25); letter-spacing: .1em; font-weight: 700; }
.go-btn:active { box-shadow: 0 1px 0 #1d5a3e; }
.cbtn { border-radius: 10px; font-weight: 600; }
.cbtn.fade { background: var(--accent-soft); border-color: rgba(14, 77, 115, .35); color: var(--accent); }
.panel h4 { letter-spacing: .3em; color: var(--gold); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.panel h4::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
/* 小窓・お知らせ */
.modal { border-radius: 14px; }
.modal-bg { background: rgba(9, 30, 46, .45); }
.note { background: rgba(15, 37, 51, .035); border-left: 3px solid var(--gold); border-radius: 8px; }
h4.sec { letter-spacing: .06em; font-weight: 600; }
.subtabs button { border-radius: 8px; } .subtabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.toast { background: #0f2533; color: #fff; }
.dropcover { background: rgba(14, 77, 115, .15); border-color: var(--accent); }
.mk { background: var(--accent); }
.panel > * { flex-shrink: 0; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.swgroups { display: flex; flex-wrap: wrap; gap: 6px; } .grp .cnt { margin-left: 6px; }
.subtabs button.on .cnt { background: rgba(255, 255, 255, .25); color: #fff; }

/* =========================================================
   ロゴに合わせた色：深い緑と金。とっておきと同じ作り（メイリオ・白いカード・すりガラスの帯・金の下線）
   グラデーションや光る影は使わず、平らな面と細い線で区切る
   ========================================================= */
:root:not([data-theme="dark"]) {
  --bg: #eef1ec; --card: rgba(255, 255, 255, .96); --card2: #eef2ee; --line: rgba(19, 38, 28, .13); --ink: #13261c; --muted: #5d6f63;
  --accent: #1b4d36; --accent-ink: #fff; --accent-soft: #e4ece6; --gold: #b08a45;
  --go: #2a6e4a; --go-soft: #e6f0e9; --stop: #b04a3f; --stop-soft: #f6e8e5; --warn: #8a6a22;
  --wave-on: #dfe9e2; --wave-off: #eef1ee; --shadow: 0 1px 2px rgba(19, 38, 28, .05), 0 6px 18px rgba(19, 38, 28, .06);
}
:root[data-theme="dark"] { --bg: #0c1712; --card: #14231b; --card2: #1a2c22; --line: rgba(255, 255, 255, .1); --ink: #eef1ec; --muted: #9aab9f; --accent: #8cc3a0; --accent-ink: #0c1712; --accent-soft: #1f3529; --gold: #d6b06a; --go: #3c8c62; --go-soft: #18301f; }
:root { --r: 10px; }
body::before { background: linear-gradient(180deg, rgba(238, 241, 236, .6) 0, rgba(238, 241, 236, .88) 240px, rgba(238, 241, 236, .94) 100%); }
:root[data-theme="dark"] body::before { background: rgba(12, 23, 18, .92); }
/* 上の帯：深い緑のすりガラス */
.top { background: rgba(11, 42, 28, .86); border-bottom: 1px solid rgba(214, 176, 106, .25); }
body.live .top { background: rgba(8, 30, 20, .95); box-shadow: inset 0 -3px 0 var(--gold); }
.logo img { height: 38px; width: auto; display: block; }
.top .logo b { font-weight: 700; letter-spacing: .08em; }
.top .logo small { color: rgba(255, 255, 255, .6); letter-spacing: .1em; }
.top .tbtn.on { border-color: #d6b06a; }
.top .modesw button[data-mode="live"].on { background: #2a6e4a; }
body.pro .logo b::after { border-color: #d6b06a; color: #d6b06a; }
/* ボタン：平ら。色は面だけで分ける */
.btn, .btn.primary, .btn.go, .go-btn, .cbtn { box-shadow: none; }
.btn { border-radius: 8px; letter-spacing: .02em; }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { background: #143b29; border-color: #143b29; }
:root[data-theme="dark"] .btn.primary:hover { background: #a6d4b6; }
.btn.go { background: var(--go); border-color: var(--go); }
.go-btn { background: var(--go); border-radius: 10px; letter-spacing: .06em; border-bottom: 4px solid #1b4d36; }
.go-btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.cbtn { border-radius: 8px; }
.cbtn.fade { background: var(--accent-soft); border-color: rgba(27, 77, 54, .3); color: var(--accent); }
/* 見出し：字の間を空けすぎない、細い金の線 */
.panel h4 { letter-spacing: .08em; color: var(--gold); font-size: 12px; }
.panel h4::after { background: rgba(176, 138, 69, .35); }
.tab.on { box-shadow: inset 0 -2px 0 var(--gold); }
.scene { border-left-color: var(--gold); background: rgba(176, 138, 69, .1); }
.cue.is-screen { background: #f1f4f0; } :root[data-theme="dark"] .cue.is-screen { background: #182a20; }
.cue:hover, .lrow:hover { border-color: rgba(27, 77, 54, .35); }
.subtabs button.on { background: var(--accent); border-color: var(--accent); }
.modal-bg { background: rgba(8, 26, 18, .45); }
.toast { background: #13261c; }
.dropcover { background: rgba(27, 77, 54, .12); }
.empty .hero-logo { width: 220px; max-width: 70%; height: auto; display: block; margin: -10px auto 6px; filter: drop-shadow(0 6px 14px rgba(8, 26, 18, .25)); border-radius: 18px; background: #0b2a1c; padding: 10px; }
input[type="range"], .chk input, .seg input { accent-color: var(--accent); }
:root[data-theme="dark"] .mrow { background: linear-gradient(90deg, var(--go-soft) 0 75%, #3a3420 75% 92%, #3a2220 92%); }
