:root {
  --primary: #1a73e8;
  --ndt: #1565c0;
  --mat: #e65100;
  --ot: #2e7d32;
  --bg: #f5f5f5;
  --card: #fff;
  --text: #212121;
  --muted: #757575;
  --border: #e0e0e0;
  --danger: #c62828;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, 'Noto Sans KR', sans-serif; background: var(--bg); color: var(--text); font-size: 13px; }

/* Auth */
.auth-container { max-width: 380px; margin: 80px auto; padding: 24px; background: var(--card); border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.auth-container h2 { text-align: center; margin-bottom: 20px; color: var(--primary); }
.auth-container input { width: 100%; padding: 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; }
.auth-container button { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; }
.auth-container button:active { opacity: 0.8; }
.auth-toggle { text-align: center; margin-top: 12px; color: var(--muted); font-size: 14px; }
.auth-toggle a { color: var(--primary); cursor: pointer; text-decoration: none; }
.auth-error { color: var(--danger); text-align: center; margin-bottom: 12px; font-size: 14px; }

/* Header — single line */
.header { background: var(--primary); color: #fff; padding: 10px 10px; position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.header h1 { font-size: 13px; font-weight: 700; white-space: nowrap; }
.header-nav { display: flex; align-items: center; gap: 6px; }
.header-nav .current-date { font-size: 14px; font-weight: 700; white-space: nowrap; margin: 0 4px; }
.header-actions { display: flex; gap: 6px; align-items: center; }
.header-actions .user-name { font-size: 11px; opacity: 0.85; white-space: nowrap; }
/* 헤더 버튼 통일 스타일 */
.hbtn { display: inline-flex; align-items: center; justify-content: center; height: 30px; min-width: 30px; padding: 0 10px; background: rgba(255,255,255,0.22); border: none; color: #fff; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.15s; }
.hbtn:hover { background: rgba(255,255,255,0.35); }
.hbtn.active { background: rgba(255,255,255,0.38); }
.clickable-name { cursor: pointer; border-bottom: 1px dashed rgba(0,0,0,0.3); padding: 1px 0; white-space: nowrap; display: inline-block; }

/* Category tabs — colored backgrounds */
.tabs { display: flex; gap: 0; background: var(--card); border-bottom: 1px solid var(--border); }
/* SCHEDULE_VERSIONS_2026_08_29: '전체'를 반으로 줄이고 그 왼쪽에 '이전버전'을 넣는다.
   두 칸이 합쳐서 원래 '전체' 한 칸 폭을 쓰므로 다른 탭 배치는 그대로다. */
.tab.tab-hist { flex: 0.5; font-size: 12px; color: #6d4c41; background: #f5efe6; }
.tab.tab-hist:hover { background: #efe4d4; }
.tab.tab-all-half { flex: 0.5; }
/* 탭은 어떤 폭에서도 줄바꿈되지 않아야 한다 — 한 칸이 접히면 줄 전체 높이가 밀려 표가 잘린다 */
.tab { white-space: nowrap; }
.tab .lbl-full { display: inline; }
.tab .lbl-short { display: none; }
.tab { flex: 1; padding: 8px; text-align: center; font-size: 13px; font-weight: 600; border: none; background: #f5f5f5; cursor: pointer; border-bottom: 3px solid transparent; color: var(--muted); transition: all 0.15s; box-shadow: 0 2px 4px rgba(0,0,0,0.08); }
.tab:active { opacity: 0.7; }
.tab.active { border-bottom-color: var(--primary); color: var(--primary); background: #fff; box-shadow: 0 4px 12px rgba(63,81,181,0.25); }
.tab.ndt { background: #f0f6ff; color: var(--ndt); box-shadow: 0 3px 8px rgba(25,118,210,0.18); }
.tab.ndt.active { border-bottom-color: var(--ndt); color: #fff; background: var(--ndt); box-shadow: 0 4px 12px rgba(25,118,210,0.35); }
.tab.mat { background: #fff5ed; color: var(--mat); box-shadow: 0 3px 8px rgba(230,126,34,0.18); }
.tab.mat.active { border-bottom-color: var(--mat); color: #fff; background: var(--mat); box-shadow: 0 4px 12px rgba(230,126,34,0.35); }
.tab.ot { background: #f0f8f1; color: var(--ot); box-shadow: 0 3px 8px rgba(46,125,50,0.18); }
.tab.ot.active { border-bottom-color: var(--ot); color: #fff; background: var(--ot); box-shadow: 0 4px 12px rgba(46,125,50,0.35); }
/* WNWO_RESTORE_2026_04_23: WN/WO tab + weekly-table styles */
.tab.wn { background: #e8eaf6; color: #283593; box-shadow: 0 3px 8px rgba(40,53,147,0.18); }
.tab.wn.active { border-bottom-color: #283593; color: #fff; background: #283593; box-shadow: 0 4px 12px rgba(40,53,147,0.35); }
.tab.wo { background: #e0f2f1; color: #00695c; box-shadow: 0 3px 8px rgba(0,105,92,0.18); }
.tab.wo.active { border-bottom-color: #00695c; color: #fff; background: #00695c; box-shadow: 0 4px 12px rgba(0,105,92,0.35); }
.weekly-table { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--card); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.weekly-table th, .weekly-table td { border: 1px solid var(--border); padding: 4px 5px; text-align: center; vertical-align: middle; font-size: 12px; }
.weekly-table thead th { font-weight: 700; white-space: nowrap; position: sticky; top: 0; z-index: 10; }
.weekly-table thead th:first-child { background: #f0f0f0; position: sticky; left: 0; top: 0; z-index: 20; min-width: 52px; }
.weekly-table thead th.wn-hdr { background: #c5cae9; color: #283593; }
.weekly-table thead th.wo-hdr { background: #b2dfdb; color: #00695c; }
.weekly-table td:first-child { background: #f8f9fa; font-weight: 800; font-size: 12px; position: sticky; left: 0; z-index: 5; white-space: nowrap; min-width: 52px; }
.weekly-table td.wn-cell { background: #e8eaf6; min-width: 60px; }
.weekly-table td.wo-cell { background: #e0f2f1; min-width: 60px; }
.weekly-table td.pm-time { background: #fff8e1; }
.weekly-table td.patient-highlight { background: #fff176 !important; outline: 2px solid #f9a825; z-index: 1; position: relative; }
.weekly-table td.patient-dim { opacity: 0.3; }

/* Stats bar */
.stats-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 11px; color: var(--muted); background: var(--card); border-bottom: 1px solid var(--border); position: relative; }
/* 웹: 배너 가운데, 모바일: 우측 */
#highlight-banner { position: absolute !important; left: 50%; top: 50%; transform: translate(-50%, -50%); }
@media (max-width: 768px) {
  /* SCHEDULE_VERSIONS_2026_08_30: 모바일에서 '이전버전 PgUp' 이 3줄로 접혀 탭 높이가 커졌다.
     ① 모바일엔 PageUp 키가 없으므로 힌트를 지운다 ② 라벨을 짧게 ③ 모든 탭을 균등 배분. */
  .tab.tab-hist::after { content: none; }
  .tab .lbl-full { display: none; }
  .tab .lbl-short { display: inline; }
  .tab, .tab.tab-hist, .tab.tab-all-half { flex: 1; font-size: 12px; padding: 8px 2px; }

  #highlight-banner { left: auto; right: 8px; transform: translateY(-50%); }
}
.stat { display: flex; align-items: center; gap: 3px; }
.stat-dot { width: 7px; height: 7px; border-radius: 50%; }
.stat-dot.ndt { background: var(--ndt); }
.stat-dot.mat { background: var(--mat); }
.stat-dot.ot { background: var(--ot); }

/* Schedule table */
.schedule-wrap { overflow-y: auto; overflow-x: hidden; padding: 0; max-height: calc(100vh - 130px); }
.schedule-x-scroll { overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; padding: 4px 4px 4px 0; }
.schedule-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 600px; background: var(--card); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.schedule-table th, .schedule-table td { border: 1px solid var(--border); padding: 4px 5px; text-align: center; vertical-align: middle; }
.schedule-table thead th { font-size: 12px; font-weight: 700; white-space: nowrap; position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 4px rgba(0,0,0,0.10); }
.schedule-table thead th.time-hdr { background: #f0f0f0; min-width: 52px; padding: 3px 4px; position: sticky; left: 0; top: 0; z-index: 20; box-shadow: 2px 2px 5px rgba(0,0,0,0.13); }
.schedule-table thead th.ndt-hdr { background: #e3f2fd; color: var(--ndt); }
.schedule-table thead th.mat-hdr { background: #fff3e0; color: var(--mat); }
.schedule-table thead th.ot-hdr { background: #e8f5e9; color: var(--ot); }
.schedule-table td.time-cell { background: #f8f9fa; font-weight: 800; font-size: 12px; color: #333; white-space: nowrap; min-width: 52px; padding: 3px 4px; position: sticky; left: 0; z-index: 5; box-shadow: 2px 0 4px rgba(0,0,0,0.08); }
.schedule-table td.time-cell.pm { background: #fff8e1; }
.schedule-table td.ndt-cell { background: #f5f9ff; font-size: 12px; min-width: 65px; min-height: 44px; height: 44px; word-break: keep-all; }
.schedule-table td.mat-cell { background: #fffaf5; font-size: 12px; min-width: 65px; min-height: 44px; height: 44px; word-break: keep-all; }
.schedule-table td.ot-cell { background: #f5faf6; font-size: 12px; min-width: 65px; min-height: 44px; height: 44px; word-break: keep-all; }
/* 환자 하이라이트 */
.schedule-table td.patient-highlight { background: #fff176 !important; outline: 2px solid #f9a825; z-index: 1; position: relative; }
.schedule-table td.patient-dim { opacity: 0.35; }

.schedule-table td.empty { color: #ddd; }
.schedule-table td.mine { font-weight: 700; background: #e8eaf6 !important; border: 2px solid var(--primary); }

/* Absence */
.absence-section { margin: 8px 4px; padding: 10px; background: #ffebee; border-radius: 8px; }
.absence-section h3 { font-size: 13px; color: var(--danger); margin-bottom: 6px; }
.absence-list { display: flex; flex-wrap: wrap; gap: 4px; }
.absence-tag { padding: 3px 7px; background: #fff; border-radius: 5px; font-size: 12px; color: var(--danger); border: 1px solid #ffcdd2; }

.no-data { text-align: center; padding: 60px 20px; color: var(--muted); font-size: 15px; }

/* Admin */
.admin-panel { padding: 16px; }
.admin-panel h2 { font-size: 17px; margin-bottom: 14px; }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 8px; }
@media (max-width: 600px) { .user-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; } .user-card .name { font-size: 12px; } .user-card .meta { font-size: 11px; } .user-card select { font-size: 11px; padding: 3px 4px; } .user-card .actions button { padding: 3px 6px; font-size: 11px; } }
.user-card { background: var(--card); border-radius: 10px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.user-card .name { font-weight: 700; font-size: 14px; }
.user-card .meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.user-card .actions { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.user-card .actions button { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); font-size: 12px; cursor: pointer; }
.user-card .actions button.approve { background: #e8f5e9; color: var(--ot); border-color: var(--ot); }
.user-card .actions button.reject { background: #ffebee; color: var(--danger); border-color: var(--danger); }
.user-card select { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); font-size: 12px; }
.upload-section { margin-top: 20px; padding: 16px; background: var(--card); border-radius: 10px; }
.upload-section input[type=file] { margin: 8px 0; }

/* Mine tab - personal view */
.my-schedule { padding: 8px; }
.my-slot { display: flex; background: var(--card); border-radius: 10px; margin-bottom: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.my-time { width: 75px; min-width: 75px; padding: 12px 6px; background: #f8f9fa; font-weight: 700; font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--border); text-align: center; }
.my-time.pm { background: #fff8e1; }
.my-patient { flex: 1; padding: 10px 12px; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.my-patient .name { text-align: center; }
.my-patient .memo-icon { color: var(--muted); font-size: 12px; cursor: pointer; margin-left: 8px; }
.my-patient .has-memo { color: var(--primary); }

/* 출석체크 — 노란 border/background 완전 덮어씌우기 */
.schedule-table td.att-checked { position: relative; background: #e3effd !important; border: 2px solid #90bff0 !important; outline: none !important; }
.schedule-table td.att-checked::after { content: '✓'; position: absolute; top: 1px; right: 3px; font-size: 10px; font-weight: 700; color: #5a9de6; pointer-events: none; }
/* HL_OVER_ATTCHECK_2026_07_11: 하이라이트가 출석체크보다 우선 — 출석체크(파랑)된 셀도 하이라이트 시 노랗게(카테고리 무관, OT 포함). ✓·파란 border는 유지. */
.schedule-table td.att-checked.patient-highlight, .weekly-table td.att-checked.patient-highlight { background: #fff176 !important; outline: 2px solid #f9a825 !important; }

/* Memo modal */
.memo-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 200; display: flex; align-items: center; justify-content: center; }
.memo-overlay.memo-top { align-items: flex-start; padding-top: 5vh; }
.memo-overlay.memo-bottom { align-items: flex-end; padding-bottom: 5vh; }
.memo-modal { background: #fff; border-radius: 12px; padding: 20px; width: 90%; max-width: 340px; }

/* 모바일: 메모창 하단/상단 고정 시트 */
@media (max-width: 600px) {
  .memo-overlay {
    top: auto; bottom: 0; left: 0; right: 0;
    height: auto;
    background: transparent;
    align-items: flex-end;
    pointer-events: none;
    z-index: 200;
  }
  /* 오후 환자 → 상단 배치 */
  .memo-overlay.memo-top {
    top: 0; bottom: auto;
    align-items: flex-start;
    padding-top: 0;
  }
  .memo-modal {
    pointer-events: auto;
    width: 100%; max-width: 100%;
    border-radius: 14px 14px 0 0;
    padding: 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.22);
    max-height: 55vh;
    overflow-y: auto;
  }
  .memo-overlay.memo-top .memo-modal {
    border-radius: 0 0 14px 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  }
}
.memo-modal h3 { font-size: 15px; margin-bottom: 8px; }
.memo-modal textarea { width: 100%; height: 80px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; font-size: 14px; resize: none; }
.memo-modal .btns { display: flex; gap: 8px; margin-top: 10px; }
.memo-modal .btns button { flex: 1; padding: 8px; border-radius: 8px; border: none; font-size: 14px; cursor: pointer; }
.memo-modal .btns .save { background: var(--primary); color: #fff; }
.memo-modal .btns .cancel { background: #eee; }
.memo-history { max-height: 200px; overflow-y: auto; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 8px; }
.memo-entry { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; font-size: 12px; }
.memo-entry:last-child { border-bottom: none; }
.memo-entry .meta { color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.memo-entry .text { color: var(--text); }
.memo-entry .del-btn { float: right; color: var(--danger); cursor: pointer; font-size: 11px; }
/* ADMIN_FOLD_2026_05_30: 관리자 섹션 폴더블 (수동전송·전송내역·메모전체목록) */
details.fold-sec:not(.upload-section){ margin-top:16px; border-top:1px solid #eee; padding-top:12px; }
details.fold-sec > summary{ cursor:pointer; list-style:none; font-size:13px; font-weight:700; display:flex; align-items:center; gap:8px; padding:2px 0; }
details.fold-sec > summary::-webkit-details-marker{ display:none; }
details.fold-sec > summary::before{ content:'▶'; font-size:9px; color:#999; flex:0 0 auto; }
details.fold-sec[open] > summary::before{ content:'▼'; }
details.fold-sec .fold-hint{ margin-left:auto; color:#bbb; font-size:11px; font-weight:600; }
details.fold-sec[open] > summary{ margin-bottom:8px; }

/* Pinned memos inside memo-history */
.memo-pinned-section { position: sticky; top: 0; z-index: 2; background: #fffde7; border-bottom: 2px solid #ffd54f; }
.memo-pinned-section .memo-entry { background: #fffde7; border-bottom: 1px solid #fff9c4; }
.memo-pinned-section .memo-entry:last-child { border-bottom: none; }
.pin-btn { cursor: pointer; font-size: 13px; margin-right: 4px; float: right; }
.count-row td { background: #e3f2fd !important; font-weight: 700; font-size: 12px; color: var(--primary); text-align: center; }

.tab.mine { background: #f3efff; color: #7c4dff; }
.tab.mine.active { border-bottom-color: #7c4dff; color: #fff; background: #7c4dff; }

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .schedule-table td, .schedule-table th { padding: 3px 3px; font-size: 11px; }
  .schedule-table td.ndt-cell, .schedule-table td.mat-cell, .schedule-table td.ot-cell { min-width: 55px; min-height: 44px; height: 44px; }
  /* 모바일: 모든 탭에서 시작=굵게, 끝=회색 2줄 표시 */
  /* MAT 탭: 스크롤 없이 화면 맞춤 */
  .tab-mat-active { table-layout: fixed; width: 100%; min-width: unset !important; }
  .tab-mat-active td.mat-cell, .tab-mat-active th.mat-hdr { min-width: unset !important; width: auto; }
  .tab-mat-active .clickable-name { white-space: normal; }
}
/* PWA 설치 배너 */
#pwa-banner {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: #1a73e8; color: #fff;
  padding: 12px 16px; font-size: 13px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.2);
  align-items: center; gap: 10px;
}
#pwa-banner.show { display: flex; }
#pwa-banner .pwa-text { flex: 1; }
#pwa-banner .pwa-text b { display: block; font-size: 14px; }
#pwa-banner .pwa-text span { opacity: 0.85; font-size: 12px; }
#pwa-banner button { padding: 6px 14px; border: none; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; }
#pwa-banner .btn-install { background: #fff; color: #1a73e8; }
#pwa-banner .btn-close { background: transparent; color: rgba(255,255,255,0.7); font-size: 18px; padding: 4px 8px; }
.desktop-only { display: inline; }
@media (max-width: 600px) { .desktop-only { display: none; } }

/* 드래그 셀 선택 */
.schedule-table td.drag-selected { outline: 2px solid #f9a825 !important; background: #fff9c4 !important; }
#drag-count-badge { display:none; position:fixed; bottom:70px; right:16px; z-index:500; background:#333; color:#fff; font-size:13px; font-weight:700; padding:8px 16px; border-radius:20px; box-shadow:0 4px 12px rgba(0,0,0,0.3); pointer-events:none; }
#drag-count-badge.show { display:block; }

/* 특이사항 모달 */
#notices-modal { display:none; position:fixed; inset:0; z-index:3000; background:rgba(0,0,0,0.45); }
#notices-modal.open { display:flex; align-items:center; justify-content:center; padding:16px; }
#notices-modal-box { background:#fff; border-radius:14px; width:100%; max-width:560px; max-height:82vh; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 8px 32px rgba(0,0,0,0.22); }
#notices-modal-box .nm-header { background:var(--primary); color:#fff; padding:12px 16px; display:flex; align-items:center; justify-content:space-between; }
#notices-modal-box .nm-header h2 { font-size:15px; margin:0; }
#notices-modal-body { flex:1; overflow-y:auto; padding:14px; }
.notice-add-form { background:#f8f9ff; border-radius:10px; padding:12px; margin-bottom:14px; border:1px solid #e3e8ff; }
.notice-add-form input[type=text] { width:100%; padding:8px 10px; border:1px solid #ddd; border-radius:8px; font-size:13px; box-sizing:border-box; margin-bottom:8px; }
.notice-add-form textarea { width:100%; padding:8px 10px; border:1px solid #ddd; border-radius:8px; font-size:13px; resize:vertical; min-height:64px; box-sizing:border-box; }
.notice-card { border:1px solid #eee; border-radius:8px; padding:10px 12px; margin-bottom:8px; background:#fff; }
.notice-card .nc-name { font-weight:700; color:#1976d2; font-size:13px; }
.notice-card .nc-text { color:#444; font-size:13px; margin:4px 0; word-break:keep-all; }
.notice-card .nc-meta { font-size:11px; color:#aaa; }
.notice-card .nc-actions { display:flex; gap:6px; margin-top:6px; }
.notice-card .nc-actions button { font-size:11px; padding:3px 10px; border-radius:6px; cursor:pointer; border:1px solid; }
/* REHAB_SMS_HIDE_X_AND_BOHOSA_2026_04_20: 제외 X 버튼 숨김 (기능/핸들러는 보존) */
.sms-x { display: none !important; }
/* THEME_GOLD_2026_07_11: 옵트인 블랙&골드 테마 (기본=미적용). body.theme-gold 일 때만 활성.
   콘텐츠(스케줄표)는 가독성 위해 밝게 유지, 헤더/탭/버튼 액센트만 블랙&골드 고급 톤. */
body.theme-gold {
  --primary: #9a7b1f;      /* 골드 액센트(버튼·링크·활성탭) */
  --bg: #f6f2e9;           /* 웜 아이보리 배경 */
  --border: #e4d9c0;
}
body.theme-gold .header {
  background: linear-gradient(90deg, #0b0b0c 0%, #1d1a12 55%, #0b0b0c 100%);
  color: #e9c96a;
  border-bottom: 1px solid #c9a227;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
body.theme-gold .header h1,
body.theme-gold .header .current-date,
body.theme-gold .header .user-name { color: #eccf78; }
body.theme-gold .header .hbtn {
  background: rgba(201,162,39,0.14);
  color: #eccf78;
  border: 1px solid rgba(201,162,39,0.5);
}
body.theme-gold .header .hbtn:hover { background: rgba(201,162,39,0.28); }
body.theme-gold .tabs { border-bottom: 1px solid #d8c9a4; box-shadow: 0 1px 0 #c9a227; }
body.theme-gold .stat-dot { box-shadow: 0 0 0 1px rgba(201,162,39,0.4); }
/* 로그인 화면 골드 톤 */
body.theme-gold .auth-container { border: 1px solid #e4d9c0; box-shadow: 0 8px 28px rgba(120,95,20,0.18); }
body.theme-gold .auth-container h2 { color: #9a7b1f; }

/* THEME_GOLD_CONTENT_2026_07_11 v2: 콘텐츠 전면 골드 톤(부서 구분색·하이라이트·출석체크 유지, 가독성 우선) */
body.theme-gold { --card: #fdf9ee; --border: #e3d5ae; }
body.theme-gold .tab:not(.ndt):not(.mat):not(.ot):not(.wn):not(.wo):not(.mine) { background: #f0e8d0; color: #8a7433; }
body.theme-gold .tab.active:not(.ndt):not(.mat):not(.ot):not(.wn):not(.wo):not(.mine) { background: #fdf9ee; color: var(--primary); box-shadow: 0 4px 12px rgba(154,123,31,0.28); }
body.theme-gold .schedule-table thead th.time-hdr,
body.theme-gold .weekly-table thead th:first-child { background: #eadfc0; }
body.theme-gold .schedule-table td.time-cell,
body.theme-gold .weekly-table td:first-child { background: #f3ecdb; color: #5c4a1a; box-shadow: 2px 0 4px rgba(120,95,20,0.12); }
body.theme-gold .schedule-table td.time-cell.pm,
body.theme-gold .weekly-table td.pm-time { background: #efe0b8; }
body.theme-gold .schedule-table td.ndt-cell { background: #f7f4e6; }
body.theme-gold .schedule-table td.mat-cell { background: #faf2df; }
body.theme-gold .schedule-table td.ot-cell { background: #f4f4e2; }
body.theme-gold .schedule-table td.empty { color: #d9cba0; }
body.theme-gold .my-time { background: #f3ecdb; color: #7a6530; }
body.theme-gold .my-time.pm { background: #efe0b8; }
body.theme-gold .memo-modal,
body.theme-gold #notices-modal-box,
body.theme-gold .notice-card { background: #fdf9ee; }
body.theme-gold .stats-bar { border-bottom: 1px solid #d8c9a4; }
body.theme-gold .no-data { color: #9a8a5f; }

/* THEME_PINK_2026_07_11: 옵트인 핑크 테마 (기본 미적용). body.theme-pink 로만 활성. 밝고 부드러운 로즈 톤. */
body.theme-pink {
  --primary: #c2185b;      /* 로즈 액센트 */
  --bg: #fdf2f6;           /* 연핑크 배경 */
  --border: #f3d4e0;
}
body.theme-pink .header {
  background: linear-gradient(90deg, #d81b60 0%, #ad1457 55%, #d81b60 100%);
  color: #fff;
  border-bottom: 1px solid #f8bbd0;
  box-shadow: 0 2px 12px rgba(173,20,87,0.28);
}
body.theme-pink .header h1,
body.theme-pink .header .current-date,
body.theme-pink .header .user-name { color: #fff; }
body.theme-pink .header .hbtn {
  background: rgba(255,255,255,0.16);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
}
body.theme-pink .header .hbtn:hover { background: rgba(255,255,255,0.3); }
body.theme-pink .tabs { border-bottom: 1px solid #f3c9db; box-shadow: 0 1px 0 #f06292; }
body.theme-pink .stat-dot { box-shadow: 0 0 0 1px rgba(216,27,96,0.35); }
/* THEME_PINK_CONTENT_2026_07_11: 콘텐츠 전면 핑크 톤(부서 구분색·하이라이트·출석체크 유지) */
body.theme-pink { --card: #fff6fa; }
body.theme-pink .tab:not(.ndt):not(.mat):not(.ot):not(.wn):not(.wo):not(.mine) { background: #fae1ec; color: #ad4d74; }
body.theme-pink .tab.active:not(.ndt):not(.mat):not(.ot):not(.wn):not(.wo):not(.mine) { background: #fff6fa; color: var(--primary); box-shadow: 0 4px 12px rgba(194,24,91,0.28); }
body.theme-pink .schedule-table thead th.time-hdr,
body.theme-pink .weekly-table thead th:first-child { background: #f6d7e4; }
body.theme-pink .schedule-table td.time-cell,
body.theme-pink .weekly-table td:first-child { background: #fce4ec; color: #880e4f; }
body.theme-pink .schedule-table td.time-cell.pm,
body.theme-pink .weekly-table td.pm-time { background: #f8cadb; }
body.theme-pink .schedule-table td.ndt-cell { background: #f7eef6; }
body.theme-pink .schedule-table td.mat-cell { background: #fdf0ee; }
body.theme-pink .schedule-table td.ot-cell { background: #faf0f4; }
body.theme-pink .schedule-table td.empty { color: #e8c7d6; }
body.theme-pink .my-time { background: #fce4ec; color: #ad4d74; }
body.theme-pink .my-time.pm { background: #f8cadb; }
body.theme-pink .memo-modal,
body.theme-pink #notices-modal-box,
body.theme-pink .notice-card { background: #fff6fa; }
body.theme-pink .no-data { color: #b3798f; }
body.theme-pink .auth-container { border: 1px solid #f3d4e0; box-shadow: 0 8px 28px rgba(173,20,87,0.15); }
body.theme-pink .auth-container h2 { color: #c2185b; }

/* THEME_BLACK_2026_07_21: 블랙&골드 (Understand-Anything 톤) — near-black 배경 + 뮤트 골드 액센트 + 웜 오프화이트 텍스트. body.theme-black 로만 활성. 기존 골드(theme-gold, 아이보리)와 별개. */
body.theme-black {
  --primary: #d4af5a;
  --bg: #0e0e10;
  --border: #2a2a30;
  --card: #16161a;
  background: #0e0e10;
  color: #e9e3d5;
}
body.theme-black .header {
  background: linear-gradient(90deg, #0a0a0b 0%, #17140d 55%, #0a0a0b 100%);
  color: #e2c274;
  border-bottom: 1px solid #c9a24b;
  box-shadow: 0 2px 14px rgba(0,0,0,0.6);
}
body.theme-black .header h1,
body.theme-black .header .current-date,
body.theme-black .header .user-name { color: #e2c274; }
body.theme-black .header .hbtn {
  background: rgba(201,162,75,0.12);
  color: #e2c274;
  border: 1px solid rgba(201,162,75,0.45);
}
body.theme-black .header .hbtn:hover { background: rgba(201,162,75,0.26); }
body.theme-black .tabs { background: #0e0e10; border-bottom: 1px solid #2a2a30; box-shadow: 0 1px 0 #c9a24b; }
body.theme-black .stats-bar { background: #0e0e10; border-bottom: 1px solid #2a2a30; color: #cfc8b8; }
body.theme-black .stat-dot { box-shadow: 0 0 0 1px rgba(201,162,75,0.4); }
body.theme-black .no-data { color: #8a8272; }
/* 탭(카테고리 색은 유지, 나머지만 다크) */
body.theme-black .tab:not(.ndt):not(.mat):not(.ot):not(.wn):not(.wo):not(.mine) { background: #1a1a1d; color: #b8b0a0; }
body.theme-black .tab.active:not(.ndt):not(.mat):not(.ot):not(.wn):not(.wo):not(.mine) { background: #26221a; color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
/* 시간표 그리드 (다크 + 골드 헤더 + 밝은 텍스트) */
body.theme-black .schedule-table,
body.theme-black .weekly-table { background: #16161a; color: #e9e3d5; }
body.theme-black .schedule-table th,
body.theme-black .schedule-table td,
body.theme-black .weekly-table th,
body.theme-black .weekly-table td { border-color: #2a2a30; color: #e4ddce; }
body.theme-black .schedule-table thead th,
body.theme-black .weekly-table thead th { background: #1c1a14; color: #e2c274; }
body.theme-black .schedule-table td.time-cell,
body.theme-black .weekly-table td:first-child { background: #1a1a1d; color: #d4af5a; box-shadow: 2px 0 4px rgba(0,0,0,0.4); }
body.theme-black .schedule-table td.time-cell.pm,
body.theme-black .weekly-table td.pm-time { background: #201d16; }
body.theme-black .schedule-table td.ndt-cell { background: #12161a; }
body.theme-black .schedule-table td.mat-cell { background: #1a1512; }
body.theme-black .schedule-table td.ot-cell { background: #15181a; }
body.theme-black .schedule-table td.empty { color: #46433c; }
body.theme-black .clickable-name,
body.theme-black .schedule-table td span,
body.theme-black .weekly-table td span { color: #ece6d8; }
body.theme-black .my-time { background: #1a1a1d; color: #d4af5a; }
body.theme-black .my-time.pm { background: #201d16; }
/* 모달·카드·로그인 */
body.theme-black .memo-modal,
body.theme-black #notices-modal-box,
body.theme-black .notice-card { background: #16161a; color: #e9e3d5; border-color: #2a2a30; }
body.theme-black .auth-container { background: #16161a; border: 1px solid #2a2a30; box-shadow: 0 8px 28px rgba(0,0,0,0.6); color: #e9e3d5; }
body.theme-black .auth-container h2 { color: #d4af5a; }
/* THEME_BLACK 사이드바(#rm-sidebar 인라인 흰색 오버라이드) */
body.theme-black #rm-sidebar { background: #141418; border-right-color: #2a2a30; box-shadow: 2px 0 10px rgba(0,0,0,.5); }
body.theme-black #rm-sidebar .rms-head { color: #e2c274; border-bottom-color: #2a2a30; }
body.theme-black #rm-sidebar .rms-head .rms-collapse { background: #23232a; color: #cfc8b8; }
body.theme-black #rm-sidebar .rms-head .rms-collapse:hover { background: #2e2e38; }
body.theme-black #rm-sidebar .rms-item { color: #d2ccbe; }
body.theme-black #rm-sidebar .rms-item:hover { background: #23201a; }
body.theme-black #rm-sidebar .rms-item.active { background: #2a2418; color: #e2c274; font-weight: 700; }
body.theme-black #rm-sidebar .rms-sec { color: #7d766a; }
body.theme-black #rm-sidebar-toggle { background: #1a1a1d; color: #e2c274; border-color: #2a2a30; }

/* ===== THEME_BLACK 전면 셀 색상 감사 (고급·권위 블랙&골드) — 인라인 색 !important 제압 ===== */
/* 하이라이트: 노랑 → 딥 골드 글로우 */
body.theme-black .schedule-table td.patient-highlight,
body.theme-black .weekly-table td.patient-highlight { background: #33290f !important; outline: 2px solid #d4af5a !important; color: #f4ecd8 !important; }
body.theme-black .schedule-table td.patient-highlight .clickable-name,
body.theme-black .weekly-table td.patient-highlight { color: #f6eeda !important; }
body.theme-black .schedule-table td.patient-dim,
body.theme-black .weekly-table td.patient-dim { opacity: 0.22; }
/* 출석체크(✓): 연파랑 → 딥 틸 + 그린 체크 */
body.theme-black .schedule-table td.att-checked { background: #14201a !important; border: 1px solid #3f6b52 !important; }
body.theme-black .schedule-table td.att-checked::after { color: #74c69a !important; }
body.theme-black .schedule-table td.att-checked.patient-highlight,
body.theme-black .weekly-table td.att-checked.patient-highlight { background: #33290f !important; outline: 2px solid #d4af5a !important; }
/* 본인(mine): 연라벤더 → 다크 + 골드 테두리 */
body.theme-black .schedule-table td.mine { background: #1c1b26 !important; border: 2px solid #d4af5a !important; color: #ece6d8 !important; }
body.theme-black .tab.mine { background: #241f2e; color: #c9b3ff; }
body.theme-black .tab.mine.active { background: #4a3d78; color: #fff; }
/* 드래그 선택: 연노랑 → 딥 골드 */
body.theme-black .schedule-table td.drag-selected { background: #2f2712 !important; outline: 2px solid #d4af5a !important; }
/* 점심시간: 밝은 주황 → 뮤트 다크 골드 바 */
body.theme-black .lunch-bar { background: linear-gradient(90deg,#1a1710 0%,#2b2214 50%,#1a1710 100%) !important; color: #e2c274 !important; box-shadow: inset 0 0 0 1px rgba(201,162,75,.22) !important; }
/* 오전/오후 해제: 연노랑 → 다크 앰버 */
body.theme-black .schedule-table td.clear-cell { background: #241d10 !important; color: #e0a94a !important; }
/* count(인원): 연파랑 → 다크 골드텍스트 */
body.theme-black .schedule-table td.count-cell { background: #14181f !important; color: #d4af5a !important; }
/* 결석: 연빨강 → 다크 크림슨 틴트 */
body.theme-black .schedule-table td.absent-hdr { background: #251316 !important; color: #e28585 !important; }
body.theme-black .schedule-table td.absent-cell { background: #1d1315 !important; color: #e29494 !important; }
/* 변경 셀: 연노랑+노랑테두리 → 딥 골드 강조 */
body.theme-black .schedule-table td.cell-changed { background: #2a2210 !important; border: 2px solid #d4af5a !important; color: #f0e6cf !important; }
/* 태그색(엑셀 파스텔) 셀: 다크 중립 틴트로 완화(가독성 우선) */
body.theme-black .schedule-table td.td-tinted { background: #1b1b20 !important; color: #e4ddce !important; }
/* 시간표 헤더/시간 셀 */
body.theme-black .schedule-table th.time-hdr { background: #1c1a14 !important; color: #e2c274 !important; }
body.theme-black .schedule-table td.time-cell { background: #1a1a1d !important; color: #d4af5a !important; }
body.theme-black .schedule-table td.time-cell.pm { background: #201d16 !important; }
/* 주간표(WN/WO) 시간/셀 */
body.theme-black .weekly-table td.pm-time { background: #201d16 !important; color: #d4af5a !important; }
/* 하이라이트 배너(인라인 흰색) */
body.theme-black #highlight-banner { background: rgba(28,26,20,0.96) !important; color: #e9e3d5 !important; border: 1px solid rgba(201,162,75,.4) !important; }
/* 프로필 메뉴(인라인 흰색) */
body.theme-black #profileMenu { background: #16161a !important; border-color: #2a2a30 !important; }
body.theme-black #profileMenu > div { color: #d8d2c4 !important; border-bottom-color: #2a2a30 !important; }

/* ===== THEME_BLACK 상부 탭(NDT/MAT/OT/WN/WO) 다크 + 카테고리 색 액센트 ===== */
body.theme-black .tab.ndt { background: #111a24 !important; color: #6fb3f0 !important; box-shadow: none !important; }
body.theme-black .tab.mat { background: #201810 !important; color: #e79a5a !important; box-shadow: none !important; }
body.theme-black .tab.ot  { background: #101d15 !important; color: #6cc48a !important; box-shadow: none !important; }
body.theme-black .tab.wn  { background: #14141f !important; color: #8f9ae0 !important; box-shadow: none !important; }
body.theme-black .tab.wo  { background: #0f1a19 !important; color: #4db8ae !important; box-shadow: none !important; }
body.theme-black .tab.ndt.active { background: #1976d2 !important; color: #fff !important; box-shadow: 0 3px 10px rgba(25,118,210,.5) !important; }
body.theme-black .tab.mat.active { background: #c05f1a !important; color: #fff !important; box-shadow: 0 3px 10px rgba(192,95,26,.5) !important; }
body.theme-black .tab.ot.active  { background: #2e7d32 !important; color: #fff !important; box-shadow: 0 3px 10px rgba(46,125,50,.5) !important; }
body.theme-black .tab.wn.active  { background: #283593 !important; color: #fff !important; box-shadow: 0 3px 10px rgba(40,53,147,.5) !important; }
body.theme-black .tab.wo.active  { background: #00695c !important; color: #fff !important; box-shadow: 0 3px 10px rgba(0,105,92,.5) !important; }

/* ===== THEME_BLACK 카테고리 컬럼 그룹 구별 강화 (NDT/MAT/OT) — 셀·헤더 틴트 ===== */
/* 헤더: 카테고리별 다크 틴트 + 색 글자 */
body.theme-black .schedule-table thead th.ndt-hdr { background: #0f1926 !important; color: #7fb3ea !important; }
body.theme-black .schedule-table thead th.mat-hdr { background: #221810 !important; color: #e79a5a !important; }
body.theme-black .schedule-table thead th.ot-hdr  { background: #0f2016 !important; color: #6cc48a !important; }
/* 셀: 그룹이 눈에 띄게 (파랑/주황/초록 기운의 다크) */
body.theme-black .schedule-table td.ndt-cell { background: #0e151f !important; }
body.theme-black .schedule-table td.mat-cell { background: #1b140d !important; }
body.theme-black .schedule-table td.ot-cell  { background: #0e1a12 !important; }
/* 그룹 경계 살짝 강조(왼쪽 얇은 라인) */
body.theme-black .schedule-table td.ndt-cell { box-shadow: inset 1px 0 0 rgba(111,179,240,.07); }
body.theme-black .schedule-table td.mat-cell { box-shadow: inset 1px 0 0 rgba(231,154,90,.07); }
body.theme-black .schedule-table td.ot-cell  { box-shadow: inset 1px 0 0 rgba(108,196,138,.07); }

/* ===== THEME_BLACK 주간표(WN/WO weekly-table) 전면 다크 — 구조는 다크, 색칠된 환자셀(데이터)은 유지 ===== */
body.theme-black .weekly-table { background: #16161a; }
body.theme-black .weekly-table th,
body.theme-black .weekly-table td { border-color: #2a2a30 !important; }
/* 시간 헤더(#f0f0f0) + 치료사(#f8f9fa) */
body.theme-black .weekly-table th[style*="background:#f0f0f0"] { background: #1c1a14 !important; color: #e2c274 !important; }
body.theme-black .weekly-table td[style*="background:#f8f9fa"] { background: #1c1a14 !important; color: #b8b0a0 !important; }
/* 요일 헤더 (wn-hdr/wo-hdr) */
body.theme-black .weekly-table thead th.wn-hdr { background: #171727 !important; color: #9aa4e8 !important; }
body.theme-black .weekly-table thead th.wo-hdr { background: #0f1c1b !important; color: #5cc7bd !important; }
/* 시간 셀 (am #fff / pm #fff8e1) */
body.theme-black .weekly-table td[style*="background:#fff"] { background: #1a1a1d !important; color: #d4af5a !important; }
body.theme-black .weekly-table td.pm-time,
body.theme-black .weekly-table td[style*="background:#fff8e1"] { background: #201d16 !important; color: #d4af5a !important; }
/* 합계 행 (#c5cae9 WN / #b2dfdb WO) */
body.theme-black .weekly-table tr[style*="background:#c5cae9"] td,
body.theme-black .weekly-table tr[style*="background:#b2dfdb"] td { background: #1c1a14 !important; color: #e2c274 !important; }
body.theme-black .weekly-table tr[style*="background:#c5cae9"] td:first-child,
body.theme-black .weekly-table tr[style*="background:#b2dfdb"] td:first-child { color: #e2c274 !important; }
/* 빈(색 없는) WN/WO 셀만 다크; 색칠된 셀은 인라인색 유지(데이터) */
body.theme-black .weekly-table td.wn-cell:not([style*="background"]),
body.theme-black .weekly-table td.wo-cell:not([style*="background"]) { background: #16161a !important; color: #e6dfd0 !important; }
/* 색칠 셀 텍스트는 진하게(밝은 파스텔 위 가독성) */
body.theme-black .weekly-table td.wn-cell[style*="background"],
body.theme-black .weekly-table td.wo-cell[style*="background"] { color: #1a1a1a !important; }

/* ===== THEME_BLACK 색셀(--wxc) 표현 방식 = 다크 틴트 + 좌측 색 바 + 밝은 글자 =====
   엑셀/WNWO 색을 '밝은 배경'으로 쓰지 않고, color-mix로 어둡게 섞어 배경 + 왼쪽 색 액센트로.
   → 색 의미(hue) 보존 · 그리드 다크 유지 · 글자 가독성. (color-mix 미지원 구브라우저는 인라인 배경으로 폴백) */
body.theme-black .weekly-table td.wn-cell[style*="--wxc"],
body.theme-black .weekly-table td.wo-cell[style*="--wxc"],
body.theme-black .schedule-table td.td-tinted[style*="--wxc"],
body.theme-black .schedule-table td.ndt-cell[style*="--wxc"],
body.theme-black .schedule-table td.mat-cell[style*="--wxc"],
body.theme-black .schedule-table td.ot-cell[style*="--wxc"] {
  background: color-mix(in srgb, var(--wxc) 22%, #141419) !important;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--wxc) 80%, #141419) !important;
  color: #efe9db !important;
}
/* 색셀 안의 이름/텍스트도 밝게 */
body.theme-black .weekly-table td[style*="--wxc"] .clickable-name,
body.theme-black .schedule-table td[style*="--wxc"] .clickable-name,
body.theme-black .weekly-table td[style*="--wxc"] span,
body.theme-black .schedule-table td[style*="--wxc"] span { color: #f2ecde !important; }
/* 본인 뷰 색칩도 동일 처리 */
body.theme-black .my-patient .name[style*="--wxc"] {
  background: color-mix(in srgb, var(--wxc) 26%, #141419) !important;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--wxc) 80%, #141419);
  color: #efe9db !important;
}

/* THEME_BLACK 주간표 글자 톤다운 — near-white가 너무 튀어서 부드러운 웜 그레이로(가독성 유지) */
body.theme-black .weekly-table td.wn-cell[style*="--wxc"],
body.theme-black .weekly-table td.wo-cell[style*="--wxc"],
body.theme-black .weekly-table td.wn-cell:not([style*="background"]),
body.theme-black .weekly-table td.wo-cell:not([style*="background"]) { color: #beb8a9 !important; }
body.theme-black .weekly-table td[style*="--wxc"] span,
body.theme-black .weekly-table td[style*="--wxc"] .clickable-name,
body.theme-black .weekly-table td span { color: #c2bcad !important; }

/* 셀 메모/특이사항 아이콘 축소 — 이름+아이콘 한 줄 유지 */
.cell-ico{font-size:8px;vertical-align:1px;margin:0 2px;letter-spacing:0}

/* SCHEDULE_VERSIONS_2026_08_29 — 시간표 변경 이력 오버레이 */
.sh-ov{position:fixed;inset:0;background:rgba(15,25,45,.55);display:none;align-items:flex-start;justify-content:center;z-index:9000;padding:24px 10px;overflow:auto}
.sh-ov.on{display:flex}
.sh-box{background:#fff;border-radius:16px;width:100%;max-width:560px;box-shadow:0 24px 60px -16px rgba(10,30,70,.5);overflow:hidden}
.sh-hd{display:flex;align-items:center;gap:8px;background:#5d4037;color:#fff;padding:11px 14px;font-weight:800;font-size:15px}
.sh-hd .sh-x{margin-left:auto;background:none;border:none;color:#fff;font-size:19px;cursor:pointer;line-height:1}
.sh-body{padding:12px 14px 16px;max-height:76vh;overflow:auto}
.sh-msg{padding:18px;text-align:center;color:#78909c;font-size:13px}
.sh-msg.err{color:#c62828}
.sh-msg.ok{color:#2e7d32;font-weight:700}
.sh-cal-hd{display:flex;align-items:center;justify-content:center;gap:14px;font-size:15px;margin-bottom:4px}
.sh-nav{border:1px solid #d9e0ea;background:#f7f9fc;border-radius:8px;width:30px;height:28px;font-size:17px;cursor:pointer;line-height:1}
.sh-legend{text-align:center;font-size:11px;color:#90a4ae;margin-bottom:8px}
.sh-legend .dot{display:inline-block;width:9px;height:9px;border-radius:50%;vertical-align:middle;margin-right:3px}
.sh-legend .dot.on{background:#5d4037}
.sh-legend .dot.off{background:#e0e0e0}
.sh-cal{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.sh-wd{text-align:center;font-size:11px;font-weight:800;color:#78909c;padding:3px 0}
.sh-wd.sun{color:#e53935}.sh-wd.sat{color:#1e88e5}
.sh-d{position:relative;height:44px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-size:14px}
.sh-d.empty{background:none}
/* 이력이 있는 날만 굵게·진하게. 없는 날은 흐리게 — 누를 수 있는 날이 한눈에 보이게. */
.sh-d.has{background:#efe7de;color:#4e342e;font-weight:900;cursor:pointer;border:2px solid #bcaaa4}
.sh-d.has:hover{background:#e0d3c6}
.sh-d.none{background:#fafafa;color:#c9d0d8;font-weight:400}
.sh-d.today{outline:2px solid #1565c0;outline-offset:-2px}
.sh-d .cnt{position:absolute;top:2px;right:5px;font-size:9px;font-weight:800;color:#8d6e63}
.sh-back{display:inline-block;font-size:12px;color:#5d4037;cursor:pointer;margin-bottom:8px;font-weight:700}
.sh-sub{font-size:14px;font-weight:800;margin-bottom:8px;color:#37474f}
.sh-sub .mono{font-weight:600;color:#78909c}
.sh-ver{display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px solid #e6e9ee;border-radius:10px;margin-bottom:6px;cursor:pointer;background:#fbfcfe}
.sh-ver:hover{background:#f1f5fb;border-color:#c9d6e8}
.sh-ver .tm{font-weight:900;font-size:14px;color:#37474f;min-width:46px}
.sh-ver .tm2{font-weight:700;font-size:13px;color:#607d8b;min-width:42px}
.sh-ver .src{font-size:12px;color:#78909c}
.sh-ver .au{font-size:11px;color:#90a4ae}
.sh-ver .latest{margin-left:auto;font-size:10px;font-weight:800;color:#fff;background:#43a047;border-radius:6px;padding:2px 6px}
.sh-tot{font-size:12px;color:#78909c;margin-bottom:8px}
.sh-sect{margin-bottom:10px}
.sh-sect-t{font-size:12px;font-weight:800;margin-bottom:4px;padding:2px 6px;border-radius:6px;display:inline-block}
.sh-sect.add .sh-sect-t{background:#e8f5e9;color:#2e7d32}
.sh-sect.del .sh-sect-t{background:#ffebee;color:#c62828}
.sh-sect.chg .sh-sect-t{background:#fff8e1;color:#ef6c00}
.sh-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12.5px;padding:4px 6px;border-bottom:1px solid #f2f4f7}
.sh-row .loc{color:#78909c;min-width:132px}
.sh-row .bef{color:#c62828;text-decoration:line-through}
.sh-row .aft{color:#2e7d32;font-weight:700}
.sh-row .arw{color:#90a4ae}

/* SCHEDULE_VERSIONS_2026_08_29 — 과거 버전을 현재와 같은 격자로 보여준다 */
.sh-ov.wide .sh-box{max-width:96vw}
.shg-wrap{overflow:auto;max-height:60vh;border:1px solid #e3e8ef;border-radius:10px}
.shg{border-collapse:collapse;width:100%;font-size:11.5px;table-layout:auto}
.shg th,.shg td{border:1px solid #e3e8ef;padding:3px 5px;text-align:center;white-space:nowrap}
.shg th{background:#eef3f9;color:#1a3d66;font-weight:800;position:sticky;top:0;z-index:2}
.shg th.ndt{background:#eaf1fb}.shg th.mat{background:#fdeeea}.shg th.ot{background:#eaf6ec}
.shg td.tm,.shg th.tm{background:#f6f8fb;color:#546e7a;font-weight:800;position:sticky;left:0;z-index:1;min-width:46px}
.shg th.col-gone{background:#ffebee;color:#c62828}
.shg th.col-new{background:#e8f5e9;color:#2e7d32}
.shg th .ct{display:block;font-size:9px;font-weight:800}
.shg tr.row-gone td{opacity:.55}
/* 변경 칸 — 과거 기준 격자 위에 지금 무엇이 달라졌는지 얹는다 */
.shg td.c-del{background:#ffe9e9}
.shg td.c-add{background:#e6f6e9}
.shg td.c-chg{background:#fff4e0}
.shg td .bef{color:#c62828;text-decoration:line-through}
.shg td .aft{color:#1b5e20;font-weight:800;display:block}
.shg td.c-chg .aft::before{content:'→ ';color:#ef6c00;text-decoration:none}
.shg td .tag{display:block;font-size:8.5px;font-weight:800;color:#2e7d32}
.shg-legend{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:6px 0 8px;font-size:11.5px}
.shg-legend .lg{padding:2px 8px;border-radius:7px;font-weight:800}
.shg-legend .lg.c-del{background:#ffe9e9;color:#c62828}
.shg-legend .lg.c-add{background:#e6f6e9;color:#2e7d32}
.shg-legend .lg.c-chg{background:#fff4e0;color:#ef6c00}
.shg-legend .lg.tot{background:#eceff1;color:#546e7a}
.shg-legend .lg.toggle{margin-left:auto;background:#e3eefb;color:#1565c0;cursor:pointer}

/* SCHEDULE_VERSIONS_2026_08_29 — 과거 버전을 현재 시간표 위에 덮어씌워 볼 때 */
#shv-bar{position:fixed;left:50%;transform:translateX(-50%);bottom:14px;z-index:9500;display:none;
  align-items:center;gap:10px;background:#3e2723;color:#fff;padding:9px 14px;border-radius:12px;
  box-shadow:0 10px 30px -8px rgba(0,0,0,.55);font-size:13px;max-width:96vw;flex-wrap:wrap}
#shv-bar.on{display:flex}
#shv-bar .t{font-weight:800;color:#ffcc80}
#shv-bar b{font-size:14px;letter-spacing:.3px}
#shv-bar .latest{background:#43a047;border-radius:6px;padding:2px 7px;font-size:11px;font-weight:800}
#shv-bar .pos{background:#5d4037;border-radius:6px;padding:2px 7px;font-size:11px;font-weight:700}
#shv-bar .chg{color:#d7ccc8;font-size:12px}
#shv-bar .nav{cursor:pointer;background:#5d4037;border-radius:8px;padding:4px 10px;font-weight:800}
#shv-bar .nav:hover{background:#6d4c41}
#shv-bar .exit{cursor:pointer;background:#c62828;border-radius:8px;padding:4px 10px;font-weight:800;margin-left:4px}
/* 현재 시간표 칸 위에 얹는 변경 표시 */
td.shv-del{background:#ffe3e3 !important;position:relative}
td.shv-del::after{content:'';position:absolute;left:6%;right:6%;top:50%;height:2px;background:#c62828}
td.shv-add{background:#e3f6e6 !important}
td.shv-chg{background:#fff3df !important}
.shv-now{display:block;font-size:9.5px;font-weight:800;color:#1b5e20;line-height:1.15;margin-top:1px}
td.shv-chg .shv-now{color:#e65100}
.sh-ver .ago{margin-left:auto;font-size:10px;color:#90a4ae;font-weight:700}
.sh-ver .tm2.dim{color:#b0bec5;font-weight:600;font-size:11.5px}
#sh-toast{position:fixed;left:50%;transform:translateX(-50%);bottom:70px;z-index:9600;
  background:#37474f;color:#fff;padding:9px 16px;border-radius:10px;font-size:13px;font-weight:700;
  box-shadow:0 8px 24px -6px rgba(0,0,0,.5);opacity:0;pointer-events:none;transition:.2s}
#sh-toast.on{opacity:1}
/* 이전버전 탭에 키 힌트 */
.tab.tab-hist::after{content:' PgUp';font-size:9px;opacity:.55;font-weight:700}

/* SCHEDULE_VERSIONS_2026_08_30 — 모바일 탭 오버라이드는 반드시 파일 끝에.
   같은 특이도라면 나중에 선언된 규칙이 이긴다. 앞쪽 미디어쿼리에 두면
   뒤에 추가된 `.tab.tab-hist::after` 힌트가 그대로 살아난다(실제 발생). */
@media (max-width: 768px) {
  .tab.tab-hist::after { content: none !important; }
  .tab .lbl-full { display: none; }
  .tab .lbl-short { display: inline; }
  .tab, .tab.tab-hist, .tab.tab-all-half { flex: 1; font-size: 12px; padding: 8px 2px; }
}
