* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --ink: #15302b;
  --ink-2: #4c6661;
  --ink-3: #8aa19c;
  --mint: #1fb39a;
  --mint-d: #128a76;
  --mint-l: #e3f6f1;
  --coral: #ff6257;
  --coral-l: #ffe9e6;
  --amber: #f5a524;
  --amber-l: #fff3dd;
  --sky: #3aa8f0;
  --sky-l: #e2f2fd;
  --violet: #8b6cf0;
  --violet-l: #efeafe;
  --glass: rgba(255, 255, 255, 0.84);
  --line: rgba(21, 48, 43, 0.08);
  --shadow: 0 6px 20px rgba(21, 48, 43, 0.12), 0 1px 3px rgba(21, 48, 43, 0.08);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
html, body {
  height: 100%;
  color: var(--ink);
  font-family: var(--font);
  background: #cfe6e0;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; touch-action: manipulation; }

/* ===== 아이콘 ===== */
.ic { width: 1em; height: 1em; display: block; flex: none; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }

#app {
  position: relative;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 70% at 50% 0%, #e8f6f2 0%, #cfe7e0 55%, #bcdcd4 100%);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ===== HUD ===== */
#hud { padding: 8px 10px 0; display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 20; }
.hud-card {
  display: flex; align-items: center; gap: 9px;
  background: var(--glass); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 18px; padding: 7px 7px 7px 8px; box-shadow: var(--shadow);
}
.day-block {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  background: linear-gradient(160deg, #27c2a8, #12917c); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
}
.day-block small { font-size: 9px; font-weight: 700; letter-spacing: .08em; opacity: .85; }
.day-block b { font-size: 18px; font-weight: 800; margin-top: 2px; }
.time-block { flex: 1; min-width: 0; }
.time-row { display: flex; align-items: center; gap: 6px; }
#clock { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.phase { font-size: 10.5px; font-weight: 700; color: var(--mint-d); background: var(--mint-l); padding: 3px 7px; border-radius: 999px; white-space: nowrap; }
.phase.warn { color: #a86400; background: var(--amber-l); }
.phase.over { color: #fff; background: var(--coral); }
.timeline { position: relative; height: 5px; border-radius: 3px; background: rgba(21,48,43,.08); margin-top: 7px; }
.timeline i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: linear-gradient(90deg, #6fd9c6, var(--mint)); }
.timeline.over i { background: linear-gradient(90deg, #ff9d8f, var(--coral)); }
.tl-mark { position: absolute; top: -2px; width: 2px; height: 9px; border-radius: 1px; }
.tl-mark.lunch { left: 33.3%; background: var(--amber); }
.tl-mark.close { left: 94.4%; background: var(--coral); }
.stat-chip { display: flex; align-items: center; gap: 4px; height: 32px; padding: 0 9px 0 7px; border-radius: 11px; background: #fff; border: 1px solid var(--line); font-weight: 800; font-size: 14px; }
.stat-chip [data-icon] { font-size: 17px; }
.won-badge { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(160deg, #ffd45c, #f0a020); color: #fff; font-size: 13px !important; box-shadow: inset 0 -1.5px 0 rgba(0,0,0,.12); }
.stat-chip.rating [data-icon] { color: #ffb400; }
.stat-chip b.bump { animation: bump .35s ease-out; }
.hud-btns { display: flex; flex-direction: column; gap: 3px; }
.hud-btns .round-btn { width: 28px; height: 20px; border-radius: 7px; font-size: 13px; }
.round-btn { width: 32px; height: 32px; border-radius: 11px; background: rgba(21,48,43,.06); color: var(--ink-2); font-size: 15px; display: flex; align-items: center; justify-content: center; flex: none; }
.round-btn:active { transform: scale(.92); }

.vitals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.vital {
  display: flex; align-items: center; gap: 5px;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 13px; padding: 5px 7px 5px 5px; box-shadow: 0 3px 10px rgba(21,48,43,.08);
  --c: var(--mint); --cl: var(--mint-l);
}
.vital.hunger { --c: var(--amber); --cl: var(--amber-l); }
.vital.bladder { --c: var(--sky); --cl: var(--sky-l); }
.vital.stamina { --c: var(--mint); --cl: var(--mint-l); }
.vital.mental { --c: #f06292; --cl: #fde7ef; }
.v-ic { width: 24px; height: 24px; border-radius: 8px; background: var(--cl); color: var(--c); font-size: 15px; flex: none; }
.v-body { flex: 1; min-width: 0; }
.v-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 10px; font-weight: 600; color: var(--ink-2); }
.v-top em { font-style: normal; font-weight: 800; color: var(--ink); font-size: 11px; }
.vital b { display: block; height: 5px; border-radius: 3px; background: rgba(21,48,43,.08); margin-top: 4px; overflow: hidden; }
.vital b i { display: block; height: 100%; width: 100%; border-radius: 3px; background: var(--c); transition: width .25s; }
.vital.crit { --c: var(--coral); --cl: var(--coral-l); animation: vpulse 1s infinite; }
.vital.crit .v-ic { animation: shake .45s infinite; }

/* ===== Map (3D) ===== */
#map { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#stage, #stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#ov { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
#ov > * { position: absolute; left: 0; top: 0; will-change: transform; }
#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--mint-d); z-index: 5; }

.rlabel {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; color: var(--ink);
  background: rgba(255,255,255,.9); padding: 3px 8px 3px 6px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(21,48,43,.12);
}
.rlabel i { width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--mint)); }
.rlabel em { font-style: normal; color: var(--coral); font-weight: 800; }

/* 시설 버튼: 핀 모양 */
.sbtn { pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 5px; --c: var(--mint); }
.sbtn .pin {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  background: #fff; color: var(--c); font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(21,48,43,.22), inset 0 0 0 2px rgba(21,48,43,.05);
  transition: transform .1s;
}
.sbtn .pin::after {
  content: ''; position: absolute; bottom: -4px; left: 50%; width: 10px; height: 10px; background: #fff;
  transform: translateX(-50%) rotate(45deg); border-radius: 2px; z-index: -1;
}
.sbtn small { font-size: 9.5px; font-weight: 700; color: var(--ink); background: rgba(255,255,255,.92); padding: 1px 7px; border-radius: 999px; box-shadow: 0 1px 4px rgba(21,48,43,.12); }
.sbtn:active .pin { transform: scale(.88); }
.sbtn.shot { --c: #3f7df0; }
.sbtn.iv { --c: var(--sky); }
.sbtn.toilet { --c: var(--violet); }
.sbtn.snack { --c: var(--amber); }
.sbtn.phone { --c: #9bb0ab; }
.sbtn.phone .pin, .sbtn.chart .pin { width: 34px; height: 34px; font-size: 17px; }
.sbtn.phone.ringing { --c: #fff; }
.sbtn.phone.ringing .pin { background: var(--coral); animation: ring .5s infinite; }
.sbtn.phone.ringing .pin::after { background: var(--coral); }
.sbtn.phone.ringing .pin::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--coral); animation: ripple 1s infinite; }

/* 환자 머리 위 배지 */
.po { pointer-events: auto; position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px 4px; }
.badge-ic {
  width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--c, var(--mint));
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  box-shadow: 0 3px 8px rgba(21,48,43,.22);
}
.badge-ic.shot { --c: #3f7df0; } .badge-ic.iv { --c: var(--sky); } .badge-ic.heat { --c: #ff7a3d; }
.badge-ic.bell { --c: #fff; background: var(--coral); }
.badge-ic.pay, .badge-ic.doc { --c: var(--violet); }
.badge-ic.exam { --c: var(--mint); }
.badge-ic.alert { --c: #fff; background: var(--coral); animation: pulse .6s infinite; }
.po .bar { width: 26px; height: 4px; border-radius: 2px; background: rgba(21,48,43,.18); overflow: hidden; box-shadow: 0 0 0 1.5px rgba(255,255,255,.85); }
.po .bar i { display: block; height: 100%; width: 100%; background: #35c48a; }
.po .bar i.mid { background: var(--amber); }
.po .bar i.low { background: var(--coral); }
.po.ringing .badge-ic { animation: ring .45s infinite; }
.po.queued .badge-ic { box-shadow: 0 0 0 2px var(--mint), 0 3px 8px rgba(21,48,43,.22); }
.po .qmark { display: none; }
.po.queued .qmark { display: flex; position: absolute; top: -3px; right: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--mint); color: #fff; font-size: 9px; align-items: center; justify-content: center; box-shadow: 0 0 0 1.5px #fff; }

.pbar { width: 40px; height: 6px; border-radius: 3px; background: rgba(21,48,43,.18); overflow: hidden; box-shadow: 0 0 0 2px rgba(255,255,255,.9); }
.pbar i { display: block; height: 100%; width: 0; background: #ffc531; }
.pbar.iv i { background: var(--sky); }
.pbar.heat i { background: #ff7a3d; }
.pbar.doc i { background: var(--mint); }

/* 콤보 */
#combo { position: absolute; top: 8px; right: 10px; z-index: 25; pointer-events: none; }
#combo .cb {
  display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, #ff8a3d, #ff5257); padding: 5px 10px 5px 8px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(255,82,87,.35);
}
#combo .cb .ic { font-size: 14px; }

/* toast / hint / float */
#toasts { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 92%; z-index: 30; pointer-events: none; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 8px; max-width: 100%;
  background: rgba(255,255,255,.97); color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.35;
  padding: 6px 12px 6px 6px; border-radius: 14px; box-shadow: var(--shadow);
  animation: toastIn .22s ease-out, fadeOut .4s ease-in 2.3s forwards;
}
.toast .t-ic { width: 26px; height: 26px; border-radius: 9px; background: var(--mint-l); color: var(--mint-d); font-size: 15px; display: flex; align-items: center; justify-content: center; flex: none; }
.toast.warn .t-ic { background: var(--coral-l); color: var(--coral); }
.toast.good .t-ic { background: var(--mint); color: #fff; }
#hint {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 31;
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(21,48,43,.94); color: #fff; border-radius: 16px;
  padding: 11px 13px 11px 11px; font-size: 13px; font-weight: 500; line-height: 1.45;
  box-shadow: 0 10px 30px rgba(21,48,43,.35);
  animation: toastIn .25s ease-out;
}
#hint .h-ic { width: 30px; height: 30px; border-radius: 10px; background: rgba(127,240,220,.15); color: #7ff0dc; font-size: 17px; display: flex; align-items: center; justify-content: center; flex: none; }
#hint b { color: #7ff0dc; font-weight: 700; display: block; font-size: 10.5px; letter-spacing: .06em; margin-bottom: 1px; }
.float { position: absolute; left: 0; top: 0; z-index: 25; pointer-events: none; font-weight: 800; font-size: 14px; color: var(--mint-d); text-shadow: 0 1px 0 #fff, 0 0 6px #fff; animation: floatUp 1s ease-out forwards; white-space: nowrap; }
.float.bad { color: var(--coral); }

/* ===== 하단 도크 ===== */
#bottom { padding: 0 10px 8px; position: relative; z-index: 20; }
.dock {
  background: var(--glass); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.7); border-radius: 20px; padding: 8px 8px 8px 10px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
}
.dock-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dock-label { font-size: 11px; font-weight: 700; color: var(--ink-3); flex: none; }
#queue { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; flex: 1; min-height: 28px; align-items: center; }
#queue::-webkit-scrollbar { display: none; }
.qchip { flex: none; display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 5px 9px 5px 6px; border-radius: 999px; background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.qchip .ic { font-size: 13px; color: var(--mint-d); }
.qchip .x { color: var(--ink-3); font-weight: 600; margin-left: 1px; }
.qchip.cur { background: var(--ink); color: #fff; border-color: var(--ink); }
.qchip.cur .ic { color: #7ff0dc; }
.qempty { font-size: 11.5px; color: var(--ink-3); }
/* 처치 트레이 */
.tray { flex: 1; min-width: 0; }
.tray-head, .mode-head { display: flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; color: var(--ink-3); margin-bottom: 5px; }
.tray-head [data-icon] { font-size: 13px; }
.tray-head em { font-style: normal; color: var(--ink-2); margin-left: auto; margin-right: 4px; }
.tray-slots { display: flex; gap: 6px; padding: 5px; border-radius: 15px; background: linear-gradient(180deg, #eef4f3, #e2ebe9); box-shadow: inset 0 1px 2px rgba(21,48,43,.08); }
.hand {
  flex: 1; height: 40px; border-radius: 11px; border: 1.5px dashed rgba(21,48,43,.15);
  display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 20px; color: var(--ink-3);
}
.hand:empty::after { content: '비어 있음'; font-size: 10.5px; font-weight: 600; color: #a8bab6; }
.hand.full { border: none; background: #fff; box-shadow: 0 2px 6px rgba(21,48,43,.12); color: var(--c, var(--mint)); animation: bump .25s ease-out; }
.hand.full span { font-size: 11.5px; font-weight: 700; color: var(--ink); }
.hand.full::before { content: ''; width: 4px; height: 20px; border-radius: 2px; background: var(--c); margin-right: 1px; }
.hand.shot { --c: #3f7df0; } .hand.iv { --c: var(--sky); }
.mode { flex: none; }
.seg { display: flex; padding: 3px; border-radius: 14px; background: linear-gradient(180deg, #eef4f3, #e2ebe9); box-shadow: inset 0 1px 2px rgba(21,48,43,.08); gap: 2px; }
.seg button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 58px; height: 44px; border-radius: 11px; font-size: 10.5px; font-weight: 700; color: var(--ink-3); transition: background .15s, color .15s; }
.seg button [data-icon], .seg button .ic { font-size: 17px; }
.seg button.on { background: #fff; box-shadow: 0 2px 6px rgba(21,48,43,.14); }
.seg button[data-mode="safe"].on { color: var(--mint-d); }
.seg button[data-mode="fast"].on { color: #d97a00; }

/* 줌 버튼 */
.zoom-ctl { position: absolute; right: 10px; bottom: 10px; z-index: 22; display: flex; flex-direction: column; gap: 1px; border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); background: var(--line); }
.zoom-ctl button { width: 36px; height: 34px; background: rgba(255,255,255,.92); color: var(--ink-2); font-size: 16px; display: flex; align-items: center; justify-content: center; }
.zoom-ctl button:active { background: var(--mint-l); }

/* 원장님 호출 말풍선 */
.errand { pointer-events: auto; display: flex; align-items: center; gap: 5px; background: #fff; border-radius: 12px; padding: 5px 9px 5px 5px; font-size: 11px; font-weight: 700; color: var(--ink); box-shadow: 0 6px 14px rgba(21,48,43,.22); white-space: nowrap; animation: bump .3s ease-out; }
.errand::after { content: ''; position: absolute; bottom: -4px; left: 50%; width: 9px; height: 9px; background: #fff; transform: translateX(-50%) rotate(45deg); }
.errand .e-ic { width: 22px; height: 22px; border-radius: 7px; background: var(--violet-l); color: var(--violet); font-size: 13px; display: flex; align-items: center; justify-content: center; }
.errand i { display: block; position: absolute; left: 6px; right: 6px; bottom: 2px; height: 2px; border-radius: 1px; background: var(--violet); transform-origin: left; }
.chart-count { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.chart-count:empty { display: none; }
.sbtn.chart { --c: #6b7f7b; }
.sbtn.chart.piled { --c: var(--coral); }
.sbtn.chart.piled .pin { animation: pulse 1s infinite; }
.badge-ic.rude { --c: #fff; background: #ff8a3d; }
.badge-ic.errand { --c: var(--violet); }

/* ===== Screens ===== */
.screen {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 35, 31, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.hidden { display: none !important; }
.card {
  width: 100%; max-width: 400px; max-height: 100%; overflow-y: auto;
  background: #fff; border-radius: 26px; padding: 26px 20px 18px; text-align: center;
  box-shadow: 0 20px 60px rgba(15,35,31,.3);
  animation: cardIn .3s cubic-bezier(.2,.9,.3,1.2);
}
.card.small { max-width: 300px; }
.brand-mark {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px; font-size: 34px; color: #fff;
  background: linear-gradient(160deg, #2fd0b5, #12917c); box-shadow: 0 10px 24px rgba(18,145,124,.35);
}
.brand-mark.soft { width: 52px; height: 52px; font-size: 22px; border-radius: 16px; background: var(--mint-l); color: var(--mint-d); box-shadow: none; }
.eyebrow { font-size: 11.5px; font-weight: 700; color: var(--mint-d); letter-spacing: .02em; }
.card h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; }
.card h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 14px; }
.sub { font-size: 15px; font-weight: 600; color: var(--ink-3); margin-top: 2px; }
.howto { text-align: left; list-style: none; display: flex; flex-direction: column; gap: 4px; margin: 20px 0 16px; }
.howto li { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 14px; background: #f5f9f8; }
.howto li > [data-icon] { width: 32px; height: 32px; border-radius: 10px; background: #fff; color: var(--mint-d); font-size: 18px; flex: none; box-shadow: 0 1px 3px rgba(21,48,43,.1); }
.howto b { font-size: 13px; font-weight: 700; display: block; }
.howto small { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
button.primary { display: block; width: 100%; padding: 15px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 16px; font-weight: 700; margin-top: 8px; box-shadow: 0 8px 20px rgba(21,48,43,.25); }
button.primary:active { transform: scale(.98); }
button.secondary { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 12px; border-radius: 14px; background: var(--mint-l); color: var(--mint-d); font-size: 14px; font-weight: 700; margin-top: 8px; }
button.secondary [data-icon] { font-size: 17px; }
.card.help { text-align: left; padding: 18px 16px 16px; max-height: 92%; display: flex; flex-direction: column; }
.help-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.help-top h2 { margin: 0; }
.tabs { display: flex; gap: 4px; padding: 3px; border-radius: 13px; background: #eef4f3; margin-bottom: 12px; flex: none; }
.tabs button { flex: 1; padding: 8px 2px; border-radius: 10px; font-size: 12px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(21,48,43,.12); }
.tab-body { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.hrow, .flow li { display: flex; gap: 11px; padding: 10px; border-radius: 14px; background: #f5f9f8; align-items: flex-start; }
.hrow > [data-icon], .flow li > [data-icon] { width: 34px; height: 34px; border-radius: 11px; background: #fff; color: var(--mint-d); font-size: 19px; flex: none; box-shadow: 0 1px 3px rgba(21,48,43,.1); }
.hrow b, .flow b { font-size: 13.5px; font-weight: 700; display: block; margin-bottom: 1px; }
.hrow p, .flow p { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.hrow p b { display: inline; font-size: 12px; }
.flow { list-style: none; display: flex; flex-direction: column; gap: 6px; counter-reset: f; }
.flow li { position: relative; }
.tipbox { display: flex; gap: 9px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--amber-l); color: #8a5400; font-size: 12.5px; }
.tipbox [data-icon] { font-size: 18px; color: var(--amber); }
.icon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.icon-grid > div { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: #f5f9f8; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.icon-grid .badge-ic { flex: none; }
.note { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.lead { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.fact { padding: 10px 12px; border-radius: 14px; background: #f5f9f8; }
.fact b { font-size: 18px; font-weight: 800; color: var(--coral); letter-spacing: -.02em; }
.fact p { font-size: 12.5px; color: var(--ink); line-height: 1.5; margin-top: 1px; }
.fact em { font-style: normal; font-weight: 700; color: var(--mint-d); }
.fact small { font-size: 10.5px; color: var(--ink-3); }
.labor { margin-top: 10px; padding: 12px; border-radius: 16px; background: #15302b; color: #fff; text-align: left; }
.labor h4 { font-size: 12px; font-weight: 700; color: #7ff0dc; margin-bottom: 6px; display: flex; align-items: center; gap: 5px; }
.labor .lrow { display: flex; justify-content: space-between; font-size: 12.5px; padding: 3px 0; color: rgba(255,255,255,.85); }
.labor .lrow b { color: #fff; }
.labor .lrow.total { border-top: 1px solid rgba(255,255,255,.15); margin-top: 4px; padding-top: 7px; font-weight: 700; }
.labor .lrow.total b { color: #ff9d8f; font-size: 15px; }
button.ghost { display: block; width: 100%; padding: 11px; color: var(--ink-3); font-size: 13px; font-weight: 600; margin-top: 4px; }

#res-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; text-align: left; }
.stat { background: #f5f9f8; border-radius: 14px; padding: 10px 12px; }
.stat small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.stat b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.stat.bad b { color: var(--coral); }
#res-badges { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 14px 0 4px; }
.badge { font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px; background: var(--amber-l); color: #a56300; }
.badge.good { background: var(--mint-l); color: var(--mint-d); }
.shop-head { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 8px; }
.shop-head h3 { font-size: 15px; font-weight: 800; }
#shop-money { display: flex; align-items: center; gap: 4px; font-weight: 800; }
#shop-money .ic { color: var(--amber); }
#shop { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; align-items: center; gap: 11px; text-align: left; background: #f5f9f8; border-radius: 16px; padding: 9px 10px; }
.item .it-ic { width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--mint-d); font-size: 21px; flex: none; box-shadow: 0 1px 3px rgba(21,48,43,.1); display: flex; align-items: center; justify-content: center; }
.item .tx { flex: 1; min-width: 0; }
.item .tx b { font-size: 13.5px; font-weight: 700; display: block; }
.item .tx small { font-size: 11px; color: var(--ink-3); }
.item button { display: flex; align-items: center; gap: 3px; padding: 8px 11px; border-radius: 11px; background: var(--ink); color: #fff; font-weight: 700; font-size: 12px; white-space: nowrap; }
.item button .ic { color: #ffd166; }
.item button:disabled { background: #e3eae8; color: #9fb1ad; }
.item button:disabled .ic { color: #b9c6c3; }

/* ===== Animations ===== */
@keyframes shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes ring { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(5deg); } }
@keyframes ripple { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.5); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes vpulse { 0%,100% { box-shadow: 0 3px 10px rgba(21,48,43,.08); } 50% { box-shadow: 0 0 0 2px rgba(255,98,87,.45), 0 3px 10px rgba(21,48,43,.08); } }
@keyframes bump { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-4px); } }
@keyframes floatUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-34px); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 370px) {
  .stat-chip { padding: 0 7px 0 5px; font-size: 13px; }
  #clock { font-size: 18px; }
  .v-top span { display: none; }
}

/* ===================== v3 추가 ===================== */
#map { touch-action: none; }
.tl-mark.close { left: 94.4%; }
.tl-lunch { position: absolute; top: -1px; height: 7px; left: 44.4%; width: 11.1%; border-radius: 3px; background: repeating-linear-gradient(45deg, rgba(245,165,36,.55) 0 3px, rgba(245,165,36,.25) 3px 6px); }
.phase.lunch { color: #a86400; background: var(--amber-l); }

/* 트레이 슬롯(동적 개수) */
.tray-slots .hand { min-width: 0; }
.hand .med-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.hand.full::before { display: none; }
.hand.full { box-shadow: 0 2px 6px rgba(21,48,43,.12), inset 0 -3px 0 var(--c); }
.hand.full span { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 빠른 메뉴 */
.quick { display: flex; flex-direction: column; gap: 5px; flex: none; }
.qbtn { position: relative; display: flex; align-items: center; gap: 5px; width: 116px; white-space: nowrap; height: 31px; padding: 0 9px; border-radius: 11px; background: #fff; border: 1px solid var(--line); font-size: 12px; font-weight: 700; box-shadow: 0 2px 6px rgba(21,48,43,.06); }
.qbtn [data-icon], .qbtn .ic { font-size: 16px; }
.qbtn.choco [data-icon] { color: #8d5a3b; }
.qbtn.mates [data-icon] { color: var(--mint-d); }
.qbtn em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 800; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: #eef4f3; color: var(--ink-2); display: flex; align-items: center; justify-content: center; }
.qbtn:active { transform: scale(.96); }
.qbtn:disabled { opacity: .45; }

/* 시트(약품장 · 투약 확인 · 동료 요청) */
.sheet {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 40;
  background: rgba(255,255,255,.98); border-radius: 20px; padding: 12px; box-shadow: 0 -6px 30px rgba(21,48,43,.22);
  animation: sheetIn .2s ease-out;
}
.sheet h4 { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.sheet h4 .ic { font-size: 17px; color: var(--mint-d); }
.sheet h4 .close { margin-left: auto; width: 28px; height: 28px; border-radius: 9px; background: #eef4f3; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--ink-2); }
.sheet .sub2 { font-size: 11.5px; color: var(--ink-3); margin-bottom: 9px; }
.med-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.med-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; border-radius: 14px; background: #f5f9f8; border: 2px solid transparent; font-size: 11.5px; font-weight: 700; color: var(--ink); }
.med-btn .mi { width: 34px; height: 34px; border-radius: 11px; background: #fff; color: var(--c); font-size: 20px; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -3px 0 var(--c), 0 1px 3px rgba(21,48,43,.1); }
.med-btn small { font-size: 10px; color: var(--ink-3); font-weight: 600; }
.med-btn:active { transform: scale(.95); border-color: var(--c); }
.rx { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #15302b; color: #fff; font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.rx .chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: #fff; color: var(--c); font-weight: 800; }
.rx .chip .ic { font-size: 14px; }
.timer { height: 4px; border-radius: 2px; background: #eef4f3; overflow: hidden; margin-top: 9px; }
.timer i { display: block; height: 100%; background: var(--coral); transform-origin: left; }
.mate-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.mate-row:first-of-type { border-top: none; }
.mate-av { width: 34px; height: 34px; border-radius: 12px; background: var(--mint-l); color: var(--mint-d); font-size: 18px; flex: none; display: flex; align-items: center; justify-content: center; }
.mate-name { font-size: 12.5px; font-weight: 700; width: 58px; flex: none; line-height: 1.2; }
.mate-name small { display: block; font-size: 10px; color: var(--ink-3); font-weight: 600; }
.focus-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; flex: 1; padding: 3px; border-radius: 12px; background: #eef4f3; }
.focus-seg button { padding: 7px 0; border-radius: 9px; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.focus-seg button.on { background: #fff; color: var(--mint-d); box-shadow: 0 2px 5px rgba(21,48,43,.12); }

/* 오버레이 배지 추가 */
.badge-ic.ticket { --c: #fff; background: #15302b; font-size: 11px; font-weight: 800; width: 26px; border-radius: 8px; }
.badge-ic.ticket b { font-weight: 800; }
.badge-ic.blood { --c: #e53935; }
.badge-ic.mate { --c: #fff; background: var(--mint); }
.badge-ic.med { box-shadow: 0 3px 8px rgba(21,48,43,.22), inset 0 0 0 2.5px var(--c); }
.po .mate-tag { position: absolute; top: -5px; left: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--mint); color: #fff; font-size: 9px; display: none; align-items: center; justify-content: center; box-shadow: 0 0 0 1.5px #fff; }
.po.by-mate .mate-tag { display: flex; }

/* 말풍선 */
.bubble { pointer-events: none; max-width: 190px; background: #fff; color: var(--ink); font-size: 11.5px; font-weight: 700; line-height: 1.35; padding: 6px 9px; border-radius: 12px; box-shadow: 0 6px 14px rgba(21,48,43,.2); text-align: center; animation: bump .25s ease-out; }
.bubble.lead { background: #2d3e66; color: #fff; }
.bubble.sweet { background: #ffe3ef; color: #a2195b; }
.bubble.doc { background: #fff6dc; color: #7a5200; }
.nametag { pointer-events: none; font-size: 9.5px; font-weight: 700; color: #fff; background: rgba(21,48,43,.7); padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.nametag.lead { background: #2d3e66; }
.nametag.me { background: var(--coral); }

/* 브리핑 / 결과 / 저녁 */
.brief-grid { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.brief-item { display: flex; gap: 11px; align-items: center; padding: 10px 12px; border-radius: 15px; background: #f5f9f8; }
.brief-item > .bi { width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--mint-d); font-size: 21px; display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 1px 3px rgba(21,48,43,.1); }
.brief-item b { font-size: 13.5px; display: block; }
.brief-item p { font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.brief-item .tag { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--coral-l); color: var(--coral); margin-left: 4px; vertical-align: 1px; }
.brief-item .tag.good { background: var(--mint-l); color: var(--mint-d); }
.bars2 { display: flex; gap: 6px; margin-top: 4px; }
.bars2 div { flex: 1; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.bars2 b { display: block; height: 6px; border-radius: 3px; background: #e3ebe9; margin-top: 3px; overflow: hidden; }
.bars2 i { display: block; height: 100%; border-radius: 3px; }
.promo { margin-top: 10px; padding: 12px; border-radius: 16px; background: linear-gradient(135deg, #fff6dc, #ffe9c2); text-align: left; }
.promo h4 { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: #8a5400; }
.promo h4 .ic { font-size: 17px; color: #e09a00; }
.promo .pbar2 { height: 7px; border-radius: 4px; background: rgba(138,84,0,.15); margin: 8px 0 4px; overflow: hidden; }
.promo .pbar2 i { display: block; height: 100%; background: linear-gradient(90deg, #ffc531, #f5a524); }
.promo small { font-size: 11px; color: #8a5400; }
.promo.up { background: linear-gradient(135deg, #ffd45c, #f5a524); }
.promo.up h4, .promo.up small { color: #4a2c00; }
.invest { margin-top: 8px; padding: 10px 12px; border-radius: 14px; background: var(--mint-l); color: var(--mint-d); font-size: 12.5px; font-weight: 600; text-align: left; display: flex; gap: 8px; align-items: center; }
.invest .ic { font-size: 18px; flex: none; }
.act-list { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.act { display: flex; gap: 11px; align-items: center; padding: 11px 12px; border-radius: 16px; background: #f5f9f8; border: 2px solid transparent; width: 100%; text-align: left; }
.act.on { border-color: var(--mint); background: #fff; box-shadow: 0 4px 12px rgba(21,48,43,.1); }
.act > .ai { width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--mint-d); font-size: 20px; display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 1px 3px rgba(21,48,43,.1); }
.act b { font-size: 13.5px; display: block; }
.act p { font-size: 11.5px; color: var(--ink-3); }
.act.forced { background: var(--coral-l); border-color: var(--coral); }
.act.forced > .ai { color: var(--coral); }
.mood { text-align: left; padding: 11px 13px; border-radius: 16px; background: #15302b; color: rgba(255,255,255,.88); font-size: 12.5px; line-height: 1.55; margin-bottom: 10px; }
.mood b { color: #7ff0dc; }
.item .owned { font-size: 11px; font-weight: 700; color: var(--mint-d); }
.home-tag { display: inline-block; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--mint-l); color: var(--mint-d); margin-left: 4px; vertical-align: 1px; }

/* 채혈 미니게임 */
.card.blood h2 { margin-bottom: 4px; }
.blood-vein { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--mint-l); color: var(--mint-d); }
.blood-vein.hard { background: var(--coral-l); color: var(--coral); }
.arm { position: relative; margin: 16px 0 12px; height: 92px; border-radius: 46px; background: linear-gradient(180deg, #f7d7bd, #eec3a2); box-shadow: inset 0 -6px 12px rgba(0,0,0,.08); overflow: hidden; }
.vein { position: absolute; left: -10%; right: -10%; top: 40px; height: 9px; border-radius: 5px; background: rgba(110,120,200,.55); transform: rotate(-3deg); }
.vein.faint { background: rgba(110,120,200,.18); }
.track { position: absolute; left: 16px; right: 16px; top: 26px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.35); }
.zone { position: absolute; top: 0; bottom: 0; border-radius: 10px; background: rgba(53,196,138,.55); box-shadow: inset 0 0 0 2px rgba(18,138,118,.7); }
.needle { position: absolute; top: -10px; width: 4px; height: 58px; margin-left: -2px; border-radius: 2px; background: #2d3436; box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.needle::after { content: ''; position: absolute; bottom: -6px; left: -3px; border: 5px solid transparent; border-top: 8px solid #2d3436; }
.anger { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.anger b { flex: 1; height: 8px; border-radius: 4px; background: #eef4f3; overflow: hidden; }
.anger i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb36b, var(--coral)); transition: width .3s; }
.blood-msg { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 10px 0 2px; min-height: 20px; }
.blood-msg.bad { color: var(--coral); }
.blood-msg.good { color: var(--mint-d); }
button.primary.danger { background: #e53935; box-shadow: 0 8px 20px rgba(229,57,53,.3); }
.choice #choice-btns { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.choice #choice-btns button { text-align: left; padding: 12px 14px; border-radius: 14px; background: #f5f9f8; font-size: 13.5px; font-weight: 700; }
.choice #choice-btns button small { display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); margin-top: 2px; }
.choice #choice-btns button:active { background: var(--mint-l); }
.choice h2 { font-size: 17px; line-height: 1.45; }

@keyframes sheetIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.actor-ov { display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
.actor-ov .pbar { visibility: hidden; }

.qbtn b { font-weight: 700; font-size: 11.5px; }

/* ===== 스테이지 미리보기 ===== */
.card.brief .tabs { margin: 0 0 10px; }
.minimap { width: 100%; height: auto; display: block; border-radius: 16px; background: #cfe6e0; }
.minimap text { font-family: var(--font); }
.map-wrap { position: relative; }
.scale-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.scale-grid div { background: #f5f9f8; border-radius: 12px; padding: 8px 6px; text-align: center; }
.scale-grid b { display: block; font-size: 17px; font-weight: 800; }
.scale-grid small { font-size: 10.5px; color: var(--ink-3); font-weight: 600; }
.ev-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; justify-content: flex-start; }
.ev { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 5px 9px; border-radius: 999px; background: #f5f9f8; color: var(--ink-2); }
.ev .ic { font-size: 13px; color: var(--mint-d); }
.ev.warn { background: var(--coral-l); color: var(--coral); }
.ev.warn .ic { color: var(--coral); }
.stage-next { margin-top: 10px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; border: 1.5px dashed rgba(21,48,43,.15); font-size: 12px; color: var(--ink-3); text-align: left; }
.stage-next .ic { font-size: 18px; }
.plan { text-align: left; padding: 11px 13px; border-radius: 16px; background: linear-gradient(135deg, #e3f6f1, #d2efe7); margin-top: 6px; }
.plan h4 { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--mint-d); margin-bottom: 4px; }
.plan h4 .ic { font-size: 16px; }
.plan p { font-size: 12.5px; color: var(--ink); line-height: 1.5; }
.brief-mates { margin-top: 6px; text-align: left; padding: 10px 12px; border-radius: 15px; background: #f5f9f8; }
.brief-mates > b { font-size: 12.5px; display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.brief-mates > b .ic { font-size: 16px; color: var(--mint-d); }
.brief-mates .mate-row { border-top: none; padding: 5px 0 0; }
#preview-bar { position: absolute; left: 10px; right: 10px; top: 10px; z-index: 45; display: flex; align-items: center; gap: 8px; padding: 9px 9px 9px 14px; border-radius: 18px; background: rgba(21,48,43,.92); color: #fff; box-shadow: 0 10px 30px rgba(21,48,43,.35); }
#preview-bar .pv-tx { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
#preview-bar .pv-tx b { font-size: 13.5px; }
#preview-bar .pv-tx span { font-size: 11px; color: rgba(255,255,255,.7); }
.pv-btn { padding: 9px 13px; border-radius: 12px; background: #7ff0dc; color: #15302b; font-weight: 800; font-size: 13px; }
.pv-btn.ghosty { background: rgba(255,255,255,.12); color: #fff; }

.v-top span { white-space: nowrap; overflow: hidden; }
.v-top { gap: 3px; }
.vital.bladder .v-top span { letter-spacing: -0.04em; }

/* ===== 스토리 디오라마 ===== */
#cutscene { position: fixed; inset: 0; z-index: 95; background: radial-gradient(120% 90% at 50% 30%, #2b4a44, #0f1f1c); }
#cs-stage, #cs-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cs-bar { position: absolute; left: 0; right: 0; height: 9vh; background: #000; z-index: 2; transition: transform .6s ease; }
.cs-bar.top { top: 0; } .cs-bar.bottom { bottom: 0; }
#cutscene.intro .cs-bar.top { transform: translateY(-100%); }
#cutscene.intro .cs-bar.bottom { transform: translateY(100%); }
.cs-head { position: absolute; top: calc(9vh + 10px + env(safe-area-inset-top)); left: 14px; right: 14px; z-index: 3; display: flex; align-items: center; justify-content: space-between; }
#cs-title { color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .02em; background: rgba(255,255,255,.12); padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(6px); }
#cs-skip { color: rgba(255,255,255,.85); font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.35); }
#cs-box { position: absolute; left: 12px; right: 12px; bottom: calc(9vh + 12px + env(safe-area-inset-bottom)); z-index: 3; max-width: 460px; margin: 0 auto; background: rgba(255,255,255,.96); border-radius: 18px; padding: 14px 16px 12px; box-shadow: 0 12px 40px rgba(0,0,0,.35); min-height: 96px; }
#cs-who { display: inline-block; font-size: 12px; font-weight: 800; color: #fff; background: var(--who, #15302b); padding: 3px 10px; border-radius: 999px; margin-bottom: 6px; }
#cs-who:empty { display: none; }
#cs-text { font-size: 15px; font-weight: 600; line-height: 1.55; color: var(--ink); min-height: 46px; }
#cs-box.narr { background: rgba(21,48,43,.9); }
#cs-box.narr #cs-text { color: #fff; text-align: center; font-weight: 700; }
.cs-next { display: block; text-align: right; font-size: 11px; font-weight: 700; color: var(--ink-3); margin-top: 4px; animation: blink 1.2s infinite; }
#cs-box.narr .cs-next { color: rgba(255,255,255,.6); }
@keyframes blink { 50% { opacity: .3; } }

/* ===== 의료지식 퀴즈 ===== */
#screen-quiz { z-index: 110; }
.card.quiz { text-align: left; }
.quiz-top { display: flex; align-items: center; gap: 8px; }
.quiz-badge { width: 32px; height: 32px; border-radius: 10px; background: var(--violet-l); color: var(--violet); font-size: 18px; }
.card.quiz h2 { font-size: 18px; line-height: 1.45; margin: 10px 0 8px; }
#quiz-opts { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
#quiz-opts button { text-align: left; padding: 12px 14px; border-radius: 14px; background: #f5f9f8; font-size: 14px; font-weight: 700; border: 2px solid transparent; }
#quiz-opts button.ok { background: var(--mint-l); border-color: var(--mint); color: var(--mint-d); }
#quiz-opts button.bad { background: var(--coral-l); border-color: var(--coral); color: var(--coral); }
#quiz-opts button:disabled { opacity: 1; }
.quiz-exp { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #15302b; color: #fff; font-size: 12.5px; line-height: 1.5; }
.quiz-exp b { color: #7ff0dc; }
.mate-row.locked .focus-seg { opacity: .45; pointer-events: none; }
.lock-tag { font-size: 10.5px; font-weight: 800; color: #2d3e66; background: #e3e8f4; padding: 3px 8px; border-radius: 999px; margin-left: auto; white-space: nowrap; }

/* ===== v4: 안내 문구는 HUD 게이지 위에, 시설 버튼은 좌우 레일로 ===== */
#hud { position: relative; }
#toasts { position: absolute; top: auto; bottom: 0; left: 10px; right: 10px; width: auto; transform: none; z-index: 40; display: block; pointer-events: none; }
#toasts .toast { width: 100%; max-width: none; min-height: 44px; border-radius: 14px; padding: 6px 12px 6px 7px; font-size: 12.5px; box-shadow: 0 6px 18px rgba(21,48,43,.18); animation: toastIn .18s ease-out, fadeOut .35s ease-in 2.1s forwards; }
#toasts .toast > span:last-child { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#hint { position: absolute; left: 10px; right: 10px; top: 8px; bottom: auto; z-index: 41; }
.zoom-ctl { top: 50%; bottom: auto; transform: translateY(-50%); }
.rail { position: absolute; bottom: 10px; z-index: 22; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 8px 6px 9px; border-radius: 18px;
  background: rgba(255,255,255,.62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 4px 14px rgba(21,48,43,.12); }
.rail.left { left: 8px; } .rail.right { right: 8px; }
.rail-cap { font-size: 9.5px; font-weight: 800; color: var(--ink-3); letter-spacing: -.02em; white-space: nowrap; }
.rail .sbtn { position: static; transform: none !important; gap: 4px; }
.rail .sbtn .pin::after { display: none; }
.rail .sbtn .pin { width: 42px; height: 42px; font-size: 21px; }
.rail { gap: 6px; padding: 6px 4px 7px; border-radius: 14px; }
.rail .sbtn .pin { width: 34px; height: 34px; font-size: 17px; }
.rail .sbtn small { font-size: 9px; padding: 1px 5px; }
.rail-cap { font-size: 8.5px; }
.rail.left { left: 4px; } .rail.right { right: 4px; }
.zoom-ctl { top: 34%; right: 6px; }
.zoom-ctl button { width: 32px; height: 30px; font-size: 14px; }

/* 지시·호출 요청 칩 (지도 위가 아니라 도크에) */
.errand { display: none !important; }
#requests { display: flex; gap: 5px; flex: none; }
#requests:empty { display: none; }
.req { position: relative; overflow: hidden; display: flex; align-items: center; gap: 4px; flex: none; max-width: 150px; font-size: 11.5px; font-weight: 800; padding: 5px 9px 7px 6px; border-radius: 12px; color: #fff; background: #2d3e66; box-shadow: 0 3px 8px rgba(21,48,43,.2); animation: bump .3s ease-out; }
.req.doc { background: #b07d00; }
.req .ic { font-size: 14px; flex: none; }
.req span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req i { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #ffd166; transform-origin: left; }
.req.queued { opacity: .55; }
.bubble { max-width: 150px; font-size: 10.5px; padding: 4px 8px; border-radius: 10px; opacity: .95; }

/* v5 */
.req-row { padding: 6px 6px 6px 8px; margin: -2px -2px 0; border-radius: 14px; background: linear-gradient(90deg, rgba(45,62,102,.10), rgba(176,125,0,.08)); }
.req-row .dock-label { color: #2d3e66; }
#requests { flex: 1; overflow-x: auto; scrollbar-width: none; }
#requests::-webkit-scrollbar { display: none; }
.req { max-width: 220px; }
.cs-btns { display: flex; gap: 6px; }
#cs-mute { width: 34px; height: 30px; border-radius: 999px; background: rgba(0,0,0,.35); color: #fff; font-size: 16px; display: flex; align-items: center; justify-content: center; }
#cs-mute.off { color: rgba(255,255,255,.5); }

.po .bar i.over { width: 100% !important; background: var(--coral); animation: overBlink .5s infinite; }
@keyframes overBlink { 50% { opacity: .25; } }
/* 동료·팀장 처리 중 = 파란색 원 (내 처리 중 = 민트 체크와 구분) */
.po .mate-tag { background: #2f6fe4 !important; width: 15px; height: 15px; }
.po.by-mate .badge-ic { box-shadow: 0 0 0 2.5px #2f6fe4, 0 3px 8px rgba(21,48,43,.22); }
.po.by-mate .bar { box-shadow: 0 0 0 1.5px #2f6fe4; }
.badge-ic.mate { --c: #fff; background: #2f6fe4 !important; }

#cs-sound-hint { align-self: center; font-size: 10.5px; font-weight: 700; color: #fff; background: rgba(0,0,0,.45); padding: 5px 9px; border-radius: 999px; white-space: nowrap; }

/* ===== 튜토리얼 코치마크 ===== */
#coach { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.coach-hole { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(8, 22, 19, .62); outline: 3px solid #7ff0dc; outline-offset: 2px; transition: left .08s linear, top .08s linear, width .15s, height .15s; }
.coach-hole.none { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; outline: none; }
.coach-finger { position: fixed; width: 46px; height: 46px; border-radius: 50%; background: #7ff0dc; color: #15302b; font-size: 26px; box-shadow: 0 6px 16px rgba(0,0,0,.35); animation: tapPulse 1.1s ease-in-out infinite; }
.coach-finger.hidden { display: none; }
@keyframes tapPulse { 0%,100% { transform: translate(-50%, 0) scale(1); } 50% { transform: translate(-50%, -8px) scale(.92); } }
.coach-card { position: fixed; left: 12px; right: 12px; max-width: 440px; margin: 0 auto; pointer-events: auto; background: #fff; border-radius: 20px; padding: 13px 16px 14px; box-shadow: 0 16px 40px rgba(0,0,0,.35); animation: cardIn .25s ease-out; }
.coach-card.top { top: calc(env(safe-area-inset-top) + 12px); }
.coach-card.bottom { bottom: calc(env(safe-area-inset-bottom) + 12px); }
.coach-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.coach-step { font-size: 11px; font-weight: 800; color: var(--mint-d); background: var(--mint-l); padding: 3px 9px; border-radius: 999px; }
#coach-skip { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.coach-text { font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.coach-text b { color: var(--mint-d); }
#coach-next { margin-top: 10px; padding: 12px; font-size: 15px; }

/* 나 · 팀장 화살표 */
.big-arrow { pointer-events: none; display: flex; flex-direction: column; align-items: center; z-index: 6; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.big-arrow.me { color: #ffd23f; }
.big-arrow.lead { color: #5b7bd6; transform-origin: bottom; }
.big-arrow.lead svg { width: 30px; height: 35px; }
.ar-tag { font-size: 12px; font-weight: 900; padding: 2px 9px; border-radius: 999px; margin-bottom: 2px; color: #15302b; background: #ffd23f; border: 2px solid #15302b; }
.big-arrow.lead .ar-tag { background: #2d3e66; color: #fff; border-color: #fff; font-size: 11px; }
.nametag.hide { display: none; }

/* 화살표: 작고 반투명하게 */
.big-arrow { opacity: .55; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.big-arrow svg { width: 17px; height: 20px; }
.big-arrow.lead { opacity: .45; }
.big-arrow.lead svg { width: 14px; height: 16px; }
.ar-tag { font-size: 9px; padding: 0 5px; border-width: 1.5px; margin-bottom: 1px; }
.big-arrow.lead .ar-tag { font-size: 8.5px; }
/* 지도 위 약품장 버튼(작게) */
.sbtn.mini .pin { width: 30px; height: 30px; font-size: 15px; }
.sbtn.mini small { font-size: 9px; padding: 1px 6px; }

/* 채혈: 멈춘 바늘 결과 표시 */
.needle { transition: background .15s; }
.needle.hit { background: #12a37e; box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 12px rgba(18,163,126,.8); }
.needle.hit::after { border-top-color: #12a37e; }
.needle.miss { background: #e53935; box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 12px rgba(229,57,53,.7); animation: needleShake .3s; }
.needle.miss::after { border-top-color: #e53935; }
.zone.hit { background: rgba(53,196,138,.85); }
.zone.miss { box-shadow: inset 0 0 0 2px rgba(229,57,53,.7); }
#btn-blood-stop:disabled { opacity: .55; }
#btn-blood-stop { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
@keyframes needleShake { 25% { margin-left: -5px; } 75% { margin-left: 1px; } }
