/* ============================================================
   Patient Connect — Design v4 "CLINICAL WORKSPACE"
   참고: Linear(quiet chrome) · Stripe(table-first) · Notion(sidebar shell)
   원칙: 액센트 1개(#4f46e5) / 1px 보더 / 장식 0 / 타이포 위계
   ============================================================ */
:root {
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #a1a1aa;
  --line: #e4e4e7;
  --line-soft: #f1f1f3;
  --canvas: #f7f7f8;
  --surface: #ffffff;
}
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { background: var(--canvas); color: var(--ink); font-feature-settings: 'tnum'; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 앱 쉘 / 사이드바 ---------- */
.sidebar {
  width: 248px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
@media (max-width: 1023px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .22s cubic-bezier(.3,.7,.4,1); box-shadow: 0 0 0 100vmax rgba(0,0,0,0); }
  .sidebar.open { transform: none; box-shadow: 24px 0 60px -30px rgba(0,0,0,.25); }
}
.sb-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(24,24,27,.35); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sb-backdrop.on { opacity: 1; pointer-events: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--line-soft); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item i { width: 18px; text-align: center; font-size: 13px; color: var(--ink-3); }
.nav-item.active i { color: var(--accent); }
.nav-label { padding: 0 10px; margin: 14px 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }

/* ---------- 버튼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s; white-space: nowrap; }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  background: var(--accent); color: #fff; transition: background .12s; white-space: nowrap; cursor: pointer; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line);
  transition: background .12s, color .12s, border-color .12s; white-space: nowrap; cursor: pointer; }
.btn-ghost:hover { background: var(--line-soft); color: var(--ink); }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-kakao { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; padding: 0 18px; border-radius: 10px; font-size: 15px; font-weight: 700;
  background: #FEE500; color: #191919; cursor: pointer; }
.btn-touch { min-height: 40px; }

/* ---------- 입력 ---------- */
.input, .input-light {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-size: 14px; transition: border-color .12s, box-shadow .12s;
}
.input::placeholder, .input-light::placeholder { color: var(--ink-3); }
.input:focus, .input-light:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

/* ---------- 칩 / 탭 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  transition: all .12s; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: #cfcfd4; color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab {
  display: inline-flex; align-items: center; height: 38px; padding: 0 4px; margin-right: 18px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-3);
  border-bottom: 2px solid transparent; transition: color .12s; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--ink-2); }
.tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* ---------- 카드 / 테이블 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.card-hover { transition: border-color .15s, box-shadow .15s; }
.card-hover:hover { border-color: #c7c7ce; box-shadow: 0 4px 16px -6px rgba(24,24,27,.1); }
.tbl { width: 100%; font-size: 13.5px; }
.tbl th { text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--ink-3); border-bottom: 1px solid var(--line); background: #fcfcfd; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.tbl tbody tr:hover { background: #fafafa; }
.tbl tbody tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 배지 ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; }
.badge-neutral { background: var(--line-soft); color: var(--ink-2); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-ok { background: #ecfdf5; color: #047857; }
.badge-warn { background: #fffbeb; color: #b45309; }
.badge-danger { background: #fef2f2; color: #b91c1c; }

/* ---------- 스켈레톤 / 토스트 ---------- */
.skeleton { background: linear-gradient(90deg, #ececef 25%, #f5f5f6 50%, #ececef 75%); background-size: 600px 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: 600px 0 } }
.toast { animation: toastIn .25s cubic-bezier(.3,.7,.4,1) both; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px) } to { opacity: 1; transform: translate(-50%, 0) } }
.fade-in { animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.card-in { animation: fadeIn .25s ease both; }

/* ---------- 비포애프터 / 마소너리 ---------- */
.masonry { columns: 2 280px; column-gap: 16px; }
.masonry > * { break-inside: avoid; margin-bottom: 16px; }
.ba-before, .ba-after { display: block; }

/* ---------- 프린트 ---------- */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}

/* ============================================================
   상담(발표) 화면 전용 — cinema 다크 (기능 화면이므로 유지, 크롬은 중립화)
   ============================================================ */
.cinema { background: #101012; color: #f4f4f5; }
.cinema ::-webkit-scrollbar-thumb { background: #3f3f46; }

.cinema .glass, .glass-dark {
  background: #1a1a1e; border: 1px solid #2a2a31; border-radius: 12px;
}
.cinema .glass-strong, .glass-strong {
  background: #1e1e23; border: 1px solid #2e2e36; border-radius: 12px;
}
.cinema .card { background: #1a1a1e; border-color: #2a2a31; }
.cinema .clinic-title { color: #f4f4f5; }
.clinic-title { color: var(--ink); }
.grad-text { color: #a5b4fc; }
.grad-text-blue { color: var(--accent); }
.grad-animate { }
.grad-border { border: 1px solid #34343d; border-radius: inherit; }
.grad-border::before { display: none; }
.cinema .btn-primary { background: #6366f1; }
.cinema .btn-primary:hover { background: #818cf8; }
.cinema .btn-ghost { background: #26262c; border-color: #34343d; color: #d4d4d8; }
.cinema .btn-ghost:hover { background: #2e2e35; }
.cinema .chip { background: #1e1e23; border-color: #2e2e36; color: #a1a1aa; }
.cinema .chip.on { background: #f4f4f5; border-color: #f4f4f5; color: #18181b; }
.input-dark { background: #1a1a1e; border: 1px solid #2e2e36; border-radius: 8px; color: #f4f4f5; font-size: 14px; }
.input-dark::placeholder { color: #71717a; }
.input-dark:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.cinema .skeleton { background: linear-gradient(90deg, #1e1e23 25%, #26262c 50%, #1e1e23 75%); background-size: 600px 100%; }

.film-thumb { transition: all .18s ease; opacity: .45; border-radius: 8px; }
.film-thumb:hover { opacity: .8; }
.film-thumb.active { opacity: 1; outline: 2px solid #818cf8; outline-offset: 2px; }

.compare-wrap { position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; }
.compare-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split, 50%)); }
.compare-handle { position: absolute; top: 0; bottom: 0; width: 3px; background: #818cf8; box-shadow: 0 0 12px rgba(129,140,248,.6); left: var(--split, 50%); transform: translateX(-50%); }
.compare-handle::after { content: '⟷'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 34px; height: 34px; border-radius: 50%; background: #818cf8; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }

.consult-text { font-size: 19px; line-height: 1.7; }

/* 레거시 클래스 무해화 (재작성 안 된 참조 대비) */
.apple-bg::before { display: none; }
.blob, .float-y, .pulse-glow { animation: none; }
.blob { display: none; }
.reveal { opacity: 1; transform: none; }
.hero-title { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.hero-sub { font-size: 16px; color: var(--ink-2); }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
