/* 환자 페이지(2026-11-23). 시안: 흰 카드 + 슬레이트 글자 + 파랑 강조(#1d4ed8), 확인 필요는 주황. */
.vet-patient-page { background: #f8fafc; color: #0f172a; }
.vet-patient-page a { color: #1d4ed8; }

.vp-switch { background: #fff; border-bottom: 1px solid #e2e8f0; }
.vp-switch-inner { max-width: var(--vet-page-max, 1360px); margin: 0 auto; padding: 10px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.vp-crumb { display: flex; gap: 6px; align-items: center; font-size: 13px; color: #475569; }
.vp-crumb a { text-decoration: none; }
.vp-crumb span:last-child { color: #0f172a; font-weight: 700; }
.vp-search { position: relative; flex: 1 1 320px; min-width: 0; display: flex; align-items: center; gap: 8px; }
.vp-search label { font-size: 13px; font-weight: 700; color: #334155; white-space: nowrap; margin: 0; }
.vp-search input { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; font-size: 14px; background: #f8fafc; }
.vp-search-results { position: absolute; top: calc(100% + 4px); left: 72px; right: 0; z-index: 20; background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .08); max-height: 360px; overflow-y: auto; }
.vp-search-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; color: #0f172a; text-decoration: none; font-size: 14px; }
.vp-search-row:hover, .vp-search-row:focus { background: #eff6ff; }
.vp-search-row.is-disabled { color: #64748b; cursor: not-allowed; }
.vp-search-row small { color: #64748b; }
.vp-search-empty { padding: 10px 12px; font-size: 13px; color: #475569; }
.vp-recent { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vp-recent-label { font-size: 12px; color: #475569; }
.vp-recent-chip { font-size: 13px; text-decoration: none; padding: 6px 10px; border-radius: 999px; border: 1px solid #e2e8f0; color: #334155 !important; }
.vp-recent-chip.is-current { border-color: #1d4ed8; background: #eff6ff; color: #1e3a8a !important; font-weight: 700; }

.vp-main { max-width: var(--vet-page-max, 1360px); margin: 0 auto; padding: 20px var(--vet-gutter, 24px) 48px; }
.vp-status { padding: 24px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; color: #475569; }
#vpContent { display: flex; flex-direction: column; gap: 18px; }
#vpContent[hidden] { display: none; }
.vp-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.vp-card[hidden] { display: none; }
.vp-card h2 { margin: 0; font-size: 17px; }
.vp-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.vp-muted { color: #475569; font-size: 13px; margin: 0; }
.vp-error { color: #b91c1c; font-size: 13px; margin: 0; }

.vp-identity { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.vp-identity-main { display: flex; gap: 16px; align-items: center; min-width: 0; }
.vp-avatar { width: 60px; height: 60px; flex: 0 0 60px; border-radius: 50%; background: #dbeafe; color: #1d4ed8; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; }
.vp-identity-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vp-name-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.vp-name-line h1 { margin: 0; font-size: 26px; }
.vp-name-line span, .vp-sub { font-size: 13px; color: #475569; }
.vp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.vp-chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #f1f5f9; color: #334155; }
.vp-chip.is-primary { background: #dbeafe; color: #1e3a8a; }
.vp-chip.is-warn { background: #fef3c7; color: #78350f; }
.vp-chip.is-muted { font-weight: 400; color: #475569; }
.vp-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.vp-actions small { font-size: 12px; color: #475569; }
.vp-action-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.vp-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; color: #0f172a !important; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.vp-btn.is-primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff !important; }
.vp-btn:disabled { opacity: .6; cursor: default; }

.vp-attention { background: #fff7ed; border: 1px solid #fdba74; border-radius: 14px; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.vp-attention-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.vp-attention-head strong { color: #7c2d12; }
.vp-attention-head span { font-size: 13px; color: #9a3412; }
.vp-attention-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.vp-attention-item { background: #fff; border: 1px solid #fed7aa; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.vp-attention-item strong { font-size: 14px; }
.vp-attention-item span { color: #475569; }
.vp-attention-item a { font-weight: 700; }
.vp-attention-empty { font-size: 13px; color: #475569; }
.vp-attention:has(.vp-attention-empty) { background: #fff; border-color: #e2e8f0; }

.vp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.vp-kpi { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #475569; }
.vp-kpi strong { font-size: 26px; color: #0f172a; }
.vp-kpi small { font-size: 12px; }
.vp-progress { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.vp-progress div { height: 8px; background: #2563eb; }

.vp-columns { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.vp-col-main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.vp-col-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
#vpWeightChart svg { width: 100%; height: auto; }

.vp-timeline { list-style: none; margin: 0; padding: 0; }
.vp-timeline-row { display: grid; grid-template-columns: 92px 88px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.vp-timeline-row:last-child { border-bottom: 0; }
/* 타임라인 종류 필터(2026-11-25) */
.vp-timeline-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; }
.vp-timeline-filter .vp-chip { border: 1px solid #e2e8f0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.vp-timeline-filter .vp-chip.is-active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.vp-timeline-date { font-size: 13px; color: #475569; }
.vp-timeline-text small { color: #475569; }
.vp-kind { justify-self: start; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: #f1f5f9; color: #334155; }
.vp-kind.is-prescription { background: #dbeafe; color: #1e3a8a; }
.vp-kind.is-followup { background: #dcfce7; color: #14532d; }
.vp-kind.is-consultation { background: #fef3c7; color: #78350f; }

.vp-pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #f1f5f9; color: #334155; }
.vp-pill.is-ok { background: #dcfce7; color: #14532d; }
.vp-rx-title { margin: 0; font-size: 14px; color: #334155; }
.vp-rx-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.vp-rx-facts div { background: #f8fafc; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.vp-rx-facts span { font-size: 12px; color: #475569; }
.vp-ingredients { display: flex; flex-wrap: wrap; gap: 6px; }
.vp-ingredient { font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid #e2e8f0; }

@media (max-width: 720px) {
  .vp-switch-inner, .vp-main { padding-left: 16px; padding-right: 16px; }
  .vp-actions, .vp-action-row { align-items: stretch; justify-content: flex-start; }
  .vp-search-results { left: 0; }
  /* 휴대폰: 첫 줄 날짜·종류·열기, 둘째 줄 제목 */
  .vp-timeline-row { grid-template-columns: auto auto 1fr; grid-template-areas: "date kind link" "text text text"; row-gap: 4px; }
  .vp-timeline-date { grid-area: date; }
  .vp-kind { grid-area: kind; }
  .vp-timeline-row > a, .vp-timeline-row > span:last-child:not(.vp-timeline-text) { grid-area: link; justify-self: end; }
  .vp-timeline-text { grid-area: text; }
}

/* 경과 질문 보내기(2026-11-23) */
.vp-question textarea { width: 100%; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.6; }
.vp-action-row.is-start { justify-content: flex-start; }
.vp-link { border: 0; background: none; color: #1d4ed8; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 0; }
.confirmed-dx-cured { margin-top: 8px; }
.confirmed-dx-cured summary { cursor: pointer; font-size: 13px; color: #475569; padding: 6px 0; }

/* 치료 지표 추이(2026-11-23, 2단계) */
.vp-metric-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vp-metric-chip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid #cbd5e1; background: #fff; color: #334155; font: inherit; font-size: 13px; cursor: pointer; }
.vp-metric-chip span { margin-left: 6px; color: #64748b; font-size: 12px; }
.vp-metric-chip.is-on { background: #1d4ed8; border-color: #1d4ed8; color: #fff; font-weight: 700; }
.vp-metric-chip.is-on span { color: #dbeafe; }
.vp-metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.vp-metric { border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vp-metric-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.vp-metric-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vp-metric-head small { font-size: 12px; color: #475569; }
.vp-metric-value { align-items: flex-end; }
.vp-metric-value strong { font-size: 18px; }
.vp-chart { position: relative; height: 150px; }
.vp-chart-plot { position: absolute; left: 40px; right: 10px; top: 8px; bottom: 24px; border-bottom: 1px solid #cbd5e1; }
.vp-chart-plot svg { position: absolute !important; left: 0; top: 0; width: 100% !important; height: 100% !important; max-width: none !important; overflow: visible; }
.vp-chart-band { position: absolute; left: 0; right: 0; background: #dcfce7; }
.vp-chart-line { fill: none; stroke: #2563eb; stroke-width: 2.5; }
.vp-chart-plan { fill: none; stroke: #64748b; stroke-width: 1.5; stroke-dasharray: 5 4; }
.vp-chart-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #2563eb; }
.vp-chart-dot.is-last { background: #ea580c; }
.vp-chart-y { position: absolute; left: -40px; width: 34px; text-align: right; font-size: 11px; color: #475569; }
.vp-chart-y.is-top { top: -7px; } .vp-chart-y.is-bottom { bottom: -7px; }
.vp-chart-x { position: absolute; bottom: -20px; font-size: 11px; color: #475569; }
.vp-chart-x.is-start { left: 0; } .vp-chart-x.is-end { right: 0; }
.vp-chart-single { margin: 4px 0; font-size: 14px; }
.vp-chart-single small { color: #64748b; font-size: 12px; margin-left: 6px; }
.vp-metric-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: #14532d; }
.vp-metric-foot b.is-ok { color: #14532d; } .vp-metric-foot b.is-warn { color: #9a3412; } .vp-metric-foot b.is-muted { color: #475569; }
.vp-metric-note { font-size: 12px; }

/* 타임라인 팝업(2026-11-26): 경과보고 검토·회신, 보호자 요청. 머리(제목·이전·다음·닫기)는 고정, 본문만 스크롤. */
body.vp-popup-open { overflow: hidden; }
.vp-popup-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; padding: 24px; }
.vp-popup-backdrop[hidden] { display: none; }
.vp-popup { width: min(860px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 23, 42, .25); overflow: hidden; }
.vp-popup-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #e2e8f0; background: #fff; }
.vp-popup-head h2 { margin: 0; font-size: 17px; }
.vp-popup-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.vp-popup-nav .vp-btn[disabled] { opacity: .45; cursor: default; }
.vp-popup-body { overflow-y: auto; padding: 14px 16px 18px; flex: 1 1 auto; }
.vp-popup-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 8px 0; }
.vp-popup-facts div { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 8px; }
.vp-popup-facts span { display: block; font-size: 12px; color: #64748b; }
.vp-popup-facts strong { font-size: 13px; color: #0f172a; }
.vp-popup-text { margin: 0 0 10px; white-space: pre-wrap; font-size: 14px; line-height: 1.6; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; }
.vp-popup-body h4 { margin: 12px 0 4px; font-size: 14px; }
@media (max-width: 720px) {
  .vp-popup-backdrop { padding: 0; }
  .vp-popup { max-height: 100vh; height: 100%; border-radius: 0; }
  .vp-popup-head { flex-direction: column; align-items: stretch; }
}
/* 이전·다음 로딩(2026-11-26): 지금 내용을 흐리게 두고 머리에 '불러오는 중'. */
.vp-popup-body.is-refreshing { opacity: .55; pointer-events: none; transition: opacity .15s; }
.vp-popup-loading { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #1d4ed8; font-weight: 700; }
.vp-popup-loading[hidden] { display: none; }
.vp-spinner { width: 12px; height: 12px; border: 2px solid #bfdbfe; border-top-color: #1d4ed8; border-radius: 50%; animation: vp-spin .8s linear infinite; }
@keyframes vp-spin { to { transform: rotate(360deg); } }
.vp-popup { min-height: min(520px, calc(100vh - 48px)); }
/* 처방 팝업(2026-11-26) */
.vp-popup-actions { position: sticky; top: -14px; z-index: 1; display: flex; justify-content: flex-end; padding: 6px 0 10px; background: #fff; }
.vp-popup-prescription { margin: 0; }
/* 감량 프로그램(2026-11-30, vet-weight-program.js) */
.vwp-card { margin-top: 14px; }
.vwp-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.vwp-summary > div { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.vwp-summary span, .vwp-summary small { color: #475569; font-size: 12px; }
.vwp-summary b { font-size: 18px; }
.vwp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.vwp-steps li { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; display: flex; gap: 8px; align-items: flex-start; }
.vwp-steps li.is-current { border-color: #1d4ed8; background: #eff6ff; }
.vwp-steps li.is-pending { opacity: .75; }
.vwp-steps p { margin: 4px 0 0; font-size: 12px; color: #475569; }
.vwp-step-no { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #e2e8f0; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.vwp-steps li.is-done .vwp-step-no { background: #16a34a; color: #fff; }
.vwp-steps li.is-current .vwp-step-no { background: #1d4ed8; color: #fff; }
.vwp-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: 11px; font-weight: 700; }
.vwp-tag.is-done { background: #dcfce7; color: #166534; }
.vwp-tag.is-current { background: #dbeafe; color: #1e40af; }
.vwp-block { border-top: 1px solid #eef2f7; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.vwp-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.vwp-dl dt { font-size: 12px; color: #475569; }
.vwp-dl dd { margin: 0; font-size: 14px; font-weight: 700; }
.vwp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vwp-table th, .vwp-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #eef2f7; }
.vwp-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.vwp-form label { display: flex; flex-direction: column; font-size: 12px; color: #475569; gap: 3px; }
.vwp-form input { min-height: 36px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 0 8px; font: inherit; max-width: 170px; }
.vwp-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vwp-link { border: 0; background: none; color: #1d4ed8; text-decoration: underline; cursor: pointer; font: inherit; font-size: 12px; padding: 0; }
.vwp-share { border: 1px solid #dbeafe; border-radius: 10px; padding: 10px 12px; background: #f8fbff; display: flex; flex-direction: column; gap: 6px; }
.vwp-share p { margin: 0; }
#vwpReport { width: 100%; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; }
@media (max-width: 900px) { .vwp-summary, .vwp-steps, .vwp-dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vwp-choice { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
