/* 幅だけで 3 つ: 小 〜599 px (下のタブ・全画面のシート)・中 〜939 px (左の列・右のシート)・大 (左の列・中央の一覧・右の詳細) */
:root {
  --g-cmd: var(--bad);
  --g-ops: #ff7eb6;
  --g-voice: var(--acc);
  --g-train: #ff9f43;
  --g-ctl: var(--warn);
  --g-db: var(--ok);
  --g-sys: var(--dim);
  color-scheme: dark;
  --bg: #0f1419;
  --panel: #161d26;
  --panel2: #1b2430;
  --line: #26303c;
  --fg: #e6edf3;
  --dim: #8b98a5;
  --acc: #4cc2ff;
  --ok: #5ad19a;
  --warn: #dca21e;
  --bad: #ff6b6b;
  --rail: 76px;
  --side: 400px;
  --top: 46px;
  --bottom: 58px;
  --on-acc: var(--bg);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --fs-s: max(12px, 0.75rem);
  --h-t: 24px;
  --h-s: 32px;
  --h: 40px;
  --h-l: 48px;
  --h-pill: var(--h-t);
  --k: 0.875;
  --r: 10px;
  --r-s: 6px;
  --r-pill: 999px;
  --fs-c: 0.875rem;
  --fs-sm: max(12px, 0.8125rem);
  --sp-t: 4px;
  --sp-s: 4px;
  --sp: 8px;
  --sp-l: 8px;
  --row-gx: 12px;
  --row-gt: 8px;
  --row-bl: 12px;
  --row-py: var(--sp-s);
  --lh: 1.5;
  --lh-tight: 1.25;
  --lh-btn: 1.1;
  --pad-main: var(--sp-l);
  --pad-top: var(--sp-l);
} /* --pad-top = 本文の上の余白 (貼り付ける見出しの top を合わせる) */
/* ボタンの高さ 4 段 (--h-t 文中・--h-s 小・--h 普通・--h-l 大)、余白 4 段。文字の大きさ 小・大 で 1 段下・上、幅では変えない。
   小さいボタン・連続ボタン・Chips・縦に並ぶボタンの中の左右は「普通」(小の 4px では文字が枠に付く) */
:root[data-size="s"] {
  --k: 0.7875;
  --h-t: 20px;
  --h-s: 24px;
  --h: 32px;
  --h-l: 40px;
  --lh: 1.3;
  --row-gx: 8px;
  --row-gt: 4px;
  --top: 38px;
  --bottom: 50px;
  --rail: 64px;
}
:root[data-size="l"] {
  --k: 1;
  --h-t: 32px;
  --h-s: 40px;
  --h: 48px;
  --h-l: 56px;
  --row-gx: 12px;
  --row-gt: 12px;
}
:root[data-theme="light"] {
  --g-ops: #bf3989;
  --g-train: #bc4c00;
  color-scheme: light;
  --bg: #f6f8fa;
  --panel: #fff;
  --panel2: #f0f3f6;
  --line: #d0d7de;
  --fg: #1f2328;
  --dim: #57606a;
  --acc: #0969da;
  --ok: #1a7f37;
  --warn: #9a6700;
  --bad: #cf222e;
}
* {
  box-sizing: border-box;
}
html {
  height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
} /* iPhone の横向きで Safari が字を自動で大きくしない */
body {
  margin: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  color: var(--fg);
  /* prettier-ignore */
  font: 0.875rem/var(--lh) system-ui, "Noto Sans JP", sans-serif;
  display: grid; /* 高さは決めず上下を 0 に (iPhone のホーム画面で、計算した高さが表示とずれて下に隙間ができる) */

  grid-template-columns: calc(var(--rail) + var(--sal)) minmax(0, 1fr) calc(var(--side) + var(--sar));
  grid-template-rows: calc(var(--top) + var(--sat)) minmax(0, 1fr);
  grid-template-areas: "top top top" "rail main side";
  overflow: hidden;
}
button,
select,
input {
  font: inherit;
  font-size: var(--fs-c);
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  padding: 0 var(--sp);
}
button,
select,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
  min-height: var(--h);
}
button {
  cursor: pointer;
}
button:hover {
  border-color: var(--acc);
}
button.on,
button.pri {
  background: var(--acc);
  color: var(--on-acc);
  border-color: var(--acc);
}
button.pri {
  font-weight: 700;
} /* ボタンは 2 種類: 塗り (確定の操作 .pri・選んでいるバッジ .on) と枠つき (ほか) */
button.icon {
  background: none;
  border: none;
  font-size: var(--fs-c);
  padding: 0 var(--sp);
  min-height: max(32px, var(--h-s));
  min-width: 32px;
} /* 見た目は変えずに押せる範囲を 32px 以上に (字の大きさ「小」でも) */
input[type="search"] {
  width: 100%;
}
.dim {
  color: var(--dim);
}
.mono {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, Consolas, monospace;
}
.grow {
  flex: 1;
}
.ok {
  color: var(--ok);
}
.warn {
  color: var(--warn);
}
.bad {
  color: var(--bad);
}
#top {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: var(--sp);
  padding: var(--sat) max(var(--sp-l), env(safe-area-inset-right)) 0 max(var(--sp-l), env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  min-width: 0;
}
#top .brand {
  white-space: nowrap;
}
#pills {
  display: flex;
  gap: var(--sp-t);
  min-width: 0;
  padding: var(--sp-t) 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
#pills::-webkit-scrollbar {
  display: none;
}
#pills .pill {
  flex: none;
} /* バッジが入りきらないときは指で横に動かす */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-t);
  line-height: var(--lh-btn);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0 var(--sp-t);
  min-height: var(--h-pill);
  font-size: var(--fs-s);
  white-space: nowrap;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
  display: inline-block;
}
.dot.ok {
  background: var(--ok);
}
.dot.warn {
  background: var(--warn);
}
.dot.bad {
  background: var(--bad);
}
#status {
  font-size: var(--fs-sm);
  white-space: nowrap;
}
#rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 8px 8px calc(8px + var(--sal));
  border-right: 1px solid var(--line);
  overflow: auto;
}
.navb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  background: none;
  border-radius: var(--r-s);
  padding: 8px 2px;
  font-size: var(--fs-s);
  color: var(--dim);
}
.navb .ic {
  display: flex;
  height: 22px;
  align-items: center;
}
.navb.on {
  background: var(--panel2);
  color: var(--fg);
}
#bottom {
  display: none;
}
#mainwrap {
  grid-area: main;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
#main {
  flex: 1;
  overflow: auto;
  padding: var(--pad-main);
  min-width: 0;
  min-height: 0;
  overscroll-behavior: contain;
  container-type: inline-size;
} /* 本文が 600px 未満なら小の幅と同じ出し方 (JS の narrowAt と同じ; 下の @container) */
.dep {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-t) var(--sp-s);
  font-size: var(--fs-sm);
  margin-top: var(--sp-t);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-s);
  margin: var(--sp) 0;
}
.filters {
  position: sticky;
  top: calc(-1 * var(--pad-top));
  z-index: 2;
  background: var(--bg);
  padding: var(--sp) 0;
  margin-top: calc(-1 * var(--sp));
}
.list {
  display: flex;
  flex-direction: column;
}
.row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-rows: repeat(2, calc(var(--h-s) - 0.5px));
  gap: 0 var(--row-gx);
  align-items: center;
  padding: 0 var(--row-gx);
  line-height: var(--h-t);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.row .tt {
  grid-column: 1/-2;
  grid-row: 2;
}
.row > .rowpc {
  grid-column: -2;
  grid-row: 1;
  justify-self: end;
}
.row > :is(:last-child, span:last-child:empty) {
  grid-column: -2;
  grid-row: 2;
  justify-self: end;
} /* 受信・検索の行はどの幅も 2 段 (時刻・Ch・種類 / 内容)。右の端は 端末名 (上) と ▶ (下) */
.rowpc {
  font-size: var(--fs-s);
  color: var(--dim);
  white-space: nowrap;
}
.row.sel {
  background: var(--panel2);
} /* 重ねただけでは色を変えない (iPhone はスクロールで指を置いた行が :hover のまま残る) */
.row .t {
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}
.row .ch {
  min-width: 3.2em;
  color: var(--acc);
  font-weight: 600;
}
.row .k {
  font-weight: 700;
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.row .tt {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
}
.row .tt::-webkit-scrollbar {
  display: none;
}
.row > span:last-child:empty {
  display: none;
}
.row:has(> span:last-child:empty) > .tt {
  grid-column: 1/-1;
} /* 入らない内容は「…」で切らず横にスクロール。▶ の無い行は ▶ の欄まで使う */

.more {
  margin: var(--sp-l) auto;
  display: block;
}
.vo-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp);
  margin: var(--sp-l) 0;
}
#side {
  grid-area: side;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
}
#side-head {
  display: flex;
  align-items: center;
  gap: var(--sp-s);
  padding: var(--sp-t) calc(var(--sp-s) + var(--sar)) var(--sp-t) var(--sp-l);
  border-bottom: 1px solid var(--line);
}
#side-body {
  flex: 1;
  overflow: auto;
  padding: var(--sp-l) calc(var(--sp-l) + var(--sar)) var(--sp-l) var(--sp-l);
  min-height: 80px;
}
@media (width>=940px) {
  body:not(.side-open) {
    grid-template-columns: calc(var(--rail) + var(--sal)) minmax(0, 1fr);
    grid-template-areas: "top top" "rail main";
  }
  body:not(.side-open) #side {
    display: none;
  }
  body:not(.side-open) #main {
    padding-right: calc(var(--pad-main) + var(--sar));
  }
} /* 大: 閉じたら右の列ごと消して本文を広げる */
table.kv {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-sm);
}
table.kv th {
  text-align: left;
  color: var(--dim);
  font-weight: 400;
  padding: var(--sp-t) var(--sp-s) var(--sp-t) 0;
  vertical-align: top;
  white-space: nowrap;
}
table.kv td {
  padding: var(--sp-t) 0;
  word-break: break-word;
}
table.grid {
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
table.grid th,
table.grid td {
  border-bottom: 1px solid var(--line);
  padding: var(--sp-t) var(--sp-s);
  text-align: left;
  white-space: nowrap;
}
.tl {
  position: relative;
  margin-left: var(--sp);
  border-left: 2px solid var(--line);
  padding-left: calc(var(--sp-l) + var(--sp-t));
}
.tl .it {
  position: relative;
  margin: 0 0 var(--sp);
}
.tl .it::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--acc);
}

