/* ============================================================
   현황판 (#page-status) + 원장실 태블릿 화면 (#page-callscreen)
   - 헤더·버튼은 ui.css 공통 규칙(.zd-head / .ar-pill-btn)을 따름
   ============================================================ */

#page-status {
  position: relative;
}

/* ---------- 본문: 맵 + 오른쪽 패널 ---------- */
#page-status .sb-main {
  display: flex;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 var(--zd-gutter, 32px) 24px;
}
#page-status .sb-mapwrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-white, #fff);
  border: 1px solid var(--hairline, rgba(0, 0, 0, 0.08));
  border-radius: 16px;
  padding: 14px;
}
#page-status .sb-editbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff8e1;
  font-size: 13px;
  color: #6b5200;
}
#page-status .sb-editbar[hidden] {
  display: none;
}
#page-status .sb-editbar .sb-editbar-txt {
  margin-right: auto;
}
#page-status .sb-map {
  position: relative;
  flex: 1 1 auto;
  min-height: 420px;
}
#page-status .sb-gridlines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(0, 102, 204, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 102, 204, 0.08) 1px, transparent 1px);
  background-size: calc(100% / 24) calc(100% / 14);
  border-radius: 8px;
  pointer-events: none;
}

/* ---------- 방 상자 ---------- */
#page-status .sb-room {
  position: absolute;
  box-sizing: border-box;
  padding: 4px;
  container-type: size;
}
#page-status .sb-room-in {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--hairline, rgba(0, 0, 0, 0.1));
  background: #fafafb;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
#page-status .sb-room:hover .sb-room-in {
  border-color: rgba(0, 102, 204, 0.4);
}
#page-status .sb-room.is-running .sb-room-in {
  background: #eef5fd;
  border-color: rgba(0, 102, 204, 0.35);
}
#page-status .sb-room.is-due .sb-room-in {
  background: #fff;
  border-style: dashed;
  border-color: rgba(0, 0, 0, 0.22);
}
#page-status .sb-room.is-doctor-room .sb-room-in {
  background: #f6f3fb;
}
#page-status .sb-room.is-calling .sb-room-in {
  border: 2px solid #d70015;
  animation: sb-pulse 1.2s ease-in-out infinite;
}
#page-status .sb-room.is-coming .sb-room-in {
  border: 2px solid #1f8a4c;
}
#page-status .sb-room.is-later .sb-room-in {
  border: 2px solid #c27c0e;
}
@keyframes sb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(215, 0, 21, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(215, 0, 21, 0); }
}

#page-status .sb-room-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
#page-status .sb-room-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#page-status .sb-chip {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-soft);
  white-space: nowrap;
}
#page-status .is-running .sb-chip {
  background: #0066cc;
  color: #fff;
}
#page-status .is-due .sb-chip {
  background: #fff1d6;
  color: #8a5a00;
}
#page-status .sb-room-body {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 6px;
  overflow: hidden;
}
#page-status .sb-patient {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#page-status .is-due .sb-patient {
  color: var(--text-soft);
}
#page-status .sb-more {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}
#page-status .sb-proc {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#page-status .sb-when {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
#page-status .sb-over {
  color: #d70015;
}
#page-status .sb-doc {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(123, 63, 196, 0.1);
  color: #6b35b0;
}
#page-status .sb-doc.is-now {
  background: #7b3fc4;
  color: #fff;
}
#page-status .sb-emptytxt {
  font-size: 13px;
  color: var(--text-muted);
}
#page-status .sb-next {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#page-status .sb-room-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  min-width: 0;
}
#page-status .sb-callstate {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: #d70015;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#page-status .is-coming .sb-callstate {
  color: #1f8a4c;
}
#page-status .is-later .sb-callstate {
  color: #a86500;
}
#page-status .sb-call-btn {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(215, 0, 21, 0.35);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #d70015;
  cursor: pointer;
  white-space: nowrap;
}
#page-status .sb-call-btn:hover {
  background: #d70015;
  color: #fff;
}

