/* ============================================================
   PetCare+ 1.5 · 기록 화면 전용 스타일
   Soft Medical + Calm Dashboard + Warm Care
   ============================================================ */

:root {
  /* Palette (기록 화면 스펙) */
  --bg: #F7F8F5;
  --primary: #6FAF9A;
  --deep: #315B4E;
  --mint: #DDEFE7;
  --bluegray: #E7EEF1;
  --text: #25332E;
  --sub: #738079;
  --card: #FFFFFF;
  --warn: #F6D8C8;
  --warn-text: #B0693F;

  --line: #EAEEEA;
  --shadow: 0 8px 28px rgba(49, 91, 78, 0.07);
  --shadow-sm: 0 4px 16px rgba(49, 91, 78, 0.06);

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --r-pill: 999px;

  --font: Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t: 0.22s;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  display: flex; justify-content: center; align-items: flex-start;
  min-height: 100vh; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }
.material-symbols-rounded { font-variation-settings: 'wght' 300, 'opsz' 24, 'FILL' 0, 'GRAD' 0; user-select: none; }

/* ── App frame ───────────────────────────────────────── */
.app {
  position: relative;
  width: 100%; max-width: 430px;
  height: 100vh;
  height: 100dvh; /* 모바일: 주소창 제외한 실제 보이는 높이 */
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
@media (min-width: 480px) {
  body { padding: 28px 0; }
  .app {
    min-height: 0; height: 904px;
    border-radius: 40px;
    box-shadow: 0 40px 90px rgba(49, 91, 78, 0.18), 0 0 0 1px rgba(0,0,0,0.04);
  }
}

.status-bar {
  flex-shrink: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 26px 2px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.02em;
}
.status-bar .ic { display: flex; align-items: center; gap: 7px; }
.status-bar .ic .material-symbols-rounded { font-size: 18px; }

.scroll { flex: 1; overflow-y: auto; padding: 0 20px 28px; scroll-behavior: smooth; }
.scroll::-webkit-scrollbar { display: none; }
.scroll { scrollbar-width: none; }

/* ── Header (page-hero 디자인 통일) ──────────────────── */
.r-header {
  flex-shrink: 0;
  background: linear-gradient(145deg, #2d6a3f 0%, #3F7A4D 45%, #5a9e6a 100%);
  padding: 16px 20px 22px;
  position: relative;
  overflow: hidden;
}
.r-header::before {
  content: "";
  position: absolute; top: -50px; right: -50px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,0.07); pointer-events: none;
}
.r-header::after {
  content: "";
  position: absolute; bottom: -30px; left: -20px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,0.05); pointer-events: none;
}
.r-header-top { display: flex; align-items: center; justify-content: space-between; }
.r-title { font-size: 22px; font-weight: 900; letter-spacing: -0.04em; color: #fff; }
.r-subtitle { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.72); margin-top: 3px; }
.r-header-actions { display: flex; gap: 8px; }
.pet-chip.static {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 12px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  padding: 5px 14px 5px 10px;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.92);
}
.pet-chip.static .avatar { font-size: 16px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background var(--t) var(--ease);
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn .material-symbols-rounded { font-size: 23px; }

.pet-chip {
  margin-top: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--r-pill);
  background: var(--card); box-shadow: var(--shadow-sm);
  font-size: 15px; font-weight: 700;
}
.pet-chip .avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--mint);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.pet-chip .material-symbols-rounded { font-size: 18px; color: var(--sub); }
.pet-chip.static { cursor: default; }

/* ── Section ─────────────────────────────────────────── */
.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.section-more {
  font-size: 13px; color: var(--sub); font-weight: 600;
  display: flex; align-items: center; gap: 2px;
}
.section-more .material-symbols-rounded { font-size: 17px; }

/* ── Summary card ────────────────────────────────────── */
.summary {
  margin-top: 18px;
  background: linear-gradient(160deg, #FFFFFF 0%, #F3F8F5 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.summary-top { display: flex; align-items: baseline; justify-content: space-between; }
.summary-count { font-size: 15px; font-weight: 700; }
.summary-count b { font-size: 22px; color: var(--deep); }
.summary-last { font-size: 13px; color: var(--sub); }
.summary-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.stat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--r-pill);
  background: var(--mint); color: var(--deep);
  font-size: 13px; font-weight: 600;
}
.stat-pill.alt { background: var(--bluegray); color: #3F6473; }
.stat-pill.warn { background: var(--warn); color: var(--warn-text); }
.stat-pill .material-symbols-rounded { font-size: 16px; }
.summary-note {
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line);
  font-size: 13px; color: var(--sub); line-height: 1.55;
  display: flex; gap: 8px;
}
.summary-note .material-symbols-rounded { font-size: 18px; color: var(--primary); flex-shrink: 0; }