.heat {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.heat td.c {
  height: 9px;
  padding: 0;
  border: 1px solid var(--bg);
}
.heat th {
  font-weight: 400;
  color: var(--dim);
  font-size: var(--fs-s);
  line-height: var(--lh-tight);
  padding: 0 2px;
  overflow: hidden;
  white-space: nowrap;
}
.heat tr:first-child > th {
  overflow: visible;
  text-align: left;
}
.heat tr > th:first-child {
  width: 3.6em;
  text-align: left;
  padding-right: var(--sp);
}
.heat tr > td.dim:last-child {
  padding-left: var(--sp);
}
.heat tr > :last-child {
  width: 2.8em;
  font-size: var(--fs-s);
  line-height: var(--lh-btn);
}
.wf {
  width: 100%;
  height: clamp(220px, 45vw, 460px);
  background: #000;
  border-radius: var(--r);
  display: block;
  touch-action: none;
  cursor: grab;
} /* 画素は表示の大きさ × 画素密度で描く (wf.js)。高さに上限 */
@media (width>=1400px) {
  .cfg-body[data-tab="gr"]:has(#st-wf) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--sp-l);
    align-items: start;
  }
} /* 広い画面のグラフ: ウォーターフォールと受信状況を 2 列 (待ち受けはウォーターフォールが無いので 1 列) */
.logbox {
  font:
    var(--fs-s)/var(--lh) ui-monospace,
    Consolas,
    monospace;
  white-space: pre-wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp) var(--sp-l);
  max-height: 320px;
  overflow: auto;
}
h3.sub {
  font-size: var(--fs-c);
  margin: var(--sp-l) 0 var(--sp);
}

#pop,
#modal,
#askbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(var(--sp-l), var(--sat)) var(--sp-l) max(var(--sp-l), var(--sab));
}
.pop-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: var(--r);
  width: min(720px, 100%);
  max-height: calc(100% - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.pop-head {
  display: flex;
  align-items: center;
  gap: var(--sp);
  padding: var(--sp-t) var(--sp-l);
  border-bottom: 1px solid var(--line);
}
.pop-body {
  overflow: auto;
  padding: var(--sp-l);
}
/* 1 つを選ぶ横並びは連続したボタン (.seg): 1px の隙間に枠の色を見せて、折り返しても 1 つのまとまりに。高さは「小」 */
.seg[hidden] {
  display: none;
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1px;
  max-width: 100%;
  vertical-align: middle;
  background: var(--line);
  outline: 1px solid var(--line);
  outline-offset: -1px;
  border-radius: var(--r-s);
  overflow: hidden;
}
.seg > button {
  flex: 1 1 auto;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  color: inherit;
  padding: 0 var(--sp);
  font-size: var(--fs-sm);
  min-height: var(--h-s);
  white-space: nowrap;
}
.seg > button:hover:not(.on) {
  background: var(--panel2);
}
.seg > button.on {
  background: var(--acc);
  color: var(--on-acc);
}
.seg:empty {
  display: none;
}
.seg.full {
  display: flex;
  width: fit-content;
  margin: var(--sp) 0;
}
.seg.full.tabs {
  display: grid;
  width: auto;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
} /* 上のタブ (設定・DB) はどの幅も幅いっぱいの等分 */
.seg.full:first-child {
  margin-top: 0;
}
.seg.big > button {
  min-height: var(--h-l);
}
.seg.mid > button {
  min-height: var(--h);
} /* DB・設定・音声・検索の最初の 2 段は 大・普通 */
#player .vp-nav > select,
.rc-sel select {
  min-height: var(--h-l);
}
.seg.cols5 {
  display: grid;
  width: auto;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.seg.cols5 > button:last-child:nth-child(5n + 1) {
  grid-column: span 5;
}
.seg.cols5 > button:last-child:nth-child(5n + 2) {
  grid-column: span 4;
}
.seg.cols5 > button:last-child:nth-child(5n + 3) {
  grid-column: span 3;
}
.seg.cols5 > button:last-child:nth-child(5n + 4) {
  grid-column: span 2;
} /* 等分の格子の最後の行は、最後のボタンを行の終わりまで伸ばす (空の升に枠の色を出さない) */
#toasts {
  position: fixed;
  right: calc(var(--sp-l) + var(--sar));
  bottom: var(--sp-l);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: var(--sp);
  max-width: min(380px, calc(100vw - 2 * var(--sp-l)));
}
.toast {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--acc);
  border-radius: var(--r);
  padding: var(--sp) var(--sp-l);
  font-size: var(--fs-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

button.small {
  padding: 0 var(--sp);
  font-size: var(--fs-s);
  min-height: var(--h-s);
  border-radius: var(--r-s);
}
.dage {
  font-size: var(--fs-s);
  white-space: nowrap;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.hscroll {
  overflow-x: auto;
  max-width: 100%;
}
details.raw {
  margin-top: var(--sp-l);
}
.vw-hist > summary {
  cursor: pointer;
}
details.raw summary {
  cursor: pointer;
  color: var(--dim);
}
td.hex,
div.hex {
  word-break: break-all;
  font-size: var(--fs-s);
}
.now {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-t);
  align-items: center;
  min-height: var(--h-s);
  line-height: var(--h-s);
} /* 上の帯の行は 1 段ずつ「小」の高さ (折り返した段も) */
.now > b {
  color: var(--acc);
  min-width: 4.2em;
}
.now .talk {
  color: var(--g-ctl);
  font-weight: 700;
}
.now .play {
  color: var(--ok);
  font-weight: 700;
}
.now .dep {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-t);
  margin-top: 0;
  color: var(--dim);
}
.now .tog {
  border: none;
  background: none;
  padding: 0 var(--sp-t);
  color: var(--dim);
  font-size: var(--fs-s);
}
.now.open {
  align-items: flex-start;
}
.deps {
  flex-basis: 100%;
  padding-left: 4.6em;
  display: flex;
  flex-direction: column;
}
.deprow {
  display: flex;
  gap: var(--sp-t);
}
.deprow .dn {
  min-width: 4em;
  color: var(--dim);
}
.deprow .fs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-t);
}
.optext {
  white-space: normal;
  line-height: var(--lh);
}
.unv {
  color: var(--dim);
  font-weight: 400;
}
.optabw {
  width: 100%;
  overflow-x: auto;
}
.optab {
  border-collapse: collapse;
  margin: 0;
}
.optab td {
  border: none;
  padding: 0 1.2em 0 0;
  vertical-align: top;
  white-space: nowrap;
}
.optab td:last-child {
  padding-right: 0;
}
.opcells {
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.opcells > .r {
  display: grid;
  border-bottom: 1px solid var(--line);
}
.opcells .c {
  padding: var(--sp-t);
  min-width: 0;
  overflow-wrap: anywhere;
}
.opcells .c + .c {
  border-left: 1px solid var(--line);
}
.opcells .k {
  color: var(--dim);
  font-size: var(--fs-s);
  font-weight: 600;
  line-height: var(--lh-tight);
}
.opcells .v {
  line-height: var(--lh-tight);
}
.opcells > .inline > .c {
  display: flex;
  align-items: baseline;
  gap: var(--sp-s);
}
.opcells > .inline .k {
  flex: none;
}
.opcells > .inline .v {
  min-width: 0;
}
.optitle {
  margin: var(--sp-t) 0 0;
}
.opsech {
  margin: var(--sp-l) 0 0;
  color: var(--dim);
  font-weight: 600;
}
.opgap {
  height: 10px;
}
.opdet > summary {
  cursor: pointer;
  margin: 0;
}
.opdet > .opcells {
  margin-top: var(--sp-t);
}
.opsech + .opcells {
  margin-top: var(--sp-t);
}
.opack {
  margin-top: var(--sp);
}
.opcells > .rcv > .c.c0 {
  border-left: none;
}
.opcells > .rcv > .c {
  padding-top: 0;
  padding-bottom: 0;
}
.opcells > .rcv > .c:nth-child(-n + 2) {
  padding-top: var(--sp-t);
}
.opcells > .rcv > .c:nth-last-child(-n + 2) {
  padding-bottom: var(--sp-t);
}
#ana-w tr.open td {
  background: color-mix(in srgb, var(--acc) 15%, transparent);
}
@media (width<940px) {
  body {
    grid-template-columns: calc(var(--rail) + var(--sal)) minmax(0, 1fr);
    grid-template-areas: "top top" "rail main";
  }
  #main {
    padding-right: calc(var(--pad-main) + var(--sar));
  }
  #nowbar {
    padding-right: calc(var(--sp-l) + var(--sar));
  } /* iPhone の横向き: 右の安全域 (中の幅) */
  #side {
    position: fixed;
    top: calc(var(--top) + var(--sat));
    right: 0;
    bottom: 0;
    width: min(var(--side), 100vw);
    z-index: 20;
    transform: translateX(105%);
    transition: transform 0.18s;
    box-shadow: -6px 0 18px rgba(0, 0, 0, 0.35);
  }
  body.side-open #side {
    transform: none;
  }
}
@media (width<600px) {
  :root {
    --top: 44px;
  }
  body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: calc(var(--top) + var(--sat)) minmax(0, 1fr) auto;
    grid-template-areas: "top" "main" "bottom";
  }
  #rail {
    display: none;
  }
  #bottom {
    grid-area: bottom;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    min-height: var(--bottom);
    border-top: 1px solid var(--line);
    background: var(--bg);
  } /* 高さは中身から (決めた高さでは文字が切れる)。下の安全域は足さない (iPhone のホーム画面で隙間が二重になる) */
  #bottom .navb {
    flex: 1;
    padding: var(--row-py) 0;
    line-height: 1.2;
    color: var(--dim);
  }
  #bottom .navb.on {
    color: var(--fg);
  }
  #top .brand {
    display: none;
  }
  #status:empty {
    display: none;
  }
  #status {
    order: -1;
    flex: none;
    display: block;
    border: 1px solid var(--bad);
    border-radius: var(--r-pill);
    padding: 0 var(--sp-t);
    line-height: calc(var(--h-pill) - 2px);
    font-size: var(--fs-s);
    color: var(--bad);
  }
  #status::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bad);
    margin-right: var(--sp-t);
    vertical-align: middle;
  } /* 題名は出さず、状態のバッジを見せる。つながらないときだけ #status を赤いバッジにして並びの頭に */
  #side {
    top: 0;
    width: 100vw;
    bottom: 0;
  }
  #side-head {
    padding-top: calc(var(--sp-t) + var(--sat));
    padding-left: calc(var(--sp-l) + var(--sal));
  }
  #side-body {
    padding-bottom: calc(var(--sp-l) + var(--sab));
    padding-left: calc(var(--sp-l) + var(--sal));
  }
  #main {
    padding-left: calc(var(--pad-main) + var(--sal));
  }
  #nowbar {
    padding-left: calc(var(--sp-l) + var(--sal));
  }
  #bottom {
    padding: 0 var(--sar) 0 var(--sal);
  } /* 全画面のシートの一番下をホームバーに掛けない (下のタブには足さない) */
  .row .tt {
    font-size: var(--fs-sm);
  }
  .deps {
    padding-left: 0;
  }
  .row .ch {
    min-width: 2.6em;
  }
  #toasts {
    bottom: calc(var(--bottom) + var(--sp) + var(--sab));
  }
}

