/* ======================================================
   kcd.css — KCD 조회 서비스 공통 스타일
   Spring + JSP 프로젝트 적용용
   경로 예시: src/main/webapp/resources/css/kcd.css
   ====================================================== */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

/* ── CSS 변수 ─────────────────────────────────────────── */
:root {
  --kcd-primary:       #3d8b5e;
  --kcd-primary-light: #f0f9f4;
  --kcd-primary-mid:   #c3e6d2;
  --kcd-primary-dark:  #2d6b47;
  --kcd-text-main:     #1e293b;
  --kcd-text-sub:      #64748b;
  --kcd-text-muted:    #94a3b8;
  --kcd-border:        #e2e8f0;
  --kcd-border-focus:  #7ec8a0;
  --kcd-bg-base:       #f8fafc;
  --kcd-bg-white:      #ffffff;
  --kcd-bg-hover:      #f0f9f4;
  --kcd-find-color:    #1e5c3a;
  --kcd-find-bg:       #d4eddf;
}

/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--kcd-bg-base);
  color: var(--kcd-text-main);
  line-height: 1.5;
  min-height: 100dvh;
}
button  { cursor: pointer; border: none; background: none; font-family: inherit; font-size: 1rem; line-height: 1.5; color: inherit; }
input   { font-family: inherit; font-size: 1rem; line-height: 1.5; }
a       { text-decoration: none; color: inherit; }
ul, ol  { list-style: none; }
img     { display: block; max-width: 100%; }