/* 상자 크기에 따라 글자 조절 */
@container (max-height: 110px) {
  #page-status .sb-next,
  #page-status .sb-doc { display: none; }
}
@container (max-height: 86px) {
  #page-status .sb-when { display: none; }
  #page-status .sb-patient { font-size: 15px; }
}
@container (max-width: 150px) {
  #page-status .sb-chip { display: none; }
  #page-status .sb-patient { font-size: 15px; }
}
@container (min-height: 290px) and (min-width: 340px) {
  #page-status .sb-room-in { padding: 16px 18px; }
  #page-status .sb-room-name { font-size: 20px !important; }
  #page-status .sb-chip { font-size: 13px; padding: 3px 9px; }
  #page-status .sb-patient { font-size: 32px !important; margin-top: 6px; }
  #page-status .sb-proc { font-size: 19px !important; margin-top: 4px; }
  #page-status .sb-when { font-size: 15px !important; margin-top: 8px; }
  #page-status .sb-doc { font-size: 13px; padding: 3px 8px; margin-top: 8px; }
  #page-status .sb-next { font-size: 13px; margin-top: 10px; }
  #page-status .sb-emptytxt { font-size: 16px; }
  #page-status .sb-callstate { font-size: 14px; }
  #page-status .sb-call-btn { height: 34px; padding: 0 14px; font-size: 14px; }
}
@container (min-height: 190px) and (min-width: 240px) {
  #page-status .sb-room-name { font-size: 16px; }
  #page-status .sb-patient { font-size: 22px; }
  #page-status .sb-proc { font-size: 15px; }
  #page-status .sb-when { font-size: 13px; }
}

/* 편집 모드 */
#page-status.is-editing .sb-room-in {
  cursor: grab;
  background: #fff;
  border: 1.5px solid rgba(0, 102, 204, 0.45);
  justify-content: center;
  align-items: center;
  text-align: center;
}
#page-status.is-editing .sb-room.is-dragging .sb-room-in {
  cursor: grabbing;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
#page-status.is-editing .sb-room.is-dragging {
  z-index: 3;
}
#page-status .sb-room-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
#page-status .sb-resize {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 16px;
  height: 16px;
  border-right: 3px solid #0066cc;
  border-bottom: 3px solid #0066cc;
  border-radius: 0 0 4px 0;
  cursor: nwse-resize;
}

/* ---------- 오른쪽 패널 ---------- */
#page-status .sb-side {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
}
#page-status .sb-card {
  background: var(--bg-white, #fff);
  border: 1px solid var(--hairline, rgba(0, 0, 0, 0.08));
  border-radius: 16px;
  padding: 14px;
}
#page-status .sb-card h2 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
#page-status .sb-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#page-status .sb-side-empty {
  font-size: 12px;
  color: var(--text-muted);
}
#page-status .sb-callitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border-left: 3px solid #d70015;
  background: #fff5f5;
}
#page-status .sb-callitem.st-coming {
  border-left-color: #1f8a4c;
  background: #f1faf4;
}
#page-status .sb-callitem.st-later {
  border-left-color: #c27c0e;
  background: #fff8ec;
}
#page-status .sb-callitem-main {
  flex: 1 1 auto;
  min-width: 0;
}
#page-status .sb-callitem-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#page-status .sb-callitem-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-soft);
}
#page-status .sb-callitem-acts {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#page-status .sb-mini {
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--border-strong, rgba(0, 0, 0, 0.16));
  border-radius: 7px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
#page-status .sb-mini:hover {
  border-color: #0066cc;
  color: #0066cc;
}
#page-status .sb-mini--muted {
  color: var(--text-soft);
}
#page-status .sb-screen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 13px;
}
#page-status .sb-screen-name {
  font-weight: 600;
}
#page-status .sb-screen-state {
  margin-right: auto;
  font-size: 12px;
  color: var(--text-soft);
}
#page-status .sb-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c7c7cc;
}
#page-status .sb-dot.on {
  background: #1f8a4c;
  box-shadow: 0 0 0 3px rgba(31, 138, 76, 0.15);
}
#page-status .sb-soon {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}
#page-status .sb-soon b {
  font-variant-numeric: tabular-nums;
}