#vp-viz {
  position: relative;
}
#vp-viz canvas {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--panel);
}
#vp-wave {
  height: 84px;
  cursor: crosshair;
}
#vp-play-head {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--warn);
  pointer-events: none;
  left: 0;
}
@container (width<600px) {
  #vp-wave {
    height: 44px;
  }
}
button.on .dim {
  color: inherit;
  opacity: 0.8;
}
[data-pane][hidden] {
  display: none;
}
/* iPhone でバッジが切れない、音声の上を貼り付け */
.vo-top {
  position: sticky;
  top: calc(-1 * var(--pad-top));
  z-index: 3;
  background: var(--bg);
  padding: var(--sp) 0;
  margin-top: calc(-1 * var(--sp));
  border-bottom: 1px solid var(--line);
}
#player .vp-bar {
  display: flex;
  gap: var(--sp);
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
}
#player .vp-bar > * {
  white-space: nowrap;
}
#player {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp);
  align-items: center;
} /* 段の間は検索の段 (.rc-sel と入力欄) と同じ「普通」 */
#player > .vp-bar:not(.vp-infoline) {
  margin: 0;
}
#player .vp-infoline,
#player #vp-viz {
  flex-basis: 100%;
}
#player .vp-nav,
#player .vp-ctl {
  flex-basis: 100%;
  flex-wrap: nowrap;
} /* どの幅も 1 段目 端末・欠損率・Ch (大)、2 段目 −10・戻る・再生・進む・+10・出力・WAV保存 (普通) */
#player #vp-info,
#player #vp-r3info {
  font-size: var(--fs-s);
}
/* 音声は波形 (スペクトログラムでなく)、記録の Ch は 1 行 */
#player #vp-wave {
  display: block;
}
#rx-live[hidden] {
  display: none;
}
.tl.ud .it {
  margin: 0 0 var(--sp-t);
  cursor: default;
}
.tl.ud .it[data-i] {
  cursor: pointer;
}
.tl.ud .tm {
  display: inline-block;
  width: 19ch;
  white-space: nowrap;
  font-family: ui-monospace, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  margin-right: var(--sp-t);
  font-size: var(--fs-s);
}
.tl.ud .it.pos::before {
  background: var(--ok);
  width: 8px;
  height: 8px;
  left: 3px;
  top: 8px;
}
.tl.ud .it.zk::before {
  background: var(--line);
  width: 6px;
  height: 6px;
  left: 4px;
  top: 9px;
}
.tl.ud .tx {
  font-size: var(--fs-sm);
}
.clsbox {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp) var(--sp-l);
  margin: var(--sp) 0;
}
.clsh {
  display: flex;
  gap: var(--sp-t);
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: var(--sp);
}
.fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: var(--sp-s);
}
@media (width<600px) {
  .fgrid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  }
  :root .fgrid button {
    padding: 0 var(--sp-t);
  }
} /* 小の幅は iPhone (375px) で 4 列 */
.fgrid button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-t);
  padding: 0 var(--sp-l);
  min-height: var(--h-l);
  text-align: left;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}
.fgrid button > :first-child {
  flex: none;
}
.fgrid button > :not(:first-child) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
} /* 名前と件数を 1 行に。編成名は切らず、入らないときは件数を「…」で縮める */
.vf {
  color: var(--dim);
  margin-left: var(--sp-t);
  font-size: var(--fs-s);
}
.vf.bad {
  color: var(--bad);
}
.vftop {
  margin: calc(-1 * var(--sp-t)) 0 var(--sp);
}
.vftop .vf:first-child {
  margin-left: 0;
}
.trainbtn {
  display: inline-flex;
  align-items: center;
  min-height: var(--h-t);
  padding: 0 var(--sp-t);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--panel);
  color: inherit;
  font: inherit;
  line-height: var(--lh-btn);
  cursor: pointer;
  white-space: nowrap;
  vertical-align: baseline;
}
.trainbtn.warn {
  color: var(--warn);
}
.trainbtn:hover {
  border-color: var(--acc);
}

.cabgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--sp);
}
.cab {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp) var(--sp-l);
  font-size: var(--fs-sm);
}
#nowbar {
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 0 var(--sp-l);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
  max-height: 40vh;
  overflow: auto;
  background: var(--bg);
}
@media (width<600px) {
  body[data-sec="dbedit"] #nowbar {
    display: none;
  }
}
@container (width<600px) {
  .dbe table.vehx td {
    padding: var(--sp-t) calc(var(--sp-t) / 2);
  }
  .dbe table.vehx button.small {
    padding: 0 var(--sp-t);
  }
} /* 小の幅: DB の編集は詳細の画面 (横の欄のシート) と同じく上の帯を出さない */
#nowbar.empty {
  display: none;
}
#nb-top,
#nb-play,
#nb-lines {
  display: contents;
} /* 帯の 3 つの部分は箱を作らない (中の行はそのまま並ぶ) */
#nowbar a {
  color: inherit;
  text-decoration: underline dotted;
  cursor: pointer;
}
.now.load {
  color: var(--dim);
  gap: var(--sp-t);
}

