/* 遠隔服薬指導システム：iPad操作前提（ボタン高さ56px以上・文字18px以上） */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1d2733;
  --muted: #5f6b7a;
  --line: #d8dee6;
  --primary: #0b6e6e;
  --primary-dark: #08585a;
  --secondary: #e6f2f2;
  --danger: #c0392b;
  --warning: #b9770e;
  --ok: #1e8449;
  --call: #d35400;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 18px;
  line-height: 1.6;
}
a { color: var(--primary); }
h1 { font-size: 26px; margin: 0 0 16px; }
h2 { font-size: 21px; margin: 0 0 12px; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-size: 16px; }
.hint { color: var(--muted); font-size: 16px; }
.lead { font-size: 20px; }
.danger-text { color: var(--danger); }
.inline { display: inline; }

/* ---- 上部バー */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--primary); color: #fff; padding: 10px 16px; min-height: 60px;
  flex-wrap: wrap;
}
.topbar-title { font-weight: 700; font-size: 20px; }
.topbar-user { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar-link { color: #fff; }
.topbar-name { font-size: 16px; opacity: .9; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.6); background: transparent; }

.container { max-width: 1100px; margin: 0 auto; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card.narrow { max-width: 520px; margin: 32px auto; }

/* ---- ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 56px; padding: 0 22px; border-radius: var(--radius);
  border: 2px solid transparent; font-size: 18px; font-weight: 700; cursor: pointer;
  text-decoration: none; background: var(--secondary); color: var(--primary-dark);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: var(--primary-dark); border-color: #b9dada; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: #fff4e0; color: var(--warning); border-color: #f0c987; }
.btn-call { background: var(--call); color: #fff; font-size: 20px; min-height: 64px; }
.btn-xl { min-height: 72px; font-size: 22px; padding: 0 32px; }
.btn-small { min-height: 44px; font-size: 16px; padding: 0 14px; }
.btn-block { width: 100%; }
.btn-shot { min-height: 56px; }
.blink { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 0%, 100% { box-shadow: 0 0 0 0 rgba(211,84,0,.7); opacity: 1; } 50% { box-shadow: 0 0 0 10px rgba(211,84,0,0); opacity: .75; } }

/* ---- フォーム */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 16px; color: var(--muted); font-weight: 600; }
input[type=text], input[type=password], input[type=date], select, textarea {
  font-size: 18px; min-height: 52px; padding: 10px 12px; border: 1px solid #b8c2cc; border-radius: 8px;
  background: #fff; color: var(--text); width: 100%;
}
textarea { min-height: 72px; resize: vertical; }
.code-input { font-size: 28px; letter-spacing: 6px; text-align: center; }
.check { display: flex; align-items: center; gap: 12px; min-height: 56px; font-size: 18px; cursor: pointer; }
.check input { width: 28px; height: 28px; flex: none; }
.checks { border: 2px solid #f0c987; background: #fffaf0; border-radius: var(--radius); padding: 8px 16px; margin: 0 0 16px; }
.checks legend { font-weight: 700; padding: 0 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; align-items: end; }
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-row .field { margin-bottom: 0; min-width: 180px; flex: 1; }
.form-row.compact input { min-height: 44px; max-width: 280px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 16px; margin-bottom: 12px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.actions .btn { flex: 1; min-width: 160px; }
.errors { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; border-radius: 8px; padding: 12px 16px; margin: 12px 0; font-weight: 600; }
.flashes { margin-bottom: 12px; }
.flash { background: #eaf4ff; border: 1px solid #b7d4f5; border-radius: 8px; padding: 12px 16px; margin-bottom: 8px; }
.steps { padding-left: 1.4em; }
.qr { text-align: center; margin: 12px 0; }
.qr img { border: 1px solid var(--line); border-radius: 8px; }
.secret { margin-bottom: 16px; font-size: 16px; }
.secret code { display: block; word-break: break-all; font-size: 18px; padding: 8px; background: #f0f3f6; border-radius: 6px; }

/* ---- 撮影 */
.section-title { font-size: 21px; margin: 20px 0 10px; }
.shot { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; background: #fbfcfd; }
.shot-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.shot-label { font-weight: 700; font-size: 19px; }
.req { margin-left: 10px; font-size: 14px; color: #fff; background: var(--danger); border-radius: 4px; padding: 2px 8px; vertical-align: middle; }
.opt { margin-left: 10px; font-size: 14px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; vertical-align: middle; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.thumb { width: 150px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.thumb img { width: 150px; height: 150px; object-fit: cover; display: block; }
.thumb-del { width: 100%; min-height: 48px; border: 0; border-top: 1px solid var(--line); background: #fff; color: var(--danger); font-size: 16px; font-weight: 700; cursor: pointer; }

/* ---- 店舗：依頼一覧 */
.toolbar { margin: 8px 0 16px; }
.toolbar .btn { width: 100%; }
.request-list { display: flex; flex-direction: column; gap: 12px; }
.req-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-left: 8px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px;
}
.req-card.status-waiting { border-left-color: var(--warning); }
.req-card.status-claimed { border-left-color: #2e86c1; }
.req-card.status-in_call { border-left-color: var(--call); background: #fff6ef; }
.req-card.status-done { border-left-color: var(--ok); opacity: .85; }
.req-card.status-switched_to_face, .req-card.status-cancelled { opacity: .7; }
.req-no { font-size: 30px; font-weight: 800; line-height: 1.2; }
.req-no-label { font-size: 15px; font-weight: 600; color: var(--muted); margin-right: 8px; }
.req-initial { font-size: 20px; color: var(--muted); }
.req-meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 17px; color: var(--muted); }
.req-actions .btn { min-width: 200px; }
.badge-new { color: #fff; background: var(--danger); border-radius: 999px; padding: 2px 10px; font-size: 15px; }
.status { display: inline-block; border-radius: 999px; padding: 2px 12px; font-size: 16px; font-weight: 700; background: #eef1f4; color: var(--text); }
.status-waiting { background: #fff1d6; color: #8a5a00; }
.status-claimed { background: #e3f0fb; color: #1b5e8f; }
.status-in_call { background: #fde3d3; color: #a04000; }
.status-done { background: #e2f4e8; color: #186a3b; }
.status-switched_to_face { background: #f3e5f5; color: #6c3483; }
.status-cancelled { background: #eceff1; color: #546e7a; }

.banner { border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; font-size: 22px; font-weight: 800; }
.banner-done { background: #e2f4e8; color: #186a3b; border: 2px solid #82c99c; }
.banner-face { background: #f3e5f5; color: #6c3483; border: 2px solid #c39bd3; }
.banner-error { background: #fdecea; color: var(--danger); border: 2px solid #f1a9a0; font-size: 20px; }

.sound-unlock { position: fixed; inset: 0; background: rgba(13,40,48,.82); z-index: 50; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sound-unlock-box { background: #fff; border-radius: 16px; padding: 32px 40px; text-align: center; max-width: 520px; margin: 16px; }
.sound-unlock-icon { font-size: 56px; }

/* ---- 通話画面（共通） */
.call-main, .rx-main { padding: 12px 16px; max-width: none; }
.call-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pharmacist-name { font-size: 26px; font-weight: 800; }
.call-stage { position: relative; background: #0f1a20; border-radius: var(--radius); overflow: hidden; height: calc(100vh - 230px); min-height: 360px; }
.call-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.call-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center; text-align: center; color: #fff; padding: 24px; }
.call-placeholder .danger-text { color: #ffb4a8; }
.call-actions { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; padding-right: 380px; }

/* ---- チャット（右下・折りたたみ） */
.chat { position: fixed; right: 16px; bottom: 16px; width: 360px; max-width: calc(100vw - 32px); z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.chat-toggle { width: 100%; min-height: 52px; border: 0; background: var(--primary); color: #fff; font-size: 18px; font-weight: 700; border-radius: 12px 12px 0 0; cursor: pointer; }
.chat.collapsed .chat-toggle { border-radius: 12px; }
.chat.collapsed .chat-body { display: none; }
.chat-badge { background: var(--danger); border-radius: 999px; padding: 0 8px; font-size: 14px; margin-left: 6px; }
.chat-log { height: 220px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: #f7f9fb; }
.msg { max-width: 85%; padding: 6px 10px; border-radius: 10px; font-size: 17px; }
.msg-mine { align-self: flex-end; background: #d9efef; }
.msg-other { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.msg-meta { font-size: 13px; color: var(--muted); }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.chat-form { display: flex; gap: 8px; padding: 8px; border-top: 1px solid var(--line); }
.chat-form input { min-height: 48px; flex: 1; min-width: 0; }
.chat-form .btn { flex: none; white-space: nowrap; }
.chat-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 8px 10px; }
.chip { min-height: 44px; border: 1px solid #b9dada; background: var(--secondary); color: var(--primary-dark); border-radius: 999px; padding: 0 12px; font-size: 15px; cursor: pointer; }

/* ---- 薬剤師：キュー */
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { background: #eef2f5; font-size: 16px; }
.table.small th, .table.small td { font-size: 15px; padding: 8px 10px; }
.table tr.inactive { opacity: .55; }
.table tr.warn td { background: #fff6f5; }
.table-wrap { overflow-x: auto; }
.queue-table td.big { font-size: 26px; font-weight: 800; }
.queue-table tr.mine td { background: #eef8f8; }

/* ---- 薬剤師：指導画面 */
.notice-bar { background: #fff8e1; border: 1px solid #f5d77a; border-radius: 8px; padding: 8px 14px; margin-bottom: 10px; font-size: 16px; }
.note-bar { background: #eaf4ff; border: 1px solid #b7d4f5; border-radius: 8px; padding: 8px 14px; margin-bottom: 10px; }
.rx-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* 薬剤師画面のチャットは下部に固定せず並べる（完了ボタンを隠さない） */
.page-rx-req .chat { position: static; width: auto; max-width: none; margin-top: 16px; box-shadow: none; }
.page-rx-req .chat-log { height: 180px; }
.rx-right .call-stage { height: 56vh; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tab { min-height: 48px; padding: 0 14px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 16px; cursor: pointer; }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.img-cell { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; min-height: 160px; display: flex; align-items: center; justify-content: center; }
.img-cell img { width: 100%; height: 260px; object-fit: contain; background: #222; cursor: zoom-in; display: block; }
.expired { color: var(--muted); font-weight: 700; padding: 40px 10px; }
.finish { margin-top: 12px; }
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 60; display: flex; flex-direction: column; }
.viewer-toolbar { display: flex; gap: 8px; padding: 10px; flex-wrap: wrap; justify-content: center; }
.viewer-stage { flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; }
.viewer-stage img { max-width: 100%; max-height: 100%; transition: transform .08s; user-select: none; -webkit-user-drag: none; }

/* ---- 管理 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-num { font-size: 34px; font-weight: 800; color: var(--primary); }
.stat-label { color: var(--muted); font-size: 16px; }
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.menu-item { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--text); min-height: 90px; }
.menu-item strong { font-size: 21px; color: var(--primary); }
.menu-item span { color: var(--muted); font-size: 16px; }

@media (max-width: 900px) {
  .rx-split { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .menu-grid, .stats { grid-template-columns: 1fr; }
  .req-actions, .req-actions .btn { width: 100%; }
  .chat { width: auto; left: 16px; }
  .call-actions { padding-right: 0; }
}

/* ---- オンライン服薬指導（LINE）：スタッフ */
.toolbar-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.toolbar-2 .btn { width: 100%; }
a.tab { display: inline-flex; align-items: center; text-decoration: none; color: var(--text); }
a.tab.active { color: #fff; }
.nowrap { white-space: nowrap; }
.kv { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.kv th { text-align: left; width: 7em; color: var(--muted); font-weight: 600; padding: 6px 8px 6px 0; vertical-align: top; font-size: 16px; }
.kv td { padding: 6px 0; }
.big-name { font-size: 26px; font-weight: 800; }
.badge-ready { display: inline-block; margin-left: 8px; background: #fde3d3; color: #a04000; border-radius: 999px; padding: 2px 12px; font-size: 15px; font-weight: 700; animation: blink 1.2s ease-in-out infinite; }
.status-scheduled { background: #fff1d6; color: #8a5a00; }
.status-no_show { background: #eceff1; color: #546e7a; }
.file-plain { position: absolute; width: 1px; height: 1px; opacity: 0; }
.btn-shot { position: relative; }
.sheet h1 { font-size: 24px; }
.sheet-steps { padding-left: 1.4em; }
.sheet-steps li { margin-bottom: 18px; }
.sheet-qr { margin: 8px 0; }
.sheet-code { font-size: 40px; font-weight: 800; letter-spacing: 6px; font-family: ui-monospace, "Consolas", monospace; border: 3px dashed var(--primary); border-radius: 12px; display: inline-block; padding: 8px 20px; margin: 8px 0; }
@media print {
  .no-print, .topbar, .flashes { display: none !important; }
  body { background: #fff; }
  .sheet { border: 0; }
}

/* ---- 患者さん（LINE内・スマホ） */
body.patient { background: #f3f7f4; }
.p-header { background: #06c755; color: #fff; font-weight: 800; padding: 14px 16px; font-size: 18px; }
.p-main { max-width: 560px; margin: 0 auto; padding: 16px; }
.p-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.p-card h1 { font-size: 23px; }
.p-card .btn-block { margin-top: 12px; }
.p-item { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; color: var(--text); text-decoration: none; }
.p-when { font-size: 21px; font-weight: 800; }
.consent { background: #fffaf0; border: 2px solid #f0c987; border-radius: 10px; padding: 8px 14px; margin: 12px 0; font-size: 17px; }
.consent ul { padding-left: 1.2em; margin: 6px 0; }
.p-wait { margin-top: 8px; }
body.p-call .p-main { max-width: none; padding: 0; }
.p-call-stage { position: relative; background: #0f1a20; height: calc(100vh - 110px); min-height: 420px; }
.p-call-hint { padding: 8px 16px; margin: 0; }

.narrow-field { max-width: 160px; min-width: 120px !important; }
.form-row.compact input.num-input { max-width: 90px; }

/* ---- 共有画像（薬情）表示 */
.docview { position: relative; overflow: hidden; background: #2b3036; border-radius: var(--radius); touch-action: none; user-select: none; }
.docview-stage { position: absolute; left: 50%; top: 50%; transform-origin: 0 0; }
.docview-stage img, .docview-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.docview-stage img { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.4); }
.docview-ptr { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: rgba(229,57,53,.55); border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(229,57,53,.8); pointer-events: none; }
.docview-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #cfd8dc; font-size: 18px; text-align: center; padding: 16px; }
.docview[data-tool="move"] { cursor: grab; }
.docview[data-tool="pointer"] { cursor: none; }
.docview[data-tool="pen"] { cursor: crosshair; }

/* ---- 薬剤師：来局の指導画面 */
.rx-split-call { grid-template-columns: 1.15fr 1fr; }
.thumbs-row { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 8px; min-height: 72px; align-items: center; }
.thumb-btn { flex: none; width: 72px; height: 72px; padding: 0; border: 2px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; cursor: pointer; font-size: 12px; }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-btn.active { border-color: var(--call); box-shadow: 0 0 0 2px rgba(211,84,0,.3); }
.doc-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.tool-group { display: flex; gap: 4px; }
.tool { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 15px; cursor: pointer; }
.tool.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.share-toggle { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; margin-left: auto; }
.share-toggle input { width: 22px; height: 22px; }
.doc-area { height: calc(100vh - 330px); min-height: 380px; }
.video-panel { position: relative; background: #0f1a20; border-radius: var(--radius); overflow: hidden; height: 46vh; min-height: 300px; }
.remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.self-video { position: absolute; right: 10px; bottom: 10px; width: 26%; max-width: 220px; border-radius: 8px; border: 2px solid #fff; background: #000; transform: scaleX(-1); }
.video-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; padding: 20px; }
.video-placeholder .hint { color: #b0bec5; }
.video-label { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.6); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 15px; }
.video-label:empty { display: none; }
.call-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.call-controls .btn-xl { flex: 1 1 100%; }

/* ---- 店舗：窓口端末 */
.counter-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #eef2f5; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin-bottom: 12px; font-size: 16px; }
.counter-bar.on { background: #e2f4e8; border-color: #82c99c; font-weight: 700; }
.counter { position: fixed; inset: 0; z-index: 80; background: #0b2f2f; color: #fff; display: flex; flex-direction: column; }
.counter-calling { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.counter-no { font-size: clamp(64px, 14vw, 160px); font-weight: 900; line-height: 1.1; }
.counter-no span { color: #ffd54f; }
.counter-who { font-size: clamp(30px, 5vw, 54px); font-weight: 800; }
.counter-msg { font-size: clamp(30px, 5vw, 56px); font-weight: 800; margin-top: 12px; }
.counter-sub { font-size: clamp(20px, 3vw, 30px); margin-top: 16px; opacity: .9; }
.counter-guiding { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.c-head { font-size: 24px; font-weight: 800; padding: 12px 18px; background: rgba(0,0,0,.25); }
.c-body { flex: 1; display: grid; grid-template-columns: 1fr; gap: 10px; padding: 10px; min-height: 0; }
.c-body.with-doc { grid-template-columns: 1fr 1.4fr; }
.c-video { position: relative; background: #000; border-radius: 10px; overflow: hidden; min-height: 0; }
.c-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.c-video-off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #cfd8dc; }
.c-doc { min-height: 0; height: 100%; }
.c-self-wrap { position: absolute; right: 16px; bottom: 16px; width: 22%; max-width: 260px; text-align: center; font-size: 14px; }
.c-self-wrap video { width: 100%; border-radius: 10px; border: 2px solid #fff; background: #000; transform: scaleX(-1); display: block; }
.counter:not(.guiding) .c-self-wrap { position: static; margin: 0 auto 28px; width: 280px; max-width: 60vw; }
.c-error { position: absolute; left: 16px; right: 16px; top: 16px; background: #fdecea; color: var(--danger); padding: 12px 16px; border-radius: 8px; font-weight: 700; font-size: 18px; }
@media (max-width: 900px) { .rx-split-call { grid-template-columns: 1fr; } .c-body.with-doc { grid-template-columns: 1fr; grid-template-rows: 1fr 1.4fr; } }
/* 指導中の自分の映像は、薬情に重ならないよう薬剤師映像の左下に小さく */
.counter.guiding .c-self-wrap { left: 20px; right: auto; bottom: 20px; width: 15%; max-width: 200px; }

.voice-pick { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.voice-pick select { min-height: 40px; width: auto; max-width: 280px; font-size: 15px; padding: 4px 8px; }

/* 呼び出し画面：番号をできるだけ大きく。自分の映像（カメラに映っています）は出さない（カメラ自体はON） */
.counter-calling { padding: 12px 24px; }
.counter-calling .counter-no { font-size: min(34vw, 46vh); line-height: 1; letter-spacing: -0.02em; }
.counter-calling .counter-who { font-size: min(6vw, 7.5vh); margin-top: 4px; }
.counter-calling .counter-msg { font-size: min(5.2vw, 6.5vh); margin-top: 10px; }
.counter-calling .counter-sub { font-size: min(3.2vw, 4.2vh); margin-top: 12px; }
.counter:not(.guiding) .c-self-wrap { display: none; }

/* 呼び出し中の番号をゆっくり点滅させて目立たせる（1秒周期。激しい点滅は避ける） */
.counter-calling .counter-no { animation: callno-blink 1s ease-in-out infinite; }
@keyframes callno-blink {
  0%, 100% { opacity: 1; text-shadow: 0 0 24px rgba(255, 213, 79, .55); }
  50% { opacity: .15; text-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .counter-calling .counter-no { animation-duration: 2s; } }

/* ---- 混雑状況・優先依頼 */
.congestion-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.congestion-label { font-weight: 700; font-size: 16px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg-btn { min-height: 48px; padding: 0 18px; border: 0; border-right: 1px solid var(--line); background: #fff; font-size: 17px; font-weight: 700; cursor: pointer; }
.seg-btn:last-child { border-right: 0; }
.seg-btn.active.cong-sel-0 { background: #e2f4e8; color: #186a3b; }
.seg-btn.active.cong-sel-1 { background: #fff1d6; color: #8a5a00; }
.seg-btn.active.cong-sel-2 { background: #fdecea; color: #b03a2e; }
.cong { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 14px; font-weight: 700; }
.cong-0 { background: #e2f4e8; color: #186a3b; }
.cong-1 { background: #fff1d6; color: #8a5a00; }
.cong-2 { background: #fdecea; color: #b03a2e; }
.store-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.store-chip { background: #fff; border: 1px solid var(--line); border-left: 6px solid #82c99c; border-radius: 10px; padding: 8px 14px; min-width: 210px; }
.store-chip.cong-bg-1 { border-left-color: #f0b429; }
.store-chip.cong-bg-2 { border-left-color: #e74c3c; background: #fff8f7; }
.store-chip-name { font-weight: 800; }
.store-chip-meta { font-size: 15px; color: var(--muted); }
.badge-priority { display: inline-block; background: #e74c3c; color: #fff; border-radius: 999px; padding: 1px 10px; font-size: 14px; font-weight: 800; vertical-align: middle; }
.queue-table tr.priority td { background: #fff1ef; }
.queue-table tr.priority td.order { color: #b03a2e; }
.queue-table td.order { font-size: 22px; font-weight: 800; text-align: center; width: 70px; }
.wait-warn { color: #b9770e; font-weight: 800; }
.wait-alert { color: #c0392b; font-weight: 800; }
.banner-priority { background: #fdecea; color: #b03a2e; border: 2px solid #f1a9a0; font-size: 20px; }
.priority-check { background: #fff8f7; border: 1px solid #f5c6c0; border-radius: 10px; padding: 4px 14px; margin-top: 12px; }
.req-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- 窓口端末の待合表示（患者さん向け） */
.board { position: fixed; inset: 0; z-index: 45; background: #0b2f2f; color: #fff; display: flex; align-items: center; justify-content: center; }
.board-inner { width: min(1100px, 92vw); text-align: center; transition: transform 1s; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; font-size: min(3.4vw, 4.2vh); font-weight: 800; opacity: .9; margin-bottom: 3vh; }
.board-clock { font-variant-numeric: tabular-nums; }
.board-lead { font-size: min(5vw, 6.2vh); font-weight: 800; margin-bottom: 4vh; }
.board-label { font-size: min(3vw, 3.8vh); color: #b2dfdb; margin-bottom: 2vh; }
.board-nums { display: flex; flex-wrap: wrap; justify-content: center; gap: 2vh 3vw; min-height: 14vh; margin-bottom: 4vh; }
.board-num { font-size: min(9vw, 12vh); font-weight: 900; color: #ffd54f; background: rgba(255,255,255,.07); border-radius: 18px; padding: 0 3vw; line-height: 1.3; font-variant-numeric: tabular-nums; }
.board-empty { font-size: min(3.4vw, 4.2vh); color: #b2dfdb; align-self: center; }
.board-guide { font-size: min(3.4vw, 4.4vh); font-weight: 700; margin-bottom: 2vh; }
.board-note { font-size: min(2.8vw, 3.6vh); color: #ffe082; }
.board-staff { position: absolute; right: 10px; bottom: 10px; background: transparent; color: rgba(255,255,255,.35); border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }

/* ---- 窓口端末の音の設定 */
.audio-settings { border: 2px solid #b9dada; }
.audio-grid { margin-top: 12px; }
.audio-grid select { font-size: 15px; }
