/* 遠隔臨場のサンプル。色と形は docs/specs/screens/mock の画面に合わせた */
:root {
  --bg: #f2f4f7; --card: #fff; --fg: #111827; --muted: #6b7280; --line: #e5e7eb;
  --primary: #2563eb; --primary-weak: #dbeafe; --danger: #dc2626; --danger-weak: #fee2e2; --ok: #16a34a; --warn: #d97706;
  --dark: #111318; --dark2: #1c1f26; --dark3: #2a2e37; --dark-line: #343944; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", sans-serif; background: var(--bg); color: var(--fg); font-size: 15px; line-height: 1.6; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; }
button { font: inherit; cursor: pointer; }
select, input { font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--fg); }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 0; } label > select, label > input { margin-top: 4px; font-weight: 400; }

/* ヘッダー */
.top { display: flex; align-items: center; gap: 14px; padding: 10px 22px; background: #fff; border-bottom: 1px solid var(--line); }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; }
.meet-title { display: flex; flex-direction: column; min-width: 0; } .meet-title b { font-size: 17px; } .meet-title span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sample-tag { margin-left: auto; background: #fef3c7; color: #92400e; border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 700; }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--fg); text-decoration: none; font-weight: 600; min-height: 44px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sub { background: #fff; }
.btn.wide { width: 100%; margin-top: 14px; font-size: 17px; min-height: 52px; }
.btn:disabled { opacity: .5; cursor: default; }

.card { background: var(--card); border-radius: 16px; padding: 24px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.center { display: grid; place-items: center; padding: 48px 16px; }
.msg { max-width: 520px; width: 100%; text-align: center; } .msg h1 { font-size: 22px; margin: 8px 0; }
.msg-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; } .msg-icon.warn { background: #fef3c7; color: var(--warn); } .msg-icon.ok { background: #dcfce7; color: var(--ok); }
.form { max-width: 480px; width: 100%; } .form h1 { font-size: 22px; margin: 0 0 12px; }
.invite { display: flex; flex-direction: column; background: var(--bg); border-radius: 10px; padding: 12px 14px; } .invite b { font-size: 16px; }
.note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 14px; }
.err { color: var(--danger); background: var(--danger-weak); border-radius: 8px; padding: 8px 12px; }

/* PC-01 入室準備 */
.prejoin { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; padding: 24px; max-width: 1400px; margin: 0 auto; }
.preview { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 16px; overflow: hidden; }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview-label { position: absolute; left: 14px; top: 14px; background: rgba(17,24,39,.75); color: #fff; padding: 4px 12px; border-radius: 8px; font-weight: 600; }
.cam-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; background: #1f2937; }
.preview .notice { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); background: #fff; padding: 8px 14px; border-radius: 10px; font-weight: 600; }
.dev-row { display: flex; gap: 12px; margin-top: 12px; }
.tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 96px; min-height: 76px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-weight: 600; font-size: 14px; }
.tool[aria-pressed="false"] { background: var(--danger-weak); color: var(--danger); border-color: #fecaca; }
.meter { flex: 1; background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 10px 14px; } .meter span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.bars { display: flex; gap: 5px; margin-top: 6px; } .bars i { flex: 1; height: 20px; border-radius: 3px; background: #e5e7eb; } .bars i.on { background: #16a34a; }
.side h2 { margin: 0; font-size: 20px; } .who { background: var(--primary-weak); border-radius: 12px; padding: 10px 14px; margin: 14px 0 4px; } .who > div { display: flex; align-items: center; gap: 10px; }
.big-name { font-size: 22px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #7c3aed; color: #fff; display: inline-grid; place-items: center; font-weight: 700; flex: none; }
.avatar.big { width: 84px; height: 84px; font-size: 34px; }
.denied { background: var(--danger-weak); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; } .denied h2 { color: var(--danger); font-size: 17px; }
@media (max-width: 900px) { .prejoin { grid-template-columns: 1fr; padding: 12px 16px; } .tool { min-width: 72px; } }

/* 会議（PC-03・PC-04・PC-06） */
body.dark { background: var(--dark); color: #e5e7eb; }
.meeting { display: grid; grid-template-rows: auto 1fr auto auto; height: 100vh; }
.mh { display: flex; align-items: center; gap: 16px; padding: 8px 20px; background: #fff; color: var(--fg); }
.rec { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 14px; background: #e5e7eb; color: #4b5563; font-weight: 600; font-size: 14px; margin-left: auto; }
.rec::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #9ca3af; }
.rec.on { background: #e11d48; color: #fff; } .rec.on::before { background: #fff; }
.me-chip { display: flex; align-items: center; gap: 8px; font-weight: 600; } .host-badge { background: #2563eb; color: #fff; border-radius: 4px; padding: 0 6px; font-size: 12px; }
.stage { display: grid; grid-template-columns: 1fr auto; min-height: 0; }
.mainview { position: relative; display: grid; place-items: center; padding: 16px; min-height: 0; }
.mainbox { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.mainbox video { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; background: #000; border-radius: 10px; }
.main-empty { color: #9ca3af; font-size: 18px; }
.main-label { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.6); padding: 2px 10px; border-radius: 6px; font-size: 13px; }
.overlay { position: absolute; inset: 0; pointer-events: none; }
.vtools { position: absolute; left: 28px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; background: rgba(28,31,38,.9); border-radius: 12px; padding: 8px; z-index: 2; }
.vtool { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #e5e7eb; background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; font-size: 12px; }
.vtool.on { border-color: #fbbf24; color: #fbbf24; }
.hint { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); background: rgba(17,19,24,.85); padding: 6px 16px; border-radius: 999px; font-size: 14px; }
.ptr-label { font: 700 13px sans-serif; }
.strip { display: flex; gap: 8px; padding: 0 16px 12px; overflow-x: auto; }
.tile { position: relative; width: 178px; height: 100px; flex: none; background: var(--dark3); border-radius: 8px; overflow: hidden; border: 2px solid transparent; cursor: pointer; }
.tile.main { border-color: #3b82f6; } .tile video { width: 100%; height: 100%; object-fit: cover; }
.tile .nm { position: absolute; left: 6px; bottom: 4px; right: 6px; font-size: 12px; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tag { position: absolute; left: 6px; top: 4px; background: #2563eb; color: #fff; font-size: 11px; border-radius: 4px; padding: 0 5px; }
.tile .ini { position: absolute; inset: 0; display: grid; place-items: center; }
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: #fff; color: var(--fg); }
.bar .sp { flex: 1; }
.ctl { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 82px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--fg); font-size: 13px; position: relative; }
.ctl.off { color: var(--danger); background: var(--danger-weak); border-color: #fecaca; }
.ctl.active { background: var(--primary-weak); border-color: #93c5fd; }
.ctl.rec-on { color: #fff; background: #e11d48; border-color: #e11d48; }
.ctl.leave { background: var(--danger); color: #fff; border-color: var(--danger); min-width: 110px; font-size: 16px; flex-direction: row; gap: 6px; }
.ctl .dot { position: absolute; top: 4px; right: 18px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; }
.panel { width: 360px; background: #fff; color: var(--fg); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); } .tabs button { flex: 1; background: none; border: 0; padding: 12px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--primary); border-color: var(--primary); } .tabs .x { flex: none; }
.plist, .chat { flex: 1; overflow-y: auto; padding: 10px 16px; }
.group { color: var(--muted); font-size: 13px; margin: 10px 0 4px; }
.prow { display: flex; align-items: center; gap: 10px; padding: 6px 0; } .prow .nm { flex: 1; min-width: 0; } .prow .nm div { font-size: 12px; color: var(--muted); }
.kick { border: 1px solid #fecaca; color: var(--danger); background: #fff; border-radius: 8px; font-size: 12px; padding: 4px 8px; }
.cmsg { margin: 8px 0; } .cmsg .h { font-size: 12px; color: var(--muted); } .cmsg .b { background: var(--bg); border-radius: 10px; padding: 6px 10px; white-space: pre-wrap; word-break: break-word; }
.cmsg.mine .b { background: var(--primary-weak); } .cmsg .del { border: 0; background: none; color: var(--muted); font-size: 12px; }
.chat-in { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); } .chat-in button { flex: none; }
.panel-note { font-size: 12px; color: var(--muted); padding: 10px 16px; border-top: 1px solid var(--line); }
.banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: #fff; color: var(--fg); border-radius: 10px; padding: 8px 14px; display: flex; gap: 10px; align-items: center; z-index: 3; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 10; }
.modal { background: #fff; color: var(--fg); border-radius: 14px; padding: 22px; width: min(420px, 92vw); } .modal h3 { margin: 0 0 8px; } .modal .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.waiting, .left-page { display: grid; place-items: center; height: 100vh; padding: 16px; background: var(--bg); color: var(--fg); }
.timer { font-size: 18px; font-weight: 700; }
@media (max-width: 900px) { .panel { position: fixed; inset: 0; width: auto; z-index: 5; } .ctl { min-width: 60px; font-size: 11px; } .bar { gap: 6px; padding: 8px; flex-wrap: wrap; } .tile { width: 120px; height: 68px; } }
.q { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.qbars { display: inline-flex; align-items: flex-end; gap: 2px; } .qbars i { width: 4px; border-radius: 1px; display: block; }
.prow .q { font-weight: 400; font-size: 12px; }
/* PC-07・PC-08 電子小黒板 */
.bb { max-width: 1400px; margin: 0 auto; padding: 16px 24px 90px; }
.bb h1 { margin: 6px 0; font-size: 24px; } .back { color: var(--primary); text-decoration: none; font-weight: 600; }
.bb-bar { display: flex; gap: 10px; align-items: center; margin: 14px 0; } .bb-bar input { max-width: 340px; } .bb-bar .sp, .bb-head .sp, .bb-foot .sp { flex: 1; }
.bb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 20px; align-items: start; }
.bb-table { padding: 0; overflow: hidden; } .bb-table table { border-collapse: collapse; width: 100%; } .bb-table th, .bb-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.bb-table th { background: #f9fafb; color: var(--muted); font-size: 13px; } .bb-table tr.sel td { background: var(--primary-weak); } .bb-table tbody tr { cursor: pointer; }
.bb-preview img { width: 100%; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }
.bb-edit .bb-grid { grid-template-columns: minmax(0, 1fr) 360px; }
.bb-head { display: flex; align-items: center; gap: 12px; } label.inline { display: flex; gap: 8px; align-items: center; margin: 0; } label.inline select { width: auto; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; } .tools button { display: flex; flex-direction: column; align-items: center; min-width: 56px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 12px; }
.tools button.on { background: var(--primary); color: #fff; border-color: var(--primary); } .tools .gap { width: 12px; } .tools button:disabled { opacity: .4; }
.tools b { font-size: 18px; line-height: 1.2; }
.canvas-wrap { background: #e5e7eb; border-radius: 12px; padding: 12px; display: grid; place-items: center; }
#cv { max-width: 100%; max-height: 62vh; touch-action: none; background: #1f4d3a; }
.bb-foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; align-items: center; padding: 12px 24px; background: #fff; border-top: 1px solid var(--line); }
.menu { position: relative; } .menu-list { position: absolute; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.12); z-index: 5; min-width: 120px; }
.menu-list button { display: block; width: 100%; text-align: left; padding: 8px 14px; border: 0; background: none; } .menu-list button.danger { color: var(--danger); }
.copy-list { max-height: 60vh; overflow: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; } .copy-list button { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px; text-align: left; } .copy-list img { width: 100%; }
@media (max-width: 1100px) { .bb-grid, .bb-edit .bb-grid { grid-template-columns: 1fr; } }

/* 黒板の重ね（PC-04）・黒板ツール・写真 */
.board-ov { position: absolute; z-index: 1; pointer-events: none; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.board-ov img { width: 100%; height: 100%; display: block; }
.board-measured { position: absolute; color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; display: flex; align-items: center; font-family: sans-serif; }
.board-panel { position: absolute; left: 108px; top: 50%; transform: translateY(-50%); background: #fff; color: var(--fg); border-radius: 12px; padding: 12px 14px; z-index: 3; width: 260px; display: grid; gap: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.opts { display: flex; gap: 6px; } .opts.grid2 { display: grid; grid-template-columns: 1fr 1fr; }
.opt { border: 0; background: #f3f4f6; border-radius: 8px; padding: 8px 12px; font-weight: 600; } .opt.on { background: var(--primary); color: #fff; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; } .photo { color: inherit; text-decoration: none; } .photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: #000; }
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 20; box-shadow: 0 6px 18px rgba(0,0,0,.3); }

/* SP-04（スマホのブラウザの会議）。縦長: ヘッダーは短く、映像・タイル・下のボタン */
body.sp .meeting { grid-template-rows: auto 1fr auto auto; height: 100dvh; }
body.sp .mh { padding: 6px 10px; gap: 8px; flex-wrap: wrap; } body.sp .mh .logo, body.sp .me-chip .avatar { display: none; }
body.sp .meet-title b { font-size: 14px; } body.sp .meet-title span { font-size: 11px; }
body.sp .rec { margin-left: 0; font-size: 12px; padding: 2px 10px; } body.sp .me-chip { font-size: 12px; } body.sp #qBadge small { display: none; }
body.sp .mainview { padding: 6px; } body.sp .vtools { left: 10px; }
body.sp .strip { padding: 0 6px 6px; } body.sp .tile { width: 112px; height: 64px; }
body.sp .bar { gap: 4px; padding: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); flex-wrap: nowrap; overflow-x: auto; } body.sp .bar .sp { display: none; }
body.sp .ctl { min-width: 56px; font-size: 10px; padding: 4px 6px; } body.sp .ctl svg { width: 20px; height: 20px; } body.sp .ctl.leave { min-width: 64px; font-size: 12px; }
body.sp .panel { position: fixed; inset: 0; width: auto; z-index: 6; }
body.sp .hint { font-size: 12px; bottom: 10px; }