table.grid.wrap td,
table.grid.wrap th {
  white-space: normal;
}
:is(table.bstab, table.dbtab) :is(td, th):not(:last-child) {
  white-space: nowrap;
}
.kchip {
  white-space: nowrap;
} /* 基地局・履歴の名前と日時・種類は折り返さない */
table.grid.idx {
  width: 100%;
  font-size: var(--fs-s);
}
table.grid.idx td,
table.grid.idx th {
  padding: var(--sp-t) var(--sp-s);
}
.dsep {
  margin: var(--sp-l) 0 var(--sp) -14px;
  padding: var(--sp-t) var(--sp-s);
  font-size: var(--fs-s);
  font-weight: 700;
  color: var(--fg);
  background: var(--panel2);
  border-radius: var(--r-s);
  display: inline-block;
}
table.chtab th:first-child {
  color: var(--acc);
  font-weight: 700;
}
table.chtab td {
  font-size: var(--fs-s);
}
/* 設定の行: 名前 (.sl) のすぐ右から左詰めに値と部品 (.sv; 右に寄せると操作しづらい)。
   2 列の格子: 部品の行を包む要素の無い sec_voice.contSettings も同じ形にするため */
.set {
  display: grid;
  grid-template-columns: minmax(7em, max-content) minmax(0, 1fr);
  column-gap: var(--sp);
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.set.two {
  grid-template-columns: minmax(7em, max-content) minmax(0, 1fr) minmax(7em, max-content) minmax(0, 1fr);
}
@media (width<600px) {
  .set.two {
    grid-template-columns: minmax(7em, max-content) minmax(0, 1fr);
  }
}
.cfg-body {
  container: cfg/inline-size;
}
@container cfg (width<600px) {
  .set.two {
    grid-template-columns: minmax(7em, max-content) minmax(0, 1fr);
  }
} /* 本文が狭いとき (大の幅で右の欄を開いた) も 1 組ずつ */
[data-mod="view"] .set {
  grid-template-columns: 14em minmax(0, 1fr);
}
[data-mod="view"] .set > .sl {
  white-space: normal;
}
@container cfg (width<600px) {
  [data-mod="view"] .set {
    grid-template-columns: 7em minmax(0, 1fr);
  }
} /* 通知のタブは見出しごとの表の値の列をそろえる (長い名前は折り返す) */
table.grid.rs-dev th {
  white-space: nowrap;
  overflow-wrap: normal;
} /* RTL-SDR の表の見出しは単語の途中で折らない */
.set > .sl,
.set > .vo-sub > span {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-t);
  min-height: var(--h);
  padding: var(--sp-t) 0;
  color: var(--dim);
  font-size: var(--fs-sm);
  white-space: nowrap;
  box-sizing: border-box;
}
.set > .sl::after,
.set > .vo-sub > span::after {
  content: "";
  position: absolute;
  left: 0;
  right: -200vw;
  bottom: 0;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}
.set > label.sl {
  cursor: pointer;
}
.set > .sv,
.set > .vo-sub > :not(span) {
  align-self: center;
  justify-self: start;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--sp-t) var(--sp-s);
  min-width: 0;
  max-width: 100%;
  padding: var(--sp-t) 0;
  text-align: left;
  overflow-wrap: anywhere;
}
.set > .sv.wide,
.set > .vo-sub > .vo-rng {
  justify-self: stretch;
  flex-wrap: nowrap;
}
.set > .sv.wide input[type="range"],
.set > .vo-sub > .vo-rng input[type="range"] {
  flex: 0 1 20em;
  width: 20em;
  max-width: 100%;
  min-width: 0;
}
.set > .sv.wide > :not(input),
.set > .vo-sub > .vo-rng > :not(input) {
  flex: none;
  white-space: nowrap;
} /* 棒は 20em まで (大の幅で端まで伸ばさない)、数字は棒のすぐ右 */
.set > .vo-sub > .seg,
.set > .sv > .seg {
  display: inline-flex;
  gap: 1px;
  padding: 0;
  justify-self: start;
  align-self: center;
} /* 連続ボタンは行の部品の余白・間隔を受けない (隙間と上下に地の色が見える) */
.set > .sv.ok {
  color: var(--ok);
  font-weight: 700;
}
.set > .sv.bad {
  color: var(--bad);
  font-weight: 700;
}
.set > .sv.warn {
  color: var(--warn);
}
.set > .sfull {
  grid-column: 1/-1;
  min-height: var(--h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.set > .sgh {
  font-weight: 700;
  padding-top: var(--sp);
}
.set > .sv :is(button, select) {
  min-height: var(--h-s);
}
.set > .sv .seg > button {
  min-height: var(--h-s);
} /* 行の中の部品は「小」: どの行も高さ = 普通 (中の字で 40px) */
.unsaved {
  color: var(--warn);
  font-size: var(--fs-s);
  white-space: nowrap;
}
.rs-cell {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-t) var(--sp-s);
}
.rs-cell select {
  min-height: var(--h-s);
}
.rs-n {
  display: inline-flex;
  align-items: center;
  gap: var(--sp);
}
.rs-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp);
  margin-top: var(--sp);
  padding: var(--sp) var(--sp-l);
  background: var(--panel2);
  border: 1px solid var(--warn);
  border-radius: var(--r);
  font-size: var(--fs-sm);
} /* 受信の設定の未保存の変更 (受信の設定の区画の下端に貼り付け) */
.set input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
}
.set .iqst {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.set-msg {
  font-size: var(--fs-s);
  color: var(--dim);
  margin-top: var(--sp-t);
}
.set-msg:empty {
  display: none;
}
.dbe :is(input:not([type="checkbox"]):not([type="radio"]), select) {
  min-height: var(--h-s);
}
.dbe table.grid td {
  white-space: nowrap;
}
.dbe .hscroll {
  overflow-x: auto;
} /* DB の編集の表: 入力欄 + 方・操作のボタン (↑↓削除) を 1 行に、小の幅も横にスクロール (小の幅の表の折り返しより強く) */
.set-act {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp);
  margin-top: var(--sp);
}
h3.sub.hrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-s);
}
h3.sub.hrow > .hr {
  display: flex;
  align-items: center;
  gap: var(--sp-s);
  font-weight: 400;
}
.cfg-body .seg[hidden],
.cfg-body button[hidden] {
  display: none;
}
.pop-box.plain {
  border-left-color: var(--acc);
  width: min(560px, 100%);
}
.row .pl {
  padding: 0 var(--row-gt);
  color: var(--acc);
}
a {
  color: var(--acc);
}
#player #vp-wav {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list.ls {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.list.ls .li {
  display: flex;
  gap: var(--sp);
  align-items: baseline;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  text-align: left;
  padding: var(--row-py) var(--sp-l);
}
.list.ls .li:last-child {
  border-bottom: none;
}
.list.ls .li.on {
  background: var(--panel2);
}
.list.ls .li .nm {
  flex: 1;
}
.list.ls .li.on .dim {
  color: var(--dim);
  opacity: 1;
}
.ex {
  margin-left: var(--sp-t);
}
#theme svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
.pw-end {
  padding: var(--h-l) var(--sp-l);
  text-align: center;
}
#power[hidden] {
  display: none;
}
.pop-box.bare {
  width: min(420px, 100%);
}
.pwr.pwr3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}
.cfg-body {
  display: flex;
  flex-direction: column;
}
.cfg-body > [hidden] {
  display: none;
}
#power svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
.pop-box:not(.plain) {
  border-left-color: var(--kc, var(--warn));
}
.pop-box:not(.plain) .pop-head b {
  color: var(--kc, var(--fg));
}
.toast {
  border-left-color: var(--kc, var(--acc));
}
.toast .toast-h > b {
  color: var(--kc, var(--fg));
}