/* ── Scrollbar ────────────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(61,139,94,0.35) transparent;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(61,139,94,0.35); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(61,139,94,0.6); }

/* ── App Shell ────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  max-width: 480px;
  margin: 0 auto;
  background: var(--kcd-bg-base);
}
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4.5rem;
}
.page-content--no-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── Bottom Navigation ────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--kcd-bg-white);
  border-top: 1px solid var(--kcd-border);
  z-index: 50;
}
.bottom-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 4rem;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0.5rem;
}
.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: 100%;
  color: var(--kcd-text-muted);
  transition: color 0.15s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav__item.active { color: var(--kcd-primary); }
.bottom-nav__item .nav-icon { width: 20px; height: 20px; stroke-width: 2; }
.bottom-nav__item.active .nav-icon { stroke-width: 2.5; }
.bottom-nav__item .nav-label { font-size: 10px; font-weight: 500; }
.bottom-nav__item.active .nav-label { font-weight: 600; }

/* ── Page Header ──────────────────────────────────────── */
.page-header { position: sticky; top: 0; z-index: 40; }
.page-header__bar {
  position: relative;
  background: linear-gradient(135deg, var(--kcd-primary) 0%, #3f9467 55%, var(--kcd-primary-dark) 100%);
  overflow: hidden;
}
.page-header__blob1 {
  position: absolute; top: -1.5rem; right: 0.5rem;
  width: 7rem; height: 7rem;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  filter: blur(1.5rem);
  pointer-events: none;
}
.page-header__blob2 {
  position: absolute; bottom: 0; left: 33%;
  width: 5rem; height: 5rem;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  filter: blur(1rem);
  transform: translateY(50%);
  pointer-events: none;
}
.page-header__inner {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  min-height: 62px;
}
.page-header__back {
  display: flex;
  align-items: center;
  margin-left: -4px;
  padding: 0.4rem;
  border-radius: 0.375rem;
  color: rgba(255,255,255,0.9);
  transition: background 0.15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.page-header__back:hover { background: rgba(255,255,255,0.25); }
.page-header__back:active { background: rgba(255,255,255,0.35); }
.page-header__back svg { width: 28px; height: 28px; }
.page-header__title-wrap { flex: 1; min-width: 0; }
.page-header__title {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-header__subtitle {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 500;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-header__right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.page-header__right-btn {
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
  transition: background 0.15s;
}
.page-header__right-btn:hover { background: rgba(255,255,255,0.3); }
.page-header__right-btn svg { width: 18px; height: 18px; }
.page-header__sub-bar {
  background: #fff;
  border-bottom: 1px solid var(--kcd-border);
}
.page-header__sub-bar--border-top {
  border-top: 1px solid var(--kcd-border);
}

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--kcd-border);
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 1rem;
}
.card--2xl { border-radius: 1.25rem; }
.card--no-pad { padding: 0; overflow: hidden; }

/* ── Inputs ───────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--kcd-bg-base);
  border: 1px solid var(--kcd-border);
  border-radius: 0.75rem;
  outline: none;
  color: var(--kcd-text-main);
  font-size: 0.9375rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: var(--kcd-border-focus);
  box-shadow: 0 0 0 3px rgba(126,200,160,0.2);
}
.input::placeholder { color: var(--kcd-text-muted); }
.input--white { background: #fff; }

/* ── Search wrap ──────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap .input { padding-right: 3rem; }
.search-btn {
  position: absolute;
  right: 0.5rem; top: 50%;
  transform: translateY(-50%);
  padding: 0.5rem;
  background: var(--kcd-primary);
  color: #fff;
  border-radius: 0.5rem;
  display: flex; align-items: center;
  transition: background 0.15s;
}
.search-btn:hover { background: var(--kcd-primary-dark); }
.search-btn svg { width: 1rem; height: 1rem; }

/* ── Buttons ──────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; border-radius: 0.75rem; font-weight: 600; transition: all 0.15s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--kcd-primary); color: #fff; padding: 0.875rem 1.25rem; width: 100%; }
.btn--primary:hover { background: var(--kcd-primary-dark); }
.btn--primary:disabled { background: #cbd5e1; cursor: not-allowed; transform: none; }
.btn--outline { background: #fff; color: var(--kcd-text-main); border: 1px solid var(--kcd-border); padding: 0.875rem 1.25rem; width: 100%; }
.btn--outline:hover { background: var(--kcd-bg-hover); }
.btn--danger { background: #fff; color: #dc2626; border: 1px solid var(--kcd-border); padding: 0.875rem 1.25rem; width: 100%; }
.btn--danger:hover { background: #fef2f2; }

/* ── Badges ───────────────────────────────────────────── */
.badge { display: inline-block; border-radius: 0.375rem; font-size: 0.75rem; padding: 0.125rem 0.5rem; font-weight: 700; }
.badge--primary { background: var(--kcd-primary); color: #fff; }
.badge--light   { background: var(--kcd-primary-light); color: var(--kcd-primary-dark); }
.badge--find    { background: var(--kcd-find-bg); color: var(--kcd-find-color); }
.badge--pill    { border-radius: 999px; }
.badge--kcd-ver {
  font-size: 10px; padding: 0.2rem 0.5rem;
  background: var(--kcd-primary-light); color: var(--kcd-primary-dark);
  border-radius: 999px;
}

/* ── View Toggle ──────────────────────────────────────── */
.view-toggle {
  display: flex; gap: 0.5rem;
  background: var(--kcd-bg-base);
  padding: 0.25rem; border-radius: 0.75rem;
}
.view-toggle__btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.375rem 0;
  border-radius: 0.5rem;
  font-size: 0.875rem; font-weight: 600;
  color: var(--kcd-text-sub);
  transition: all 0.15s;
}
.view-toggle__btn.active { background: #fff; color: var(--kcd-primary); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.view-toggle__btn svg { width: 1rem; height: 1rem; }

/* ── Tree Item ────────────────────────────────────────── */
.tree-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: #fff;
  border: 1px solid var(--kcd-border);
  border-radius: 1rem;
  cursor: pointer; width: 100%; text-align: left;
  transition: box-shadow 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.tree-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.tree-item:active { transform: scale(0.98); }
.tree-item__name {
  flex: 1; font-size: 0.875rem; font-weight: 600;
  color: var(--kcd-text-main); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tree-item__count {
  font-size: 0.75rem; font-weight: 600;
  padding: 0.125rem 0.5rem;
  background: var(--kcd-primary-light); color: var(--kcd-primary-dark);
  border-radius: 999px; flex-shrink: 0;
}
.tree-item svg { width: 1rem; height: 1rem; color: var(--kcd-text-muted); flex-shrink: 0; }

/* ── Breadcrumb ───────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 0.375rem;
  overflow-x: auto; white-space: nowrap;
  padding: 0.75rem;
  scrollbar-width: none;
}
.breadcrumb::-webkit-scrollbar { display: none; }
.breadcrumb__btn {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.375rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 11px; font-weight: 600;
  background: var(--kcd-bg-base); color: var(--kcd-text-sub);
  transition: all 0.15s; flex-shrink: 0; white-space: nowrap;
}
.breadcrumb__btn:hover { background: var(--kcd-primary-light); color: var(--kcd-primary); }
.breadcrumb__btn.active { background: var(--kcd-primary); color: #fff; }
.breadcrumb__btn svg { width: 12px; height: 12px; }
.breadcrumb__sep { color: var(--kcd-text-muted); flex-shrink: 0; display: flex; align-items: center; }
.breadcrumb__sep svg { width: 12px; height: 12px; }

/* ── List Rows ────────────────────────────────────────── */
.list-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--kcd-border);
  background: #fff; width: 100%;
  transition: background 0.15s; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover, .list-row:active { background: var(--kcd-bg-hover); }

/* ── Icon Box ─────────────────────────────────────────── */
.icon-box {
  flex-shrink: 0;
  width: 2.75rem; height: 2.75rem;
  border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center;
}
.icon-box svg { width: 1.25rem; height: 1.25rem; }

/* ── Empty State ──────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 5rem 1rem; text-align: center;
}
.empty-state__icon {
  width: 5rem; height: 5rem; border-radius: 50%;
  background: var(--kcd-primary-light);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.empty-state__icon svg { width: 2.5rem; height: 2.5rem; color: var(--kcd-primary); }
.empty-state__title { font-size: 1rem; font-weight: 700; color: var(--kcd-text-main); margin-bottom: 0.5rem; }
.empty-state__text  { font-size: 0.875rem; color: var(--kcd-text-muted); line-height: 1.7; }

/* ── Hero Gradient Section ────────────────────────────── */
.hero-gradient {
  background: linear-gradient(135deg, var(--kcd-primary) 0%, #4a9d6e 50%, var(--kcd-primary-dark) 100%);
  position: relative;
}
.hero-gradient__blob-mask {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.hero-gradient__blob1 {
  position: absolute; top: 0; right: 0;
  width: 16rem; height: 16rem;
  background: rgba(255,255,255,0.08);
  border-radius: 50%; filter: blur(3rem);
  transform: translate(25%, -50%); pointer-events: none;
}
.hero-gradient__blob2 {
  position: absolute; bottom: 0; left: 0;
  width: 12rem; height: 12rem;
  background: rgba(255,255,255,0.08);
  border-radius: 50%; filter: blur(2rem);
  transform: translate(-25%, 50%); pointer-events: none;
}
.hero-gradient__content { position: relative; }

/* ── Timeline ─────────────────────────────────────────── */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute; left: 21px; top: 2.75rem; bottom: 2rem;
  width: 2px; background: var(--kcd-border);
}
.timeline__item { position: relative; padding-left: 3rem; }
.timeline__item + .timeline__item { margin-top: 1.5rem; }
.timeline__dot {
  position: absolute; left: 0; top: 1rem;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.timeline__dot--unchanged { background: #9ca3af; }
.timeline__dot--modified  { background: #3b82f6; }
.timeline__dot--created   { background: #22c55e; }
.timeline__dot--deleted   { background: #ef4444; }

/* ── Status Badges ────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem 0.5rem; border-radius: 0.5rem;
  border: 1px solid; font-size: 0.75rem; font-weight: 600;
}
.status-badge svg { width: 14px; height: 14px; }
.status-badge--unchanged { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }
.status-badge--modified  { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.status-badge--created   { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.status-badge--deleted   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ── Coverage Items ───────────────────────────────────── */
.coverage-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem; border-radius: 0.75rem; border: 1px solid;
}
.coverage-item--yes { background: #f0fdf4; border-color: #bbf7d0; }
.coverage-item--yes .coverage-item__name { color: #14532d; font-size: 0.875rem; font-weight: 600; }
.coverage-item--no  { background: #f9fafb; border-color: #e5e7eb; }
.coverage-item--no  .coverage-item__name { color: #6b7280; font-size: 0.875rem; font-weight: 600; }
.coverage-item svg  { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.coverage-item--yes svg { color: #16a34a; }
.coverage-item--no  svg { color: #9ca3af; }

/* ── Version Comparison Panel ─────────────────────────── */
.version-panel {
  background: linear-gradient(135deg, #f5f3ff, #eff6ff);
  border: 1px solid #e9d5ff;
  border-radius: 0.75rem; padding: 1rem;
}
.version-panel__toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; cursor: pointer;
}
.version-panel__toggle h3 { font-size: 0.875rem; font-weight: 600; color: #581c87; }
.version-panel__toggle svg { width: 1.25rem; height: 1.25rem; color: #581c87; transition: transform 0.2s; }
.version-panel__toggle.open svg { transform: rotate(180deg); }
.version-panel__body { display: none; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #e9d5ff; }
.version-panel__body.open { display: block; }
.version-panel__body > * + * { margin-top: 0.75rem; }

/* ── KCD Version Dropdown ─────────────────────────────── */
.kcd-version-wrap { position: relative; }
.kcd-version-btn {
  display: flex; align-items: center; gap: 0.25rem;
  padding: 0 0.75rem 0 1rem;
  border-right: 1px solid var(--kcd-border);
  align-self: stretch;
  font-size: 0.75rem; font-weight: 700;
  color: var(--kcd-text-sub);
  flex-shrink: 0;
}
.kcd-version-btn svg { width: 12px; height: 12px; transition: transform 0.2s; }
.kcd-version-btn.open { color: var(--kcd-primary); }
.kcd-version-btn.open svg { transform: rotate(180deg); }
.kcd-version-dropdown {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 60;
  background: #fff; border: 1px solid var(--kcd-border);
  border-radius: 1rem; box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  overflow: hidden; min-width: max-content; display: none;
}
.kcd-version-dropdown.open { display: block; }
.kcd-version-dropdown__label {
  padding: 0.625rem 1rem;
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--kcd-text-muted);
  border-bottom: 1px solid var(--kcd-border);
}
.kcd-version-dropdown__pills {
  display: flex; gap: 0.25rem; padding: 0.5rem;
}
.kcd-version-pill {
  flex: 1; padding: 0.5rem;
  border-radius: 0.75rem; font-size: 0.75rem; font-weight: 700;
  color: var(--kcd-text-sub); white-space: nowrap;
  transition: all 0.15s;
}
.kcd-version-pill:hover { background: var(--kcd-bg-base); }
.kcd-version-pill.active { background: var(--kcd-primary); color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* ── Category Badge (Chapter Palette) ────────────────────
   JS로 동적 색상 주입. 아래는 fallback.          */
.chapter-badge {
  width: 2.75rem; height: 2.75rem; border-radius: 0.75rem;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border: 1px solid; flex-shrink: 0;
}
.chapter-badge__roman { font-size: 11px; font-weight: 800; line-height: 1; }
.chapter-badge__code  { font-size: 9px;  font-weight: 600; line-height: 1.4; opacity: 0.7; }

/* ── Profile ──────────────────────────────────────────── */
.profile-hero {
  padding: 1rem 1.25rem;
  position: relative; overflow: hidden;
}
.profile-card {
  position: relative; z-index: 10;
  background: rgba(255,255,255,0.95);
  border-radius: 1rem; padding: 1.25rem;
  border: 1px solid var(--kcd-border);
}
.avatar {
  width: 4rem; height: 4rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--kcd-primary-light), var(--kcd-primary-mid));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar svg { width: 2rem; height: 2rem; color: var(--kcd-primary-dark); }

/* ── Stat Grid ────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* ── Section Title ────────────────────────────────────── */
.section-title {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0 0.25rem;
}
.section-title__bar { width: 4px; height: 1rem; background: var(--kcd-primary); border-radius: 2px; }
.section-title__text { font-size: 0.875rem; font-weight: 700; color: var(--kcd-text-sub); }

/* ── Autocomplete Dropdown ────────────────────────────── */
.autocomplete {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #fff; border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15); overflow: hidden;
  z-index: 30; display: none;
}
.autocomplete.open { display: block; }
.autocomplete__item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--kcd-border);
  cursor: pointer; width: 100%;
  transition: background 0.15s;
}
.autocomplete__item:last-child { border-bottom: none; }
.autocomplete__item:hover { background: var(--kcd-bg-hover); }
.autocomplete__item svg { width: 1rem; height: 1rem; color: var(--kcd-text-muted); flex-shrink: 0; }
.autocomplete__item__text { flex: 1; font-size: 0.9rem; color: var(--kcd-text-main); text-align: left; }
.autocomplete__item__code { font-size: 0.75rem; color: var(--kcd-text-muted); }

/* ── Recent searches box ──────────────────────────────── */
.recent-box {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-radius: 1rem; padding: 1rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  margin-top: 1rem;
}

/* ── Search result card ───────────────────────────────── */
.result-card {
  background: #fff; border: 1px solid var(--kcd-border);
  border-radius: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden; cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.result-card:hover  { box-shadow: 0 6px 18px rgba(0,0,0,0.1); }
.result-card:active { transform: scale(0.99); }
.result-card__img-strip {
  width: 5rem; flex-shrink: 0; overflow: hidden;
  background: linear-gradient(to bottom, var(--kcd-primary-light), var(--kcd-primary-mid));
  position: relative; min-height: 90px;
}
.result-card__img-strip img { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.result-card__img-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.3));
}
.result-card__body { flex: 1; padding: 0.875rem 1rem; min-width: 0; }

/* ── Favourite card ───────────────────────────────────── */
.fav-card {
  background: #fff; border: 1px solid var(--kcd-border);
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 1rem; cursor: pointer;
  display: flex; align-items: center; gap: 0.75rem;
  transition: box-shadow 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}
.fav-card:hover  { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.fav-card:active { transform: scale(0.98); }
.fav-card__letter {
  width: 3rem; height: 3rem; border-radius: 0.75rem; flex-shrink: 0;
  background: linear-gradient(135deg, var(--kcd-primary-light), var(--kcd-primary-mid));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; color: var(--kcd-primary-dark);
}

/* ── History banner (home) ────────────────────────────── */
.history-banner {
  background: linear-gradient(135deg, #5cb888 0%, #52a876 60%, #3e8e62 100%);
  border-radius: 1.25rem; padding: 1.25rem;
  cursor: pointer; display: block;
  overflow: hidden; position: relative;
  transition: filter 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.history-banner:hover  { filter: brightness(1.07); }
.history-banner:active { transform: scale(0.98); }
.history-banner__blob1 {
  position: absolute; right: -20px; top: -20px;
  width: 7rem; height: 7rem;
  background: rgba(255,255,255,0.1); border-radius: 50%;
}
.history-banner__blob2 {
  position: absolute; right: 20px; bottom: -24px;
  width: 5rem; height: 5rem;
  background: rgba(255,255,255,0.1); border-radius: 50%;
}
.history-banner__content { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.history-banner__icon-wrap {
  width: 3rem; height: 3rem; border-radius: 0.75rem;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.history-banner__icon-wrap svg { width: 1.5rem; height: 1.5rem; color: #fff; }
.history-banner__arrow {
  width: 2.25rem; height: 2.25rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.history-banner__arrow svg { width: 1.25rem; height: 1.25rem; color: #fff; }

/* ── Toast ────────────────────────────────────────────── */
.kcd-toast {
  position: fixed; bottom: 5.5rem; left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: rgba(30,41,59,0.92);
  color: #fff; padding: 0.625rem 1.25rem;
  border-radius: 999px; font-size: 0.875rem; font-weight: 600;
  pointer-events: none; opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999; white-space: nowrap;
}
.kcd-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Quick Category grid ──────────────────────────────── */
.quick-cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.quick-cat-btn {
  display: flex; flex-direction: column;
  align-items: center; gap: 0.375rem;
  border-radius: 1rem; padding: 0.75rem 0.25rem;
  border: 1px solid; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: box-shadow 0.15s, transform 0.1s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.quick-cat-btn:hover  { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.quick-cat-btn:active { transform: scale(0.95); }
.quick-cat-btn__code {
  width: 2.25rem; height: 2.25rem; border-radius: 0.625rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.quick-cat-btn__range { font-size: 9px; font-weight: 600; color: var(--kcd-text-muted); text-align: center; line-height: 1.2; }
.quick-cat-btn__label { font-size: 9px; font-weight: 600; color: var(--kcd-text-sub); text-align: center; line-height: 1.2; }

/* ── Fee card (search result) ─────────────────────────── */
.fee-card { background: #fff; border: 1px solid var(--kcd-border); border-radius: 1.25rem; padding: 1rem; }
.fee-price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.fee-price-box { border-radius: 0.75rem; padding: 0.75rem; }
.fee-price-box--clinic   { background: #eff6ff; }
.fee-price-box--hospital { background: #faf5ff; }
.fee-price-box__label { font-size: 0.75rem; font-weight: 600; margin-bottom: 0.25rem; }
.fee-price-box--clinic   .fee-price-box__label { color: #1d4ed8; }
.fee-price-box--hospital .fee-price-box__label { color: #7e22ce; }
.fee-price-box__value { font-weight: 700; }
.fee-price-box--clinic   .fee-price-box__value { color: #1e3a8a; }
.fee-price-box--hospital .fee-price-box__value { color: #4c1d95; }

/* ── Form ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--kcd-text-sub); margin-bottom: 0.5rem; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .input { padding-left: 3rem; }
.input-icon-wrap__icon {
  position: absolute; left: 1rem; top: 50%;
  transform: translateY(-50%);
  color: var(--kcd-text-muted); pointer-events: none;
}
.input-icon-wrap__icon svg { width: 1.25rem; height: 1.25rem; display: block; }

/* ── KCD Detail hero (텍스트 좌 / 이미지 우) ───────────── */
.detail-hero {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: var(--kcd-bg-white);
  border-bottom: 1px solid var(--kcd-border);
}
.detail-hero__content {
  flex: 1;
  min-width: 0;
}
.detail-hero__figure {
  flex-shrink: 0;
  width: 6.25rem;
  height: 6.25rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--kcd-bg-base);
  border: 1px solid var(--kcd-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-hero__figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── Responsive ───────────────────────────────────────── */
@media (min-width: 480px) {
  .bottom-nav { left: 50%; transform: translateX(-50%); width: 480px; }
  .app-shell  { box-shadow: 0 0 40px rgba(0,0,0,0.1); }
}
