/*
 * ALPS Search 테스트 프런트 스타일 — ALPS 공통 디자인(무채색 버튼, 얇은 테두리, 캔들 산 로고).
 * 처음 화면은 가운데 검색창 하나, 검색하면 검색창이 위로 올라가고 결과가 아래에 나온다.
 * 다크 모드는 <html class="dark"> 로 켠다.
 */
:root {
  color-scheme: light;
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #EEF0F3;
  --border: #E3E6EB;
  --text: #10151F;
  --text-2: #4A5361;
  --muted: #5B6472;
  --bad: #B3211A;
  --bad-bg: #FDE8E6;
  --chip-bg: #FFF1D6;
  --chip-fg: #8A4B00;
  --mark-bg: #FFE08A;
  --mark-fg: #10151F;
  --primary-bg: #10151F;
  --primary-fg: #FFFFFF;
  --band: #CBD2DC;
  --logo-ink: #0E2338;
  --logo-peak: #E5473B;
  --logo-sub: #C8362B;
  --sans: "Pretendard", "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --wordmark: "Manrope", "Segoe UI", system-ui, sans-serif;
}
:root.dark {
  color-scheme: dark;
  --bg: #0B0E14;
  --surface: #131822;
  --surface-2: #232A37;
  --border: #232A37;
  --text: #E8ECF2;
  --text-2: #C3CAD5;
  --muted: #A2ABB8;
  --bad: #FF6B61;
  --bad-bg: #3A1614;
  --chip-bg: #3A2A0A;
  --chip-fg: #FFC766;
  --mark-bg: #7A5A00;
  --mark-fg: #FFF4CC;
  --primary-bg: #E8ECF2;
  --primary-fg: #0B0E14;
  --band: #3A4455;
  --logo-ink: #DCE6F2;
  --logo-peak: #FF6A59;
  --logo-sub: #FF6A59;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh;
  max-width: 100%; overflow-x: clip;
  background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h2, p, ol, dl, dd { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
.defs { position: absolute; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sun { display: none; }
:root.dark .i-sun { display: block; }
:root.dark .i-moon { display: none; }

/* 로고 */
.brand { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.mark { width: 27px; height: 26px; flex: none; }
.ink { fill: var(--logo-ink); }
.peak { fill: var(--logo-peak); }
.alps-word { display: flex; flex-direction: column; line-height: 1; font-family: var(--wordmark); }
.alps-word b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; color: var(--logo-ink); }
.alps-word i { margin-top: 3px; font-style: normal; font-size: 8px; font-weight: 700; letter-spacing: .32em; color: var(--logo-sub); }

/* 버튼 */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.btn-primary { height: 40px; padding: 0 18px; flex: none; border: 0; border-radius: 20px; background: var(--primary-bg); color: var(--primary-fg); font-weight: 600; }
.btn-primary:hover { opacity: .88; }
.btn-outline { height: 40px; padding: 0 16px; border: 1px solid var(--band); border-radius: 8px; background: transparent; font-weight: 600; }
.btn-outline:hover { background: var(--surface-2); }

/* 상단: 로고 · 검색창 · 설정 */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px 24px; min-height: 68px; padding: 10px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.search {
  display: flex; align-items: center; gap: 4px; flex: 1; max-width: 720px; height: 48px; padding: 0 4px 0 16px;
  border: 1px solid var(--band); border-radius: 24px; background: var(--surface);
}
.search:focus-within { border-color: var(--text); }
.search > .icon { color: var(--muted); }
.search input {
  flex: 1; min-width: 0; height: 100%; padding: 0 8px; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 16px;
}
.search input::-webkit-search-cancel-button { display: none; }
.search .icon-btn { width: 40px; height: 40px; border-radius: 50%; }
/* 자동완성 목록 */
.search { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; margin: 0; padding: 6px; list-style: none; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 24px -12px rgba(16, 21, 31, .35); }
.suggest li { padding: 9px 12px; border-radius: 8px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--surface-2); }
.suggest li { display: flex; align-items: center; gap: 8px; }
.suggest-word { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.suggest .suggest-head { padding: 4px 12px 6px; font-size: 12px; color: var(--muted); cursor: default; }
.suggest .suggest-head:hover, .suggest .suggest-foot:hover { background: transparent; }
.suggest-del { flex: 0 0 auto; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.suggest-del:hover { background: var(--border); color: var(--text); }
.suggest .suggest-foot { justify-content: flex-end; padding: 6px 8px 2px; border-top: 1px solid var(--border); margin-top: 4px; border-radius: 0; cursor: default; }
.suggest-foot button { border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; padding: 2px 4px; }
.suggest-foot button:hover { color: var(--text); text-decoration: underline; }
/* 오타 교정 안내 */
.corrected { margin-bottom: 8px; color: var(--text-2); }
.corrected b { color: var(--text); }
.corrected button { padding: 0; border: 0; background: none; color: var(--text); text-decoration: underline; }
.top-actions { display: flex; gap: 4px; margin-left: auto; }

/* 처음 화면: 로고와 검색창을 가운데에 크게 */
body.home .top {
  position: static; flex-direction: column; justify-content: center; gap: 32px;
  min-height: 0; padding: 22vh 20px 0; background: transparent; border: 0;
}
body.home .mark { width: 67px; height: 64px; }
body.home .brand { gap: 14px; }
body.home .alps-word b { font-size: 46px; }
body.home .alps-word i { margin-top: 7px; font-size: 16px; }
body.home .search { flex: none; width: 100%; max-width: 640px; height: 54px; border-radius: 27px; }
body.home .top-actions { position: fixed; top: 8px; right: 12px; margin: 0; }
body.home #main { display: none; }

/* 인기 검색어(처음 화면) */
.popular { display: none; }
body.home .popular { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; max-width: 640px; margin: 20px auto 0; padding: 0 20px; }
.popular span { color: var(--muted); font-size: 12px; font-weight: 600; }
.popular button { height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text-2); font-size: 13px; }
.popular button:hover { border-color: var(--band); color: var(--text); }

/* 연결 설정 */
.settings { padding: 10px 24px 10px 174px; background: var(--surface); border-bottom: 1px solid var(--border); }
body.home .settings { max-width: 760px; margin: 20px auto 0; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; }
.settings form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 10px; max-width: 980px; }
.settings label { display: flex; flex-direction: column; gap: 3px; flex: 1 1 84px; min-width: 0; }
.settings label.wide { flex-basis: 136px; }
.settings label span { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings .btn-outline { height: 34px; }
.settings .hint { margin-top: 6px; }
.settings input, .settings select { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.settings input:focus, .settings select:focus { outline: none; border-color: var(--text); }
.hint { margin-top: 8px; color: var(--muted); font-size: 12px; }

/* 결과 */
#main { max-width: 760px; padding: 16px 24px 48px; margin-left: 150px; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 22px; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.status.error { padding: 10px 14px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); font-size: 14px; }
.scope { padding: 1px 8px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; }
.chip { padding: 1px 8px; border-radius: 10px; background: var(--chip-bg); color: var(--chip-fg); font-size: 12px; font-weight: 600; }
.chip.neutral { background: transparent; color: var(--muted, inherit); border: 1px solid currentColor; font-weight: 500; } /* 사용자가 고른 상태(경고 아님) */
.results { display: flex; flex-direction: column; gap: 28px; }
.hit-path { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit-title { margin-top: 2px; font-size: 19px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.hit-body { margin-top: 4px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hit-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 12px; }
.hit-meta div { display: flex; gap: 6px; min-width: 0; }
.hit-meta dt { color: var(--muted); flex: none; }
.hit-meta dd { color: var(--text-2); overflow-wrap: anywhere; }
.empty p:first-child { font-size: 16px; font-weight: 600; }

@media (max-width: 900px) {
  #main { margin-left: 0; }
  .settings { padding-left: 24px; }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; padding: 8px 12px; }
  .top .brand { order: 1; }
  .top-actions { order: 2; }
  .search { order: 3; flex: 1 1 100%; max-width: none; }
  body.home .top { padding-top: 16vh; }
  body.home .search { order: 0; }
  #main { padding: 12px 16px 40px; }
  .settings { padding: 10px 16px; }
  .settings label { flex-basis: calc(50% - 5px); }
  body.home .settings { margin: 16px 16px 0; }
  .btn-primary { padding: 0 14px; }
}

/* 결과 보기: 목록 | JSON */
.view-switch { display: flex; align-items: center; gap: 4px; margin: -6px 0 14px; }
.view-switch button { padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; }
.view-switch button[aria-pressed="true"] { border-color: var(--text); color: var(--text); font-weight: 600; }
.view-switch .copy { margin-left: auto; }
.json-view { margin: 0; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text);
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; tab-size: 2; }

/* 유사 문서 */
.related { margin-top: 8px; }
.related-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text-2); font-size: 13px; }
.related-btn:hover { color: var(--text); }
.related-out { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.related-note { margin: 0; color: var(--muted); font-size: 13px; }
.related-keys { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; font-size: 12px; }
.related-keys span { padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-2); }
.related-keys span.theme { border-color: var(--text-2); font-weight: 600; }
.related-list { margin: 0; padding-left: 20px; font-size: 14px; }
.related-list li { margin: 4px 0; }
.related-title { margin-right: 8px; }
.related-score { margin-right: 8px; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.related-shared { color: var(--muted); font-size: 12px; }

/* 검색 결과 위의 연관 정보 */
.related-summary { list-style: none; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.related-summary .related-keys { align-items: center; margin: 0; }
.related-summary .related-keys strong { margin-right: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.related-summary .related-keys button { padding: 2px 10px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text-2); font-size: 12px; }
.related-summary .related-keys button:hover { color: var(--text); }
.related-summary .related-keys button.theme { border-color: var(--text-2); font-weight: 600; }
.related-summary .related-note { margin-top: 10px; }

/* 로그인한 계정 · 로그아웃 */
.top-actions { align-items: center; }
.top-actions .user { color: var(--muted); font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-btn { padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text); font-size: 13px; }

/* 로그인 화면 */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px 16px; }
.login-head { display: flex; align-items: center; gap: 14px; }
.login-head .mark { width: 54px; height: 52px; }
.login-head .alps-word b { font-size: 38px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; padding: 22px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.login-card label { display: flex; flex-direction: column; gap: 4px; }
.login-card label span { color: var(--muted); font-size: 12px; font-weight: 600; }
.login-card input { height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.login-card input:focus { outline: none; border-color: var(--text); }
.login-card .btn-primary { height: 42px; margin-top: 4px; }
.login-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.login-msg { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.login-msg.error { background: var(--bad-bg); color: var(--bad); }

/* 통합 검색: 통합 결과 | 고객사별 탭 */
.tabs { display: flex; gap: 2px; margin: -4px 0 16px; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.tabs button { flex: none; padding: 9px 12px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { border-bottom-color: var(--text); color: var(--text); font-weight: 600; }
.count { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.group { display: flex; flex-direction: column; gap: 16px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.group > .results { gap: 22px; }
.group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 13px; }
.group-head strong { color: var(--text); font-size: 15px; }
.group-more, .more-status button { align-self: flex-start; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text); font-size: 13px; }
.group-more:hover, .more-status button:hover { background: var(--surface-2); }
.group-skip { margin-top: 16px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.group-skip.error { color: var(--bad); }
.domain-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.domain-chips button { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text-2); font-size: 13px; }
.domain-chips button[aria-pressed="true"] { border-color: var(--text); color: var(--text); font-weight: 600; }

/* 무한 스크롤: 목록 끝 */
.more-status { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; padding: 8px 0 16px; color: var(--muted); font-size: 13px; text-align: center; }
.more-status button { align-self: center; }

/* 집계 결과 */
.aggs { list-style: none; }
.agg-total { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.agg { margin-bottom: 16px; }
.agg h3 { margin: 0 0 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.agg-table { border-collapse: collapse; width: 100%; max-width: 520px; font-size: 14px; }
.agg-table th, .agg-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.agg-table th.num, .agg-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.agg-value { font-size: 28px; font-weight: 700; margin: 0; }

/* 첨부 문서 미리 보기 */
.hit-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; margin-top: 8px; }
.hit-actions .related, .hit-actions .preview { margin-top: 0; flex: 1 1 100%; }
.hit-actions > .related:not(:has(.related-out:not([hidden]))), .hit-actions > .preview:not(:has(.preview-out:not([hidden]))) { flex: 0 0 auto; }
.preview-out { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.pv-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(8, 11, 17, .62); }
.pv-dialog { display: flex; flex-direction: column; width: min(1280px, 100%); height: min(92vh, 1100px); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .55); overflow: hidden; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--border); }
.pv-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-nav { display: flex; align-items: center; gap: 6px; }
.pv-nav .related-btn { min-width: 34px; font-size: 16px; line-height: 1; }
.pv-nav .related-btn:disabled { opacity: .4; cursor: default; }
.pv-count { min-width: 76px; text-align: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pv-link { font-size: 13px; color: var(--muted); }
.pv-total { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pv-backdrop.full { padding: 0; }
.pv-dialog.full { width: 100%; height: 100%; border-radius: 0; border: 0; }
.hit-actions .download { display: flex; align-items: center; gap: 8px; }
.pv-close { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.pv-close:hover { background: var(--bg); color: var(--text); }
.pv-note { margin: 6px 18px 0; }
.pv-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 172px 1fr; }
.pv-list { overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--border); background: var(--bg); }
.pv-thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 2px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.pv-thumb img, .pv-ph { width: 128px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.pv-thumb img { height: auto; display: block; }
.pv-ph { aspect-ratio: 210 / 297; display: flex; align-items: center; justify-content: center; color: #8A93A0; }
.pv-thumb:hover { border-color: var(--border); }
.pv-thumb.on { border-color: var(--text); color: var(--text); font-weight: 700; }
.pv-main { overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 20px; background: var(--bg); }
.pv-main img { max-width: 100%; height: auto; background: #fff; border: 1px solid var(--border); box-shadow: 0 8px 24px -12px rgba(16, 21, 31, .45); }
.pv-main iframe { width: 100%; height: 100%; border: 0; background: var(--surface); }
.pv-main .related-note { align-self: center; }
@media (max-width: 640px) {
  .pv-backdrop { padding: 0; }
  .pv-dialog { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .pv-head { padding: 8px 8px 8px 14px; gap: 6px; flex-wrap: wrap; }
  .pv-title { flex-basis: calc(100% - 48px); font-size: 15px; }
  .pv-close { order: 1; }
  .pv-full { display: none; }
  .pv-nav, .pv-head .related-btn, .pv-link, .pv-total { order: 2; }
  .pv-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .pv-list { grid-row: 2; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 8px; gap: 8px; border-right: 0; border-top: 1px solid var(--border); }
  .pv-thumb { flex: 0 0 auto; padding: 4px; }
  .pv-thumb img, .pv-ph { width: 64px; }
  .pv-main { padding: 12px; }
}

/* LLM 토큰 수 */
.scope.tokens { font-variant-numeric: tabular-nums; }

/* 맞은 말 표시 */
mark { padding: 0 2px; border-radius: 3px; background: var(--mark-bg); color: var(--mark-fg); font-weight: 600; }
.hit-meta div.matched dd { color: var(--text); }

/* 패싯(결과 좁히기) */
.facets { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 6px 0 10px; }
.facet { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.facet-label { color: var(--muted, inherit); font-size: 12px; margin-right: 2px; }
.facets button.chip { cursor: pointer; }
.chip.facet-on { font-weight: 600; }
.chip.facet-off { font-weight: 600; text-decoration: line-through; opacity: .85; }
.facet-tree { flex-basis: 100%; }
.facet-tree-sep { color: var(--muted, inherit); }
.hit-dup { margin: 6px 0 0; font-size: 12px; }
.search.dragging { outline: 2px dashed var(--text-2, currentColor); outline-offset: 2px; }
.file-search { margin: 8px 0 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.file-search-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; overflow-wrap: anywhere; }
.file-search-exact { margin: 0 0 6px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.hit-dup button.chip { cursor: pointer; }
.hit-dup-list { margin: 4px 0 0; padding-left: 18px; color: var(--text-2, inherit); }
.hit-dup-list li { overflow-wrap: anywhere; }
.hit-dup-list .mono { font-family: ui-monospace, Consolas, monospace; }
.hit-dup-list .muted { color: var(--muted, inherit); }
.facet-value { display: inline-flex; align-items: center; gap: 0; }
.facet-exclude { border: 0; background: none; color: var(--muted, inherit); cursor: pointer; font-size: 13px; padding: 0 4px; line-height: 1; }
.facet-exclude:hover, .facet-exclude:focus-visible { color: var(--danger, #c0392b); }
.hit-actions .ev { display: contents; } /* 사용 기록용 감싸기(배치는 그대로) */
.hit-title[data-ev] { cursor: default; }
/* 결과 내 검색 */
.refine { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 6px 0 8px; }
.refine-toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; user-select: none; }
.refine-path { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.refine-base { font-weight: 600; }
.refine-hint { color: var(--muted, inherit); font-size: 12px; }
/* 0건 안내: 다른 분야에서 찾은 결과 */
/* 반영 못 한 조건·데이터에 없는 말 안내 */
.notapplied { margin: -8px 0 16px; padding: 8px 12px; border-left: 3px solid var(--chip-fg); border-radius: 6px; background: var(--chip-bg); color: var(--chip-fg); font-size: 13px; }
.notapplied p { margin: 0; }
.notapplied p + p { margin-top: 4px; }

/* 결과마다 맞은 조건 칩(조건·완화·선호·검색어). 풀린 조건(이 문서가 맞지 않은 것)은 회색 취소선. */
.hit-matched { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 6px 0 0; padding: 0; font-size: 12px; }
.hit-matched .chip { border: 1px solid var(--border, #d0d5dd); border-radius: 999px; padding: 1px 8px; color: var(--text-2); background: transparent; }
.hit-matched .chip.ok { color: var(--text); }
.hit-matched .chip.pref { border-style: dashed; }
.hit-matched .chip.miss { color: var(--muted); text-decoration: line-through; }

/* 정렬 선택(관련도·최신순 등 — 같은 해석으로 정렬만 바꿔 다시 찾는다) */
.sort-bar { display: flex; justify-content: flex-end; margin: 4px 0 8px; font-size: 13px; }
.sort-bar select { margin-left: 6px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border, #ccc); background: var(--surface, #fff); color: inherit; }

/* 사이트 하단: 사업자 정보·오픈소스 라이선스(관리자 콘솔·검색 화면 공통) */
.site-footer { word-break: keep-all; margin-top: 40px; padding: 20px 16px 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; line-height: 1.7; }
.site-footer-inner { max-width: 1100px; margin: 0 auto; text-align: center; }
.site-footer-inner p { margin: 0; overflow-wrap: anywhere; }
.site-footer-company span { display: inline-block; }
.site-footer-company span + span::before { content: "|"; margin: 0 8px; color: var(--border); }
.site-footer-inner .site-footer-copy { margin-top: 6px; }
.site-footer-link { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.site-footer-link:hover { color: var(--text); }
.site-footer-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 2px; }
.oss-dialog { font-size: 14px; line-height: 1.5; text-align: left; word-break: keep-all; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 16px 48px -16px rgba(16, 21, 31, .45); }
.oss-dialog::backdrop { background: rgba(10, 14, 22, .45); }
.oss-dialog[open] { display: flex; flex-direction: column; }
.oss-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.oss-head h2 { margin: 0; font-size: 16px; }
.oss-close { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.oss-close:hover { color: var(--text); background: var(--border); }
.oss-note { margin: 12px 18px 0; color: var(--muted); font-size: 13px; }
.oss-table-wrap { overflow: auto; margin: 12px 0 0; padding: 0 18px 18px; }
.oss-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.oss-table th, .oss-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.oss-table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.oss-table td:last-child { white-space: nowrap; }
.oss-table a { color: inherit; }
@media (max-width: 760px) {
  .site-footer-company span { display: block; }
  .site-footer-company span + span::before { content: none; }
}

/* 데이터 관리(업무 데이터 게시판) */
.data-board { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; max-width: 1400px; margin: 0 auto; padding: 20px 24px; word-break: keep-all; }
.db-tables h2 { margin: 0 0 4px; font-size: 18px; }
.db-tables ul { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.db-tables button { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.db-tables button:hover { background: var(--surface-2); }
.db-tables button[aria-current="true"] { border-color: var(--text); box-shadow: inset 3px 0 0 var(--text); }
.db-t-name { font-weight: 600; font-size: 14px; }
.db-t-meta, .db-hint { color: var(--muted); font-size: 12px; }
.db-hint { margin: 0; }
.db-error { margin: 8px 0; padding: 8px 12px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); font-size: 13px; }
.db-view { min-width: 0; padding: 18px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.db-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.db-head h3 { margin: 0 0 2px; font-size: 17px; }
.db-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 10px; }
.db-search input { flex: 1 1 240px; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.db-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.db-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.db-table th, .db-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.db-table th { background: var(--surface-2); color: var(--muted); font-weight: 600; white-space: nowrap; }
.db-table tbody tr { cursor: pointer; }
.db-table tbody tr:hover, .db-table tbody tr:focus-visible { background: var(--surface-2); outline: none; }
.db-table td { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.db-title { font-weight: 600; }
.db-nowrap { white-space: nowrap; }
.db-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; }
.db-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.db-badge.ok { background: var(--surface-2); color: var(--text-2); }
.db-badge.wait { background: var(--chip-bg); color: var(--chip-fg); }
.db-badge.bad { background: var(--bad-bg); color: var(--bad); }
.db-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 16px 48px -16px rgba(16, 21, 31, .45); }
.db-dialog::backdrop { background: rgba(10, 14, 22, .45); }
.db-dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 50px); }
.db-dialog-head, .db-dialog-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 18px; }
.db-dialog-head { border-bottom: 1px solid var(--border); }
.db-dialog-head h2 { margin: 0; font-size: 16px; }
.db-dialog-foot { border-top: 1px solid var(--border); }
.db-dialog-body { overflow: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.db-x { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.db-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.db-field > span { font-weight: 600; }
.db-field small { margin-left: 6px; color: var(--muted); font-weight: 400; font-family: ui-monospace, Consolas, monospace; }
.db-field input, .db-field textarea, .db-field select { width: 100%; box-sizing: border-box; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.db-field textarea { resize: vertical; }
.db-field input:focus, .db-field textarea:focus, .db-field select:focus { outline: none; border-color: var(--text); }
.db-file { padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; }
.db-ro { padding: 6px 10px; border-radius: 8px; background: var(--surface-2); max-height: 160px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.db-derived summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.db-derived .db-field { margin-top: 8px; }
.db-del { color: var(--bad); border-color: var(--bad); }
@media (max-width: 860px) {
  .data-board { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; }
  .db-tables ul { flex-direction: row; overflow-x: auto; }
  .db-tables li { flex: none; }
}