/* iPhone: 1 行に収める (音声の上・Ch・タブ・設定の行) */
@container (width<600px) {
  #player .vp-bar {
    gap: var(--sp-t);
  }
  #player,
  :root .rc-sel {
    column-gap: var(--sp-t);
  } /* 1 段目の横は音声・検索とも細 (.rc-sel の本の決まりがこの後ろにあるので :root で強く) */
  #player button,
  #player select {
    padding: 0;
  } /* 5 つを 1 行に収める (横の余白なし) */
  #player > .vp-bar {
    min-width: 0;
    max-width: 100%;
  }
  #player :is(.vp-nav, .vp-ctl) > * {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  } /* 1 行に収める (入らない文字は「…」) */
}
.chips:empty {
  display: none;
}
.rc-sel {
  display: flex;
  gap: var(--sp);
  margin: 0 0 var(--sp);
}
.rc-sel select {
  flex: 1;
  min-width: 0;
} /* 検索: 1 段目 端末・種類・Ch (大)、2 段目 入力欄 (普通) */
/* iPhone: 横のスクロールをなるべく無くす。並びは等分の格子に、表は折り返す */
@media (width<600px) {
  .hscroll,
  .optabw {
    overflow-x: visible;
  }
  table.grid {
    width: 100%;
  }
  table.grid th,
  table.grid td {
    white-space: normal;
    padding: var(--sp-t) var(--sp-s);
    font-size: var(--fs-s);
    overflow-wrap: anywhere;
  }
  .optab td {
    white-space: normal;
    padding-right: 0.6em;
  }
  .opbody .optab {
    font-size: max(12px, min(0.875rem, 3.6vw));
  }
  .opbody .optab td {
    word-break: keep-all;
    padding-right: 0.5em;
  } /* 指令通告の内容の時刻の表: 画面の幅に合わせて小さく、時刻の途中で折らない */
  .seg.tabs {
    display: grid;
    width: auto;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }
  .seg.depsel {
    display: grid;
    width: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .seg.depsel > button:last-child:nth-child(4n + 1) {
    grid-column: span 4;
  }
  .seg.depsel > button:last-child:nth-child(4n + 2) {
    grid-column: span 3;
  }
  .seg.depsel > button:last-child:nth-child(4n + 3) {
    grid-column: span 2;
  }
  :is(.seg.tabs, .seg.depsel, .seg.cols5) > button {
    padding: 0 var(--sp-t);
    font-size: var(--fs-s);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }
  .seg.depsel > button .dim {
    display: none;
  } /* 等分の格子は小さい文字・狭い余白 (8px では「更新履歴」が切れる) */
  .wf {
    max-width: 100%;
  }
}
.logbox {
  overflow-wrap: anywhere;
}
/* 種類の色 = ジャンルの色 (util.js の GENRES と同じ) */
.k-指令通告,
.k-通告受領,
.k-通告応答 {
  color: var(--g-cmd);
}
.tl .it.k-指令通告::before,
.tl .it.k-通告受領::before,
.tl .it.k-通告応答::before {
  background: var(--g-cmd);
}
.k-運行把握モニタ,
.k-運行情報詳細,
.k-運行情報一覧 {
  color: var(--g-ops);
}
.tl .it.k-運行把握モニタ::before,
.tl .it.k-運行情報詳細::before,
.tl .it.k-運行情報一覧::before {
  background: var(--g-ops);
}
.k-音声 {
  color: var(--g-voice);
}
.tl .it.k-音声::before {
  background: var(--g-voice);
}
.k-登録応答,
.k-登録日時,
.k-在圏報告,
.k-登録要求,
.k-在圏確認,
.k-記録転送,
.k-応答なし {
  color: var(--g-train);
}
.tl .it.k-登録応答::before,
.tl .it.k-登録日時::before,
.tl .it.k-在圏報告::before,
.tl .it.k-登録要求::before,
.tl .it.k-在圏確認::before,
.tl .it.k-記録転送::before,
.tl .it.k-応答なし::before {
  background: var(--g-train);
}
.k-基地局情報,
.k-受信確認,
.k-通話状態,
.k-未解析 {
  color: var(--g-ctl);
}
.tl .it.k-基地局情報::before,
.tl .it.k-受信確認::before,
.tl .it.k-通話状態::before,
.tl .it.k-未解析::before {
  background: var(--g-ctl);
}
.k-DB不一致,
.k-DB更新 {
  color: var(--g-db);
}
.tl .it.k-DB不一致::before,
.tl .it.k-DB更新::before {
  background: var(--g-db);
}
.k-システム,
.k-RTL-SDR {
  color: var(--g-sys);
}
.tl .it.k-システム::before,
.tl .it.k-RTL-SDR::before {
  background: var(--g-sys);
}
/* 音声の一覧の行はどの幅でも 1 行。種類は出さない */
#vo-list .row {
  grid-template-columns: auto auto minmax(0, 1fr);
  grid-template-rows: none;
  align-content: center;
  box-sizing: border-box;
  min-height: var(--h-s);
}
#vo-list .row:has(> .rowpc) {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}
#vo-list .row .k {
  display: none;
}
#vo-list .row > :is(:last-child, span:last-child:empty, .rowpc) {
  grid-column: auto;
  grid-row: auto;
}
#vo-list .vdur {
  display: inline-block;
  min-width: 7.5ch;
  font-variant-numeric: tabular-nums;
}
#vo-list .row .tt {
  grid-column: auto;
  grid-row: auto;
}
@container (width<600px) {
  #vo-list .row,
  #vo-list .row:has(> .rowpc) {
    min-height: var(--h);
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 0 var(--row-gt);
    font-size: var(--fs-s);
  }
  #vo-list .row .tt {
    font-size: var(--fs-s);
  }
  #vo-list .row .ch {
    min-width: 3em;
    font-variant-numeric: tabular-nums;
  }
  #vo-list .rowpc {
    display: none;
  }
} /* 音声のスマホ幅は 1 行に入らないので端末名を出さない */
.tl.ud {
  overflow-x: hidden;
  margin-left: 0;
  padding-left: 20px;
  border-left: none;
  background: linear-gradient(var(--line), var(--line)) 7px 0/2px 100% no-repeat;
}
.tl.ud .it {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: -20px;
  padding-left: 20px;
}
:root[data-size="l"] .tl.ud .it {
  white-space: normal;
} /* 文字「大」は 1 行に入らない */
.tl.ud .it::before {
  left: 2px;
}
.tl.ud .it .tx {
  white-space: normal;
}
.tl.ud .dsep {
  margin-left: -14px;
}
.tblk > summary.dsep {
  margin-left: 0;
}
.tl.ud .cabs {
  display: inline;
  font-size: var(--fs-s);
  color: var(--dim);
}
.tl.ud .cabs span + span::before {
  content: " ";
}
.tl.ud .cabs .lead {
  color: var(--fg);
}
.tl.ud .pl {
  padding: 0 var(--sp-s);
  color: var(--acc);
}
@media (width<600px) {
  .tl.ud .it {
    font-size: var(--fs-s);
  }
}
button:disabled {
  opacity: 0.6;
  cursor: default;
}
.pill .dage {
  font-size: var(--fs-s);
  opacity: 0.85;
}
table.sttab {
  table-layout: fixed;
  width: 100%;
}
table.sttab td,
table.sttab th {
  white-space: normal;
  overflow-wrap: anywhere;
}
table.sttab col.c-code {
  width: 5.5em;
}
table.sttab col.c-conf {
  width: 4em;
}
table.sttab col.c-n {
  width: 4.5em;
}
table.sttab col.c-km {
  width: 9em;
}
table.sttab col.c-lines {
  width: 30%;
}
table.lntab {
  table-layout: fixed;
  width: 100%;
}
table.lntab col.c-code {
  width: 4.5em;
}
table.lntab col.c-n {
  width: 3.5em;
}
table.lntab td {
  white-space: normal;
}
button.mute {
  padding: 0 var(--sp-t);
  line-height: var(--lh-tight);
}
button.mute.on {
  opacity: 0.6;
}
button.mute svg {
  display: block;
  width: 16px;
  height: 16px;
}
.navb[hidden] {
  display: none;
}
#ana-w th,
#ana-w td.num {
  white-space: nowrap;
}
#ana input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  vertical-align: middle;
}
.pgenre {
  font-size: var(--fs-s);
  color: var(--dim);
  margin: var(--sp) 0 var(--sp-t);
}
.scanrow {
  display: flex;
  align-items: center;
  gap: var(--sp);
}
/* プリセットの行: 名前 + 右に選択肢の小さなボタン (行を押すと最初の選択肢) */
.list.ls .li.prow {
  align-items: center;
  padding: var(--row-py) var(--sp-l);
  cursor: pointer;
  flex-wrap: nowrap;
}
.li.prow .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.li.prow .bnd {
  display: flex;
  gap: var(--sp-s);
  flex: none;
  font-size: var(--fs-s);
}
/* 電源: 色は止まる重さ (再読込 = 緑・再起動 = 黄・終了 = 赤)、初期設定は中立 */
.pwr {
  display: grid;
  gap: var(--sp);
  margin: var(--sp) 0;
  max-width: 560px;
}
.pwr button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--sp-t);
  padding: 0 var(--sp);
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.pwr button svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.pwr .pw-reload svg {
  color: var(--ok);
}
.pwr .pw-restart svg {
  color: var(--warn);
}
.pwr .pw-stop {
  border-color: color-mix(in srgb, var(--bad) 45%, var(--line));
}
.pwr .pw-stop svg,
.pwr .pw-stop span {
  color: var(--bad);
}
.pwr button:hover:not(:disabled) {
  background: var(--panel2);
}
.pwr button:disabled {
  opacity: 0.6;
}
.li.prow.pick .radio {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--dim);
  box-sizing: border-box;
  position: relative;
}
.li.prow.pick.on .radio {
  border-color: var(--acc);
}
.li.prow.pick.on .radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--acc);
}
.list.ls .li.prow.pick.on {
  background: color-mix(in srgb, var(--acc) 14%, var(--panel));
  box-shadow: inset 3px 0 0 var(--acc);
}
.li.prow.pick.on .nm {
  font-weight: 700;
}
.li.prow.pick .radio.sq {
  border-radius: var(--r-s);
}
.li.prow.pick.on .radio.sq::after {
  border-radius: calc(var(--r-s) - 4px);
}
.li.prow.chrow .nm {
  white-space: normal;
}
.li.prow.chrow .nm .dim {
  font-size: var(--fs-s);
}
.li.prow .chst {
  flex: none;
  font-size: var(--fs-s);
}
.li.prow.pick.off {
  cursor: default;
  opacity: 0.75;
}
.li.prow.pick.fixed {
  cursor: default;
}
.anatop {
  margin: var(--sp-t) 0 var(--sp);
}
.nb-ana {
  font-variant-numeric: tabular-nums;
}