/* ── Quick record buttons ────────────────────────────── */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-btn {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  padding: 14px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  transition: transform var(--t) var(--ease);
}
.quick-btn:active { transform: translateY(2px); }
.quick-ic {
  width: 42px; height: 42px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.quick-ic .material-symbols-rounded { font-size: 22px; }
.quick-btn span { font-size: 12px; font-weight: 600; }
/* 더보기 항목도 부모 4열 그리드에 그대로 이어지도록 (줄 끊김 방지) */
.quick-more { display: none; }
.quick-more.open { display: contents; }
.quick-toggle {
  width: 100%; margin-top: 12px; padding: 11px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; color: var(--sub);
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.quick-toggle .material-symbols-rounded { font-size: 18px; transition: transform var(--t) var(--ease); }
.quick-toggle.open .material-symbols-rounded { transform: rotate(180deg); }

/* ── Filter chips (가로 스크롤) ──────────────────────── */
.filter-row {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 0 2px; margin: 0 -20px; padding-left: 20px; padding-right: 20px;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-row { scrollbar-width: none; }
.filter-chip {
  flex-shrink: 0;
  padding: 9px 16px; border-radius: var(--r-pill);
  background: var(--card); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--sub);
  transition: all var(--t) var(--ease);
}
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Timeline ────────────────────────────────────────── */
.day-group { margin-top: 22px; }
.day-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; margin-bottom: 12px;
}
.day-label .rel { font-size: 13px; font-weight: 600; color: var(--primary); }
.day-label .line { flex: 1; height: 1px; background: var(--line); }

/* 타임라인 세로선 레이아웃 */
.tl-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.tl-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
}
/* 시간 컬럼 */
.tl-time-col {
  width: 52px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 10px;
  padding-top: 14px;
}
.tl-time-txt {
  font-size: 12px;
  font-weight: 600;
  color: var(--sub);
  white-space: nowrap;
  line-height: 1;
}
.tl-time-ampm {
  font-size: 10px;
  color: var(--sub);
  margin-top: 2px;
  opacity: 0.7;
}
/* 세로선 + 점 컬럼 */
.tl-line-col {
  width: 20px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.tl-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--line);
  flex-shrink: 0;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}
.tl-row:first-child .tl-dot { border-color: var(--primary); background: var(--primary); }
.tl-vline {
  width: 1.5px;
  background: var(--line);
  flex: 1;
  min-height: 10px;
  margin-top: 0;
}
.tl-row:last-child .tl-vline { display: none; }
/* 카드 컬럼 */
.tl-card-col {
  flex: 1;
  min-width: 0;
  padding: 0 0 10px 10px;
}