/* ---------- 팝오버 ---------- */
#page-status .sb-pop {
  position: absolute;
  z-index: 30;
  width: 340px;
  max-width: calc(100% - 24px);
  padding: 14px;
  background: #fff;
  border: 1px solid var(--hairline, rgba(0, 0, 0, 0.1));
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
}
#page-status .sb-pop[hidden] {
  display: none;
}
#page-status .sb-pop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
#page-status .sb-pop-title {
  font-size: 16px;
  font-weight: 700;
}
#page-status .sb-pop-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-soft);
}
#page-status .sb-x {
  border: 0;
  background: none;
  font-size: 15px;
  color: var(--text-soft);
  cursor: pointer;
}
#page-status .sb-pop-notes {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff8e1;
  font-size: 12px;
  color: #6b5200;
}
#page-status .sb-pop-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
#page-status .sb-pop-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#page-status .sb-tag {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-soft);
}
#page-status .sb-tag.st-in_progress {
  background: #0066cc;
  color: #fff;
}
#page-status .sb-pop-section {
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
}
#page-status .sb-pop-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#page-status .sb-doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(215, 0, 21, 0.35);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #d70015;
  cursor: pointer;
}
#page-status .sb-doc-btn.is-hint {
  background: #d70015;
  border-color: #d70015;
  color: #fff;
}
#page-status .sb-doc-btn small {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}
#page-status .sb-doc-btn:hover {
  background: #b80012;
  border-color: #b80012;
  color: #fff;
}
#page-status .sb-pop-calls {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#page-status .sb-pop-calls li {
  display: flex;
  align-items: center;
  gap: 6px;
}
#page-status .sb-pop-calls li .sb-mini:first-of-type {
  margin-left: auto;
}
#page-status .sb-pop-foot {
  margin-top: 12px;
  text-align: right;
}
#page-status .sb-link {
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #0066cc;
  cursor: pointer;
}

/* ---------- 알림 ---------- */
#page-status .sb-toast {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 40;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 32px));
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
#page-status .sb-toast[hidden] {
  display: none;
}
#page-status .sb-toast.is-ok { background: rgba(31, 138, 76, 0.95); }
#page-status .sb-toast.is-warn { background: rgba(168, 101, 0, 0.95); }
#page-status .sb-toast.is-error { background: rgba(215, 0, 21, 0.95); }

/* ---------- 화면 크기 ---------- */
@media (min-width: 1800px) {
  #page-status .sb-side { flex-basis: 340px; }
}
@media (max-width: 1279px) {
  #page-status .sb-side { flex-basis: 260px; }
}
@media (max-width: 1023px) {
  #page-status .sb-main { flex-direction: column; }
  #page-status .sb-side { flex: 0 0 auto; overflow: visible; }
  #page-status .sb-map { min-height: 0; aspect-ratio: 24 / 14; }
}
@media (max-width: 768px) {
  #page-status .sb-main { padding: 0 12px 88px; }
  #page-status .sb-mapwrap { padding: 8px; }
  #page-status .sb-map { aspect-ratio: auto; min-height: 0; flex: 0 0 auto; }
  /* 휴대폰: 맵 대신 방 목록 */
  #page-status .sb-room {
    position: static;
    width: auto !important;
    height: auto !important;
    container-type: normal;
    padding: 0 0 8px;
  }
  #page-status .sb-gridlines,
  #page-status #sbEditBtn { display: none; }
}

/* ============================================================
   원장실 태블릿 화면
   ============================================================ */
body.zd-kiosk #app-sidebar,
body.zd-kiosk #mobile-bottom-nav {
  display: none !important;
}
#page-callscreen {
  padding: 0 !important;
  background: #111 !important;
}
#page-callscreen .cs-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 24px clamp(16px, 4vw, 48px);
  color: #fff;
  background: #1c1c1e;
  transition: background-color 0.3s;
}
#page-callscreen .cs-root.is-ringing {
  animation: cs-flash 1.4s ease-in-out infinite;
}
#page-callscreen .cs-root.is-active {
  background: #0f2a1a;
}
@keyframes cs-flash {
  0%, 100% { background: #5a0008; }
  50% { background: #b3000f; }
}
#page-callscreen .cs-top {
  display: flex;
  align-items: center;
  gap: 16px;
}
#page-callscreen .cs-who {
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 700;
}
#page-callscreen .cs-clock {
  margin-left: auto;
  font-size: clamp(22px, 3.4vw, 40px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
#page-callscreen .cs-menu,
#page-callscreen .cs-link {
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}
#page-callscreen .cs-start {
  margin: 16px 0 0;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  background: #0066cc;
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
#page-callscreen .cs-start small {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.85;
}
#page-callscreen .cs-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}
#page-callscreen .cs-idle {
  text-align: center;
}
#page-callscreen .cs-idle-big {
  font-size: clamp(40px, 8vw, 96px);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
}
#page-callscreen .cs-idle-sub {
  margin-top: 8px;
  font-size: clamp(14px, 1.8vw, 20px);
  color: rgba(255, 255, 255, 0.55);
}
#page-callscreen .cs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 16px;
  width: 100%;
}
#page-callscreen .cs-card {
  padding: clamp(16px, 2.4vw, 28px);
  border-radius: 20px;
  background: #fff;
  color: #1d1d1f;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}
