/*검색박스*/
.searcharea {
    width: 500px;
}
.searcharea .search-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--bs-primary);
    padding: 2px;
    background-color: #fff;
    overflow: hidden;
    width: 100%;
    border-radius: 50px;
}

.searcharea .search-box input[type='text'] {
    border: none;
    padding: 3px 15px;
    margin-right: 5px;
    flex-grow: 1;
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    outline: 0;
}

.searcharea .search-box a {
    background: none;
    border: none;
    cursor: pointer;
    padding-right: 15px;
}

.searcharea .search-box i {
    color: var(--bs-primary);
}

.searcharea .dropdown-menu {
    width: 463px;
    position: absolute;
    inset: 0px 0px auto auto;
    margin: 0px;
    transform: translate3d(-631px, 38px, 0px);
}
.searcharea .dropdown-menu .search-history {
    max-height: 475px;
    overflow-y: auto
}
.searcharea .dropdown-menu .search-history .active {
    background-color: var(--bs-gray-100);
}

.search-box .search-history > div:hover {
    background-color: var(--bs-gray-100);
}

.search_guide {
    font-size: 0.9rem;
}

.search_guide .card-group-content {
}

.search_guide ul {
    padding: 15px;
}
.search_guide ul li {
    line-height: 200%;
    font-weight: 500
}

.list-sermon .liTags a {
    font-size: 0.7rem;
}



.words_bible .card-group-content {
    max-height: 600px;
    overflow-y: scroll;
}

.dic_bible .card-group-content .post:nth-child(n+2) {
    margin-top: 30px;
}


.list_church .post {
    border-bottom: 0.1px solid var(--bs-gray-400);
}
.list_church .post:last-child {
    border-bottom: 0;
}

.phones {
    border-bottom: 0.1px solid var(--bs-gray-300);
}
.phones:last-child {
    border: 0;
}
.phones .phone {
    margin-bottom: 20px;
}
.phones .phone:last-child {
    margin-bottom: 10px;
}
.underline {
    text-decoration: underline;
}

/* ── AI 답변 ── */
.ai-answer-section {
    font-size: 0.92rem;
    line-height: 1.85;
    color: var(--bs-body-color);
}

/* 마크다운 헤딩 */
.ai-answer-section .md-h1 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 2rem 0 0.5rem;
    color: var(--bs-body-color);
    border-bottom: 1px solid var(--bs-primary);
    padding-bottom: 0.3rem;
}
.ai-answer-section .md-h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 2rem 0 0.4rem;
    color: var(--bs-body-color);
    border-bottom: 0.1px solid var(--bs-gray-300);
    padding-bottom: 0.25rem;
}
.ai-answer-section .md-h3 {
    font-size: 0.92rem;
    font-weight: 700;
    margin: 2rem 0 0.35rem;
    color: var(--bs-primary);
}

/* 문단 */
.ai-answer-section .md-p {
    margin: 0 0 0.7rem;
    line-height: 1.85;
}

/* 리스트 */
.ai-answer-section .md-ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0.3rem 0 0.7rem;
}
.ai-answer-section .md-ul li,
.ai-answer-section .md-ol li {
    margin-bottom: 0.3rem;
    line-height: 1.7;
}
.ai-answer-section .md-ul li:last-child,
.ai-answer-section .md-ol li:last-child {
    margin-bottom: 0;
}

/* 순서 목록은 요약 박스로 강조 */
.ai-answer-section .md-ol {
    list-style: decimal;
    background: var(--bs-gray-100);
    border: 0.1px solid var(--bs-gray-200);
    border-radius: 12px;
    padding: 16px 20px 16px 2.4rem;
    margin: 0.5rem 0 1rem;
    font-weight: 600;
}

/* 인용 */
.ai-answer-section .md-bq {
    border-left: 3px solid var(--bs-primary);
    background: var(--bs-gray-100);
    margin: 0.6rem 0;
    padding: 0.5rem 1rem;
    border-radius: 0 6px 6px 0;
    color: var(--bs-gray-700);
    font-style: italic;
}
.ai-answer-section .md-bq p { margin: 0; }

/* 구분선 */
.ai-answer-section .md-hr {
    border: none;
    border-top: 1px solid var(--bs-gray-300);
    margin: 0.8rem 0;
}

/* 인라인 코드 */
.ai-answer-section .md-code {
    background: var(--bs-gray-100);
    border: 0.1px solid var(--bs-gray-300);
    border-radius: 4px;
    padding: 0.1em 0.4em;
    font-size: 0.85em;
    font-family: monospace;
    color: #c7254e;
}