.rec-card {
  width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex; gap: 12px; align-items: flex-start;
  transition: transform var(--t) var(--ease);
}
.rec-card:active { transform: scale(0.99); }
.rec-card-ic {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.rec-card-ic .material-symbols-rounded { font-size: 21px; }
.rec-card-body { flex: 1; min-width: 0; }
.rec-card-head { display: flex; align-items: center; gap: 6px; }
.rec-type { font-size: 14px; font-weight: 800; }
.rec-time { display: none; }
.rec-star { margin-left: auto; color: #E0B23C; display: none; }
.rec-star.on { display: inline-flex; }
.rec-star .material-symbols-rounded { font-size: 18px; font-variation-settings: 'wght' 400, 'FILL' 1, 'opsz' 20; }
.rec-summary { font-size: 13px; color: var(--text); margin-top: 4px; line-height: 1.45; }
.rec-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rec-tag {
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--mint); color: var(--deep);
}
.rec-tag.warn { background: var(--warn); color: var(--warn-text); }
.rec-tag.neutral { background: var(--bluegray); color: #3F6473; }
.rec-tag.ghost { background: var(--bg); color: var(--sub); border: 1px solid var(--line); }
.rec-tag .material-symbols-rounded { font-size: 13px; vertical-align: -2px; }
/* 기록 출처 배지 — 아이콘 없이 통일된 알약 버튼 */
.rec-tag.src-manual { background: #EEF4FA; color: #4E7CA8; }
.rec-tag.src-schedule_check { background: var(--mint); color: var(--deep); }
.rec-tag.src-hospital { background: #FCF1E8; color: #C77E45; }

/* ── Empty state ─────────────────────────────────────── */
.empty {
  text-align: center; padding: 48px 20px;
  display: none; flex-direction: column; align-items: center; gap: 16px;
}
.empty.show { display: flex; }
.empty-ic {
  width: 76px; height: 76px; border-radius: 20px;
  background: var(--mint); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.empty-ic .material-symbols-rounded { font-size: 38px; }
.empty-text { font-size: 15px; color: var(--sub); line-height: 1.6; }
.empty-text b { color: var(--text); font-weight: 700; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary); color: #fff;
  border-radius: var(--r-sm); padding: 13px 22px;
  font-size: 15px; font-weight: 700;
  transition: transform 0.12s var(--ease), background var(--t) var(--ease);
}
.btn-primary:active { transform: scale(0.97); background: #5f9e8a; }
.btn-block { width: 100%; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 13px 22px; font-size: 15px; font-weight: 700;
}
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  color: #C0564E; background: #FBEDEC; border: none;
  border-radius: var(--r-sm); padding: 13px 22px; font-size: 15px; font-weight: 700;
}

/* ── Bottom nav ──────────────────────────────────────── */
.tabbar {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 6px));
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #A9B4AD; padding: 4px 0;
  transition: color var(--t) var(--ease);
}
.tab .material-symbols-rounded { font-size: 25px; }
.tab span { font-size: 12px; font-weight: 500; }
.tab.active { color: var(--primary); }
.tab.active span { font-weight: 700; }
.tab.active .material-symbols-rounded { font-variation-settings: 'wght' 400, 'opsz' 24, 'FILL' 0, 'GRAD' 0; }

.home-indicator { display: none; }

/* ── Sheet / Modal 공통 ──────────────────────────────── */
.overlay {
  position: absolute; inset: 0;
  background: rgba(37, 51, 46, 0.42);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t) var(--ease);
  z-index: 100;
  display: flex;
}
.overlay.show { opacity: 1; pointer-events: auto; }

/* Bottom sheet */
.overlay.bottom { align-items: flex-end; }
.sheet {
  width: 100%;
  max-height: calc(100dvh - 48px);
  max-height: calc(100vh - 48px); /* fallback */
  background: var(--bg);
  border-radius: 22px 26px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
  overflow: hidden;
}
.overlay.show .sheet { transform: translateY(0); }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: #D5DCD7; margin: 12px auto 4px; flex-shrink: 0; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px 12px; flex-shrink: 0;
}
.sheet-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.sheet-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--card); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center; color: var(--sub);
}
.sheet-close .material-symbols-rounded { font-size: 19px; }
.sheet-body {
  flex: 1; /* 남은 공간 모두 차지해 foot을 항상 하단에 고정 */
  overflow-y: auto;
  padding: 4px 20px 16px;
  -webkit-overflow-scrolling: touch;
}
.sheet-body::-webkit-scrollbar { display: none; }
.sheet-body { scrollbar-width: none; }
.sheet-foot {
  flex-shrink: 0;
  padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 8px));
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; gap: 10px;
}

/* Center modal */
.overlay.center {
  align-items: center; justify-content: center;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  align-items: flex-end;
}
@media (min-height: 600px) {
  .overlay.center { align-items: center; }
}
.modal {
  width: 100%; max-width: 360px;
  max-height: calc(100% - 48px - env(safe-area-inset-bottom, 0px));
  background: var(--bg); border-radius: var(--r-lg);
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(0.94); opacity: 0;
  transition: transform var(--t) var(--ease), opacity var(--t) var(--ease);
}
.overlay.show .modal { transform: scale(1); opacity: 1; }