#page-callscreen .cs-card.st-coming {
  background: #e8f6ed;
}
#page-callscreen .cs-card.st-later {
  background: #fff4e0;
}
#page-callscreen .cs-card-room {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.05;
  color: #b3000f;
}
#page-callscreen .cs-card.st-coming .cs-card-room {
  color: #1f8a4c;
}
#page-callscreen .cs-card.st-later .cs-card-room {
  color: #a86500;
}
#page-callscreen .cs-card-patient {
  margin-top: 8px;
  font-size: clamp(24px, 3.6vw, 40px);
  font-weight: 700;
}
#page-callscreen .cs-card-proc {
  margin-top: 4px;
  font-size: clamp(18px, 2.4vw, 26px);
  color: #3a3a3c;
}
#page-callscreen .cs-card-meta {
  margin-top: 10px;
  font-size: clamp(13px, 1.6vw, 17px);
  color: #6e6e73;
}
#page-callscreen .cs-card-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff8e1;
  font-size: 15px;
}
#page-callscreen .cs-card-acts {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
#page-callscreen .cs-btn {
  flex: 1 1 0;
  min-height: 64px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 800;
  cursor: pointer;
}
#page-callscreen .cs-btn--go { background: #1f8a4c; color: #fff; }
#page-callscreen .cs-btn--later { background: #f1e3c4; color: #6b4300; }
#page-callscreen .cs-btn--done { background: #e5e5ea; color: #1d1d1f; }
#page-callscreen .cs-hist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}
#page-callscreen .cs-hist > span:first-child {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
}
#page-callscreen .cs-pick {
  margin: auto;
  text-align: center;
}
#page-callscreen .cs-pick-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
}
#page-callscreen .cs-pick-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 24px 0;
}
#page-callscreen .cs-pick-btn {
  min-width: 200px;
  min-height: 72px;
  padding: 0 24px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: #1d1d1f;
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}
#page-callscreen .cs-root.is-pick {
  justify-content: center;
}
#page-status.is-editing .sb-room.is-overlap .sb-room-in {
  border-color: #d70015;
  background: #fff5f5;
}
@media (max-width: 768px) {
  #page-status .zd-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 12px 10px;
  }
  #page-status .ar-pill-btn {
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border-strong, rgba(0, 0, 0, 0.16));
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
  }
}

/* ── 원장실 화면: 방 보기 (가로로 긴 보조 모니터) ─────────────────── */
#page-callscreen .cs-root--rooms {
  height: 100vh;
  min-height: 0;
  padding: clamp(8px, 1.4vh, 18px) clamp(10px, 1vw, 20px);
  gap: clamp(6px, 1.2vh, 14px);
  background: #111;
  overflow: hidden;
}
#page-callscreen .cs-top--slim {
  flex: 0 0 auto;
  gap: 12px;
}
#page-callscreen .cs-top--slim .cs-who { font-size: clamp(14px, 2.6vh, 40px); }
#page-callscreen .cs-top--slim .cs-clock { font-size: clamp(16px, 3.2vh, 52px); }
#page-callscreen .cs-top--slim .cs-menu { height: clamp(28px, 3vh, 44px); font-size: clamp(12px, 1.5vh, 20px); }
#page-callscreen .cs-top--slim .cs-start--inline { font-size: clamp(13px, 1.6vh, 22px); }
#page-callscreen .cs-start--inline {
  margin: 0;
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 10px;
  flex-direction: row;
}
#page-callscreen .cs-strip {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr));
  gap: clamp(6px, 0.6vw, 14px);
}
#page-callscreen .cs-rbox {
  container-type: size;
  min-width: 0;
  min-height: 0;
  border-radius: 14px;
  background: #1f1f22;
  border: 2px solid #2c2c30;
  color: #f2f2f7;
  overflow: hidden;
}
#page-callscreen .cs-rbox-in {
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: clamp(8px, 4cqh, 22px) clamp(8px, 7cqw, 20px);
  gap: clamp(2px, 2cqh, 10px);
}
#page-callscreen .cs-rbox-name {
  font-size: clamp(14px, min(14cqw, 10cqh), 96px);
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#page-callscreen .cs-rbox-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(1px, 1.2cqh, 6px);
  overflow: hidden;
}
#page-callscreen .cs-rbox-patient {
  font-size: clamp(13px, min(12cqw, 8cqh), 80px);
  font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#page-callscreen .cs-rbox-proc {
  font-size: clamp(11px, min(8cqw, 5.5cqh), 52px);
  color: #d1d1d6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#page-callscreen .cs-rbox-when,