/* 링크 */
.ai-answer-section .md-link {
    color: var(--bs-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.ai-answer-section .md-link:hover { opacity: 0.75; }

/* [참조] 텍스트 (URL 없는 링크) */
.ai-answer-section .md-ref {
    font-weight: 600;
    color: var(--bs-body-color);
}

/* ── AI 참고 자료 섹션 ── */
.ai-sources-section {
    margin-top: 32px;
    border-top: 1px solid var(--bs-gray-200);
    padding-top: 24px;
}
/* AI 답변 내 h3(예: '추천 설교', .md-h3)와 동일한 스타일 */
.ai-sources-header {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--bs-primary);
    margin-bottom: 14px;
}

/* 탭 — 세그먼트(알약) 스타일 */
.ai-source-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    background: var(--bs-gray-100);
    border: 0;
    border-radius: 999px;
    margin-bottom: 16px;
}
.ai-source-tabs .nav-item { margin: 0; }
.ai-source-tabs .nav-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bs-gray-600);
    padding: 7px 16px;
    border: 0 !important;
    border-radius: 999px;
    background: transparent;
    transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.ai-source-tabs .nav-link:hover {
    color: var(--bs-gray-800);
}
.ai-source-tabs .nav-link.active {
    color: var(--bs-primary);
    background: #fff;
    box-shadow: 0 1px 5px rgba(15, 30, 60, .10);
}
.ai-source-tabs .nav-link .badge {
    font-size: 0.66rem;
    font-weight: 700;
    vertical-align: middle;
    padding: 3px 7px;
    background: color-mix(in srgb, var(--bs-primary) 10%, transparent) !important;
    color: var(--bs-primary) !important;
}

.ai-source-content {
    border: 0;
    padding: 0;
    background: transparent;
}

/* 개별 문서 카드 */
.ai-source-doc {
    padding: 16px 18px;
    margin-bottom: 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--bs-gray-200);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.ai-source-doc:hover {
    border-color: color-mix(in srgb, var(--bs-primary) 35%, var(--bs-gray-200));
    box-shadow: 0 8px 20px rgba(15, 30, 60, .07);
    transform: translateY(-1px);
}
.ai-source-doc:last-child {
    margin-bottom: 2px;
}

.ai-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--bs-primary) 10%, #fff);
    color: var(--bs-primary);
    font-size: 0.66rem;
    font-weight: 700;
    margin-right: 8px;
    vertical-align: middle;
    flex-shrink: 0;
}

.ai-source-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}
.ai-source-preview {
    font-size: 0.8rem;
    color: var(--bs-gray-600);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ai-source-meta {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.ai-source-date {
    font-size: 0.72rem;
    color: var(--bs-gray-500);
}
.ai-source-link {
    font-size: 0.72rem;
    color: var(--bs-primary);
    text-decoration: none;
    font-weight: 500;
}
.ai-source-link:hover {
    text-decoration: underline;
}.ai-citation-link {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #333;
    background-color: #e8e8e8;
    border-radius: 3px;
    padding: 0 4px;
    line-height: 1.6;
    text-decoration: none;
    vertical-align: middle;
    margin: 0 1px;
}
.ai-citation-link:hover {
    background-color: #d0d0d0;
    text-decoration: none;
    color: #333;
}
/* 참조 옆 카테고리 라벨 */
.ai-citation-link .ai-citation-cat {
    margin-left: 4px;
    padding-left: 4px;
    border-left: 1px solid rgba(0,0,0,.18);
    font-weight: 700;
}
/* 카테고리별 색상 */
.ai-citation-link[data-src="sermon"]   { background-color:#e3ecfb; color:#1b4fa0; }
.ai-citation-link[data-src="sermon"]:hover   { background-color:#d2e0f6; color:#1b4fa0; }
.ai-citation-link[data-src="qa"]       { background-color:#e0f3f6; color:#0c6b78; }
.ai-citation-link[data-src="qa"]:hover       { background-color:#cfeaef; color:#0c6b78; }
.ai-citation-link[data-src="bible"]    { background-color:#e3f4e6; color:#1f7a37; }
.ai-citation-link[data-src="bible"]:hover    { background-color:#d2ecd7; color:#1f7a37; }
.ai-citation-link[data-src="lifepost"] { background-color:#fdf0db; color:#9a6300; }
.ai-citation-link[data-src="lifepost"]:hover { background-color:#fbe7c4; color:#9a6300; }

/* 검색결과 카테고리 바로가기 버튼 바 (헤더 아래 고정) */
.search-cats {
    position: sticky;
    top: 3rem; /* #page-header 높이 */
    z-index: 1080;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--bs-gray-300);
}
.search-cats .cat-btn {
    cursor: pointer;
    border: 1px solid var(--bs-gray-300);
    background: #fff;
    color: var(--bs-gray-700);
    border-radius: 50rem;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.search-cats .cat-btn:hover {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}
.search-cats .cat-btn .cat-count {
    margin-left: 5px;
    opacity: .65;
    font-weight: 500;
}

/* AI 스트리밍 타이핑 커서 */
.ai-stream-cursor {
    display: inline-block;
    margin-left: 2px;
    color: var(--bs-primary, #333);
    animation: aiCursorBlink 1s steps(2, start) infinite;
}
@keyframes aiCursorBlink {
    to { visibility: hidden; }
}
