:root{font-family:system-ui,-apple-system,'Noto Sans KR',sans-serif;color:#13213b;background:#f2f6fc}*{box-sizing:border-box}body{margin:0}header{background:white;border-bottom:1px solid #d9e3f0;padding:20px max(24px,calc((100vw - 1200px)/2));display:flex;justify-content:space-between;align-items:center;gap:10px}h1{font-size:25px;margin:3px 0}h2{font-size:21px;margin:0 0 12px}.eyebrow{letter-spacing:2px;color:#2563eb;font-size:12px;font-weight:700}small{color:#718096}nav{display:flex;align-items:center;gap:15px}a{color:#1d4ed8;text-decoration:none}main{max-width:1200px;margin:30px auto;padding:0 18px}.card{background:white;padding:25px;border:1px solid #dbe4f1;border-radius:18px;box-shadow:0 4px 15px #18335e09;margin-bottom:20px}.narrow{max-width:600px;margin:30px auto}.flex{display:flex;justify-content:space-between;align-items:center;gap:12px}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}label{font-weight:650;display:block;margin:14px 0}input,select{display:block;width:100%;border:1px solid #cbd5e1;border-radius:10px;padding:12px;font-size:15px;margin:7px 0}button,.button{display:inline-block;cursor:pointer;border:0;border-radius:10px;background:#215bd5;color:white;padding:12px 18px;font-size:14px;font-weight:650}.small{padding:7px 10px;font-size:12px}.secondary{background:#e8eef9;color:#174b9c}.danger{background:#c13d3d}.linkdanger{padding:2px;background:none;color:#b42318;font-size:11px}.alert{padding:16px;border-radius:12px;background:#fff4df;border:1px solid #f5cd90;margin-bottom:18px}.alert.ok{background:#e5f9eb;border-color:#b6e7c5}.alert.error{background:#ffe9e9;border-color:#f1b2b2}.scroll{overflow:auto}table{border-collapse:collapse;width:100%;min-width:900px}th,td{border:1px solid #dce3ed;padding:9px;vertical-align:top;text-align:left;font-size:12px}th{background:#eef4ff}th small{display:block}td{min-width:118px}.appointment{padding:6px;background:#ebf2ff;border-radius:7px;margin-bottom:5px}.appointment span{display:block;font-size:11px;color:#345480}.appointment form{display:inline}.list>div{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid #ddd;padding:10px 0}.list form{display:flex;align-items:center;gap:7px}.list form input{width:150px}.qr{width:170px;height:170px}footer{text-align:center;padding:40px;color:#72819a}@media(max-width:720px){header{padding:16px;flex-wrap:wrap}.grid{grid-template-columns:1fr}.flex{flex-direction:column;align-items:flex-start}.list>div{display:block}.list form{flex-wrap:wrap}.card{padding:16px}}

.schedule-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:10px;margin:22px 0}.day-card{border:1px solid #dce3ed;border-radius:12px;padding:10px;min-width:0}.day-card h3{margin:0 0 10px;font-size:14px}.empty{color:#77849b;font-size:13px}@media(max-width:900px){.schedule-week{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:480px){.schedule-week{grid-template-columns:1fr}}@media print{header,footer,button,nav,.button{display:none!important}.schedule-week{grid-template-columns:repeat(7,minmax(0,1fr))}}

.site-header{padding-top:14px;padding-bottom:14px;flex-wrap:wrap;gap:18px}
.site-header .brand{display:flex;align-items:center;flex-shrink:0}
.hospital-logo{display:block;width:min(320px,45vw);height:auto;max-height:86px;object-fit:contain;object-position:left center}
.header-title{color:#233a66;font-weight:800;font-size:clamp(30px,2.25vw,38px);letter-spacing:-0.02em;line-height:1.1;flex:1}
.site-header nav form{margin:0}
.site-header nav button{margin:0}
.toolbar{display:flex;flex-wrap:wrap;gap:8px}
.muted{color:#687994}
.patient-count{background:#e8eef9;color:#174b9c;border-radius:30px;padding:4px 11px;font-size:14px;vertical-align:middle}
.patient-table{min-width:980px}
.patient-table td{vertical-align:middle;font-size:14px}
.patient-table th{font-size:13px}
.code-badge{display:inline-block;font-size:20px;font-weight:850;letter-spacing:2px;color:#04786e;background:#dbf6ef;padding:8px 14px;border-radius:10px;font-variant-numeric:tabular-nums}
.code-legacy{display:inline-block;font-weight:700;color:#955a09;background:#fff3db;padding:8px 10px;border-radius:9px}
.code-caption{display:block;margin-top:5px}
.patient-actions form{margin:4px 0}
.patient-actions details{min-width:180px}
.patient-table details summary{cursor:pointer;color:#174b9c;font-weight:700}
.patient-table details .delete-summary{color:#b42318}
.patient-table input{min-width:150px;max-width:240px}
@media(max-width:720px){.hospital-logo{width:min(270px,75vw)}.header-title{flex-basis:100%;font-size:28px}nav{flex-wrap:wrap}}
@media print{.site-header{display:block!important}.site-header nav{display:none!important}}

.staff-page-shell{padding:28px;background:linear-gradient(180deg,#fbfdff 0%,#f6f9ff 100%)}
.staff-page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:18px}
.section-kicker{font-size:12px;letter-spacing:0.18em;color:#3d67b0;font-weight:800;margin-bottom:8px}
.section-title{font-size:30px;line-height:1.18;color:#142b52;margin:0 0 6px;font-weight:850;letter-spacing:-0.03em}
.section-desc{margin:0;color:#6b7d98;font-size:15px}
.schedule-info-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0 18px}
.schedule-info-card{border:1px solid #d8e2f2;background:#f8fbff;border-radius:14px;padding:14px 16px;display:flex;flex-direction:column;gap:6px}
.schedule-info-card strong{font-size:14px;color:#183768}
.schedule-info-card span{font-size:13px;color:#617392;line-height:1.5}

.schedule-scroll{width:100%;max-height:680px;overflow-x:scroll;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;border:1px solid #dce3ed;border-radius:14px;background:white}.schedule-scroll table{min-width:1580px}.schedule-scroll thead th{position:sticky;top:0;z-index:2;background:#edf4ff}.schedule-scroll tbody th{position:sticky;left:0;z-index:1;background:#f2f6fc;width:68px}.schedule-scroll td{min-width:175px;background:white}.schedule-scroll .appointment{margin-bottom:6px;border:1px solid #d9e5f6;box-shadow:0 1px 2px #0f172a08}.schedule-scroll .appointment b{display:block;font-size:12px;margin-bottom:2px}.schedule-scroll .appointment span{font-size:11px}.slot-group{margin-bottom:8px}.slot-group:last-child{margin-bottom:0}.slot-group-title{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:-0.01em;margin-bottom:6px}.slot-group-title.high{background:#e8efff;color:#1f4fb3}.slot-group-title.pain{background:#efe8ff;color:#6440c5}.slot-group-title.other{background:#eef6ea;color:#3d7b3d}.appointment-high{background:#eef4ff}.appointment-pain{background:#f4efff}.appointment-other{background:#edf6ee}.slot-empty{font-size:12px;color:#97a4b8;padding:16px 4px}

.code-manage-card,.drive-card{background:#fff;border:1px solid #d9e3f2}
.code-manage-head{margin-bottom:12px}.code-manage-note{font-size:13px}.code-edit-form{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.code-edit-form input{max-width:150px;margin:0}.code-sub-action{margin-top:6px}.ghost-button{background:#f2f6fc;color:#305f9f;border:1px solid #d9e3f2}.delete-summary{display:inline-block}

.drive-embedded-frame{width:100%;height:440px;overflow:auto;margin:16px 0 12px;border:1px solid #dbe4f1;border-radius:12px;background:white}.drive-embedded-frame iframe{display:block;width:100%;height:100%;border:0}
.action-grid .card h2{margin-bottom:14px}

.schedule-scroll::-webkit-scrollbar,.drive-embedded-frame::-webkit-scrollbar,.scroll::-webkit-scrollbar{width:12px;height:12px}.schedule-scroll::-webkit-scrollbar-thumb,.drive-embedded-frame::-webkit-scrollbar-thumb,.scroll::-webkit-scrollbar-thumb{background:#98aac6;border:2px solid #eef3fb;border-radius:10px}.schedule-scroll::-webkit-scrollbar-track,.drive-embedded-frame::-webkit-scrollbar-track,.scroll::-webkit-scrollbar-track{background:#eef3fb}
@media(max-width:900px){.staff-page-head,.code-manage-head{flex-direction:column;align-items:flex-start}.schedule-info-row{grid-template-columns:1fr}.section-title{font-size:25px}}
@media(max-width:720px){.schedule-scroll{max-height:520px}.drive-embedded-frame{height:360px}.patient-table{min-width:900px}.section-title{font-size:23px}.staff-page-shell{padding:18px}}

/* 수동 일정 추가 레이아웃 */

/* 수동 일정 추가 - 주간 시간표 바로 아래, 동일 폭의 낮은 가로형 영역 */
.manual-appointment-card {width:100%;padding:22px 26px;margin-top:0;background:#fff;}
.manual-appointment-heading {margin-bottom:14px;}
.manual-appointment-heading h2 {margin:0 0 4px;font-size:23px;color:#142b52;}
.manual-appointment-form {display:grid;grid-template-columns:minmax(140px,1.35fr) minmax(150px,1.25fr) minmax(120px,1fr) minmax(170px,1.35fr) auto;gap:12px;align-items:end;}
.manual-appointment-form label {font-size:13px;color:#26416c;min-width:0;margin:0;}
.manual-appointment-form label input,.manual-appointment-form label select {margin:6px 0 0;min-width:0;height:42px;padding:8px 10px;background:#fff;}
.manual-appointment-form button {height:42px;white-space:nowrap;padding:0 22px;}
.patient-table input[name=manual_code],.patient-table input[name=known_code] {max-width:230px;}
@media(max-width:900px) {.manual-appointment-form {grid-template-columns:repeat(2,minmax(0,1fr))}.manual-appointment-form button {grid-column:1/-1;}}
@media(max-width:520px) {.manual-appointment-card {padding:18px}.manual-appointment-form {grid-template-columns:1fr}.manual-appointment-form button {grid-column:auto;}}

/* Google Drive: iframe 차단 우회, 같은 출처 HTML을 안전하게 파싱하여 목록 표시 */
.drive-inline-frame{padding:18px 20px;overflow:auto;max-width:100%;}
#drive-inline-status{font-size:13px;color:#526986;margin-bottom:14px;}
.drive-inline-content h3{font-size:19px;color:#16345d;margin:0 0 8px;}
.drive-folder-label{font-size:13px;color:#536c88;margin:6px 0 12px;white-space:pre-wrap;}
.drive-file-items{list-style:none;margin:0;padding:0;}
.drive-file-items li{border-top:1px solid #e2eaf4;padding:13px 0;display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.drive-file-items li strong{font-size:14px;color:#142b52;flex-basis:100%;}
.drive-file-items li small{font-size:12px;color:#70829b;overflow-wrap:anywhere;}
.drive-file-items li .button{margin-left:auto;white-space:nowrap;}