#page-callscreen .cs-rbox-doc,
#page-callscreen .cs-rbox-next {
  font-size: clamp(10px, min(7cqw, 4.6cqh), 42px);
  color: #aeaeb2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
#page-callscreen .cs-rbox-doc.is-now { color: #ffd60a; font-weight: 700; }
#page-callscreen .cs-rbox-next { margin-top: auto; }
#page-callscreen .cs-rbox-empty {
  font-size: clamp(12px, min(8cqw, 5.5cqh), 48px);
  color: #636366;
}
#page-callscreen .cs-rbox.is-running { border-color: #2f6f4a; }
#page-callscreen .cs-rbox.is-running .cs-rbox-when { color: #7ee2a8; }
#page-callscreen .cs-rbox.is-running .cs-rbox-when.is-over { color: #ff9f0a; font-weight: 700; }
#page-callscreen .cs-rbox.is-due { border-color: #4a4a52; }
#page-callscreen .cs-rbox.is-empty .cs-rbox-name { color: #8e8e93; }

#page-callscreen .cs-rbox-call {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 2cqh, 10px);
}
#page-callscreen .cs-rbox-call-label {
  font-size: clamp(12px, min(9cqw, 6cqh), 56px);
  font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#page-callscreen .cs-rbox-call-acts {
  display: flex;
  gap: 6px;
}
#page-callscreen .cs-rbtn {
  flex: 1 1 0;
  min-width: 0;
  height: clamp(30px, 12cqh, 130px);
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #1d1d1f;
  font: inherit;
  font-size: clamp(12px, min(8cqw, 5cqh), 44px);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
#page-callscreen .cs-rbtn--go { background: #1f8a4c; color: #fff; }

/* 콜 온 방: 빨갛게 깜빡임 */
#page-callscreen .cs-rbox.is-ring {
  border-color: #ff453a;
  animation: cs-rbox-flash 1.2s ease-in-out infinite;
}
#page-callscreen .cs-rbox.is-ring .cs-rbox-proc,
#page-callscreen .cs-rbox.is-ring .cs-rbox-when,
#page-callscreen .cs-rbox.is-ring .cs-rbox-doc,
#page-callscreen .cs-rbox.is-ring .cs-rbox-next { color: #fff; }
@keyframes cs-rbox-flash {
  0%, 100% { background: #5a0008; box-shadow: 0 0 0 0 rgba(255, 69, 58, 0); }
  50% { background: #d70015; box-shadow: 0 0 0 6px rgba(255, 69, 58, 0.45); }
}
#page-callscreen .cs-rbox.is-coming { background: #0f3a22; border-color: #30d158; }
#page-callscreen .cs-rbox.is-coming .cs-rbox-call-label { color: #30d158; }
#page-callscreen .cs-rbox.is-later { background: #3a2a05; border-color: #ff9f0a; }
#page-callscreen .cs-rbox.is-later .cs-rbox-call-label { color: #ffb340; }
@media (prefers-reduced-motion: reduce) {
  #page-callscreen .cs-rbox.is-ring { animation: none; background: #b3000f; }
}
/* 세로로 낮은 띠 모니터(높이 500px 이하): 다음 예약·원장 시간 숨김 */
@media (max-height: 500px) {
  #page-callscreen .cs-rbox-next,
  #page-callscreen .cs-rbox-doc { display: none; }
}
