/* RTC Bench: 計測値を読みやすくするための簡素なスタイル(白黒+状態色) */
:root {
  --bg: #f4f4f2; --panel: #fff; --panel2: #fafaf8; --text: #111; --muted: #555; --line: #cfcfca; --line2: #e6e6e1;
  --ok: #16794a; --ok-bg: #dff2e7; --warn: #8a5100; --warn-bg: #fbecd2; --ng: #b3261e; --ng-bg: #f8dcd9; --info: #1f5fbf; --info-bg: #e2e8f5;
  --tile: #1b1b1b; --hud: rgba(0, 0, 0, .64);
  --c1: #111; --c2: #e08a00; --c3: #1f5fbf; --c4: #b3261e; --c5: #16794a; --c6: #7b3fb5;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111315; --panel: #1a1d20; --panel2: #202428; --text: #e6e6e6; --muted: #a0a7ae; --line: #343a40; --line2: #2a2f34;
    --ok: #4cc38a; --ok-bg: #133524; --warn: #e3a54b; --warn-bg: #3a2a10; --ng: #ff7b72; --ng-bg: #3d1614; --info: #79a8ff; --info-bg: #17243d;
    --c1: #e6e6e6; --c2: #ffb347; --c3: #79a8ff; --c4: #ff7b72; --c5: #4cc38a; --c6: #c49bff; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 13px/1.5 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif; padding-bottom: env(safe-area-inset-bottom); }
.m, code, pre, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.small { font-size: 11.5px; } .muted { color: var(--muted); } .hidden { display: none !important; }
.ok { color: var(--ok); font-weight: 600; } .warn { color: var(--warn); font-weight: 600; } .ng { color: var(--ng); font-weight: 600; }
.spacer { flex: 1; }
a { color: var(--info); }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: var(--panel); border: 1px solid #888; border-radius: 3px; padding: 5px 10px; min-height: 30px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--text); }
button.pri { background: var(--text); color: var(--bg); border-color: var(--text); }
button.on { background: var(--info-bg); border-color: var(--info); color: var(--info); }
button:disabled { opacity: .45; cursor: default; }
input[type=text], input[type=password], input[type=number], select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 4px 6px; min-width: 0; }
textarea { font-family: var(--mono); font-size: 12px; width: 100%; }
label { display: block; }
label.inl { display: inline-flex; gap: 4px; align-items: center; margin-right: 10px; }

.bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 12px; background: #111; color: #fff; }
.bar button { background: transparent; color: #fff; border-color: #777; }
.bar .brand { font-size: 14px; }
.chip { font-size: 11.5px; padding: 1px 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); }
.chip.rec { background: #b3261e; }
.chip.bad { background: #b3261e; } .chip.good { background: #16794a; }
.tabs { display: flex; flex-wrap: wrap; align-items: center; background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 8px; position: sticky; top: 42px; z-index: 19; }
.tabs a { padding: 8px 12px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }
main { padding: 10px; }
.view { display: none; } .view.on { display: block; }

.box { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; margin-bottom: 10px; min-width: 0; }
.box > .h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--line2); }
.box > .b { padding: 8px 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; font-size: 12px; }
.kv > :nth-child(odd) { color: var(--muted); }
.cols { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.col-l { flex: 1 1 260px; max-width: 310px; }
.col-c { flex: 999 1 520px; min-width: 0; }
.col-r { flex: 1 1 300px; max-width: 400px; }
.form > * { margin-bottom: 6px; }
.form label > select, .form label > input[type=text], .form label > input[type=number] { width: 100%; }
fieldset { border: 1px solid var(--line); border-radius: 4px; margin: 0 0 8px; padding: 6px 10px; }
legend { font-size: 11.5px; font-weight: 600; color: var(--muted); }

table.t { width: 100%; border-collapse: collapse; font-size: 12px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); padding: 4px 7px; border-bottom: 1px solid var(--line); background: var(--panel2); white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: 3px 7px; border-bottom: 1px solid var(--line2); white-space: nowrap; vertical-align: top; }
table.t td.wrap { white-space: normal; }
table.t td.num { text-align: right; }
.scroll { overflow: auto; } .scroll.y { max-height: 360px; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 10px; white-space: nowrap; }
.b-pass, .s-y { background: var(--ok-bg); color: var(--ok); } .b-limited, .s-l { background: var(--warn-bg); color: var(--warn); }
.b-no, .s-n { background: var(--ng-bg); color: var(--ng); } .b-todo, .s-u { background: var(--info-bg); color: var(--info); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 8px; }
.tile { position: relative; background: var(--tile); border-radius: 4px; overflow: hidden; aspect-ratio: 16 / 9; }
.tile video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.tile .hud { position: absolute; left: 6px; top: 6px; right: 6px; font: 11px/1.45 var(--mono); color: #f2f2f2; background: var(--hud); padding: 4px 7px; border-radius: 3px; pointer-events: none; white-space: pre-wrap; }
.tile .hud .ok { color: #7fd6a5; } .tile .hud .warn { color: #ffc46b; } .tile .hud .ng { color: #ff8f86; }
.tile .tbar { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.tile .tbar button { background: rgba(255, 255, 255, .85); color: #111; border: 0; min-height: 26px; padding: 2px 8px; font-size: 11px; }
.tile .label { position: absolute; left: 6px; bottom: 6px; color: #fff; font-size: 11px; background: var(--hud); padding: 1px 6px; border-radius: 3px; }
.tiles.hudoff .hud { display: none; }

.log { font: 11.5px/1.55 var(--mono); max-height: 220px; overflow: auto; padding: 6px 10px; }
.log .warn, .log .error { font-weight: 400; }
.log .error { color: var(--ng); } .log .warn { color: var(--warn); }
canvas.chart { width: 100%; height: 110px; display: block; }
.legend { font-size: 11px; color: var(--muted); padding: 0 10px 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.progress { height: 10px; background: var(--line2); border-radius: 2px; overflow: hidden; }
.progress > div { height: 100%; background: var(--text); width: 0; }
.stats4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat .l { font-size: 11px; color: var(--muted); } .stat .v { font: 600 17px var(--mono); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #111; color: #fff; padding: 8px 14px; border-radius: 4px; z-index: 50; max-width: 90vw; }
.mtabs { display: none; }
.lobby { max-width: 520px; margin: 10px auto; }
.big { font-size: 15px; padding: 8px 12px; min-height: 44px; }
.lobby input[type=text], .lobby input[type=password] { font-size: 16px; padding: 8px 10px; width: 100%; }
pre.json { font-size: 11.5px; max-height: 300px; overflow: auto; background: var(--panel2); padding: 8px; margin: 0; white-space: pre-wrap; }

@media (max-width: 760px) {
  main { padding: 6px 6px 70px; }
  .bar { gap: 5px; padding: 6px 8px; }
  .bar .chip#hClock, .bar .chip#hSig, .bar #btnMarker, .bar #btnZip { display: none; }
  .tabs { position: fixed; top: auto; bottom: 0; left: 0; right: 0; justify-content: space-around; border-top: 1px solid var(--line); border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .tabs a { padding: 12px 6px; font-size: 12px; border-bottom: 0; border-top: 2px solid transparent; }
  .tabs a.on { border-top-color: var(--text); }
  .tabs #hUser, .tabs .spacer { display: none; }
  .col-l, .col-r { max-width: none; }
  .mtabs { display: flex; position: sticky; top: 40px; z-index: 15; background: var(--panel); border: 1px solid var(--line); margin-bottom: 8px; }
  .mtabs button { flex: 1; border: 0; border-radius: 0; min-height: 40px; }
  .mtabs button.on { border-bottom: 2px solid var(--text); font-weight: 600; background: transparent; color: var(--text); }
  #view-live[data-m="video"] .col-l, #view-live[data-m="video"] .col-r, #view-live[data-m="video"] .m-num, #view-live[data-m="video"] .m-log { display: none; }
  #view-live[data-m="num"] .col-l, #view-live[data-m="num"] .tiles-box, #view-live[data-m="num"] .m-log { display: none; }
  #view-live[data-m="set"] .col-c, #view-live[data-m="set"] .col-r { display: none; }
  #view-live[data-m="log"] .col-l, #view-live[data-m="log"] .col-r, #view-live[data-m="log"] .tiles-box, #view-live[data-m="log"] .m-num { display: none; }
  .stats4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .hud { font-size: 10.5px; }
}

/* ---------- 用語の「?」・説明ポップアップ・使い方 ---------- */
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tipq { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; min-height: 0; padding: 0; margin: 0 2px 0 3px;
  border-radius: 50%; border: 1px solid var(--muted); background: var(--panel); color: var(--muted); font: 600 10px/1 system-ui, sans-serif; vertical-align: 1px; cursor: help; }
.tipq:hover, .tipq:focus-visible { border-color: var(--info); color: var(--info); outline: none; }
th .tipq { vertical-align: 0; }
.gl, [data-tip] { text-decoration: underline dotted var(--muted); text-underline-offset: 2px; cursor: help; }
.gl:focus-visible, [data-tip]:focus-visible { outline: 2px solid var(--info); outline-offset: 1px; }
.tip-pop { position: fixed; z-index: 1000; max-height: 70vh; overflow: auto; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 10px 28px 10px 12px; font-size: 12.5px; line-height: 1.6; text-align: left; font-weight: normal; white-space: normal; }
.tip-pop .tip-item + .tip-item { border-top: 1px solid var(--line2); margin-top: 8px; padding-top: 8px; }
.tip-x { position: absolute; top: 4px; right: 4px; min-height: 0; padding: 0 6px; border: 0; background: none; font-size: 16px; color: var(--muted); }
.tip-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 2px; }
.tip-fn { font-weight: 600; }
.tip-d { color: var(--text); }
.gcat { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 0 7px; border-radius: 9px; background: var(--line2); color: var(--muted); white-space: nowrap; }
.gc-video { background: #e2e8f5; color: #1f4f9f; } .gc-audio { background: #e4f3ea; color: #16794a; } .gc-data { background: #efe3fb; color: #6a2fa0; }
.gc-route { background: #fbecd2; color: #8a5100; } .gc-quality { background: #e8e8e4; color: #333; } .gc-caption { background: #dff2f4; color: #0f6570; }
.gc-translate { background: #f9e1ef; color: #9c2a6a; } .gc-tts { background: #fde7d9; color: #9a3d0b; } .gc-record { background: #ececec; color: #444; }
.gc-device { background: #e6edf0; color: #2f5161; } .gc-security { background: #f8dcd9; color: #b3261e; } .gc-geo { background: #e7f0dc; color: #3e6b14; } .gc-license { background: #f3eed9; color: #6b5a12; }
@media (prefers-color-scheme: dark) {
  .gc-video { background: #17243d; color: #79a8ff; } .gc-audio { background: #133524; color: #4cc38a; } .gc-data { background: #2d1d3d; color: #c49bff; }
  .gc-route { background: #3a2a10; color: #e3a54b; } .gc-quality, .gc-record { background: #2a2f34; color: #c8ccd0; } .gc-caption { background: #12333a; color: #6fd0dc; }
  .gc-translate { background: #3a1830; color: #f08cc4; } .gc-tts { background: #3a2214; color: #f4a873; } .gc-device { background: #1e2a30; color: #9cc0d0; }
  .gc-security { background: #3d1614; color: #ff7b72; } .gc-geo { background: #1f2d14; color: #a6d36e; } .gc-license { background: #332d14; color: #e0c862; }
}
.view-help { display: flex; gap: 8px; align-items: center; padding: 4px 10px; font-size: 12px; color: var(--muted); background: var(--panel2); border-bottom: 1px solid var(--line2); }
.view-help .vh-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-help button { min-height: 24px; padding: 0 8px; font-size: 12px; }
#tabs .tab-btn { background: none; border: 0; min-height: 0; padding: 6px 8px; color: var(--info); cursor: pointer; font: inherit; }
.help-dialog { width: min(820px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); }
.help-dialog::backdrop { background: rgba(0,0,0,.35); }
.help-head { position: sticky; top: 0; z-index: 1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.help-tabs button { min-height: 26px; padding: 0 10px; }
.help-body { padding: 6px 16px 16px; font-size: 13px; line-height: 1.7; }
.help-body h4 { margin: 14px 0 4px; font-size: 13px; }
.help-one { margin: 8px 0; padding: 8px 10px; border-radius: 6px; background: var(--info-bg); color: var(--text); }
.help-steps { margin: 0; padding-left: 1.6em; } .help-steps li { margin: 6px 0; } .help-steps li div { color: var(--text); }
.help-parts dt { font-weight: 600; margin-top: 6px; } .help-parts dd { margin: 0 0 0 1em; }
.help-tips { margin: 0; padding-left: 1.3em; }
.help-terms { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.help-gfilter { position: sticky; top: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; background: var(--panel); }
.help-gfilter input { flex: 1; min-width: 160px; }
.help-glist .tip-item { padding: 8px 0; border-bottom: 1px solid var(--line2); }
.h > .tipq { margin-right: auto; } /* 見出しの文字の直後に置く(右寄せの操作群と離す) */
.rec-help { cursor: help; }
.ref-nav { flex-wrap: wrap; gap: 6px; padding: 8px 0; }
.ref-nav button { min-height: 26px; padding: 0 10px; }
.ref-t th { text-align: left; white-space: nowrap; vertical-align: top; background: var(--panel2); }
.ref-t td { vertical-align: top; } .ref-t td.wrap { min-width: 120px; }
.ref-t tr.ref-mine th, .ref-t tr.ref-mine td { background: var(--info-bg); }
.tip-links { display: flex; gap: 12px; flex-wrap: wrap; }

/* 接続チェック(views/netcheck.js)と会議室図(common/topology-view.js) */
dialog.netcheck { width: min(960px, 96vw); max-height: 94vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); }
.nc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.nc-head button { margin-left: auto; }
.nc-diag { margin: 4px 0 8px; padding-left: 18px; }
.nc-diag .nc-good { color: var(--ok); }
.nc-diag .nc-warn { color: var(--warn); }
.nc-diag .nc-bad { color: var(--ng); font-weight: bold; }
.nc-table table { width: 100%; border-collapse: collapse; }
.topo-svg { display: block; background: var(--panel2); border-radius: 8px; }
.topo-link { stroke: var(--muted); stroke-linecap: round; }
.topo-link.q-good { stroke: var(--ok); }
.topo-link.q-warn { stroke: var(--warn); }
.topo-link.q-bad { stroke: var(--ng); }
.topo-link.q-none { stroke: var(--muted); opacity: 0.45; }
.topo-link.relay { stroke-dasharray: 8 5; }
.topo-label { font-size: 10px; fill: var(--text); paint-order: stroke; stroke: var(--panel2); stroke-width: 3px; pointer-events: none; }
.topo-label.sub { fill: var(--muted); }
.topo-node circle, .topo-node rect { fill: var(--panel); stroke: var(--info); stroke-width: 2; }
.topo-node.server rect { fill: var(--info-bg); }
.topo-node.detached circle { stroke-dasharray: 3 3; opacity: 0.6; }
.topo-node text { font-size: 12px; fill: var(--text); }
.topo-node text.sub { font-size: 10px; fill: var(--muted); }
.topo-empty { fill: var(--muted); }
.topo-table td, .topo-table th { font-size: 12px; padding: 2px 6px; text-align: left; }
.topo-table tr.q-warn td:first-child { border-left: 3px solid var(--warn); }
.topo-table tr.q-bad td:first-child { border-left: 3px solid var(--ng); }

/* 入室前の接続チェック(views/precheck.js) */
.precheck { margin: 4px 0 10px; font-size: 13px; }
.pc-judge { margin: 4px 0; padding-left: 18px; }
.pc-judge .pc-good { color: var(--ok); }
.pc-judge .pc-warn { color: var(--warn); }
.pc-judge .pc-bad { color: var(--ng); font-weight: bold; }
.pc-table td.k { color: var(--muted); padding-right: 12px; }