button.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--acc);
  font: inherit;
  text-decoration: underline dotted;
  cursor: pointer;
}
ul.chg {
  margin: var(--sp-t) 0 var(--sp-l);
  padding-left: 1.3em;
}
ul.chg li {
  margin: var(--sp-t) 0;
  line-height: var(--lh);
}
.cab .dir {
  font-size: var(--fs-s);
  color: var(--acc);
}

/* トーン・強さの欄は幅を固定 (トーンが出ても表の幅が変わらない) */
#ana-w td.at,
#ana-w th:nth-child(6) {
  width: 6.5em;
  min-width: 6.5em;
  font-variant-numeric: tabular-nums;
}
#ana-w td.ad {
  width: 4.5em;
  min-width: 4.5em;
  font-variant-numeric: tabular-nums;
}

/* 小の幅: スケルチは次の段へ (名前の欄が細くならない)。列の幅をそろえるので行ごとの格子 */
@container (width<600px) {
  #ana-w tr {
    display: grid;
    grid-template-columns: 32px 16px minmax(0, 1fr) auto 4.5em 6.5em;
    align-items: center;
    border-bottom: 1px solid var(--line);
  }
  #ana-w :is(td, th) {
    border-bottom: none;
  }
  #ana-w tr.open {
    background: color-mix(in srgb, var(--acc) 15%, transparent);
  }
  #ana-w tr.open td {
    background: none;
  }
  #ana-w th:nth-child(7) {
    display: none;
  }
  #ana-w td.as {
    grid-column: 3 / -1;
    text-align: left;
  }
  #ana-w td.as::before {
    content: "スケルチ ";
    color: var(--dim);
  }
  #ana-w td.at,
  #ana-w th:nth-child(6),
  #ana-w td.ad {
    width: auto;
    min-width: 0;
  }
}
/* 小・中の幅: 指で押せる大きさ。本文の幅でなく画面の幅で分ける */
@media (width<940px) {
  #ana-w button.mute {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-height: 32px;
    padding: 0;
  }
}

/* プリセットの切り替え中の覆い (操作を受け付けない) */
.pbar {
  display: inline-block;
  width: 80px;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--line);
  overflow: hidden;
  flex: none;
}
.pbar i {
  display: block;
  height: 100%;
  background: var(--acc);
} /* ログの読み込みの進み具合 */
#switching {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
#switching .sw-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp-l);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp);
  min-width: 200px;
}
#switching .sw-spin {
  width: 30px;
  height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: swspin 0.9s linear infinite;
}
@keyframes swspin {
  to {
    transform: rotate(360deg);
  }
}

.row.playing,
.it.playing {
  background: color-mix(in srgb, var(--acc) 14%, transparent);
  box-shadow: inset 3px 0 0 var(--acc);
}
.row.playing button.pl,
.it.playing button.pl {
  color: var(--acc);
  font-weight: 700;
}
.row.band {
  box-shadow: inset 3px 0 0 var(--band);
  padding-left: var(--row-bl);
} /* 受信・記録の区画: 左に種類の色の帯 */
.tblk {
  margin: 0 0 var(--sp);
}
.tblk > .tl {
  margin-top: var(--sp-t);
} /* 車両の履歴: 列番ごとの塊 */
.pop-tm {
  display: flex;
  align-items: center;
  gap: var(--sp-t);
  flex: none;
}
.pop-tm-bar {
  width: 64px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--line);
  overflow: hidden;
}
.pop-tm-bar i {
  display: block;
  height: 100%;
  background: var(--kc, var(--acc));
  transform-origin: left;
  animation: poptm linear forwards;
}
.pop-tm-s {
  font-size: var(--fs-s);
  color: var(--dim);
  flex: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@keyframes poptm {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
.toast-h {
  display: flex;
  align-items: center;
  gap: var(--sp);
}
.toast-h .grow {
  flex: 1;
}
#askbox {
  z-index: 70;
} /* 確認の箱は汎用のポップアップの上 */
#askbox .pop-body > div:first-child {
  text-align: center;
}
#askbox .set-act {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--sp);
  margin-top: var(--sp);
}
#askbox .set-act > button {
  width: 100%;
  justify-content: center;
} /* 文は中央・ボタンは幅いっぱいに等分 */
.boot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp);
  padding: var(--sp) 0;
} /* 最初の状態が届くまでの本文 */
.rx-chl {
  margin-top: var(--sp);
}
.pill[role="button"] {
  position: relative;
}
.pill[role="button"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: max(100%, 32px);
  transform: translateY(-50%);
} /* バッジは見た目のまま押せる範囲を 32px 以上に */
.pop-tm-bar.short {
  width: 32px;
  flex: none;
}
@media (width>=600px) {
  .now.open {
    flex-wrap: nowrap;
  }
  .now.open .deps {
    flex: 1 1 auto;
    flex-basis: auto;
    padding-left: 0;
    min-width: 0;
  }
} /* 中・大画面: 開いた在圏は ▲ の右から「▲ 三鷹 …」 */
.kan {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-t) var(--sp-s);
}
.kan .kbits {
  color: var(--dim);
  font-size: max(12px, 0.9em);
}
.kan .kbits b {
  color: var(--fg);
  font-weight: 600;
}
.kchip {
  border: 1px solid var(--acc);
  color: var(--acc);
  border-radius: var(--r-s);
  padding: 0 var(--sp-t);
  font-size: var(--fs-s);
  line-height: var(--lh);
}
.kchip.off {
  border-color: var(--line);
  color: var(--dim);
}
@media (width<600px) {
  .ktbl,
  .ktbl tbody {
    display: block;
  }
  .ktbl tr:first-child {
    display: none;
  }
  .ktbl tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--sp-t) var(--sp-s);
    padding: var(--sp) var(--sp-t);
    border-bottom: 1px solid var(--line);
    align-items: center;
  }
  table.grid.ktbl td {
    border: 0;
    padding: 0;
    white-space: nowrap;
  }
  table.grid.ktbl td:empty {
    display: none;
  }
  .ktbl td:nth-child(1) {
    grid-area: 1/1/2/3;
    min-width: 0;
  }
  .ktbl td:nth-child(4) {
    grid-area: 1/3;
  }
  .ktbl td:nth-child(2) {
    grid-area: 2/1;
  }
  .ktbl td:nth-child(3) {
    grid-area: 2/2;
  }
  .ktbl td:nth-child(3):not(:empty)::before {
    content: "冠 ";
    color: var(--dim);
  }
  .ktbl td:nth-child(5) {
    grid-area: 3/1/4/4;
    white-space: normal !important;
    font-size: var(--fs-s);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
.vo-sub {
  display: contents;
}
.vo-rng {
  display: flex;
  align-items: center;
  gap: var(--sp);
}
.vo-rng input[type="range"] {
  flex: 1;
  min-width: 0;
} /* 設定 → 通知 の自動再生 (並び・向き・速さ; sec_voice.contSettings) は設定の一覧の行に入る */

/* iPhone: 2 回タップで拡大しない (入力欄を押したときの拡大は viewport の maximum-scale=1 で止める) */
html {
  touch-action: manipulation;
}
.pw-ho {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp);
  padding: var(--sp) var(--sp-t);
  min-width: 220px;
}
.pw-ho .pbar {
  width: 200px;
} /* 端末の終了: メイン PC への受け渡し */
.vp-nav #vp-term,
.vp-nav #vp-lossmax,
.vp-nav #vp-ch {
  flex: 1 1 0;
  min-width: 0;
}
#player :is(.vp-nav, .vp-ctl) {
  display: grid;
  flex-basis: 100%;
  max-width: none;
}
#player .vp-nav {
  grid-template-columns: repeat(3, minmax(0, 14em));
}
#player .vp-ctl {
  grid-template-columns: repeat(5, minmax(0, 4em)) repeat(2, minmax(0, calc((30em - 3 * var(--sp)) / 3)));
} /* 段は幅いっぱいの箱 (上限を箱に付けると広い画面で 2 段が 1 行に並ぶ)、列の幅に上限 */
#player :is(.vp-nav, .vp-ctl) > * {
  width: auto;
  max-width: none;
} /* 等分の格子 (flex の幅 0 からの伸びは内側の余白の分だけボタンが広くなる) */
#player :is(.vp-nav, .vp-ctl) > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#player .vp-ctl > :is(button, select) {
  padding-left: var(--sp-t);
  padding-right: var(--sp-t);
} /* 本文が狭いとき (大の幅で右の欄を開いた) も 1 行に収める: 縮めて入らない文字は「…」 */ /* 音声タブ: 2 段とも同じ幅 (大の幅は選ぶ欄 3 つ分 = 14em × 3、中・小は幅いっぱい) を分け合う */
@media (width<940px) {
  #player .vp-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #player .vp-ctl {
    grid-template-columns: repeat(5, minmax(0, 0.55fr)) minmax(0, 1fr) minmax(0, 1.1fr);
  }
}
@container (width<600px) {
  #player .vp-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #player .vp-ctl {
    grid-template-columns: repeat(5, minmax(0, 0.55fr)) minmax(0, 1fr) minmax(0, 1.1fr);
  }
}
.statpop {
  position: fixed;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp) var(--sp-l);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 50;
  max-width: min(320px, 92vw);
  font-size: var(--fs-sm);
}
#json-pop {
  display: flex;
  flex-direction: column;
}
#json-pop .lp-head {
  flex: none;
}
#json-pop .lp-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
} /* 在線のバッジ: 上は固定、列番の並びだけスクロール */
.statpop .pop-row {
  padding: var(--sp-t) 0;
}
.statpop .pop-row b {
  font-size: var(--fs-c);
}
.pill.nb-rx,
.pill.nb-json {
  cursor: pointer;
}
.row .vf {
  color: var(--dim);
  margin-left: var(--sp-t);
  font-size: var(--fs-s);
}
.row .vf.bad {
  color: var(--bad);
}
@media (width<940px) {
  .gdb,
  .nb-rx .rxw,
  .pill .lab {
    display: none;
  }
  .nb-json .lab,
  .nb-rx2 .lab {
    display: inline;
  } /* 在線のバッジは名前を消さない (点と時間だけでは何か分からない) */
} /* 小・中の幅の受信のバッジは点と受信率・何秒前だけ */
.navrow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-t);
  margin: var(--sp) 0;
}
.cntb {
  display: inline-block;
  min-width: 1.5em;
  height: 1.5em;
  line-height: 1.5em;
  margin-left: var(--sp-t);
  padding: 0 var(--sp-t);
  border-radius: var(--r-pill);
  background: var(--bad);
  color: var(--on-acc);
  font-size: var(--fs-s);
  text-align: center;
  vertical-align: middle;
}
.running {
  display: flex;
  align-items: center;
  gap: var(--sp-t);
}