/* ── Form ────────────────────────────────────────────── */
.type-row {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 20px 8px; margin: 0; flex-shrink: 0;
}
.type-row::-webkit-scrollbar { display: none; }
.type-tab {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--card); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--sub); min-width: 62px;
  transition: all var(--t) var(--ease);
}
.type-tab .material-symbols-rounded { font-size: 22px; }
.type-tab.active { background: var(--deep); border-color: var(--deep); color: #fff; }

.form-q { font-size: 16px; font-weight: 800; margin: 14px 0 4px; letter-spacing: -0.02em; }
.field { margin-top: 16px; }
.field-label { font-size: 14px; font-weight: 700; margin-bottom: 9px; }
.field-label .opt { font-size: 12px; font-weight: 500; color: var(--sub); margin-left: 4px; }
.input, .textarea {
  width: 100%; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 14px 15px;
  font-size: 15px; color: var(--text); outline: none;
  transition: border-color var(--t) var(--ease);
}
.input:focus, .textarea:focus { border-color: var(--primary); }
.input::placeholder, .textarea::placeholder { color: #AFBAB2; }
.textarea { min-height: 96px; resize: none; line-height: 1.6; }
.field-2 { display: flex; gap: 10px; }
.field-2 > .field { flex: 1; margin-top: 0; }

.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-chip {
  padding: 11px 15px; border-radius: var(--r-sm);
  background: var(--card); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--text);
  transition: all var(--t) var(--ease);
}
.opt-chip.active { background: var(--mint); border-color: var(--primary); color: var(--deep); }
.opt-chip.sev-심함.active, .opt-chip.sev-긴급.active { background: var(--warn); border-color: #E0A07F; color: var(--warn-text); }

.photo-row { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-add {
  width: 88px; height: 88px; border-radius: var(--r-sm);
  border: 1.5px dashed #C8D2CB; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--sub); font-size: 12px;
}
.photo-add .material-symbols-rounded { font-size: 26px; }
.photo-thumb { width: 88px; height: 88px; border-radius: var(--r-sm); overflow: hidden; position: relative; background: var(--mint); }
.photo-thumb .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.photo-thumb .rm { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; background: rgba(37,51,46,0.6); color: #fff; display: flex; align-items: center; justify-content: center; }
.photo-thumb .rm .material-symbols-rounded { font-size: 15px; }

/* important toggle */
.switch-field {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 14px 15px; margin-top: 16px;
}
.switch-field .lab { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.switch-field .lab .material-symbols-rounded { font-size: 19px; color: #E0B23C; }
.switch {
  width: 46px; height: 28px; border-radius: var(--r-pill); background: #D9E0DB; position: relative;
  transition: background var(--t) var(--ease); flex-shrink: 0;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform var(--t) var(--ease); }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }

/* ── Detail modal ────────────────────────────────────── */
.detail-head { padding: 22px 22px 0; }
.detail-type { display: flex; align-items: center; gap: 10px; }
.detail-type .di { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.detail-type .di .material-symbols-rounded { font-size: 24px; }
.detail-type h3 { font-size: 18px; font-weight: 800; }
.detail-date { font-size: 13px; color: var(--sub); margin-top: 10px; }
.detail-body { padding: 16px 22px; overflow-y: auto; }
.detail-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { color: var(--sub); width: 88px; flex-shrink: 0; font-weight: 600; }
.detail-row .v { color: var(--text); flex: 1; font-weight: 600; }
.detail-photo { margin-top: 14px; width: 120px; height: 120px; border-radius: var(--r-sm); background: var(--mint); display: flex; align-items: center; justify-content: center; font-size: 48px; }
.link-hospital {
  width: 100%; margin-top: 16px; padding: 13px;
  background: var(--bluegray); color: #3F6473; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 7px;
}
.detail-foot {
  flex-shrink: 0;
  padding: 14px 22px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 8px));
  display: flex; gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

/* ── Search/filter sheet ─────────────────────────────── */
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 15px;
}
.search-box .material-symbols-rounded { color: var(--sub); font-size: 22px; }
.search-box input { flex: 1; border: none; outline: none; font-size: 15px; background: none; }

/* ── 검색 결과 뷰 ────────────────────────────────────── */
.search-view-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px 8px 8px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.search-view-query {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}
.search-view-count {
  font-size: 13px;
  color: var(--sub);
  padding: 10px 20px 4px;
  flex-shrink: 0;
}

/* ── Toast ───────────────────────────────────────────── */
.toast {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(14px);
  background: rgba(37,51,46,0.94); color: #fff;
  font-size: 14px; font-weight: 600; padding: 13px 20px; border-radius: var(--r-pill);
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.22);
  opacity: 0; pointer-events: none; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
  z-index: 300; white-space: nowrap;
}
.toast .material-symbols-rounded { font-size: 18px; color: #9FD9C4; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* detail star toggle */
#d-star { color: #C9D2CB; }
#d-star.on { color: #E0B23C; font-variation-settings: 'wght' 400, 'FILL' 1, 'opsz' 24; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.rise { animation: rise 0.35s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .rise { opacity: 1 !important; transform: none !important; }
}
