/* ===== 영남일보 AI 위젯 — 모바일 버전 ===== */
/* 데스크톱(330px 고정) → 모바일(100% 가변) 수정 */

/* ===== ⓘ 버튼 & 설명 박스 ===== */
.yn-ai-sb-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.yn-ai-sb-info {
    background: none;
    border: 1px solid #008d8a;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 11px;
    color: #008d8a;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.yn-ai-sb-info:hover {
    background: #008d8a;
    color: #fff;
}
.yn-ai-sb-info-box {
    display: none;
    font-size: 12px;
    color: #555;
    line-height: 1.6;
    padding: 8px 14px;
    background: #f5f5f5;
    border-bottom: 1px solid #e1e1e1;
    word-break: keep-all;
}
.yn-ai-sb-info-box.visible {
    display: block;
}

/* ===== 메인 컨테이너 — 모바일: 100% 너비 ===== */
.yn-ai-sidebar {
    width: 100%;
    margin: 20px 0;
    font-family: pretendard, '맑은고딕', 'Malgun Gothic', 'Apple SD Gothic Neo', '돋움', Dotum, '굴림', Gulim, AppleGothic, sans-serif;
    box-sizing: border-box;
}

/* --- 공통 섹션 --- */
.yn-ai-sb-section {
    background: #fff;
    border: 1px solid #d8d9d9;
    margin-bottom: 10px;
    overflow: hidden;
}

/* --- 헤더 --- */
.yn-ai-sb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    background: #fff;
    border-bottom: 1px solid transparent;
    user-select: none;
}

.yn-ai-sb-section.open .yn-ai-sb-header {
    border-bottom-color: #d8d9d9;
}

.yn-ai-sb-header:hover {
    background: #f9f9f9;
}

.yn-ai-sb-header-left {
    display: flex;
    align-items: center;
    gap: 7px;
}

.yn-ai-sb-icon {
    font-size: 16px;
}

.yn-ai-sb-title {
    font-size: 15px;
    font-weight: 600;
    color: #000;
}

.yn-ai-sb-badge {
    display: inline-block;
    background: #008d8a;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 9px;
    letter-spacing: 0.5px;
}

.yn-ai-sb-toggle {
    font-size: 11px;
    color: #999;
    transition: transform 0.25s ease;
}

.yn-ai-sb-section.open .yn-ai-sb-toggle {
    transform: rotate(180deg);
}

/* --- 바디 --- */
.yn-ai-sb-body {
    display: none;
}

.yn-ai-sb-section.open .yn-ai-sb-body {
    display: block;
}

/* ===== 다국어 해설 ===== */

.yn-sb-lang-tabs {
    display: flex;
    flex-wrap: wrap;
    padding: 10px 10px 8px;
    gap: 6px;
    border-bottom: 1px solid #e1e1e1;
    background: #fafafa;
}

.yn-sb-lang-tab {
    background: #fff;
    border: 1px solid #d8d9d9;
    border-radius: 3px;
    padding: 6px 10px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    font-weight: 500;
}

.yn-sb-lang-tab:hover {
    background: #f0f0f0;
}

.yn-sb-lang-tab.active {
    background: #008d8a;
    color: #fff;
    border-color: #008d8a;
    font-weight: 600;
}

.yn-sb-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 0;
}
.yn-sb-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #008d8a;
    border-radius: 50%;
    animation: yn-spin 0.7s linear infinite;
}
@keyframes yn-spin {
    to { transform: rotate(360deg); }
}

.yn-sb-lang-detect {
    background: #f0f8f8;
    border-color: #008d8a;
    color: #008d8a;
    font-size: 14px;
    padding: 5px 10px;
}
.yn-sb-lang-detect:hover {
    background: #e0f2f1;
}

.yn-sb-lang-code {
    font-size: 10px;
    font-weight: 700;
    margin-right: 2px;
    opacity: 0.7;
}

.yn-sb-lang-content {
    display: none;
    padding: 20px 16px;
}

.yn-sb-lang-content.active {
    display: block;
}

/* 해설 본문 */
.yn-sb-briefing {
    font-size: 15px;
    line-height: 26px;
    color: #222;
    font-weight: 400;
    letter-spacing: -0.5px;
    border-left: 3px solid #008d8a;
    padding: 0 0 0 12px;
    margin-bottom: 16px;
    word-break: keep-all;
}

.yn-sb-briefing p {
    margin: 0;
}

.yn-sb-gap {
    height: 12px;
}

.yn-sb-briefing p:last-child {
    margin-bottom: 0;
}

.yn-sb-briefing strong {
    display: block;
    color: #008d8a;
    font-size: 14px;
    font-weight: 600;
    margin-top: 2em;
    margin-bottom: 0.6em;
}

.yn-sb-briefing strong + strong {
    margin-top: 0.3em;
}

.yn-sb-briefing ul, .yn-sb-briefing ol {
    margin: 10px 0;
    padding-left: 20px;
}

.yn-sb-briefing li {
    margin-bottom: 12px;
    line-height: 26px;
}

/* 용어 */
.yn-sb-keywords {
    padding: 16px;
    border-top: 1px solid #e1e1e1;
    background: #fafafa;
}

.yn-sb-keywords h5 {
    font-size: 13px;
    color: #008d8a;
    margin: 0 0 12px;
    font-weight: 700;
}

.yn-sb-keyword-item {
    display: block;
    background: #fff;
    border: 1px solid #d8d9d9;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    line-height: 24px;
}

.yn-sb-keyword-item:last-child {
    margin-bottom: 0;
}

.yn-sb-keyword-item .term {
    font-weight: 700;
    color: #008d8a;
    margin-right: 6px;
}

/* 면책 */
.yn-sb-disclaimer {
    padding: 10px 16px;
    font-size: 12px;
    color: #8b8b8b;
    background: #f9f9f9;
    border-top: 1px solid #e1e1e1;
    line-height: 20px;
}

/* ===== 다양한 시선 ===== */

.yn-sb-reactions {
    padding: 10px;
}

.yn-sb-reaction-card {
    background: #fff;
    border: 1px solid #d8d9d9;
    padding: 12px;
    margin-bottom: 10px;
}

.yn-sb-reaction-card:last-child {
    margin-bottom: 0;
}

.yn-sb-reaction-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e1e1;
}

.yn-sb-reaction-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: #f5f5f5;
}

.yn-sb-reaction-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.yn-sb-reaction-name {
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

.yn-sb-reaction-desc {
    font-size: 12px;
    color: #8b8b8b;
    line-height: 18px;
}

.yn-sb-reaction-body {
    font-size: 15px;
    line-height: 26px;
    color: #222;
    font-weight: 400;
    letter-spacing: -0.5px;
    word-break: keep-all;
}

.yn-sb-reaction-disclaimer {
    padding: 10px 16px;
    font-size: 12px;
    color: #8b8b8b;
    background: #f9f9f9;
    border-top: 1px solid #e1e1e1;
    line-height: 20px;
}