/* 列車走行位置 (livepos.js) */
#side-body:has(> .lp-fix) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lp-fix {
  flex: none;
  max-height: 60%;
  overflow: auto;
} /* JSON の全文・欄が多くても時刻表が残る */
.lp-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.lp-tthead {
  flex: none;
  border-top: 1px solid var(--line);
  margin-top: var(--sp);
}
.lp-tthead h3.sub {
  margin-bottom: 0;
}
.lp-scroll th {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.lp-grp {
  border-top: 1px solid var(--line);
  margin-top: var(--sp-t);
  padding-top: var(--sp-t);
}

.rgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-l);
  margin: var(--sp-t) 0 var(--sp-l);
}
.rgrid .trainbtn {
  display: flex;
  align-items: center;
  min-height: var(--h-l);
  padding: 0 var(--sp-l);
  font-size: var(--fs-sm);
  white-space: normal;
  text-align: left;
  line-height: var(--lh-tight);
  border-left-width: 6px !important;
}
.lp-rname {
  padding-left: var(--sp-s);
  border-left: 6px solid var(--line);
}
.lp-ok {
  vertical-align: middle;
  margin-right: var(--sp-t);
}
#lp-find {
  display: flex;
  gap: var(--sp-t);
  margin: 0;
}
#lp-q {
  width: 9em;
}
.lp-rrow {
  align-items: center;
}
.lp-ok.off {
  visibility: hidden;
}
:is(#side-crumbs, .crumbs) {
  flex: 1;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0 var(--sp-s);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: var(--fs-c);
}
:is(#side-crumbs, .crumbs) > * {
  flex: none;
} /* 1 行: 長い段は「…」(上の画面から先に縮める) */
:is(#side-crumbs, .crumbs) .crumb {
  border: 0;
  background: none;
  padding: 0 2px;
  color: var(--acc);
  font: inherit;
  cursor: pointer;
  min-height: max(32px, var(--h-s));
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#side-crumbs .crumb.up {
  flex: 0 100 auto;
  min-width: 2.5em;
}
#crumb-pop {
  display: flex;
  flex-direction: column;
  gap: var(--sp-s);
  align-items: stretch;
}
:is(#side-crumbs, .crumbs) .crumb-here {
  font-weight: 700;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
#side-x {
  flex: none;
  color: var(--dim);
}
#side-star {
  flex: none;
  display: flex;
}
#side-star:empty {
  display: none;
}
#side-star > .fav {
  width: 32px;
  height: max(32px, var(--h-s));
}
.dtitle {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-s);
  margin: var(--sp-t) 0 var(--sp);
  font-weight: 600;
}
.dtitle > span {
  flex: 1;
  min-width: 0;
}
.dtitle > .fav {
  flex: none;
  width: 32px;
  height: var(--h-t);
  margin-right: calc(-1 * var(--sp-s));
}
:is(#side-star, .dtitle) > .fav::before {
  opacity: 0.35;
}
:is(#side-star, .dtitle) > .fav.on::before {
  opacity: 1;
} /* 詳細の ★ は見出しの行の右端 (無ければ上の帯) に常に出す (未登録は薄く) */
.fgrid button.sel,
tr.sel td {
  outline: 2px solid var(--acc);
  outline-offset: -2px;
}

/* 小の幅: 入力欄・選ぶ欄は 16px (未満だと iPhone で押したときに拡大する) */
@media (width<600px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  textarea {
    font-size: 16px !important;
  }
  select {
    font-size: 16px !important;
    zoom: var(--k);
    height: calc(var(--h) / var(--k));
    min-height: 0;
    padding: 0 calc(var(--sp) / var(--k));
  } /* 文字は 16px (押したときの拡大を起こさない) のまま、見た目はボタンと同じ大きさに縮める */
  :is(.set > .sv, .rs-cell) select {
    height: calc(var(--h-s) / var(--k));
  } /* 設定の行の中・受信の設定の表は「小」 */
  :is(#player .vp-nav, .rc-sel) > select {
    height: calc(var(--h-l) / var(--k));
  }
  .dbe :is(input:not([type="checkbox"]):not([type="radio"]), select) {
    zoom: var(--k);
    height: calc(var(--h-s) / var(--k));
    min-height: 0;
    padding: 0 calc(var(--sp) / var(--k));
  } /* DB の編集は全部「小」(保存・削除と同じ) */
}
.trainbtn,
.row .pl,
.tl.ud .pl,
.nb-stop,
.nb-live {
  min-width: var(--h-t);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.linkish,
.now .tog,
button.mute {
  min-height: 0;
}

html {
  overscroll-behavior-x: none;
}
@media (width<600px) {
  #clock {
    flex: none;
  }
}
#clock .pill {
  font-family: system-ui, "Noto Sans JP", sans-serif;
  color: var(--fg);
} /* 時計の箱の字の形と、値を受けたときの色を受けない */
.nb-rx .why-m {
  display: none;
}
@media (width<940px) {
  .nb-rx .why {
    display: none;
  }
  .nb-rx .why-m {
    display: inline;
  }
} /* 停止の原因: 小・中の幅はバッジを短く (印だけ) */

