* { box-sizing: border-box; }
:root {
  --bg: #07080a;
  --panel: #0e1014;
  --border: #262b33;
  --fg: #ffffff;
  --accent: #7cc4ff;
  --gold: #ffd240;
  --red: #ff4747;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
body.is-dragging-layout { user-select: none; }
body.is-dragging-layout #yt-frame { pointer-events: none !important; }
a { color: #7cc4ff; text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input {
  font: inherit; color: #fff; background: #14171d; border: 1px solid #383f4b;
  border-radius: 5px; padding: .26rem .52rem; cursor: pointer;
}
button:hover, select:hover { background: #1e232c; border-color: #637083; }
button:disabled { opacity: .45; border-color: #252a32; background: #101216; cursor: not-allowed; }
button[aria-pressed="true"] { border-color: #68c77b; background: #142618; }
input[type="search"], input[type="text"] { cursor: text; }
input[type="range"] { padding: 0; accent-color: #7cc4ff; cursor: pointer; }
input::placeholder { color: #94a3b8; opacity: 1; }
[hidden] { display: none !important; }
[lang="ja"], [lang="ja"] * {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans CJK JP", "Noto Sans JP", sans-serif;
}
ruby { ruby-position: over; }
rt { font-size: .56em; font-weight: 600; color: #dbeafe; user-select: none; }
html.no-furigana rt { display: none; }

header.top {
  padding: .34rem .85rem .28rem; border-bottom: 1px solid #1d2129; background: #0a0b0e;
}
.top-row {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .3rem .9rem;
}
header.top h1 { margin: 0; font-size: 1.04rem; line-height: 1.25; font-weight: 700; }
.top-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .38rem .72rem; font-size: .82rem; }
.top-nav .sep { opacity: .45; }
.top-nav button { font-size: .78rem; padding: .14rem .44rem; }
.speed-ctrl {
  display: inline-flex; align-items: center; border: 1px solid #383f4b;
  border-radius: 5px; overflow: hidden; background: #12161e;
}
.speed-ctrl button {
  border: 0; border-radius: 0; background: transparent; padding: .14rem .4rem;
  font: 700 .76rem/1.25 var(--mono); font-variant-numeric: tabular-nums;
  color: #e2e8f0;
}
.speed-ctrl button:hover { background: #1e2532; color: #fff; }
.speed-ctrl .speed-val {
  min-width: 3.1rem; text-align: center;
  border-left: 1px solid #2b323d; border-right: 1px solid #2b323d;
  color: #fff;
}
.speed-ctrl .speed-val.is-custom { background: #142618; color: #7ee787; }
.density-hint {
  margin-left: .45rem; padding: .08rem .4rem; font-size: .72rem; font-weight: 700;
  color: #fde68a; background: #261d06; border: 1px solid rgba(255, 210, 64, 0.55);
  border-radius: 4px;
}
.density-hint:hover { background: #3b2c09; border-color: #ffd240; color: #fff; }
.chapters { display: flex; flex-wrap: wrap; align-items: center; gap: .24rem; margin-top: .25rem; }
.chapters button { font-size: .74rem; padding: .1rem .38rem; background: #111419; border-color: #2d333e; }

main { padding: .4rem .85rem 1.2rem; width: 100%; max-width: none; margin: 0 auto; }
main.split-view { display: block; }

/* Monitor Stage: strictly aspect-contained video + optional below/top dock + floating speaker layer */
.player-wrap {
  position: relative; display: flex; flex-direction: column;
  background: #000; border: 1px solid var(--border);
  border-radius: 7px; overflow: hidden;
  width: 100%;
}
.player-wrap:fullscreen,
.player-wrap:-webkit-full-screen {
  width: 100vw !important; height: 100vh !important;
  max-width: none !important; max-height: none !important;
  border: 0; border-radius: 0; background: #000;
}
.stage-video-area {
  position: relative; flex: 1 1 0; min-height: 0; min-width: 0;
  width: 100%; display: flex;
  align-items: center; justify-content: center;
  background: #000; overflow: hidden; order: 2;
}
.video-box {
  position: relative; background: #000; flex: 0 0 auto;
  width: 100%; height: 100%; max-width: 100%; max-height: 100%;
}
.video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Draggable splitter between video and docked scrollers inside Fullscreen */
.stage-splitter {
  flex: 0 0 8px; height: 8px; background: #141923;
  border-top: 1px solid #2b3444; border-bottom: 1px solid #2b3444;
  cursor: ns-resize; position: relative; z-index: 15; order: 3; touch-action: none;
}
.stage-splitter::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 3px; border-radius: 99px; background: #5b6980;
}
.stage-splitter:hover, .stage-splitter.is-active { background: #1f2b3d; }
.stage-splitter:hover::after, .stage-splitter.is-active::after { background: #7cc4ff; }

.stage-dock {
  flex: 0 0 auto; max-height: 62vh; overflow-y: auto;
  background: #07090d; z-index: 14; order: 4;
}
.player-wrap.dock-top .stage-dock { order: 0; }
.player-wrap.dock-top .stage-splitter { order: 1; }
.player-wrap.dock-top .stage-video-area { order: 2; }
.player-wrap.dock-left, .player-wrap.dock-right { flex-direction: row; }
.player-wrap.dock-left .stage-dock,
.player-wrap.dock-right .stage-dock {
  width: 38vw; max-width: 58vw; max-height: none; height: 100%;
}
.player-wrap.dock-left .stage-dock { order: 0; }
.player-wrap.dock-left .stage-splitter { order: 1; }
.player-wrap.dock-right .stage-splitter { order: 3; }
.player-wrap.dock-right .stage-dock { order: 4; }
.player-wrap.dock-left .stage-splitter,
.player-wrap.dock-right .stage-splitter {
  flex: 0 0 8px; width: 8px; height: auto; cursor: ew-resize;
  border-top: 0; border-bottom: 0;
  border-left: 1px solid #2b3444; border-right: 1px solid #2b3444;
}
.player-wrap.dock-left .stage-splitter::after,
.player-wrap.dock-right .stage-splitter::after { width: 3px; height: 48px; }
.stage-dock .speaker-lanes { border: 0; border-radius: 0; box-shadow: none; }

/* Windowed Theater stage height resizer along bottom edge of player-wrap */
.stage-win-resize {
  position: absolute; left: 0; right: 0; bottom: 0; height: 7px; z-index: 28;
  cursor: ns-resize; touch-action: none; background: transparent;
}
.stage-win-resize::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 44px; height: 3px; border-radius: 99px; background: rgba(124, 196, 255, 0.45);
  opacity: 0; transition: opacity .15s;
}
.player-wrap:fullscreen .stage-win-resize,
.player-wrap:-webkit-full-screen .stage-win-resize { display: none; }
html.handles-show .stage-win-resize::after,
.stage-win-resize:hover::after { opacity: 1; }
html.handles-hidden .stage-win-resize { pointer-events: none; display: none; }

/* Minimal floating corner HUD in Fullscreen when dock is hidden */
.fs-corner-hud {
  position: absolute; top: 8px; right: 10px; z-index: 40;
  display: flex; align-items: center; gap: .3rem;
  padding: .22rem .36rem; border-radius: 6px;
  background: rgba(10, 13, 19, 0.84); border: 1px solid rgba(124, 196, 255, 0.42);
  backdrop-filter: blur(5px); opacity: .28; transition: opacity .18s;
}
.fs-corner-hud:hover, html.handles-show .fs-corner-hud { opacity: 1; }
.fs-corner-hud button { font-size: .74rem; padding: .14rem .42rem; }

/* Independent floating per-speaker scroller layer (covers entire stage incl. ultrawide & bottom matte) */
.stage-float-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 24; overflow: hidden;
}
.spk-float-card {
  --fc-scale: 1;
  --fc-alpha: 0.90;
  position: absolute; pointer-events: auto;
  display: flex; flex-direction: column;
  background: rgba(7, 9, 13, var(--fc-alpha));
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-top: 2px solid var(--spk-color, #7cc4ff);
  border-radius: 7px; backdrop-filter: blur(5px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.56);
  user-select: none; overflow: visible;
  min-width: 170px;
}
.spk-float-card.is-moving {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.78), 0 0 0 1.5px var(--spk-color, #7cc4ff);
  z-index: 32;
}
.fc-bar {
  display: flex; align-items: center; gap: .3rem;
  padding: .16rem .34rem; min-height: 22px;
  background: rgba(14, 18, 26, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px 5px 0 0; cursor: move; touch-action: none;
  font-size: calc(.75rem * var(--fc-scale));
}
.fc-bar-name {
  font-weight: 800; color: var(--spk-color, #fff);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fc-bar-grip { color: #94a3b8; font-weight: 700; flex: 0 0 auto; letter-spacing: -.5px; }
.fc-bar-btns { display: inline-flex; align-items: center; gap: .2rem; margin-left: auto; flex: 0 0 auto; }
.fc-bar-btn {
  padding: .04rem .3rem; font-size: .7rem; line-height: 1.25;
  border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 26, 36, 0.92); color: #e2e8f0;
}
.fc-bar-btn:hover { border-color: #7cc4ff; color: #fff; background: #223047; }

/* Handles visibility modes (Show / Hover / Locked-Hidden) */
html.handles-hover .spk-float-card .fc-bar {
  position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 2px;
  border-radius: 5px; border: 1px solid rgba(255, 255, 255, 0.24);
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
html.handles-hover .spk-float-card:hover .fc-bar,
html.handles-hover .spk-float-card.is-moving .fc-bar,
html.handles-hover .spk-float-card:focus-within .fc-bar {
  opacity: 1; pointer-events: auto;
}
html.handles-hidden .spk-float-card .fc-bar,
html.handles-hidden .fc-rz,
html.handles-hidden .spk-deck-resizer,
html.handles-hidden .lbl-grip,
html.handles-hidden .lbl-cfg-btn,
html.handles-hidden .stage-splitter {
  display: none !important;
}
html.handles-hidden .lane-label,
html.handles-hidden .fc-label { cursor: pointer; }
html.handles-hover .spk-deck-resizer { opacity: .12; transition: opacity .15s; }
html.handles-hover .spk-deck:hover .spk-deck-resizer,
html.handles-hover .spk-deck-resizer:hover { opacity: 1; }
html.handles-hover .lbl-cfg-btn { opacity: .28; transition: opacity .15s; }
html.handles-hover .lane-label:hover .lbl-cfg-btn,
html.handles-hover .fc-label:hover .lbl-cfg-btn,
html.handles-show .lbl-cfg-btn { opacity: 1; }

.fc-stage { display: flex; flex-direction: column; overflow: hidden; border-radius: 0 0 6px 6px; }
html.handles-hover .fc-stage, html.handles-hidden .fc-stage { border-radius: 5px; }
.fc-rows { display: flex; flex-direction: column; order: 2; }
.fc-ruler-row {
  display: grid; grid-template-columns: var(--fc-gutter, 8.8rem) minmax(0, 1fr);
  height: calc(1.3rem * var(--fc-scale)); background: rgba(12, 15, 21, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.14); order: 3;
}
.fc-stage.timer-top .fc-ruler-row {
  order: 1; border-top: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.fc-stage.timer-hidden .fc-ruler-row { display: none; }
.fc-stage.no-gutter .fc-ruler-row,
.fc-stage.no-gutter .fc-row { grid-template-columns: minmax(0, 1fr); }
.fc-stage.no-gutter .fc-gutter,
.fc-stage.no-gutter .fc-label { display: none; }
.fc-gutter {
  display: flex; align-items: center; justify-content: center;
  padding: 0 .3rem; border-right: 1px solid rgba(255, 255, 255, 0.12);
  font: 700 calc(.68rem * var(--fc-scale))/1 var(--mono); color: #9ec5fe;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.fc-ruler { position: relative; overflow: hidden; cursor: pointer; }
.fc-row {
  display: grid; grid-template-columns: var(--fc-gutter, 8.8rem) minmax(0, 1fr);
  height: calc(var(--row-base-rem, 2.55rem) * var(--fc-scale));
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.fc-row:last-child { border-bottom: 0; }
.fc-label {
  display: flex; align-items: center; gap: .34rem; padding: 0 .38rem 0 .32rem;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  font-size: calc(.84rem * var(--fc-scale)); font-weight: 800;
  color: var(--spk-color, #fff); background: rgba(10, 13, 18, 0.88);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fc-label.sub-lbl {
  font-size: calc(.76rem * var(--fc-scale)); font-weight: 700;
  box-shadow: inset 3px 0 var(--spk-color, #fff);
}
.fc-track { position: relative; overflow: hidden; cursor: pointer; }
.spk-float-card .ruler-tick {
  font-size: calc(.68rem * var(--fc-scale)); line-height: calc(1.3rem * var(--fc-scale));
}
.spk-float-card .lane-block {
  top: 2px; bottom: 2px;
  font-size: calc(.84rem * var(--fc-scale) * var(--dense-scale, 1));
  line-height: calc(var(--row-base-rem, 2.55rem) * var(--fc-scale) - 6px);
}
.spk-float-card .lane-block.has-tone-blk {
  line-height: calc(1.48rem * var(--fc-scale));
}
.spk-float-card .lane-block.has-tone-blk .lane-words {
  height: 52%; line-height: calc(1.48rem * var(--fc-scale));
}
.spk-float-card .lane-block.lb-ww { font-size: calc(.74rem * var(--fc-scale) * var(--dense-scale, 1)); }
.spk-float-card .lane-block.lb-en,
.spk-float-card .lane-block.lb-std,
.spk-float-card .lane-block.lb-custom-text { font-size: calc(.78rem * var(--fc-scale)); }
.spk-float-card .spk-avatar {
  width: calc(19px * var(--fc-scale)); height: calc(19px * var(--fc-scale));
  min-width: 13px; min-height: 13px; border-width: 1.5px;
}

/* Edge & corner resize handles on each floating speaker card */
.fc-rz { position: absolute; z-index: 30; touch-action: none; }
.fc-rz-w { top: 4px; bottom: 4px; left: -4px; width: 8px; cursor: ew-resize; }
.fc-rz-e { top: 4px; bottom: 4px; right: -4px; width: 8px; cursor: ew-resize; }
.fc-rz-s { left: 8px; right: 14px; bottom: -4px; height: 8px; cursor: ns-resize; }
.fc-rz-se {
  right: -3px; bottom: -3px; width: 14px; height: 14px; cursor: nwse-resize;
  border-right: 2.5px solid var(--spk-color, #7cc4ff);
  border-bottom: 2.5px solid var(--spk-color, #7cc4ff);
  border-radius: 0 0 4px 0; opacity: .75;
}
html.handles-hover .fc-rz-se { opacity: 0; transition: opacity .15s; }
html.handles-hover .spk-float-card:hover .fc-rz-se,
html.handles-hover .spk-float-card.is-moving .fc-rz-se { opacity: .9; }

/* Primary docked speech-overlap swimlane visualization */
.viz-stage { margin: .55rem 0 .7rem; }
.speaker-lanes {
  border: 1px solid var(--border); border-radius: 7px;
  background: #08090c; overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
.lanes-stage {
  --lane-gutter: clamp(13.5rem, 15vw, 18rem);
  position: relative; user-select: none; display: flex; flex-direction: column;
}
.lanes-body { order: 2; display: flex; flex-direction: column; }
.lanes-ruler-row {
  display: grid; grid-template-columns: var(--lane-gutter) minmax(0, 1fr);
  border-top: 1px solid #222730; background: #0d1015; height: 1.56rem; order: 3;
}
.lanes-stage.timer-top .lanes-ruler-row {
  order: 1; border-top: 0; border-bottom: 1px solid #222730;
}
.lanes-stage.timer-hidden .lanes-ruler-row { display: none; }
.lanes-gutter {
  display: flex; align-items: center; justify-content: space-between; gap: .25rem;
  padding: 0 .58rem; border-right: 1px solid #222730;
  font: 700 .8rem/1.56rem var(--mono); color: #9ec5fe;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.gutter-rz {
  position: absolute; top: 0; bottom: 0; left: calc(var(--lane-gutter) - 3px);
  width: 7px; cursor: ew-resize; z-index: 12; touch-action: none;
}
.gutter-rz:hover, .gutter-rz.is-active { background: rgba(124, 196, 255, 0.35); }
.lanes-stage.all-floating .gutter-rz { display: none; }
html.handles-hidden .gutter-rz { display: none; }
.lanes-gutter:hover { background: #151b26; color: #fff; }
.lanes-ruler { position: relative; overflow: hidden; cursor: pointer; }
.ruler-tick {
  position: absolute; top: 0; bottom: 0; border-left: 1px solid #2a303b;
  padding-left: .28rem; font: 700 .72rem/1.52rem var(--mono); color: #fff;
  font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap;
}
.lane-gridline {
  position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none; z-index: 0;
}
.ruler-ov-pill {
  position: absolute; top: 2px; bottom: 2px; background: #261d04;
  border: 1px solid var(--gold); border-radius: 3px; padding: 0 .22rem;
  font: 800 .68rem/1.15rem var(--mono); color: var(--gold); white-space: nowrap;
  overflow: hidden; text-overflow: clip; pointer-events: none; z-index: 3;
}
.ruler-note-pin {
  position: absolute; top: 2px; bottom: 2px; min-width: 6px; padding: 0 .28rem;
  border-radius: 3px; background: #141a24; border: 1px solid var(--cat-color, var(--accent));
  font: 700 .66rem/1.15rem var(--mono); color: #fff; white-space: nowrap;
  z-index: 4; cursor: pointer; transform: translateX(-2px);
}
.ruler-note-pin:hover { background: #1f2a3a; }
.lane-ann-span {
  position: absolute; top: 0; height: 3px; background: var(--cat-color, var(--accent));
  opacity: .8; pointer-events: none; z-index: 4;
}
.ann-live {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .6rem;
  padding: .42rem .65rem; background: #11151d; border-top: 1px solid #252c38;
  border-left: 3px solid var(--cat-color, var(--accent)); font-size: .88rem;
}
.ann-live-cat {
  display: inline-block; padding: .04rem .38rem; border-radius: 4px;
  border: 1px solid var(--cat-color, var(--accent)); font-size: .76rem; font-weight: 800;
  color: var(--cat-color, var(--accent)); white-space: nowrap;
}
.ann-live-title { font-weight: 800; color: #fff; }
.ann-live-note { color: #fff; flex: 1 1 18rem; }
.ann-live button { font-size: .76rem; padding: .12rem .4rem; margin-left: auto; }

/* Per-speaker deck inside the docked swimlane (supports separate height, width & subcomponents) */
.spk-deck {
  --spk-scale: 1;
  position: relative; display: flex; flex-direction: column;
  border-bottom: 2px solid #293242; background: #08090c;
}
.spk-deck:last-child { border-bottom: 0; }
.spk-deck.deck-narrow {
  border-left: 1px solid #293242; border-right: 1px solid #293242;
}
.spk-deck-resizer {
  height: 5px; background: transparent; cursor: ns-resize; touch-action: none;
  position: relative; z-index: 6; margin-top: -2px;
}
.spk-deck-resizer::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 36px; height: 2px; border-radius: 99px; background: var(--spk-color, #64748b);
}
.spk-deck-resizer:hover { background: rgba(124, 196, 255, 0.16); }

.lane-row {
  display: grid; grid-template-columns: var(--lane-gutter) minmax(0, 1fr);
  border-bottom: 1px solid #1b1f27;
  height: calc(var(--row-base-rem, 3.0rem) * var(--spk-scale, 1));
}
.spk-deck.no-gutter .lane-row { grid-template-columns: minmax(0, 1fr); }
.spk-deck.no-gutter .lane-label { display: none; }
.lane-row:last-of-type { border-bottom: 0; }
.deck-mini-ruler {
  display: grid; grid-template-columns: var(--lane-gutter) minmax(0, 1fr);
  height: 1.25rem; background: #0d1015; border-top: 1px solid #222730;
}
.spk-deck.no-gutter .deck-mini-ruler { grid-template-columns: minmax(0, 1fr); }
.spk-deck.no-gutter .deck-mini-ruler .lanes-gutter { display: none; }
.deck-mini-ruler .ruler-tick { font-size: .68rem; line-height: 1.25rem; }

.lane-label {
  display: flex; align-items: center; gap: .44rem; padding: 0 .45rem 0 .38rem;
  border-right: 1px solid #222730; font-size: calc(.96rem * min(1.25, var(--spk-scale, 1)));
  font-weight: 800; color: var(--spk-color, #fff); background: #0c0e12;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; touch-action: none;
}
.lane-label::before {
  content: ""; width: .52rem; height: .52rem; border-radius: 999px; flex: 0 0 auto;
  background: var(--spk-color, #fff);
}
.lane-label:hover { background: #151922; }
.lane-label.filtered { background: #182130; box-shadow: inset 3px 0 var(--spk-color, #fff); }
.lane-label.sub-lbl {
  font-size: calc(.84rem * min(1.2, var(--spk-scale, 1))); font-weight: 700;
  color: #e2e8f0; background: #090b0f;
  padding-left: .62rem; box-shadow: inset 3px 0 var(--spk-color, #fff); cursor: pointer;
}
.lane-label.sub-lbl::before, .lane-label.has-avatar::before { display: none; }
.lbl-stack {
  display: flex; flex-direction: column; justify-content: center;
  min-width: 0; flex: 1 1 auto; gap: 1px; line-height: 1.18;
}
.lbl-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lbl-sub {
  font-size: .72rem; font-weight: 600; color: #94a3b8;
  overflow: hidden; text-overflow: ellipsis; line-height: 1.15;
}
.lbl-cfg-btn {
  margin-left: auto; padding: .08rem .32rem; font-size: .78rem; line-height: 1.2;
  border-radius: 4px; border: 1px solid #334155; background: #111620; color: #cbd5e1;
  flex: 0 0 auto; cursor: pointer;
}
.lbl-cfg-btn:hover { border-color: #7cc4ff; color: #fff; background: #1d283a; }
.lbl-grip {
  color: rgba(255, 255, 255, 0.34); font-size: .85em; line-height: 1; flex: 0 0 auto;
  letter-spacing: -1px;
}
.lane-label:hover .lbl-grip { color: rgba(255, 255, 255, 0.88); }
.spk-deck.is-dragging { opacity: .45; }
.spk-deck.drag-over-top { box-shadow: inset 0 2.5px 0 var(--gold); }
.spk-deck.drag-over-bot { box-shadow: inset 0 -2.5px 0 var(--gold); }
.lane-row.is-row-dragging { opacity: .45; }
.lane-row.row-over-top { box-shadow: inset 0 2px 0 var(--accent); }
.lane-row.row-over-bot { box-shadow: inset 0 -2px 0 var(--accent); }

.spk-avatar {
  width: 30px; height: 30px; border-radius: 999px; object-fit: cover; flex: 0 0 auto;
  border: 2px solid var(--spk-color, #7cc4ff); background: #141820;
}
.spk-avatar.av-sm { width: 21px; height: 21px; border-width: 1.5px; }
.spk-avatar.av-xs { width: 18px; height: 18px; border-width: 1.5px; }

.lane-track { position: relative; overflow: hidden; cursor: pointer; background: #08090c; }
.lane-ov-band {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(255, 210, 64, 0.14), rgba(255, 210, 64, 0.08));
  border-top: 1px solid rgba(255, 210, 64, 0.55);
  border-bottom: 1px solid rgba(255, 210, 64, 0.55);
  pointer-events: none; z-index: 1;
}
.lane-block {
  position: absolute; top: 4px; bottom: 4px; min-width: 4px; border-radius: 5px;
  border: 1.5px solid var(--spk-color, #7cc4ff);
  background: var(--spk-bg, rgba(124, 196, 255, 0.2));
  color: #fff; padding: 0 .4rem;
  font-size: calc(.88rem * var(--spk-scale, 1) * var(--dense-scale, 1)); font-weight: 600;
  line-height: calc(var(--row-base-rem, 3.0rem) * var(--spk-scale, 1) - 10px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 2; cursor: pointer;
}
.lane-block.has-words { padding: 0; text-overflow: clip; }
.lane-words { position: relative; width: 100%; height: 100%; overflow: hidden; z-index: 2; }
.lane-txt-top {
  position: relative; z-index: 2; display: block; height: 52%;
  line-height: calc(1.55rem * var(--spk-scale, 1));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lane-block.has-tone-blk {
  line-height: calc(1.68rem * var(--spk-scale, 1));
}
.lane-block.has-tone-blk .lane-words {
  height: 52%; line-height: calc(1.68rem * var(--spk-scale, 1));
}
.lane-block.lb-tone-only {
  padding: 0; background: rgba(5, 7, 11, 0.88); border-width: 1px;
}
.lane-block.lb-tone-only .tone-svg {
  height: 100%; border-top: 0; background: transparent;
}
.bg-meter-strip {
  position: absolute; left: 0; right: 0; bottom: 0; height: 28%;
  pointer-events: none; z-index: 1; background: rgba(6, 9, 14, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.bg-tag-pill {
  position: absolute; left: 3px; bottom: 2px; z-index: 4;
  padding: 0 .24rem; border-radius: 3px; font: 700 .62rem/1.25 var(--mono);
  background: rgba(8, 11, 18, 0.9); border: 1px solid var(--trk-color, #ff85a2);
  color: var(--trk-color, #fff); pointer-events: none; white-space: nowrap;
}
.bg-ann-band {
  position: absolute; top: 1px; bottom: 1px; pointer-events: none; z-index: 1;
  background: rgba(124, 196, 255, 0.12);
  border-top: 2px solid var(--cat-color, #7cc4ff);
  border-bottom: 2px solid var(--cat-color, #7cc4ff);
}
.bg-ann-tag {
  position: absolute; left: 3px; top: 1px; font: 700 .6rem/1.2 var(--mono);
  color: var(--cat-color, #7cc4ff); background: rgba(7, 9, 14, 0.86);
  padding: 0 .22rem; border-radius: 2px; white-space: nowrap;
}
.lane-block.ja-furi-blk { line-height: 1.24; font-size: calc(.9rem * var(--spk-scale, 1) * var(--dense-scale, 1)); }
.lane-block.ja-furi-blk .lane-word { top: auto; bottom: 3px; line-height: 1.24; }
.lane-block.ja-furi-blk.has-tone-blk .lane-words { height: 55%; }
.lane-block.ja-furi-blk rt { display: ruby-text !important; }
.lane-block.ja-plain-blk rt { display: none !important; }
.lane-block.lb-ww {
  top: 3px; bottom: 3px; border: 1px dashed var(--spk-color, #7cc4ff);
  background: var(--spk-bg, rgba(124, 196, 255, 0.16));
  font-size: calc(.77rem * var(--spk-scale, 1) * var(--dense-scale, 1)); font-weight: 600;
  line-height: 1.15;
}
.lane-block.lb-ww .lane-word {
  color: #fff; font-weight: 600;
  display: inline-flex; flex-direction: column; justify-content: center;
  padding: 0 2px;
}
.lane-block.lb-ww .ww-g { display: block; line-height: 1.15; }
.lane-block.lb-ww .ww-c {
  display: block; font-size: .72em; font-weight: 700; line-height: 1.1;
  color: #fde68a; opacity: .92; margin-top: 1px;
}
.lane-block.lb-ww .lane-word.has-nuance .ww-g {
  text-decoration: underline dotted rgba(253, 230, 138, 0.65);
  text-underline-offset: 2px;
}
.lane-block.lb-ww.now { border-style: solid; border-color: #fff; background: var(--spk-bg-hi, rgba(124, 196, 255, 0.36)); }
.lane-block.lb-ww .lane-word.lw-now { color: #fff; background: rgba(255, 255, 255, 0.32); }
.lane-block.lb-en {
  top: 3px; bottom: 3px; border: 1px solid var(--spk-color, #7cc4ff);
  border-left: 3px solid var(--spk-color, #7cc4ff);
  background: var(--spk-bg, rgba(124, 196, 255, 0.14)); color: #fff;
  font-size: calc(.82rem * var(--spk-scale, 1)); font-weight: 500; padding: 0 .45rem;
}
.lane-block.lb-en.now { border-color: #fff; background: var(--spk-bg-hi, rgba(124, 196, 255, 0.38)); }
.lane-block.lb-std {
  top: 3px; bottom: 3px; border: 1px dotted var(--spk-color, #7cc4ff);
  border-left: 3px solid var(--spk-color, #7cc4ff);
  background: rgba(20, 26, 38, 0.72); color: #e2e8f0;
  font-size: calc(.8rem * var(--spk-scale, 1)); font-weight: 500; padding: 0 .45rem;
}
.lane-block.lb-std.now { border-style: solid; border-color: #fff; background: var(--spk-bg-hi, rgba(124, 196, 255, 0.36)); color: #fff; }

/* Extensible data/analysis track blocks (text, tag, meter, analysis, delivery) */
.lane-block.lb-custom-text {
  top: 3px; bottom: 3px; border: 1px solid var(--trk-color, #a9d6ff);
  border-left: 3px solid var(--trk-color, #a9d6ff);
  background: rgba(18, 24, 36, 0.84); color: #f1f5f9;
  font-size: calc(.78rem * var(--spk-scale, 1)); font-weight: 500; padding: 0 .42rem;
}
.lane-block.lb-custom-tag {
  top: 3px; bottom: 3px; border: 1px solid var(--trk-color, #ff85a2);
  background: rgba(20, 18, 28, 0.88); color: #fff;
  font-size: calc(.74rem * var(--spk-scale, 1)); font-weight: 700; padding: 0 .38rem;
  display: flex; align-items: center; gap: .28rem;
}
.tag-dot {
  width: 7px; height: 7px; border-radius: 999px; flex: 0 0 auto;
  background: var(--trk-color, #ff85a2);
}
.lane-block.lb-custom-meter {
  top: 3px; bottom: 3px; border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(10, 14, 22, 0.9); color: #fff; padding: 0;
  font-size: calc(.72rem * var(--spk-scale, 1)); font-weight: 700;
}
.meter-fill {
  position: absolute; top: 0; bottom: 0; pointer-events: none; opacity: .55;
}
.meter-mid {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 1px;
  background: rgba(255, 255, 255, 0.35); pointer-events: none;
}
.meter-lbl {
  position: relative; z-index: 2; padding: 0 .38rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.lane-block.lb-analysis {
  top: 3px; bottom: 3px; border: 1px solid var(--cat-color, #7cc4ff);
  border-left: 3px solid var(--cat-color, #7cc4ff);
  background: rgba(17, 22, 33, 0.92); color: #fff;
  font-size: calc(.75rem * var(--spk-scale, 1)); font-weight: 700; padding: 0 .4rem;
}
.lane-block.lb-delivery {
  top: 3px; bottom: 3px; border: 1px dashed rgba(148, 163, 184, 0.5);
  background: rgba(12, 16, 24, 0.88); color: #cbd5e1;
  font: 700 calc(.7rem * var(--spk-scale, 1))/calc(var(--row-base-rem, 1.9rem) * var(--spk-scale, 1) - 8px) var(--mono);
  padding: 0 .38rem;
}

.tone-svg {
  position: absolute; left: 0; right: 0; bottom: 0; height: 48%; width: 100%;
  background: rgba(5, 7, 11, 0.64); border-top: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none; z-index: 1; display: block;
}
.tone-badges-wrap {
  position: absolute; z-index: 4; display: inline-flex; align-items: center; gap: 2px;
  pointer-events: auto;
}
.tone-badges-wrap.pos-br { bottom: 2px; right: 3px; }
.tone-badges-wrap.pos-tr { top: 2px; right: 3px; }
.tone-badges-wrap.pos-tl { top: 2px; left: 3px; }
.tone-badge {
  padding: 0 .26rem; border-radius: 3px; font: 800 .62rem/1.28 var(--mono);
  background: rgba(7, 8, 12, 0.92); border: 1px solid currentColor;
  white-space: nowrap;
}
.tone-badge.tb-falsetto { color: #ff5ca8; }
.tone-badge.tb-high { color: #ffd240; }
.tone-badge.tb-low { color: #9aa7ff; }
.tone-badge.tb-quiet { color: #94a3b8; }
.tone-badge.tb-fast { color: #66e3d8; }
.tone-badge.tb-slow { color: #c9b3ff; }
.tone-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .7rem;
  padding: .26rem .6rem; background: #0b0e14; border-top: 1px solid #1e2430;
  font-size: .74rem; color: #cbd5e1;
}
.tone-legend .tl-spk { font-family: var(--mono); font-size: .72rem; }
.tone-swatch {
  display: inline-block; width: .68rem; height: 3px; border-radius: 2px;
  vertical-align: middle; margin-right: .22rem;
}
.lane-block.is-clipped .lane-words {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
}
.lane-word { position: absolute; top: 0; bottom: 0; white-space: nowrap; color: #fff; border-radius: 3px; }
.lane-word.lw-ov {
  text-decoration: underline; text-decoration-color: var(--ov-color, var(--gold));
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.lane-word.lw-now {
  background: rgba(255, 255, 255, 0.30);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.58);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.45);
  color: #fff;
}
.lane-block.has-ov { box-shadow: inset 0 -2px 0 rgba(255, 210, 64, 0.85); }
.lane-block.now {
  border-color: #fff; background: var(--spk-bg-hi, rgba(124, 196, 255, 0.4));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85); z-index: 3;
}
.lane-block.ov-linked { border-color: var(--gold); background: rgba(255, 210, 64, 0.3); z-index: 4; }
.tl-strip {
  position: absolute; top: 0; bottom: 0; left: 0; width: 300%;
  will-change: transform;
}
.jump-line {
  position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 1.5px dashed rgba(255, 210, 64, 0.36);
  pointer-events: none; z-index: 5; transition: border-color .18s, box-shadow .18s;
}
.jump-line.is-soon {
  border-left-color: #ffd240;
  box-shadow: 0 0 8px rgba(255, 210, 64, 0.55);
}
.land-line {
  position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 1px dotted rgba(124, 196, 255, 0.28);
  pointer-events: none; z-index: 4;
}
.jump-cue {
  position: absolute; top: 1px; transform: translateX(-100%);
  margin-left: -3px; padding: 0 .28rem; border-radius: 3px;
  font: 800 .64rem/1.25 var(--mono); font-variant-numeric: tabular-nums;
  color: rgba(255, 210, 64, 0.72); background: rgba(24, 18, 5, 0.78);
  border: 1px solid rgba(255, 210, 64, 0.34);
  pointer-events: none; z-index: 7; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.jump-cue.is-soon {
  color: #111; background: #ffd240; border-color: #fff;
  box-shadow: 0 0 10px rgba(255, 210, 64, 0.55);
}
.land-notch {
  position: absolute; top: 1px; margin-left: 2px; padding: 0 .2rem;
  font: 800 .62rem/1.2 var(--mono); color: rgba(124, 196, 255, 0.65);
  pointer-events: none; z-index: 5;
}
.anchor-notch {
  position: absolute; top: 1px; transform: translateX(-50%);
  padding: 0 .24rem; border-radius: 3px;
  font: 800 .6rem/1.2 var(--mono); color: #7cc4ff;
  background: rgba(10, 18, 30, 0.84); border: 1px solid rgba(124, 196, 255, 0.45);
  pointer-events: none; z-index: 5; white-space: nowrap;
}
.lane-playhead {
  position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red);
  box-shadow: 0 0 8px rgba(255, 71, 71, 0.7); pointer-events: none; z-index: 6;
}
.lanes-empty {
  padding: .55rem .9rem; font-size: .82rem; color: #cbd5e1; text-align: center;
  background: rgba(12, 15, 21, 0.85); cursor: context-menu;
}

.lanes-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .32rem .55rem;
  padding: .34rem .58rem; background: #0d1015; border-top: 1px solid #20252e;
}
.lanes-status {
  flex: 1 1 8rem; min-width: 0; font-size: .8rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lanes-status .ov-badge { color: var(--gold); font-weight: 800; margin-right: .35rem; }
.lanes-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .28rem; margin-left: auto; }
.lanes-tools button, .lanes-tools select { padding: .18rem .44rem; font-size: .79rem; }
.lanes-tools label { display: inline-flex; align-items: center; gap: .26rem; font-size: .79rem; font-weight: 700; }

.lanes-minimap-wrap {
  position: relative; height: 22px; background: #050608;
  border-top: 1px solid #20252e; cursor: pointer;
}
.lanes-minimap { display: block; width: 100%; height: 22px; }
.minimap-viewport {
  position: absolute; top: 0; bottom: 0; border: 1px solid #fff;
  background: rgba(255, 255, 255, 0.14); pointer-events: none;
}
.minimap-playhead {
  position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red);
  pointer-events: none;
}

/* Context menu & Config popovers (spacious, readable, plain-English) */
.stream-ctx-menu, .cfg-popover {
  position: fixed; z-index: 260; min-width: 19.5rem; max-width: 26rem;
  max-height: calc(100vh - 20px); overflow-y: auto;
  background: #10151f; border: 1px solid #425066; border-radius: 10px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.78); padding: .42rem 0;
  color: #f8fafc; font-size: .9rem; line-height: 1.35; user-select: none;
}
.stream-ctx-menu.is-dragging-pop, .cfg-popover.is-dragging-pop {
  border-color: #7cc4ff; box-shadow: 0 22px 54px rgba(0, 0, 0, 0.88);
}
.ctx-head {
  display: flex; align-items: center; gap: .5rem; padding: .42rem .95rem .54rem;
  font-size: .93rem; font-weight: 800; color: #e2efff; border-bottom: 1px solid #222b3a;
  cursor: move; touch-action: none;
}
.ctx-head::before {
  content: "⋮⋮"; color: #64748b; font-size: .82rem; letter-spacing: -1px; flex: 0 0 auto;
}
.ctx-head:hover::before { color: #9ec5fe; }
.ctx-head-close {
  margin-left: auto; padding: .1rem .48rem; font-size: .9rem; line-height: 1.25;
  border: 1px solid #334155; border-radius: 6px; background: transparent; color: #cbd5e1;
}
.ctx-head-close:hover { background: #1e293b; color: #fff; border-color: #64748b; }
.ctx-sec {
  padding: .62rem 1rem .26rem; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em; color: #94a3b8;
}
.ctx-sep { height: 1px; background: #222b3a; margin: .48rem 0; }
.ctx-item {
  display: flex; align-items: center; gap: .6rem; width: 100%; border: 0;
  border-radius: 0; background: transparent; color: #f8fafc; text-align: left;
  padding: .52rem 1rem; font-size: .88rem; cursor: pointer;
}
.ctx-item:hover { background: #1b2436; }
.ctx-item.ctx-danger { color: #fca5a5; }
.ctx-item .ctx-act {
  margin-left: auto; font: 700 .74rem/1.2 var(--mono); padding: .1rem .42rem;
  border-radius: 4px; border: 1px solid #3c4657; color: #cbd5e1;
}
.ctx-item.is-on .ctx-act { border-color: #68c77b; color: #7ee787; background: #112416; }
.ctx-item.is-off .ctx-act { border-color: #7cc4ff; color: #7cc4ff; background: #0f1c2e; }
.ctx-inline-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .42rem;
  padding: .34rem 1rem .44rem;
}
.ctx-opt-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .45rem .7rem; padding: .42rem 1rem;
}
.ctx-opt-lbl { font-size: .86rem; font-weight: 600; color: #e2e8f0; }
.ctx-opt-btns { display: inline-flex; flex-wrap: wrap; gap: .32rem; }
.ctx-inline-lbl {
  font-size: .82rem; font-weight: 700; color: #cbd5e1; margin-right: .2rem;
  min-width: 5.2rem;
}
.ctx-meta {
  margin-left: auto; font: 700 .8rem/1.2 var(--mono); color: #cbd5e1; min-width: 2.6rem; text-align: right;
}
.ctx-chip-btn {
  padding: .28rem .64rem; font-size: .82rem; font-weight: 700;
  border-radius: 6px; border: 1px solid #3a4659; background: #161d2b; color: #f1f5f9;
  cursor: pointer;
}
.ctx-chip-btn:hover:not(:disabled) { background: #222e44; border-color: #7cc4ff; color: #fff; }
.ctx-chip-btn.is-on { border-color: #68c77b; background: #132c1a; color: #86efac; }
.ctx-chip-btn.is-off { border-color: #4b5c74; background: #131926; color: #cbd5e1; }
.ctx-slider-row {
  display: flex; align-items: center; gap: .65rem; padding: .42rem 1rem;
}
.ctx-slider-row input[type="range"] { flex: 1 1 7rem; min-width: 6rem; }
.ctx-check-row {
  display: flex; align-items: flex-start; gap: .68rem; padding: .48rem 1rem;
  cursor: pointer; font-size: .88rem;
}
.ctx-check-row:hover { background: #182235; }
.ctx-check-row input[type="checkbox"] {
  margin: .14rem 0 0; width: 16px; height: 16px; flex: 0 0 auto;
  accent-color: #7cc4ff; cursor: pointer;
}
.ctx-check-txt { flex: 1 1 auto; min-width: 0; }
.ctx-check-main { display: block; font-weight: 600; color: #fff; }
.ctx-sub { display: block; font-size: .76rem; color: #94a3b8; margin-top: 1px; line-height: 1.3; }
.ctx-check-hint { margin-left: auto; font-size: .74rem; color: #94a3b8; font-family: var(--mono); }
.ctx-check-actions { display: inline-flex; align-items: center; gap: .25rem; margin-left: auto; flex: 0 0 auto; }
.ctx-tabs {
  display: flex; flex-wrap: wrap; gap: .38rem; padding: .52rem .9rem;
  border-bottom: 1px solid #222b3a; background: #0c1018;
}
.ctx-tab {
  display: inline-flex; align-items: center; gap: .36rem;
  padding: .28rem .66rem; font-size: .84rem; font-weight: 700;
  border-radius: 6px; border: 1px solid #334155; background: #141b28; color: #cbd5e1;
}
.ctx-tab:hover { border-color: #7cc4ff; color: #fff; }
.ctx-tab.is-on { border-color: var(--spk-color, #7cc4ff); background: #19283e; color: #fff; }
.ctx-mode-list { display: flex; flex-direction: column; gap: .42rem; padding: .35rem .9rem .45rem; }
.ctx-mode-card {
  display: block; width: 100%; text-align: left; padding: .55rem .75rem;
  border-radius: 8px; border: 1px solid #334155; background: #141b28; color: #f1f5f9;
  cursor: pointer;
}
.ctx-mode-card:hover { border-color: #7cc4ff; background: #1a2436; }
.ctx-mode-card.is-on { border-color: #68c77b; background: #122819; }
.ctx-mode-title { display: block; font-size: .88rem; font-weight: 800; color: #fff; }
.ctx-mode-card.is-on .ctx-mode-title { color: #86efac; }
.ctx-mode-desc { display: block; font-size: .76rem; color: #cbd5e1; margin-top: 2px; line-height: 1.32; }
.ctx-more { border-top: 1px solid #222b3a; margin-top: .38rem; }
.ctx-more > summary {
  padding: .55rem 1rem; font-size: .82rem; font-weight: 700; color: #9ec5fe;
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: .4rem;
}
.ctx-more > summary::-webkit-details-marker { display: none; }
.ctx-more > summary::before { content: "▸"; font-size: .78rem; transition: transform .15s; }
.ctx-more[open] > summary::before { transform: rotate(90deg); }
.ctx-more > summary:hover { background: #172030; color: #fff; }
.ctx-more-body { padding: .15rem 0 .4rem; }
.rc-mini-btn {
  padding: .16rem .46rem; font-size: .78rem; font-weight: 700; line-height: 1.25;
  border-radius: 5px; border: 1px solid #3a4659; background: #182130; color: #e2e8f0;
}
.rc-mini-btn:hover:not(:disabled) { border-color: #7cc4ff; color: #fff; background: #223047; }
.rc-mini-btn.rc-del { color: #fca5a5; }

.lane-pulse {
  position: absolute; top: 8px; bottom: 8px; min-width: 6px; border-radius: 4px;
  border: 1px dashed var(--spk-color, #7cc4ff); background: var(--spk-bg, rgba(124, 196, 255, 0.14));
  opacity: .72; pointer-events: auto; z-index: 2; cursor: pointer;
}
.lane-pulse.has-lbl {
  border-style: solid; border-color: rgba(255, 133, 162, 0.72);
  background: rgba(255, 133, 162, 0.18); opacity: .95; overflow: visible; z-index: 3;
}
.lane-pulse .pulse-lbl {
  position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-size: .68rem; font-weight: 700; line-height: 1.1;
  padding: .1rem .34rem; border-radius: 999px;
  background: rgba(24, 14, 22, 0.9); border: 1px solid rgba(255, 133, 162, 0.62);
  color: #ffc2d4; pointer-events: none;
}
.lane-word.has-vocab { cursor: pointer; }
.word-inspector {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .65rem;
  padding: .46rem .7rem; background: #121722; border-top: 1px solid #2a3444;
  border-left: 3px solid var(--accent); font-size: .88rem;
}
.wi-ja { font-size: 1.25rem; font-weight: 700; color: #fff; line-height: 1.6; }
.wi-read { font-family: var(--mono); font-size: .82rem; color: #a9d6ff; }
.wi-gloss { font-weight: 800; color: #fff; }
.wi-role { font-size: .8rem; color: #cbd5e1; }
.wi-note { font-size: .82rem; color: #fde68a; flex: 1 1 16rem; }
.wi-btns { display: inline-flex; gap: .3rem; margin-left: auto; }
.wi-btns button { font-size: .76rem; padding: .12rem .45rem; }

.transcript {
  margin-top: .65rem; padding: .58rem .72rem; border: 1px solid var(--border);
  border-radius: 7px; background: var(--panel);
}
.transcript-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .36rem; }
.transcript-controls label { display: inline-flex; align-items: center; gap: .28rem; font-size: .8rem; font-weight: 700; }
.transcript-controls button, .transcript-controls select, .transcript-controls input {
  font-size: .81rem; padding: .2rem .44rem;
}
.transcript-search { flex: 1 1 10rem; min-width: 7.5rem; }
.caption-box {
  margin-top: .42rem; border: 1px solid #222730; border-radius: 6px;
  background: #08090c; max-height: 28rem; overflow-y: auto;
}
.segment {
  display: grid; grid-template-columns: 4.5rem 7rem minmax(0, 1fr); gap: .48rem;
  align-items: baseline; padding: .38rem .58rem; border-bottom: 1px solid #191d24; cursor: pointer;
}
.segment:last-child { border-bottom: 0; }
.segment:hover { background: #141820; }
.segment.ov-child {
  background: #0d1017; box-shadow: inset 3px 0 var(--spk-color, #a9d6ff);
  padding-left: .8rem;
}
.segment.ov-linked { background: #242110 !important; box-shadow: inset 4px 0 var(--gold); }
.segment.now { background: #18271c; box-shadow: inset 4px 0 #68c77b; }
.segment.match { background: #28230f; }
.segment-time { font: 700 .84rem/1.4 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-mark {
  display: inline-block; margin-left: .22rem; padding: 0 .2rem; border-radius: 3px;
  font: 800 .72rem/1.25 var(--mono); color: var(--gold); border: 1px solid #8a6e14; background: #1d1604;
}
.segment-speaker {
  display: inline-flex; align-items: center; gap: .32rem;
  color: var(--spk-color, #a9d6ff); font-size: .84rem; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.segment-text { line-height: 1.46; }
.segment-ja { font-size: 1.02rem; line-height: 2.05; }
html.no-furigana .segment-ja { line-height: 1.5; }
.segment-ww {
  margin-top: .16rem; font-size: .78rem; line-height: 1.45; color: #bcd0ea;
  display: flex; flex-wrap: wrap; gap: .15rem .45rem;
}
.segment-ww .ww-pair { white-space: nowrap; cursor: pointer; }
.segment-ww .ww-pair:hover { color: #fff; text-decoration: underline; }
.segment-ww .ww-ja { color: #90b4e8; margin-right: .15rem; }
.segment-std { margin-top: .16rem; font-size: .84rem; line-height: 1.4; color: #a9d6ff; }
.segment-en { margin-top: .2rem; font-size: .88rem; line-height: 1.42; color: #e2e8f0; }
.segment-fields {
  margin-top: .22rem; display: flex; flex-wrap: wrap; gap: .25rem;
}
.seg-field-chip {
  display: inline-flex; align-items: center; gap: .22rem; padding: .04rem .36rem;
  border-radius: 4px; border: 1px solid var(--trk-color, #7cc4ff);
  background: #111622; font-size: .74rem; color: #e2e8f0;
}
.seg-field-chip strong { color: var(--trk-color, #7cc4ff); }

.vocab-panel {
  margin-top: .7rem; padding: .6rem .75rem; border: 1px solid var(--border);
  border-radius: 7px; background: var(--panel);
}
.vocab-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .38rem .5rem; }
.vocab-bar h2 { margin: 0; font-size: .95rem; }
.vocab-count { font: 700 .8rem/1.3 var(--mono); color: #9ec5fe; margin-right: .25rem; }
.vocab-bar select, .vocab-bar input, .vocab-bar button { font-size: .82rem; padding: .2rem .46rem; }
.vocab-bar input[type="search"] { flex: 1 1 11rem; min-width: 8rem; }
.vocab-list { margin-top: .5rem; display: grid; gap: .32rem; max-height: 30rem; overflow-y: auto; }
.vocab-row {
  display: grid; grid-template-columns: minmax(9rem, 13rem) 4.6rem minmax(0, 1fr) auto auto;
  gap: .45rem .65rem; align-items: baseline; padding: .38rem .55rem;
  border: 1px solid #222730; border-radius: 5px; background: #10131a; font-size: .86rem;
}
.vocab-row.is-known { opacity: .55; }
.v-word { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .4rem; }
.v-ja { font-size: 1.12rem; font-weight: 700; color: #fff; line-height: 1.7; }
html.no-furigana .v-ja { line-height: 1.35; }
.v-read { font-family: var(--mono); font-size: .76rem; color: #9ec5fe; }
.v-diff {
  display: inline-block; text-align: center; padding: .04rem .34rem; border-radius: 4px;
  font: 800 .72rem/1.3 var(--mono); text-transform: uppercase; border: 1px solid #475569;
  color: #fff; background: #181e29; white-space: nowrap;
}
.vd-mtg, .vd-domain, .vd-ar { border-color: #ffd240; color: #ffd240; background: #241c06; }
.vd-slang, .vd-econ { border-color: #ff85a2; color: #ff85a2; background: #261018; }
.vd-n1, .vd-c1 { border-color: #d2a8ff; color: #d2a8ff; background: #1e132b; }
.vd-n2, .vd-b2 { border-color: #7cc4ff; color: #7cc4ff; background: #102033; }
.vd-n3, .vd-b1 { border-color: #7ee787; color: #7ee787; background: #102414; }
.vd-basic { border-color: #64748b; color: #cbd5e1; background: #141820; }
.v-meaning { line-height: 1.42; }
.v-gloss { font-weight: 700; color: #fff; }
.v-role { font-size: .78rem; color: #b6c4d8; margin-left: .35rem; }
.v-note { display: block; margin-top: .12rem; font-size: .8rem; color: #fde68a; }
.v-times { display: flex; flex-wrap: wrap; gap: .22rem; justify-content: flex-end; max-width: 14rem; }
.v-time {
  font: 700 .76rem/1.25 var(--mono); padding: .08rem .34rem; border-radius: 4px;
  color: #7cc4ff; border: 1px solid #2b384d; background: #0c111a;
}
.v-time:hover { background: #182336; border-color: #7cc4ff; }
.v-known { font-size: .76rem; padding: .1rem .4rem; white-space: nowrap; }
.v-known[aria-pressed="true"] { border-color: #68c77b; background: #142618; color: #7ee787; }
.word { border-radius: 3px; }
.word:hover { background: #554b19; }
.word.word-ov { border-bottom: 2px solid var(--ov-color, var(--gold)); padding-bottom: 1px; }
.word.word-ov-hi { background: rgba(255, 210, 64, 0.28); }
.word.word-now { background: #2e5937; }
.ov-chip {
  display: inline-block; margin: 0 .22rem; padding: .02rem .38rem; border-radius: 4px;
  border: 1px solid var(--ov-color, var(--gold)); background: #12151b; color: #fff;
  font-size: .8em; line-height: 1.35; cursor: pointer; white-space: nowrap; max-width: 22rem;
  overflow: hidden; text-overflow: ellipsis; vertical-align: -0.12em;
}
.ov-chip strong { color: var(--ov-color, var(--gold)); }

.notes-panel {
  margin-top: .7rem; padding: .55rem .75rem; border: 1px solid var(--border);
  border-radius: 7px; background: var(--panel);
}
.notes-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .38rem; }
.notes-bar h2 { margin: 0; font-size: .92rem; margin-right: .25rem; }
.notes-bar input.note-title-in { flex: 0 1 12rem; min-width: 8rem; font-size: .84rem; }
.notes-bar input.note-text-in { flex: 1 1 14rem; min-width: 10rem; font-size: .84rem; }
.notes-bar select, .notes-bar button { font-size: .82rem; }
.ann-filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .38rem;
  margin-top: .45rem; padding-top: .45rem; border-top: 1px solid #1e232c;
}
.ann-filter-bar label { display: inline-flex; align-items: center; gap: .28rem; font-size: .8rem; font-weight: 700; }
.ann-filter-bar select, .ann-filter-bar button { font-size: .8rem; padding: .18rem .46rem; }
.ann-filter-bar .ann-actions { display: flex; flex-wrap: wrap; gap: .32rem; margin-left: auto; }
.notes-list { margin-top: .45rem; display: grid; gap: .3rem; }
.notes-list:empty { display: none; }
.note-row {
  display: grid; grid-template-columns: 4.5rem 10.5rem minmax(0, 1fr) auto; gap: .5rem;
  align-items: baseline; padding: .34rem .5rem; border: 1px solid #222730;
  border-left: 3px solid var(--cat-color, var(--accent)); border-radius: 4px;
  background: #101319; font-size: .85rem;
}
.note-row.ann-active { background: #182332; border-color: var(--cat-color, var(--accent)); }
.note-row .nt-time { font: 700 .84rem/1.3 var(--mono); color: #7cc4ff; cursor: pointer; white-space: nowrap; }
.note-row .nt-tag {
  font-weight: 800; font-size: .78rem; color: var(--cat-color, var(--gold));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.note-row .nt-body { line-height: 1.42; }
.note-row .nt-title { font-weight: 800; color: #fff; margin-right: .35rem; }
.note-row .nt-src {
  display: inline-block; margin-left: .3rem; padding: 0 .28rem; border-radius: 3px;
  border: 1px solid #3c4657; font: 700 .68rem/1.25 var(--mono); color: #fff;
  vertical-align: middle;
}
.note-row .nt-btns { display: inline-flex; gap: .25rem; }
.note-row .nt-edit, .note-row .nt-del { padding: .08rem .38rem; font-size: .76rem; }
.note-edit-form {
  grid-column: 1 / -1; display: grid; gap: .35rem; margin-top: .3rem;
  padding-top: .35rem; border-top: 1px solid #242a35;
}
.note-edit-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.note-edit-form input, .note-edit-form select, .note-edit-form textarea {
  font: inherit; font-size: .84rem; color: #fff; background: #0a0c10;
  border: 1px solid #3f4857; border-radius: 4px; padding: .24rem .45rem;
}
.note-edit-form input.ed-time { width: 5.5rem; font-family: var(--mono); }
.note-edit-form input.ed-title { flex: 1 1 12rem; }
.note-edit-form textarea.ed-note { width: 100%; min-height: 3.2rem; resize: vertical; }

@media (min-width: 1040px) {
  main.split-view {
    display: grid;
    grid-template-columns: var(--split-col-w, minmax(22rem, min(62vw, 960px))) minmax(20rem, 1fr);
    column-gap: .75rem; row-gap: .5rem; align-items: start;
  }
  main.split-view > .player-wrap { grid-column: 1; grid-row: 1; }
  main.split-view > .transcript {
    grid-column: 2; grid-row: 1; margin: 0;
    display: flex; flex-direction: column; overflow: hidden;
  }
  main.split-view > .transcript .caption-box { flex: 1 1 0; max-height: none; min-height: 0; }
  main.split-view > .viz-stage { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
  main.split-view > .vocab-panel,
  main.split-view > .notes-panel { grid-column: 1 / -1; margin-top: 0; }

  main.rows-beside {
    display: grid; column-gap: .75rem; row-gap: .55rem; align-items: start;
  }
  main.rows-beside.rows-left {
    grid-template-columns: var(--rows-side-w, 40%) minmax(0, 1fr);
  }
  main.rows-beside.rows-right {
    grid-template-columns: minmax(0, 1fr) var(--rows-side-w, 40%);
  }
  main.rows-beside.rows-left > .viz-stage { grid-column: 1; grid-row: 1; margin: 0; }
  main.rows-beside.rows-left > .player-wrap { grid-column: 2; grid-row: 1; }
  main.rows-beside.rows-right > .player-wrap { grid-column: 1; grid-row: 1; }
  main.rows-beside.rows-right > .viz-stage { grid-column: 2; grid-row: 1; margin: 0; }
  main.rows-beside > .transcript,
  main.rows-beside > .vocab-panel,
  main.rows-beside > .notes-panel { grid-column: 1 / -1; margin-top: 0; }
}
@media (max-width: 760px) {
  .lanes-stage { --lane-gutter: 8.5rem; }
  .segment { grid-template-columns: 4.2rem 5.8rem minmax(0, 1fr); gap: .38rem; }
  .note-row { grid-template-columns: 4rem 6rem minmax(0, 1fr) auto; }
  .vocab-row { grid-template-columns: minmax(0, 1fr) auto; }
  .v-times { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
}
