/* オンライン面談：画面の見た目。docs/画面仕様.html と同じ色・寸法。
   決まり：書体はゴシック体だけ。角は四角（丸は人の写真の枠と状態の点だけ）。区切りは線・余白・色の差。 */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #17202c;
  --muted: #566273;
  --line: #d3d9e1;
  --line-strong: #95a1b0;
  --accent: #0a58a8;
  --accent-dark: #084684;
  --accent-soft: #e5eef8;
  --ok: #1d7438;
  --ok-soft: #e6f2e9;
  --danger: #b3261e;
  --danger-soft: #fbeceb;
  --warn: #8a4b00;
  --warn-soft: #fbf1e3;
  --call: #0e1319;
  --call-2: #1b2430;
  --call-ink: #e5eaf0;
  --font: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", "Noto Sans JP", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.7; font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: var(--font); line-height: 1.4; margin: 0; text-wrap: balance; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; flex: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hint { font-size: 14px; color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, "BIZ UDGothic", monospace; letter-spacing: 0.04em; }
.center-text { text-align: center; }
.stack { display: grid; gap: 14px; }
.mark { display: inline-block; width: 18px; height: 18px; background: var(--accent); flex: none; }

/* ---- 部品 ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px; border: 2px solid transparent; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; text-align: center; background: var(--surface); color: var(--ink); }
.btn.sm { min-height: 42px; font-size: 14px; padding: 0 12px; gap: 6px; }
.btn.sm svg.i { width: 18px; height: 18px; }
.btn.big { min-height: 64px; font-size: 18px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.secondary { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn.plain { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.plain:hover, .btn.secondary:hover { background: var(--accent-soft); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-outline { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn.danger-outline:hover { background: var(--danger-soft); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--line); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.btn.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.is-off { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.link { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }

.field { display: grid; gap: 6px; }
.field.inline { display: inline-grid; }
.label { font-size: 14px; font-weight: 700; }
input:not([type=checkbox]):not([type=hidden]), select { width: 100%; min-height: 48px; padding: 0 14px; border: 2px solid var(--line-strong); background: #fff; font-size: 16px; border-radius: 0; }
select { padding-right: 32px; }
input:focus, select:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
input.digits { font-size: 26px; font-weight: 700; letter-spacing: 0.18em; min-height: 56px; }
input.digits.big { font-size: 30px; min-height: 60px; }
input[aria-invalid="true"] { border-color: var(--danger); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 15px; cursor: pointer; min-height: 44px; }
.check input { width: 24px; height: 24px; margin: 0; accent-color: var(--accent); flex: none; }

.alert { display: flex; gap: 8px; padding: 10px 12px; font-size: 14px; border-left: 4px solid; align-items: flex-start; }
.alert svg.i { width: 18px; height: 18px; margin-top: 2px; }
.alert.err { border-color: var(--danger); background: var(--danger-soft); color: #7a1a14; }
.alert.warn { border-color: var(--warn); background: var(--warn-soft); color: #5e3400; }
.alert.ok { border-color: var(--ok); background: var(--ok-soft); color: #134d26; }
.alert.info { border-color: var(--accent); background: var(--accent-soft); color: #083f78; text-align: left; }

.card { background: var(--surface); border: 1px solid var(--line); padding: 18px; }
.card.flush { padding: 0; }
.card .pad { padding: 16px; }
details.card summary { cursor: pointer; font-weight: 700; min-height: 32px; }
details.card[open] summary { margin-bottom: 10px; }
.or { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.steps { display: flex; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); background: var(--surface); }
.steps span { flex: 1; padding: 6px; text-align: center; border-left: 1px solid var(--line); }
.steps span:first-child { border-left: 0; }
.steps span.now { background: var(--accent); color: #fff; font-weight: 700; }
.steps span.done { color: var(--ok); font-weight: 700; }
.state { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 14px; font-weight: 700; }
.state .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.state.wait { background: var(--warn-soft); color: var(--warn); }
.state.wait .dot { background: var(--warn); }
.state.in { background: var(--ok-soft); color: var(--ok); }
.state.in .dot { background: var(--ok); }
.state.bad { background: var(--danger-soft); color: var(--danger); }
.state.bad .dot { background: var(--danger); }
.badge { display: inline-block; padding: 1px 8px; font-size: 12.5px; font-weight: 700; border: 1px solid; white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.badge.danger { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.badge.muted { color: var(--muted); border-color: var(--line-strong); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.table th { background: var(--bg); color: var(--muted); font-size: 13px; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table .big-cell { font-size: 18px; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions form { margin: 0; }
.devcode { font-size: 32px; font-weight: 700; letter-spacing: 0.12em; text-align: center; padding: 12px; border: 2px dashed var(--line-strong); background: #fff; }
.qr { display: block; margin: 0 auto; width: 220px; height: 220px; image-rendering: pixelated; border: 1px solid var(--line); }
ol.plain { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; }
.kv { margin: 0; display: grid; gap: 10px; }
.kv div { display: grid; gap: 2px; }
.kv dt { font-size: 13px; color: var(--muted); }
.kv dd { margin: 0; }
.kv dd.big { font-size: 22px; font-weight: 700; }
.handover { border-top: 4px solid var(--warn); }
.page-alert { max-width: 1100px; margin: 12px auto 0; }

/* ---- 職員・管理の画面の枠 ---- */
header.top { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); font-weight: 700; font-size: 15px; }
header.nav { min-height: 56px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 22px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 15px; }
header.nav .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; margin-right: 6px; }
header.nav nav { display: flex; gap: 20px; }
header.nav nav a { color: var(--ink); text-decoration: none; padding: 16px 0 13px; border-bottom: 3px solid transparent; }
header.nav nav a.now { border-bottom-color: var(--accent); color: var(--accent); font-weight: 700; }
header.nav .me { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
header.nav .me form { margin: 0; }
.narrow { max-width: 440px; margin: 24px auto; padding: 0 16px; display: grid; gap: 16px; }
.content { max-width: 1100px; margin: 24px auto; padding: 0 20px; display: grid; gap: 18px; }
.narrow-left { max-width: 640px; }
.content.narrow-left { margin-left: auto; margin-right: auto; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters select { min-width: 160px; min-height: 42px; }
.filters .push { margin-left: auto; }
.tabs { display: flex; border-bottom: 2px solid var(--line); gap: 0; }
.tabs a { padding: 10px 18px; text-decoration: none; color: var(--ink); border-bottom: 3px solid transparent; margin-bottom: -2px; font-weight: 700; }
.tabs a.now { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 720px) {
  header.nav { padding: 6px 12px; }
  header.nav nav { gap: 14px; order: 3; width: 100%; overflow-x: auto; }
  header.nav nav a { padding: 8px 0; }
  .content { padding: 0 12px; }
}

/* ---- S5 ホーム ---- */
.home { max-width: 1100px; margin: 24px auto; padding: 0 20px; }
.home-row { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.startcard { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); padding: 22px; display: grid; gap: 14px; }
.slots { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.slots .bars { display: flex; gap: 4px; }
.slots i { width: 22px; height: 10px; background: var(--line); display: block; }
.slots i.used { background: var(--accent); }
@media (max-width: 820px) { .home-row { grid-template-columns: 1fr; } .home { padding: 0 12px; } }

/* ---- S6 面談中 ---- */
.meeting { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: calc(100vh - 57px); height: calc(100dvh - 57px); min-height: 560px; }
.stage { background: var(--call); color: var(--call-ink); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; }
.callhead { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 13px; color: #c3ccd6; }
.callhead .live { width: 8px; height: 8px; border-radius: 50%; background: #4fc27a; }
.callhead .time { margin-left: auto; }
.stage-main { padding: 0 12px 12px; min-height: 0; display: grid; }
.vbox { position: relative; background: var(--call-2); display: grid; place-items: center; overflow: hidden; min-height: 0; }
.vbox video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.vbox.empty video { display: none; }
.vbox .placeholder { display: none; flex-direction: column; align-items: center; gap: 10px; color: #8d9bab; font-size: 14px; text-align: center; padding: 10px; }
.vbox.empty .placeholder { display: flex; }
.vbox .placeholder svg.person { width: 96px; height: 96px; }
.vbox .tag { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 8px; }
.selfs { display: flex; gap: 10px; padding: 0 12px 12px; }
.vbox.self { width: 180px; height: 110px; border: 2px solid #3a4756; }
.vbox.self video { object-fit: cover; }
#self-video { transform: scaleX(-1); }
/* お客様が 2 人以上のときは 2 列に並べる（3・4 人は 2 段） */
.grid { display: grid; gap: 8px; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr); }
.grid[data-n="2"], .grid[data-n="3"], .grid[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vbox.speaking, .otile.speaking { outline: 3px solid #4fc27a; outline-offset: -3px; }
.panel { background: var(--surface); border-left: 1px solid var(--line); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.ptitle { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }
.url { font-size: 13px; padding: 8px 10px; border: 1px solid var(--line-strong); background: var(--bg); overflow-wrap: anywhere; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.row2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pw { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pw-digits { font-size: 40px; font-weight: 700; letter-spacing: 0.06em; line-height: 1.1; white-space: nowrap; }
.pw-digits.dim { color: var(--line-strong); text-decoration: line-through; }
.pw-read { font-size: 12.5px; color: var(--muted); white-space: pre-line; line-height: 1.5; }
.panel .row2 .btn.sm, .panel .row3 .btn.sm { padding: 0 6px; white-space: nowrap; }
.pwmeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.pwmeta .bad { color: var(--danger); font-weight: 700; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }
#cust-count { font-weight: 400; letter-spacing: 0; }
.people { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); }
.people li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 12px; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; }
.people .nm { display: grid; line-height: 1.4; }
.people .nm .hint { font-size: 12.5px; }
@media (max-width: 900px) {
  .meeting { grid-template-columns: 1fr; height: auto; }
  .stage { min-height: 60vh; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
}
.dialog { border: 0; border-top: 4px solid var(--danger); padding: 20px; width: min(400px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
.dialog::backdrop { background: rgba(14, 19, 25, .55); }
.dialog-title { font-size: 17px; font-weight: 700; }

/* ---- お客様の画面 ---- */
body.customer { background: var(--surface); }
.cwrap { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--surface); }
.ctop { height: 52px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.cview { flex: 1; display: flex; flex-direction: column; }
.cview.center { justify-content: center; }
.cbody { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.cbody.center { align-items: center; justify-content: center; text-align: center; }
.cfoot { position: sticky; bottom: 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.cfoot .btn { width: 100%; }
.who { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; line-height: 1.5; }
.who b { font-size: 16px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #c8d3df; display: grid; place-items: center; color: #566273; flex: none; }
.notes { margin: 0; padding: 10px 12px 10px 30px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; display: grid; gap: 4px; }
.preview { position: relative; height: 260px; background: var(--call-2); display: grid; place-items: center; overflow: hidden; }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview.empty video { display: none; }
.preview .placeholder { display: none; flex-direction: column; align-items: center; gap: 8px; color: #8d9bab; font-size: 14px; }
.preview.empty .placeholder { display: flex; }
.preview .placeholder svg.person { width: 80px; height: 80px; }
.preview .tag { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 2px 6px; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle { min-height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 2px solid var(--line-strong); background: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
.toggle .st { margin-left: auto; font-size: 13px; color: var(--ok); }
.toggle[aria-pressed="false"] { border-color: var(--danger); }
.toggle[aria-pressed="false"] .st { color: var(--danger); }
.meter-row { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.meter { display: flex; gap: 3px; align-items: flex-end; height: 18px; }
.meter i { width: 7px; background: var(--line); display: block; }
.meter i:nth-child(1) { height: 6px; } .meter i:nth-child(2) { height: 9px; } .meter i:nth-child(3) { height: 12px; } .meter i:nth-child(4) { height: 15px; } .meter i:nth-child(5) { height: 18px; }
.meter i.on { background: var(--ok); }
.bigicon { width: 68px; height: 68px; display: grid; place-items: center; }
.bigicon svg.i { width: 38px; height: 38px; }
.bigicon.ok { background: var(--ok-soft); color: var(--ok); }
.bigicon.warn { background: var(--warn-soft); color: var(--warn); }
.bigicon.bad { background: var(--danger-soft); color: var(--danger); }
.cview.center .cbody > p { color: var(--muted); font-size: 15px; }
.cview.center .btn { width: 100%; }

/* C3 面談中（スマホは画面いっぱい） */
.ccall { position: fixed; inset: 0; z-index: 10; background: var(--call); color: var(--call-ink); display: flex; flex-direction: column; }
.ccall .callhead { padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
.ccall .q { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; margin-left: 4px; }
.ccall .q i { width: 3px; background: #56636f; display: block; }
.ccall .q i:nth-child(1) { height: 5px; } .ccall .q i:nth-child(2) { height: 8px; } .ccall .q i:nth-child(3) { height: 12px; }
.ccall .q.good i { background: #4fc27a; } .ccall .q.fair i:nth-child(-n+2) { background: #e2a24e; } .ccall .q.poor i:nth-child(1) { background: #f08a80; }
.stagearea { flex: 1; min-height: 0; position: relative; display: grid; padding: 4px; }
.mainv { position: relative; display: grid; place-items: center; min-height: 0; background: #000; }
.mainv video { width: 100%; height: 100%; object-fit: contain; display: block; }
.mainv.empty video { display: none; }
.mainv .placeholder { display: none; flex-direction: column; align-items: center; gap: 10px; color: #8d9bab; font-size: 14px; text-align: center; }
.mainv.empty .placeholder { display: flex; }
.mainv .placeholder svg.person { width: 96px; height: 96px; }
.pip { position: absolute; right: 10px; width: 96px; height: 128px; background: var(--call-2); border: 2px solid #e5eaf0; overflow: hidden; }
.pip.top { top: 10px; }
.pip.bottom { bottom: 10px; }
.pip video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pip.empty video { visibility: hidden; }
#c-self { transform: scaleX(-1); }
.pip .tag { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; text-align: center; padding: 1px 0; }
.others { flex: none; display: flex; gap: 6px; padding: 0 4px 4px; overflow-x: auto; }
.otile { position: relative; flex: none; width: 104px; height: 78px; background: var(--call-2); display: grid; place-items: center; overflow: hidden; }
.otile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.otile.empty video { display: none; }
.otile svg.person { width: 34px; height: 34px; color: #8d9bab; }
.otile:not(.empty) svg.person { display: none; }
.otile .tag { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; text-align: center; padding: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner { margin: 0 10px 8px; padding: 8px 10px; font-size: 14px; background: #fbf1e3; color: #5e3400; border: 0; text-align: left; }
.banner.action { background: var(--accent); color: #fff; font-weight: 700; min-height: 48px; cursor: pointer; }
.hintbar { margin: 0 10px 8px; background: rgba(255,255,255,.1); color: #e5eaf0; font-size: 13px; padding: 6px 8px; display: flex; gap: 6px; align-items: center; }
.hintbar svg.i { width: 16px; height: 16px; }
.callbar { flex: none; display: flex; justify-content: space-around; padding: 10px 6px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid #2b3642; }
.cbtn { display: grid; justify-items: center; gap: 4px; font-size: 12px; color: #e5eaf0; min-width: 68px; background: none; border: 0; cursor: pointer; padding: 0; }
.cbtn .sq { width: 54px; height: 54px; display: grid; place-items: center; background: #263240; color: #fff; }
.cbtn.off .sq { background: #fff; color: var(--danger); }
.cbtn.leave .sq { background: var(--danger); }
@media (orientation: landscape) and (max-height: 500px) {
  .ccall .callhead { padding: 4px 12px; }
  .callbar { padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .cbtn .sq { width: 44px; height: 44px; }
  .pip { width: 80px; height: 60px; }
  .otile { width: 80px; height: 56px; }
}

/* 文字を大きくしても崩れないように */
@media (max-width: 380px) {
  .cbtn { min-width: 60px; }
  .pw-digits { font-size: 34px; }
}

/* ---- スマホでログイン（QR コード） ---- */
.qrbox { border: 1px solid var(--line); padding: 14px; background: var(--bg); justify-items: center; text-align: center; }
.qrbox img { display: block; width: 260px; height: 260px; max-width: 100%; image-rendering: pixelated; background: #fff; border: 1px solid var(--line); }
.qrnum { font-size: 44px; font-weight: 700; letter-spacing: 0.1em; border: 2px solid var(--accent); color: var(--accent); background: #fff; padding: 2px 18px; line-height: 1.3; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice { min-height: 68px; font-size: 30px; }
.center-block { margin: 0 auto; }
