/* 병원 예약 — 또리 디자인 v4 (샘플 목업 매칭) */
:root {
  --primary: #129c8d;
  --primary-dark: #0e7f74;
  --primary-deep: #0a4f4c;
  --primary-soft: #e3f6f1;
  --mint: #8fe3d0;
  --mint-mid: #3fc1ac;
  --mint-line: #bfebdf;
  --mint-border: #7fd8c4;
  --bg: #f7f6f2;
  --card: #ffffff;
  --text: #16302f;
  --muted: #687d7b;
  --line: #e4ece9;
  --danger: #d64545;
  --radius: 24px;
  --shadow: 0 16px 36px rgba(23, 110, 98, .14);
  --shadow-sm: 0 8px 20px rgba(23, 110, 98, .10);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Apple SD Gothic Neo", "Noto Sans KR",
               "Malgun Gothic", "맑은 고딕", sans-serif;
  font-size: 19px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* 상단 브랜드 바 */
.brandbar {
  background: linear-gradient(150deg, #b9f0da 0%, #63d6b6 48%, #25b3a2 100%);
  color: var(--primary-deep);
  padding: calc(26px + env(safe-area-inset-top)) 0 46px;
  border-radius: 0 0 40px 40px;
  box-shadow: 0 14px 34px rgba(20, 120, 110, .20);
  position: sticky; top: 0; z-index: 10;
}
.brandbar-inner {
  max-width: 640px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 12px;
}
.brandmark {
  width: 62px; height: 62px; border-radius: 20px; flex: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%238fe3c8'/%3E%3Cstop offset='1' stop-color='%232fbfa8'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='35' y='12' width='30' height='76' rx='15' fill='url(%23g)'/%3E%3Crect x='12' y='35' width='76' height='30' rx='15' fill='url(%23g)'/%3E%3C/svg%3E") center / 62% no-repeat;
  color: var(--mint-mid);
  box-shadow: 0 8px 20px rgba(10, 79, 76, .18);
  display: flex; align-items: center; justify-content: center;
  font-size: 0;
}
.brandbar h1 { font-size: 32px; margin: 0; flex: 1; letter-spacing: -1px; color: var(--primary-deep); }
.brandbar .back {
  color: var(--primary-deep); text-decoration: none; font-size: 18px; font-weight: 700;
  background: rgba(255,255,255,.55);
  border: 2px solid rgba(255,255,255,.75); border-radius: 999px;
  padding: 8px 16px; white-space: nowrap;
}
.brandbar .back:active { background: rgba(255,255,255,.85); }

.wrap { max-width: 640px; margin: 0 auto; padding: 26px 16px 48px; }

.lead { font-size: 23px; font-weight: 800; margin: 6px 0 14px; letter-spacing: -.5px; }
.lead .sub { display: block; font-size: 18px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.center { text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 34px 0; font-size: 20px; }
.note { color: var(--muted); font-size: 17px; }

/* 단계 표시 */
.steps { display: flex; align-items: center; margin: 4px 0 16px; }
.step { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--muted); }
.step .dot {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: #fff; border: 2px solid var(--mint-line); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.step.on { color: var(--primary-dark); }
.step.on .dot { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(18, 156, 141, .25); }
.step.done .dot { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.step-line { flex: 1; height: 2px; background: var(--mint-line); margin: 0 8px; border-radius: 2px; }

/* 카드 */
.cards { display: flex; flex-direction: column; gap: 16px; margin: 16px 0; }
.card {
  display: block; background: var(--card); border-radius: 28px;
  padding: 22px; text-decoration: none; color: inherit;
  box-shadow: var(--shadow);
  border: none;
  position: relative;
}
a.card:active { background: var(--primary-soft); }
.card-name { display: flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.5px; }
.card-name::before {
  content: ""; font-size: 34px; font-weight: 800; color: var(--mint-mid);
  flex: none;
  width: 60px; height: 60px; border-radius: 50%;
  background-color: #e1f7ee;
  background-image: var(--icn, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect x='34' y='10' width='32' height='80' rx='12' fill='%230b8577'/%3E %3Crect x='10' y='34' width='80' height='32' rx='12' fill='%230b8577'/%3E %3Crect x='42' y='42' width='16' height='16' rx='4' fill='%235ed0bc'/%3E%3C/svg%3E")), linear-gradient(150deg, #f2fcf8 0%, #d3f1e7 100%);
  background-position: center; background-size: 58%, 100% 100%; background-repeat: no-repeat;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(11, 133, 119, .10);
}
.card.row .card-name::before { background-image: none; }
.card-meta { display: block; font-size: 18px; color: var(--muted); margin-top: 3px; padding-left: 70px; }
.card .go {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  color: var(--mint-mid); font-size: 26px; font-weight: 700;
}
.card.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card.row .card-name::before { content: "◷"; }
.card.row .card-meta { padding-left: 70px; }

/* 시간 슬롯 그리드 */
.grid { display: grid; gap: 12px; margin: 14px 0; }
.grid.times { grid-template-columns: repeat(3, 1fr); }
.grid.dates { grid-template-columns: repeat(2, 1fr); }
.grid.dates .slot { font-size: 19px; }
.slot {
  font-size: 21px; font-weight: 800; padding: 18px 8px;
  border: 2px solid var(--mint-line); border-radius: 20px;
  background: #fff; color: var(--primary-dark); cursor: pointer;
  min-height: 68px; font-family: inherit; letter-spacing: -.5px;
  box-shadow: var(--shadow-sm);
}
.slot:active { background: var(--mint); border-color: var(--mint); color: var(--primary-deep); }
.slot small { display: block; font-size: 15px; font-weight: 400; }
.slot.off {
  border-color: var(--line); color: #a9b5b2; background: #f2f4f2;
  cursor: default; box-shadow: none;
}

/* 버튼 */
.btn {
  display: inline-block; font-size: 20px; font-weight: 800;
  padding: 17px 30px; border-radius: 999px;
  border: 2px solid var(--primary); cursor: pointer;
  text-decoration: none; text-align: center; font-family: inherit;
  min-height: 62px; letter-spacing: -.5px;
}
.btn.primary {
  background: linear-gradient(135deg, #4ecfb0, #15a28c);
  color: #fff; border-color: transparent;
  text-shadow: 0 1px 2px rgba(10, 79, 76, .25);
  box-shadow: 0 8px 20px rgba(18, 156, 141, .28);
}
.btn.primary:active { background: linear-gradient(135deg, #3ec2a2, #0f9482); box-shadow: 0 4px 10px rgba(18, 156, 141, .25); }
.btn.ghost { background: #fff; color: var(--primary-dark); border-color: var(--mint-border); box-shadow: var(--shadow-sm); }
.btn.ghost:active { background: var(--primary-soft); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f0b4b4; box-shadow: var(--shadow-sm); }
.btn.big { display: block; width: 100%; margin-top: 18px; }
.btn.sm { padding: 10px 20px; font-size: 18px; min-height: 50px; border-radius: 999px; }
.backform { margin-top: 22px; text-align: center; }

/* 폼 */
.form { display: flex; flex-direction: column; gap: 18px; margin: 14px 0; }
.form label { font-size: 20px; font-weight: 800; display: block; }
.form input, .form select {
  display: block; width: 100%; margin-top: 8px;
  font-size: 21px; padding: 17px 18px; border-radius: 16px;
  border: 2px solid #d8e6e2; font-family: inherit; background: #fff;
}
.form input:focus, .form select:focus { border-color: var(--mint-mid); outline: none; box-shadow: 0 0 0 4px rgba(143, 227, 208, .45); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.newbook-banner { background: #fff6dc; border: 2px solid #f1cf6b; color: #664d03; border-radius: 18px; padding: 14px 16px; margin: 12px 0; font-size: 18px; font-weight: 700; }
.myurl-box { border: 2px solid var(--mint-line); border-radius: 20px; padding: 18px; margin: 14px 0; background: var(--primary-soft); }
.myurl-box .myurl-title { font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.myurl-box .myurl-url { font-size: 17px; font-weight: 700; word-break: break-all; margin: 0 0 8px; }
.clinic-list { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.clinic-list .clinic-pick { text-align: left; font-size: 20px; padding: 16px; }
.wd-row { display: flex; align-items: center; gap: 10px; }
.wd-row .wd-name { font-size: 20px; font-weight: 800; width: 26px; }
.wd-row input[type="time"] { flex: 1; }
.wd-row .wd-closed { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.wd-row .wd-closed input { width: 22px; height: 22px; }

/* 예약 완료 */
.done-box { text-align: center; padding: 12px 0 20px; }
.done-check {
  width: 92px; height: 92px; margin: 6px auto 16px;
  background: linear-gradient(135deg, #3fc1ac, #129c8d);
  color: #fff; border-radius: 50%;
  font-size: 46px; line-height: 92px;
  box-shadow: 0 0 0 10px var(--primary-soft), 0 14px 30px rgba(18, 156, 141, .28);
}
.done-box h2 { font-size: 27px; margin: 0 0 18px; letter-spacing: -.5px; }
.summary { text-align: left; margin: 0 0 16px; }
.summary > div {
  display: flex; gap: 14px; background: #fff; border-radius: 18px;
  padding: 16px 20px; margin-bottom: 12px; font-size: 20px;
  box-shadow: var(--shadow-sm); border: 1px solid transparent;
}
.summary dt { font-weight: 700; min-width: 76px; color: var(--muted); }
.summary dd { margin: 0; font-weight: 800; }
.summary-box {
  background: #fff; border-radius: var(--radius); padding: 18px;
  font-size: 20px; font-weight: 800; margin: 14px 0; text-align: center;
  box-shadow: var(--shadow); border: 2px solid var(--primary-soft);
}

/* 알림 */
.flash {
  background: #fff6dc; border: 2px solid #f1cf6b; color: #7a5b00;
  border-radius: 18px; padding: 15px 20px; margin: 0 0 14px; font-size: 19px;
}

/* 플랫폼 관리자 */
.stat-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin: 0 0 18px;
}
.stat-card {
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px 8px; text-align: center; box-shadow: var(--shadow-sm);
}
.stat-num { display: block; font-size: 30px; font-weight: 800; color: var(--primary-dark); }
.stat-label { font-size: 15px; color: var(--muted); font-weight: 700; }
.pill {
  display: inline-block; font-size: 14px; font-weight: 800; border-radius: 20px;
  padding: 3px 12px; margin-left: 8px; vertical-align: middle;
}
.pill.on { background: var(--primary-soft); color: var(--primary-deep); }
.pill.off { background: #fde8e8; color: #b91c1c; }

/* 관리자 달력 - 깔끔한 월간 뷰 */
.adminbar.dark {
  background: #0c3f3e; color: #fff; border-radius: var(--radius);
  padding: 16px 20px; margin: 0 0 18px;
  box-shadow: 0 10px 24px rgba(12, 63, 62, .22);
}
.adminbar.dark .admin-title { font-size: 22px; font-weight: 800; }
.adminbar.dark .links .tabbtn {
  color: #fff; background: rgba(255,255,255,.15); border-radius: 999px;
  padding: 12px 16px; margin-left: 8px; font-size: 18px; font-weight: 700;
  min-height: 48px; display: inline-block;
}
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 0 10px;
}
.cal-head .btn { min-width: 56px; min-height: 56px; font-size: 24px; }
.cal-title { font-size: 24px; font-weight: 800; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--line);
}
.cal-dow .dow {
  text-align: center; font-size: 15px; font-weight: 700; color: var(--muted);
  padding: 10px 0 6px;
}
.cal-grid:not(.cal-dow) { border-bottom: 1px solid var(--line); }
.cal-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: inherit; min-height: 64px; padding: 8px 0;
  border-bottom: 1px solid #eef2f0; position: relative;
}
.cal-cell .day {
  font-size: 22px; font-weight: 600; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.cal-cell .cnt {
  font-size: 13px; font-weight: 700; color: var(--primary-dark); margin-top: 2px;
}
.cal-cell .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
  margin-top: 3px;
}
.cal-cell.blank { border-bottom: 1px solid #eef2f0; }
.cal-cell.today .day { color: var(--primary-dark); font-weight: 800; background: var(--primary-soft); }
.cal-cell.selected .day { background: linear-gradient(135deg, #3fc1ac, #129c8d); color: #fff; box-shadow: 0 4px 12px rgba(18, 156, 141, .3); }
.cal-cell.past { opacity: .4; }
.card-time { font-size: 28px; font-weight: 800; display: block; color: var(--primary-dark); }
.card-phone {
  display: inline-block; font-size: 20px; font-weight: 700; color: var(--primary-dark);
  margin-top: 4px; min-height: 48px; line-height: 48px;
}
.card .btn.danger { min-height: 56px; padding: 12px 22px; font-size: 19px; }

/* 관리자 */
.adminbar {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 19px; margin: 2px 0 12px;
}
.adminbar .links a { color: var(--primary-dark); margin-left: 14px; font-weight: 700; }
.datenav { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 10px 0 18px; }
.datenav .btn { padding: 12px 8px; font-size: 18px; min-height: 54px; }

.foot {
  margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 16px; text-align: center;
}

/* 내 병원 목록 (삭제 버튼) */
.my-card { display: flex; align-items: center; }
.my-link { flex: 1; text-decoration: none; color: inherit; display: block; }
.del-btn {
  flex: none; width: 52px; height: 52px; margin-left: 10px;
  border: 2px solid #f6d4d4; background: #fff6f6; color: #c0392b;
  border-radius: 50%; font-size: 22px; font-weight: 800; cursor: pointer;
}
.del-btn:active { background: #fde8e8; }

/* 내 병원 카드: 샘플처럼 오른쪽에 예약 알약 버튼 */
.my-card .go { right: 88px; font-size: 0; line-height: 0; }
.my-card .go::after {
  content: "예약";
  font-size: 17px; font-weight: 800; line-height: 1.2; letter-spacing: -.5px;
  color: #fff; background: linear-gradient(135deg, #4ecfb0, #15a28c);
  padding: 11px 22px; border-radius: 999px; display: inline-block;
  box-shadow: 0 6px 16px rgba(18, 156, 141, .30);
}

/* 환자 홈: QR 추가 버튼 — 샘플처럼 흰 배경 + 점선 테두리 */
#qr-add-btn {
  background: #fff; color: var(--primary-dark);
  border: 2.5px dashed var(--mint-border);
  text-shadow: none; box-shadow: var(--shadow-sm);
}
#qr-add-btn:active { background: var(--primary-soft); }

/* 병원 로고 아이콘 — 병원이 설정에서 고른 아이콘이 카드 앞에 표시됨 */
.icn-cross { --icn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect x='34' y='10' width='32' height='80' rx='12' fill='%230b8577'/%3E %3Crect x='10' y='34' width='80' height='32' rx='12' fill='%230b8577'/%3E %3Crect x='42' y='42' width='16' height='16' rx='4' fill='%235ed0bc'/%3E%3C/svg%3E"); }
.icn-clinic { --icn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M12 46 L50 14 L88 46' fill='%235ed0bc' stroke='%235ed0bc' stroke-width='8' stroke-linejoin='round'/%3E %3Crect x='22' y='42' width='56' height='46' rx='6' fill='%230b8577'/%3E %3Crect x='45' y='50' width='10' height='26' rx='2.5' fill='%23ffffff'/%3E %3Crect x='37' y='58' width='26' height='10' rx='2.5' fill='%23ffffff'/%3E%3C/svg%3E"); }
.icn-stetho { --icn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M26 14 V38 a24 24 0 0 0 48 0 V14' fill='none' stroke='%230b8577' stroke-width='9' stroke-linecap='round'/%3E %3Cpath d='M50 62 V68 a14 14 0 0 0 14 14 H64' fill='none' stroke='%230b8577' stroke-width='8' stroke-linecap='round'/%3E %3Ccircle cx='26' cy='12' r='7' fill='%235ed0bc'/%3E%3Ccircle cx='74' cy='12' r='7' fill='%235ed0bc'/%3E %3Ccircle cx='74' cy='78' r='14' fill='%230b8577'/%3E%3Ccircle cx='74' cy='78' r='6.5' fill='%235ed0bc'/%3E%3C/svg%3E"); }
.icn-tooth { --icn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 25 C42 16 25 13 18 27 C13 38 19 49 21 59 C23 72 26 89 34 89 C42 89 41 70 50 70 C59 70 58 89 66 89 C74 89 77 72 79 59 C81 49 87 38 82 27 C75 13 58 16 50 25 Z' fill='%230b8577'/%3E %3Cpath d='M28 33 C32 27 39 26 44 30' fill='none' stroke='%235ed0bc' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.icn-spine { --icn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect x='31' y='8' width='38' height='17' rx='8' fill='%230b8577'/%3E %3Crect x='24' y='29' width='52' height='18' rx='9' fill='%235ed0bc'/%3E %3Crect x='24' y='51' width='52' height='18' rx='9' fill='%230b8577'/%3E %3Crect x='31' y='73' width='38' height='17' rx='8' fill='%235ed0bc'/%3E%3C/svg%3E"); }
.icn-leaf { --icn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E %3Cpath d='M38 10 c-3 4 3 6 0 10' fill='none' stroke='%235ed0bc' stroke-width='5' stroke-linecap='round'/%3E %3Cpath d='M52 8 c-3 4 3 6 0 10' fill='none' stroke='%235ed0bc' stroke-width='5' stroke-linecap='round'/%3E %3Cpath d='M64 10 c-3 4 3 6 0 10' fill='none' stroke='%235ed0bc' stroke-width='5' stroke-linecap='round'/%3E %3Cpath d='M75 50 a13 13 0 0 1 0 24' fill='none' stroke='%230b8577' stroke-width='7' stroke-linecap='round'/%3E %3Cellipse cx='46' cy='64' rx='30' ry='25' fill='%230b8577'/%3E %3Cpath d='M18 60 L6 49 C4 47 6 42 10 43 L22 51 Z' fill='%230b8577'/%3E %3Cpath d='M29 42 a17 11 0 0 1 34 0 Z' fill='%235ed0bc'/%3E %3Ccircle cx='46' cy='29' r='5' fill='%235ed0bc'/%3E %3Cpath d='M46 55 C39 61 39 72 46 79 C53 72 53 61 46 55 Z' fill='%23ffffff'/%3E %3Cpath d='M46 60 V74' stroke='%230b8577' stroke-width='3' stroke-linecap='round'/%3E %3C/svg%3E"); }
.icn-eye { --icn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M8 50 C24 28 38 21 50 21 C62 21 76 28 92 50 C76 72 62 79 50 79 C38 79 24 72 8 50 Z' fill='%23ffffff' stroke='%230b8577' stroke-width='7' stroke-linejoin='round'/%3E %3Ccircle cx='50' cy='50' r='19' fill='%235ed0bc'/%3E %3Ccircle cx='50' cy='50' r='9' fill='%230b8577'/%3E %3Ccircle cx='56' cy='44' r='4' fill='%23ffffff'/%3E%3C/svg%3E"); }
.icn-baby { --icn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E %3Ccircle cx='18' cy='56' r='8.5' fill='none' stroke='%230b8577' stroke-width='5'/%3E %3Ccircle cx='82' cy='56' r='8.5' fill='none' stroke='%230b8577' stroke-width='5'/%3E %3Ccircle cx='50' cy='55' r='33' fill='none' stroke='%230b8577' stroke-width='5'/%3E %3Cpath d='M50 23 C47 14 54 7 61 11' fill='none' stroke='%230b8577' stroke-width='6' stroke-linecap='round'/%3E %3Ccircle cx='38' cy='51' r='4.6' fill='%230b8577'/%3E%3Ccircle cx='62' cy='51' r='4.6' fill='%230b8577'/%3E %3Ccircle cx='39.5' cy='49.5' r='1.5' fill='%23ffffff'/%3E%3Ccircle cx='63.5' cy='49.5' r='1.5' fill='%23ffffff'/%3E %3Cpath d='M40 62 a10 8.5 0 0 0 20 0 Z' fill='%230b8577'/%3E %3Cpath d='M45.5 68.5 a4.5 3 0 0 0 9 0 Z' fill='%235ed0bc'/%3E %3C/svg%3E"); }
.icn-heart { --icn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 88 C16 64 8 44 18 28 C28 13 46 16 50 31 C54 16 72 13 82 28 C92 44 84 64 50 88 Z' fill='%230b8577'/%3E %3Cpath d='M22 50 H37 L43 38 L52 64 L58 50 H78' fill='none' stroke='%235ed0bc' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.icn-pill { --icn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg transform='rotate(-45 50 50)'%3E %3Cpath d='M50 33 H29 a17 17 0 0 0 0 34 H50 Z' fill='%230b8577'/%3E %3Cpath d='M50 33 H71 a17 17 0 0 1 0 34 H50 Z' fill='%235ed0bc'/%3E %3Cpath d='M25 42 H40' stroke='%23ffffff' stroke-width='5' stroke-linecap='round'/%3E %3C/g%3E%3C/svg%3E"); }

/* 로고 고르기 (관리자 설정) */
.icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.icon-pick { position: relative; display: block; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px 12px; border: 2px solid var(--line); border-radius: 18px;
  background: #fff; cursor: pointer; font-size: 15px; font-weight: 700; text-align: center;
}
.icon-sample {
  width: 58px; height: 58px; border-radius: 50%;
  background-color: #e1f7ee;
  background-image: var(--icn, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect x='34' y='10' width='32' height='80' rx='12' fill='%230b8577'/%3E %3Crect x='10' y='34' width='80' height='32' rx='12' fill='%230b8577'/%3E %3Crect x='42' y='42' width='16' height='16' rx='4' fill='%235ed0bc'/%3E%3C/svg%3E")), linear-gradient(150deg, #f2fcf8 0%, #d3f1e7 100%);
  background-position: center; background-size: 60%, 100% 100%; background-repeat: no-repeat;
  box-shadow: inset 0 0 0 2px rgba(11, 133, 119, .10);
}
.icon-pick input:checked + .icon-tile { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(143, 227, 208, .5); }

/* QR 스캐너 모달 */
#qr-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 40, 38, .6);
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.qr-modal-box {
  background: #fff; border-radius: var(--radius); padding: 24px;
  width: 100%; max-width: 420px; text-align: center;
  box-shadow: 0 20px 48px rgba(10, 40, 38, .25);
  margin: 0 auto;
}
#qr-reader { width: 100%; margin: 12px 0; }
#qr-reader video { border-radius: 18px; }

/* 플랫폼 관리자: 병원 리스트 */
.bulk-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; margin-bottom: 12px;
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  font-size: 18px; box-shadow: var(--shadow-sm);
}
.bulk-check { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.bulk-check input, .hosp-check input { width: 26px; height: 26px; cursor: pointer; }
.bulk-count { font-weight: 800; color: var(--primary-dark); }
.bulk-actions { margin-left: auto; display: flex; gap: 8px; }
.hosp-list { display: flex; flex-direction: column; gap: 10px; }
.hosp-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.hosp-row.off { opacity: .65; }
.hosp-main { flex: 1; text-decoration: none; color: inherit; display: block; }
.hosp-name { font-size: 22px; font-weight: 800; display: block; }
.hosp-sub { font-size: 16px; color: var(--muted); display: block; margin-top: 4px; }
.hosp-today { text-align: center; min-width: 56px; }
.hosp-today-num { font-size: 30px; font-weight: 800; color: var(--primary-dark); display: block; }
.hosp-today-label { font-size: 14px; color: var(--muted); }
.hosp-go { font-size: 32px; color: var(--muted); font-weight: 300; }

/* 플랫폼 관리자: 병원 상세 */
.detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.pill.big { font-size: 18px; padding: 8px 16px; }
.detail-stats { display: flex; gap: 16px; margin-left: auto; }
.detail-stat { text-align: center; }
.detail-stat .num { font-size: 34px; font-weight: 800; color: var(--primary-dark); display: block; }
.detail-stat .lbl { font-size: 14px; color: var(--muted); }
.detail-info { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.info-row { display: flex; padding: 15px 20px; border-bottom: 1px solid #eef2f0; font-size: 18px; }
.info-row:last-child { border-bottom: none; }
.info-k { flex: none; width: 110px; font-weight: 700; color: var(--muted); }
.info-v { flex: 1; }
.detail-links { margin-bottom: 20px; }
.link-copy-row { display: flex; gap: 8px; align-items: stretch; }
.link-code {
  flex: 1; font-size: 13px; word-break: break-all; background: #f4f8f6;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.detail-actions { display: flex; gap: 10px; }

/* 앱 설치 안내 */
.install-guide {
  margin: 26px 0 6px; border: 2px solid var(--line); border-radius: var(--radius);
  background: #fff; font-size: 18px; box-shadow: var(--shadow-sm);
}
.install-guide summary {
  padding: 17px 18px; cursor: pointer; font-weight: 800; font-size: 20px;
  list-style: none; color: var(--primary-dark);
}
.install-guide summary::-webkit-details-marker { display: none; }
.install-body { padding: 0 18px 16px; }
.install-body p { margin: 10px 0; line-height: 1.5; }
.muted { color: var(--muted); font-size: 16px; }

/* 병원 QR 코드 */
.qr-box {
  margin: 0 0 18px; border: 2px solid var(--line); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow-sm);
}
.qr-box summary {
  padding: 17px 18px; cursor: pointer; font-weight: 800; font-size: 20px;
  list-style: none; color: var(--primary-dark);
}
.qr-box summary::-webkit-details-marker { display: none; }
.qr-body { padding: 0 18px 18px; text-align: center; }
.qr-body #clinic-qr { display: inline-block; margin: 8px 0; }
.qr-body #clinic-qr img { border: 8px solid #fff; border-radius: 16px; box-shadow: var(--shadow); }
@media print {
  .adminbar, .datenav, .qr-box summary { display: none; }
  .qr-box { border: none; box-shadow: none; }
}

/* 언어 전환 버튼 (작은 알약) */
.lang-switch { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.lang-btn {
  font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.3;
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--mint-line); background: #fff; color: var(--primary-dark);
}
.lang-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.lang-sep { color: var(--muted); font-size: 14px; }
/* 브랜드 바 안: 제목 아래 줄 오른쪽에 (좁은 폰에서도 제목을 밀어내지 않게) */
.brandbar-inner { flex-wrap: wrap; }
.brandbar .lang-switch { flex-basis: 100%; margin: 2px 0 0; }
.brandbar .lang-btn:not(.on) { background: rgba(255,255,255,.7); border-color: rgba(255,255,255,.9); color: var(--primary-deep); }
.brandbar .lang-sep { color: var(--primary-deep); opacity: .5; }