/* 見た目は変えずに押せる範囲を 32px 以上に: 詳細の上のボタン・在圏の ▼ と編成・折りたたみの見出し (小の幅の一覧の行の中は下で段の高さに収める) */
:is(.navrow .trainbtn, .deps a[data-fid], summary) {
  position: relative;
}
:is(.navrow .trainbtn, .deps a[data-fid], summary)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 32px);
  height: max(100%, 32px);
  transform: translate(-50%, -50%);
}
@media (width>=600px) {
  .now .tog {
    position: relative;
  }
  .now .tog::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100%, 32px);
    height: max(100%, 32px);
    transform: translate(-50%, -50%);
  }
}
:is(#side-crumbs, .crumbs) .crumb:not(.up) {
  min-width: 32px;
}
input[type="range"] {
  min-height: 32px;
}
/* 一覧の行の中のボタンは文字の行の高さに収め、どの行も同じ高さに。小の幅の押す範囲は見た目の外 (::after) に広げる */
:is(.row, .it, .now, .deprow, .tx) :is(.trainbtn, .pl, .nb-stop, .nb-live) {
  min-height: var(--h-t);
  display: inline-flex;
  align-items: center;
  line-height: var(--lh-btn);
  padding-top: 0;
  padding-bottom: 0;
  vertical-align: baseline;
}
.now .tog {
  line-height: var(--lh-tight);
  vertical-align: baseline;
}
@media (width<600px) {
  :is(.row, .it, .now, .deprow, .tx) :is(.trainbtn, .pl, .tog, .nb-stop, .nb-live) {
    min-width: 0;
    position: relative;
  }
  :is(.row, .it, .now, .deprow, .tx) :is(.trainbtn, .pl, .tog, .nb-stop, .nb-live)::after {
    content: "";
    position: absolute;
    inset: -8px -4px;
  }
  :is(.row, .now, .deprow) :is(.trainbtn, .pl, .nb-stop, .nb-live)::after {
    inset: calc((var(--h-t) - var(--h-s)) / 2) -4px;
  }
  #vo-list .row :is(.trainbtn, .pl)::after {
    inset: calc((var(--h-t) - var(--h)) / 2) -4px;
  }
  .now .tog::after {
    inset: calc((1em * var(--lh-tight) - var(--h-s)) / 2) auto;
    left: 50%;
    width: max(calc(100% + 8px), 32px);
    transform: translateX(-50%);
  } /* 段の高さの中に収める (隣の段・行に掛けない) */
}
/* 上の帯の通話中・再生中・準備中は 1 行: 相手は「…」で切り、■ は右に */
.now.one {
  flex-wrap: nowrap;
  min-width: 0;
}
.now.one > b,
.now.one > .talk,
.now.one > .play,
.now.one > button {
  flex: none;
}
.now.one > .who {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 音声: 鳴らしていないときの空の情報の行・波形は出さない */
#player .vp-infoline:not(:has(span:not(:empty))) {
  display: none;
}
#vp-viz[hidden] {
  display: none;
}

button:active:not(:disabled):not(.on),
select:active {
  background: var(--panel2);
}
#player .vp-nav,
#player .vp-ctl {
  align-items: center;
}
#player .vp-nav > button,
#player .vp-ctl > button {
  height: var(--h);
  min-height: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
/* 縦に並ぶボタン (時刻表の駅・路線の列車一覧の列番・DB の駅の表・履歴の行) は文中より 1 段上の「小」 */
table.kv.lp-tt td {
  padding-top: calc(var(--sp-t) / 2);
  padding-bottom: calc(var(--sp-t) / 2);
  vertical-align: middle;
}
.lp-tt .stname {
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  line-height: var(--lh-btn);
  padding: 0 var(--sp);
} /* ボタンの無い駅名もボタンと同じ高さ・余白で文字をそろえる */
:is(.lp-tt, #lp-list td, .sttab) .trainbtn,
.lp-tt .stname {
  min-height: var(--h-s);
  padding-left: var(--sp);
  padding-right: var(--sp);
  font-size: var(--fs-c);
  font-weight: 700;
}
@media (width<600px) {
  :is(.lp-tt, #lp-list td, .sttab) .trainbtn,
  .lp-tt .stname {
    font-size: var(--fs-s);
  }
} /* 文字と行の間隔は履歴の行 (.tl.ud) と同じ */
.tl.ud .it {
  line-height: var(--h-s);
}
.tl.ud .it > :not(.tx) {
  vertical-align: top;
}
.tl.ud .it :is(.trainbtn, .pl) {
  min-height: var(--h-s);
  vertical-align: top;
  padding-left: var(--sp);
  padding-right: var(--sp);
}
.tl.ud .it .tx {
  line-height: var(--lh);
}
.tl.ud .it .tx .trainbtn {
  min-height: var(--h-t);
  vertical-align: baseline;
} /* 履歴は行を全部「小」の高さに (.tx の文は文中) */
.tl.ud .it::before {
  top: calc(var(--h-s) / 2 - 5px);
}
.tl.ud .it.pos::before {
  top: calc(var(--h-s) / 2 - 4px);
}
.tl.ud .it.zk::before {
  top: calc(var(--h-s) / 2 - 3px);
}
:is(.row, .it, .tx) .tt {
  line-height: var(--h-t);
}
:is(.row, .it, .tx) .tt :is(.trainbtn, .pl) {
  vertical-align: top;
}
.row > .pl {
  align-self: center;
}
.it > .pl {
  vertical-align: top;
} /* 行の高さ = ボタンの高さにして、ボタンの有る行と無い行をそろえる (baseline だと行が 1px ほど伸びる) */
tr.dev-pick,
tr[data-nid] {
  cursor: pointer;
}
tr[data-nid].sel td {
  background: var(--panel2);
}
tr.dev-pick.on td {
  background: var(--panel2);
} /* 2 本のとき、RTL-SDR の表の行で見る本を選ぶ */
/* 横の欄 (400px) の中身は小の幅と同じ出し方 (小の幅の @media と同じ中身) */
#side-body {
  container: side/inline-size;
}
@container (width<600px) {
  /* 横の欄・幅 600px 未満の本文 (JS の narrowAt と同じ) */
  .hscroll,
  .optabw {
    overflow-x: visible;
  }
  table.grid {
    width: 100%;
  }
  table.grid th,
  table.grid td {
    white-space: normal;
    padding: var(--sp-t) var(--sp-s);
    font-size: var(--fs-s);
    overflow-wrap: anywhere;
  }
  .optab td {
    white-space: normal;
    padding-right: 0.6em;
  }
  .opbody .optab {
    font-size: max(12px, min(0.875rem, 3.6cqw));
  }
  .opbody .optab td {
    word-break: keep-all;
    padding-right: 0.5em;
  }
  .seg.tabs {
    display: grid;
    width: auto;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }
  .seg.depsel {
    display: grid;
    width: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .seg.depsel > button:last-child:nth-child(4n + 1) {
    grid-column: span 4;
  }
  .seg.depsel > button:last-child:nth-child(4n + 2) {
    grid-column: span 3;
  }
  .seg.depsel > button:last-child:nth-child(4n + 3) {
    grid-column: span 2;
  }
  :is(.seg.tabs, .seg.depsel, .seg.cols5) > button {
    padding: 0 var(--sp-t);
    font-size: var(--fs-s);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }
  .seg.depsel > button .dim {
    display: none;
  }
  .fgrid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  }
  :root .fgrid button {
    padding: 0 var(--sp-t);
  }
  .ktbl,
  .ktbl tbody {
    display: block;
  }
  .ktbl tr:first-child {
    display: none;
  }
  .ktbl tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--sp-t) var(--sp-s);
    padding: var(--sp) var(--sp-t);
    border-bottom: 1px solid var(--line);
    align-items: center;
  }
  table.grid.ktbl td {
    border: 0;
    padding: 0;
    white-space: nowrap;
  }
  table.grid.ktbl td:empty {
    display: none;
  }
  .ktbl td:nth-child(1) {
    grid-area: 1/1/2/3;
    min-width: 0;
  }
  .ktbl td:nth-child(4) {
    grid-area: 1/3;
  }
  .ktbl td:nth-child(2) {
    grid-area: 2/1;
  }
  .ktbl td:nth-child(3) {
    grid-area: 2/2;
  }
  .ktbl td:nth-child(3):not(:empty)::before {
    content: "冠 ";
    color: var(--dim);
  }
  .ktbl td:nth-child(5) {
    grid-area: 3/1/4/4;
    white-space: normal !important;
    font-size: var(--fs-s);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .tl.ud .it {
    font-size: var(--fs-s);
  }
  .row .tt {
    font-size: var(--fs-sm);
  }
  .row .ch {
    min-width: 2.6em;
  }
  :is(.lp-tt, #lp-list td, .sttab) .trainbtn,
  .lp-tt .stname {
    font-size: var(--fs-s);
  }
}
/* 駅 DB の狭い形 (小の幅・横の欄): 駅コード・駅・件数の 3 列。駅の下の段に 確度 (推定・未確定)・キロ程・路線 */
table.sttab td.num {
  white-space: nowrap;
}
.row:has(> .fav) {
  position: relative;
}
.row > .fav,
.rowpc > .fav {
  height: calc(var(--h-s) - 0.5px);
}
.row > .fav {
  position: absolute;
  top: 0;
  right: 0;
}
.fav {
  width: 24px;
  min-height: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: var(--r-s);
  background: none;
  color: var(--dim);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
.rowpc {
  display: inline-flex;
  align-items: center;
}
.rowpc > .fav {
  margin-right: var(--sp-t);
}
.fav::before {
  content: "★";
  opacity: 0;
}
.row.sel .fav::before {
  opacity: 0.35;
}
.fav.on {
  color: var(--warn);
}
.fav.on::before,
.row:is(:hover, .sel) .fav.on::before {
  opacity: 1;
}
.fav,
.fav:is(.on, :hover, :active, :focus, :focus-visible) {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none;
} /* ボタンの決まり (button.on は強調の地) を ★ には付けない */ /* お気に入り: 端末名の左 (無い行は右上)。登録済みは黄色の ★、ほかはポインターを乗せた行・選んだ行にだけ薄い ★ */
.navrow .trainbtn {
  min-height: var(--h-s);
} /* 段を折り返しても同じ高さ (.small と並ぶ段だけ伸びて 2 段目が低くなる) */
