:root {
    --bg-outer: #F7F8F8;
    --bg-page: #F7F8F8;
    --bg-surface: #F7F8F8;
    --bg-surface-2: #F7F8F8;
    --bg-elevated: #F7F8F8;
    --bg-topbar: rgba(247, 248, 248, 0.78);
    --bg-footer: #F1F3F3;
    --border-subtle: rgba(15, 23, 42, 0.06);
    --border-default: rgba(15, 23, 42, 0.1);
    --border-strong: rgba(15, 23, 42, 0.18);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.1);
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --topbar-height: 56px;
    --sidebar-collapsed: 60px;
    --sidebar-expanded: 200px;
    --frame-max: 1700px;
    --text-sm: 0.9286rem;
    --text-lg: 1.125rem;
    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 11px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg-outer);
    color: var(--text-primary);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

/* ---------- App frame (centered shell) ---------- */

.app-outer {
    width: 100%;
    height: 100vh;
}

.app-frame {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    max-width: var(--frame-max);
    margin: 0 auto;
    background: var(--bg-page);
    position: relative;
}

.sidebar-slot {
    position: relative;
    flex-shrink: 0;
    width: var(--sidebar-expanded);
    height: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

input, kbd {
    font-family: inherit;
}

code, kbd, .mono {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Sidebar ---------- */

.sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    width: var(--sidebar-expanded);
    height: 100%;
    overflow: hidden;
    background: #F1F3F3;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--topbar-height);
    padding: 0 18px;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
    color: var(--text-primary);
}

.sidebar-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 10px 8px;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    flex: 1;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: background-color 0.12s ease, color 0.12s ease;
    font-size: 1rem;
    font-weight: 500;
}

.sidebar-item.is-hover {
    background: #E2E4E4;
    color: var(--text-primary);
}

.sidebar-item.is-active {
    background: #D8DADA;
    color: var(--text-primary);
    font-weight: 600;
}

.sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    font-size: 1rem;
}

.sidebar-label {
    font-size: 0.875rem;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 10px 4px;
}

.sidebar-caret {
    margin-left: auto;
    transition: transform 0.18s ease;
    color: var(--text-tertiary);
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-item-parent[aria-expanded="false"] .sidebar-caret {
    transform: rotate(-90deg);
}

.sidebar-subnav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 2px;
}

.sidebar-item-parent[aria-expanded="false"] + .sidebar-subnav {
    display: none;
}

.sidebar-sub {
    padding-left: 24px;
    height: 26px;
}

.sidebar-section-label {
    padding: 14px 10px 6px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
}

/* ---------- App shell ---------- */

.app-shell {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-page);
}

/* ---------- Topbar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    height: var(--topbar-height);
    box-sizing: content-box;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    background: var(--bg-topbar);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.18s ease;
}

.topbar-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.25rem;
}

.topbar-hamburger:hover { background: var(--bg-surface-2); color: var(--text-primary); }

/* 사이드바 드로어 백드롭 (모바일 전용) */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 1040;
    display: none;
}

.sidebar-backdrop.is-open { display: block; }

@media (min-width: 768px) {
    .sidebar-backdrop { display: none !important; }
}

.topbar-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.topbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1rem;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.topbar-icon-btn:hover {
    background: var(--bg-surface-2);
    color: var(--text-primary);
}

.topbar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-left: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}

.topbar-login {
    height: 36px;
    padding: 0 12px;
    margin-left: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.topbar-login:hover {
    background: var(--bg-surface-2);
    border-color: var(--border-strong);
}

/* ---------- Content ---------- */

.content {
    position: relative;
    flex: 1;
    min-height: 0;
    font-size: var(--text-sm);
    /* 스크롤 컨테이너 — 콘텐츠 + 푸터를 함께 스크롤 (sticky-footer 패턴) */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.content::-webkit-scrollbar { display: none; }

/* ---------- Page layout (main + right rail) ---------- */

.page-layout {
    position: relative;
    display: flex;
    flex-direction: row;
    flex: 1 0 auto;            /* 콘텐츠가 짧아도 늘어나 푸터를 화면 하단으로 밀어줌 */
    align-items: flex-start;
    padding: 28px;
    gap: 24px;
}

.page-main {
    flex: 1;
    min-width: 0;
}

/* ---------- Footer ---------- */

.site-footer {
    flex-shrink: 0;
    background: var(--bg-footer);
    border-top: 1px solid var(--border-default);
    color: var(--text-secondary);
}

.footer-inner {
    max-width: var(--frame-max);
    margin: 0 auto;
    padding: 1.125rem 1.75rem 0.875rem;
}

.footer-company {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0 0 0.75rem;
}

.footer-company-info {
    min-width: 0;
}

.footer-company-line {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-muted);
    word-break: keep-all;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--border-subtle);  /* 1px 보더 = px 예외 */
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.page-rail {
    display: none;
    width: 440px;
    flex-shrink: 0;
    align-self: flex-start;
    position: sticky;
    top: 0;
}

@media (min-width: 640px) {
    .page-rail {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
}

/* ---------- Section ---------- */

.section { margin-bottom: 28px; }

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    margin-bottom: 14px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.section-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-btn-ghost {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: background-color 0.12s ease;
}

.icon-btn-ghost:hover { background: var(--bg-surface-2); color: var(--text-primary); }

.chevron {
    color: var(--text-tertiary);
    display: inline-flex;
    font-size: 1rem;
}

/* ---------- Card grid ---------- */

.card-grid {
    display: grid;
    gap: 12px;
}

.card-grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.card-grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.card-grid-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }

/* card-grid-3 내 패널 배경 흰색 */
.card-grid-3 .panel { background: #fff; }

/* card-grid-3 패널 제목 영역 높이 축소 */
.card-grid-3 .panel-head { padding: 4px 14px; }
.card-grid-3 .panel-icon { width: 18px; height: 18px; font-size: 0.8rem; }
.card-grid-3 .panel-title { line-height: 1.2; }

@media (max-width: 1280px) {
    .card-grid-5 { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 1024px) {
    .card-grid-5, .card-grid-4 { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 768px) {
    .card-grid-5, .card-grid-4, .card-grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* ---------- 보증업체 카드 ---------- */

.gua-card {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    text-align: center;
}

/* 이미지 영역 — 4:3 비율 박스, 라운드, 채움 */
.gua-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
    background: var(--bg-outer);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gua-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 코드 행 — 하단 강조선 */
.gua-code {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);   /* 강조선: 디자인 고정 2px 예외 */
}
.gua-code strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* 버튼 행 (바로가기 / 상세보기) */
.gua-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.2;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.gua-btn-go {
    background: var(--accent);
    color: #fff;
}
.gua-btn-go:hover { background: var(--accent-strong, var(--accent)); filter: brightness(0.95); }
.gua-btn-detail {
    background: #fff;
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}
.gua-btn-detail:hover { background: var(--bg-outer); }

/* ---------- Program card ---------- */

.card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.card:hover { border-color: var(--border-default); box-shadow: var(--shadow-sm); }

.program-card { display: flex; flex-direction: column; gap: 10px; }

.program-head { display: flex; align-items: center; gap: 10px; min-width: 0; }

.program-thumb {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.program-emoji { font-size: 1.1rem; line-height: 1; }

.program-thumb-2 { background: linear-gradient(135deg, #f472b6, #c084fc); }
.program-thumb-3 { background: linear-gradient(135deg, #34d399, #22d3ee); }
.program-thumb-4 { background: linear-gradient(135deg, #fb923c, #fbbf24); }
.program-thumb-5 { background: linear-gradient(135deg, #f87171, #fb7185); }

.program-meta { display: flex; flex-direction: column; min-width: 0; gap: 2px; }

.program-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.program-sub {
    font-size: 1rem;
    color: var(--text-tertiary);
    display: flex;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
}

.program-sub > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.program-foot {
    display: flex;
    align-items: center;
    gap: 6px;
}

.score-pill {
    font-size: 1rem;
    font-weight: 700;
    color: var(--success);
    line-height: 1;
    background: rgba(22, 163, 74, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}

.rating-badge {
    font-size: 1rem;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
    background: var(--bg-surface-2);
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.delta-up { color: var(--success); }
.delta-down { color: var(--danger); }

/* ---------- Panel (list / chip / feed) ---------- */

.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 7px;
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.panel-icon {
    width: 22px; height: 22px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-body { padding: 6px; }

/* List row */
.list-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
}

.list-row:hover { background: var(--bg-surface-2); }

.list-rank {
    width: 24px;
    text-align: right;
    font-family: "JetBrains Mono", monospace;
    font-size: 1rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.list-thumb {
    width: 22px; height: 22px;
    border-radius: 6px;
    background: linear-gradient(135deg, #c7d2fe, #93c5fd);
    flex-shrink: 0;
}

.list-name {
    flex: 1;
    font-size: 1rem;
    color: var(--text-primary);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-name small {
    color: var(--text-tertiary);
    font-size: 1rem;
    margin-left: 4px;
    font-weight: 400;
}

.list-date {
    font-size: 1rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* 사이트 찾기 카테고리 탭 */
.site-tabs {
    display: flex;
    gap: 6px;
    padding: 4px 12px 0;
}

.site-tab {
    flex: 1 1 0;
    min-width: 0;
    height: 32px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 5px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.site-tab:hover { background: rgba(37, 99, 235, 0.16); }
.site-tab.is-active { background: #4f8ee0; color: #fff; }

.site-tab-count { font-weight: 700; opacity: 0.9; }

/* Chip grid */
.chip-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 10px;
}

.chip {
    padding: 7px 10px;
    border-radius: 6px;
    background: var(--bg-surface-2);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chip-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.chip-label .bi { color: var(--text-tertiary); font-size: 1rem; }

.chip-delta {
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.panel-foot {
    display: flex;
    justify-content: flex-end;
    padding: 8px 14px 12px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.panel-foot a { display: inline-flex; align-items: center; gap: 4px; }
.panel-foot a:hover { color: var(--text-primary); }

/* 우측 레일 패널 높이 축소 */
.page-rail .panel-head { padding: 5px 14px; }
.page-rail .panel-title { line-height: 1.2; }
.page-rail .panel-foot { padding: 6px 14px 9px; }

/* 우측 레일 패널 배경 흰색 */
.page-rail .panel { background: #fff; }

/* Feed */
.feed { padding: 4px 14px 8px; }

.feed-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.feed-item:last-child { border-bottom: 0; }

.feed-time {
    font-family: "JetBrains Mono", monospace;
    font-size: 1rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
    width: 36px;
    padding-top: 1px;
}

.feed-body { flex: 1; min-width: 0; }

.feed-title {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.45;
    margin-bottom: 6px;
}

.feed-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    color: var(--text-tertiary);
}

.feed-meta .rating-badge { padding: 2px 5px; }

/* Banner */
.banner {
    background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(96,165,250,0.03));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.banner-icon {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.banner-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.banner-sub { font-size: 1rem; color: var(--text-secondary); }

/* ---------- 숏팁 피드 ---------- */

.tip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border-subtle);
}

.tip-date { font-weight: 700; font-size: var(--text-lg); color: #C70042; }

.tip-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #C70042;
    font-weight: 500;
}

.tip-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.switch { position: relative; width: 36px; height: 20px; }

.switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.switch-knob {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-default);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.switch-knob::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: transform 0.15s ease;
}

.switch input:checked + .switch-knob { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-knob::after { transform: translateX(16px); }

.tip-feed { display: flex; flex-direction: column; }

.tip-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.tip-item-time {
    flex-shrink: 0;
    width: 42px;
    padding-top: 2px;
    font-family: "JetBrains Mono", monospace;
    color: var(--text-tertiary);
}

.tip-item-body { flex: 1; min-width: 0; }

.tip-item-title {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: #C70042;
    margin-bottom: 6px;
}

.tip-item-title:hover { text-decoration: underline; }

.tip-item-desc {
    margin: 0 0 10px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.tip-item-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tip-logo {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    flex-shrink: 0;
}

.tip-name { font-weight: 600; color: var(--text-primary); }

.tip-score {
    font-weight: 700;
    color: var(--success);
    background: rgba(22, 163, 74, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}

.tip-value { color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.tip-delta {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-variant-numeric: tabular-nums;
}

.tip-more {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--text-tertiary);
}

.tip-more:hover { color: var(--text-primary); }

.tip-like {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #C70042;
    border: 1px solid var(--border-subtle);
    border-radius: 7px;
    padding: 1px 10px;
    line-height: 1.3;
    transition: border-color 0.12s ease, color 0.12s ease, background-color 0.12s ease;
}

.tip-like:hover { border-color: var(--border-strong); background: #FFF1F4; }

/* AI Digest 패널 */
.digest-panel .panel-head {
    background:
        radial-gradient(150% 130% at 100% 0%, rgba(199, 0, 66, 0.14), rgba(199, 0, 66, 0) 60%),
        #fff;
    border-bottom: none;
    padding: 8px 14px;
}

.digest-updated { background: transparent; }

.tip-muted { color: var(--text-tertiary); font-weight: 400; }

.digest-body { padding: 14px; }

.digest-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 20px;
    padding: 0 8px;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
    line-height: 1;
    font-weight: 600;
    margin-bottom: 8px;
}

.digest-item {
    padding: 6px 0;
}

.digest-title {
    display: block;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
}

.digest-title:hover { text-decoration: underline; }

.digest-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-tertiary);
}

.digest-src { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.digest-time { flex-shrink: 0; }

/* ===================== 스포츠중계 보드 (.sb) ===================== */
.sb {
    --sb-bg: #ffffff;
    --sb-panel: #ffffff;
    --sb-row: #ffffff;
    --sb-row-alt: #f4f5f7;
    --sb-border: var(--border-subtle);
    --sb-text: var(--text-primary);
    --sb-dim: var(--text-secondary);
    --sb-orange: #C70042;
    --sb-gold: var(--text-secondary);

    display: flex;
    flex-direction: column;
    gap: 12px;
    color: var(--sb-text);
}

/* 1. 미디어 영역 */
.sb-media {
    background: var(--sb-bg);
    border: 1px solid var(--sb-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.sb-media-frame {
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--sb-dim);
    background: var(--bg-surface-2);
}

.sb-media-frame .bi { font-size: 2.5rem; }

/* 2. 결장정보 / 숏팁 열고닫기 */
.sb-aside {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sb-collapse {
    background: var(--sb-panel);
    border: 1px solid var(--sb-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.sb-collapse > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.sb-collapse > summary::-webkit-details-marker { display: none; }

.sb-collapse > summary .bi { transition: transform 0.18s ease; color: var(--sb-dim); }
.sb-collapse[open] > summary .bi { transform: rotate(180deg); }

.sb-collapse-body {
    padding: 12px 14px;
    border-top: 1px solid var(--sb-border);
    color: var(--sb-dim);
}

.sb-collapse-body--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .sb-collapse-body--split { grid-template-columns: 1fr; }
}

.sb-injury-col {
    border: 1px solid var(--sb-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.sb-injury-title {
    padding: 8px 12px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--sb-row-alt);
    border-bottom: 1px solid var(--sb-border);
}

/* 결장정보 테이블은 줄무늬(짝수행 회색) 제거 — 전부 흰색 */
.sb-injury-col .sb-table tbody tr:nth-child(even) {
    background: transparent;
}

/* 3. 카테고리 아이콘 바 */
.sb-cats {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 10px;
    background: var(--sb-bg);
    border: 1px solid var(--sb-border);
    border-radius: var(--radius-md);
}

.sb-cat {
    position: relative;
    flex: 1 1 0;
    min-width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    color: var(--sb-text);
    transition: background-color 0.12s ease;
}

.sb-cat:hover { background: rgba(15, 23, 42, 0.05); }
.sb-cat.is-active { background: var(--accent-soft); color: var(--accent); }

.sb-cat-ico { display: inline-flex; align-items: center; justify-content: center; }
.sb-cat-ico .bi { font-size: 1.9rem; }
.sb-cat-emoji { font-size: 2.3rem; line-height: 1; }

.sb-cat-badge {
    position: absolute;
    top: 4px;
    right: 30px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #d62a3f;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 4. 채널 탭 */
.sb-channels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

@media (max-width: 640px) {
    .sb-channels { grid-template-columns: repeat(2, 1fr); }
}

.sb-channel {
    height: 40px;
    border-radius: 6px;
    background: var(--sb-panel);
    border: 1px solid var(--sb-border);
    color: var(--sb-dim);
    font-weight: 600;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.sb-channel:hover { color: var(--sb-text); }
.sb-channel.is-active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* 5. 리스트 */
.sb-list {
    background: var(--sb-bg);
    border: 1px solid var(--sb-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.sb-list-bar {
    padding: 9px 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sb-list-bar--live {
    background: linear-gradient(90deg, #b8243a, #8e1b2c);
    color: #ffd9a0;
}

.sb-list-bar--wait {
    background: #151C2F;
    color: #e0b341;
}

.sb-bar-channels { color: #fff; }

.sb-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.sb-table th,
.sb-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--sb-border);
    text-align: center;
    vertical-align: middle;
}

.sb-table thead th {
    color: var(--sb-dim);
    font-weight: 600;
    background: var(--sb-row-alt);
}

.sb-table tbody tr:nth-child(even) { background: var(--sb-row-alt); }
.sb-table tbody tr:hover { background: rgba(15, 23, 42, 0.03); }

.sb-col-sport { width: 3.5rem; white-space: nowrap; }
.sb-col-time { width: 5rem; white-space: nowrap; color: var(--sb-text); }
.sb-col-league { width: 7.5rem; white-space: nowrap; color: var(--sb-text); }
.sb-col-match {
    width: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    color: var(--sb-text);
    font-weight: 500;
}
.sb-col-match.is-hot { color: var(--sb-orange); }
.sb-col-status { width: 7.5rem; }

.sb-sport-emoji { font-size: 1.1rem; }

.sb-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: var(--text-sm);
}

.sb-status--live { background: #d62a3f; color: #fff; }
.sb-status--wait { background: var(--bg-surface-2); color: var(--text-secondary); border: 1px solid var(--border-default); }

/* ===================== 스포츠정보 (.si) ===================== */
.si-tabbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--sb-border);
    border-radius: var(--radius-md);
}

.si-tabnav {
    flex: 0 0 auto;
    width: 32px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.si-tabnav:hover { background: rgba(15, 23, 42, 0.05); color: var(--text-primary); }

.si-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.si-tabs::-webkit-scrollbar { display: none; }

.si-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    height: 40px;
    padding: 0 14px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 600;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.si-tab:hover { background: rgba(15, 23, 42, 0.05); color: var(--text-primary); }
.si-tab.is-active { background: #c0202f; color: #fff; }

/* 커스텀 카테고리 드롭다운 (모바일) */
.si-dropdown {
    display: none;
    position: relative;
}

.si-dropdown-toggle {
    position: relative;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: #c0202f;
    color: #fff;
    font-weight: 700;
    font-size: var(--text-sm);
}

.si-dropdown-toggle .bi {
    position: absolute;
    right: 14px;
    font-size: 1rem;
    transition: transform 0.18s ease;
}

.si-dropdown.is-open .si-dropdown-toggle .bi { transform: rotate(180deg); }

.si-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: #fff;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 1030;
    display: none;
    max-height: 320px;
    overflow-y: auto;
}

.si-dropdown.is-open .si-dropdown-menu { display: block; }

.si-dropdown-option {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: 6px;
    text-align: center;
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 500;
}

.si-dropdown-option:hover { background: var(--bg-surface-2); }
.si-dropdown-option.is-selected { color: #c0202f; font-weight: 700; }

.si-table {
    width: 100%;
    border-collapse: collapse;
}

.si-table th,
.si-table td {
    padding: 14px 14px;
    border-bottom: 1px solid var(--sb-border);
    vertical-align: middle;
}

.si-table thead th {
    color: var(--text-secondary);
    font-weight: 600;
    background: var(--sb-row-alt);
    text-align: center;
    white-space: nowrap;
}

.si-table tbody tr:hover { background: rgba(15, 23, 42, 0.03); }

.si-col-home { text-align: left; }
.si-col-away { text-align: right; }
.si-col-sched,
.si-col-writer,
.si-col-views { text-align: center; white-space: nowrap; }

.si-team {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.si-team--away { justify-content: flex-end; }

.si-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c7d2fe, #93c5fd);
    flex-shrink: 0;
}

.si-logo-wrap { position: relative; display: inline-flex; }

.si-new {
    position: absolute;
    top: -7px;
    right: -12px;
    padding: 1px 5px;
    border-radius: 4px;
    background: #d62a3f;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.4;
}

.si-team-name { font-weight: 600; color: var(--text-primary); white-space: nowrap; }

.si-league,
.si-vs,
.si-date { display: block; line-height: 1.5; }

.si-league { font-weight: 600; color: var(--text-primary); }
.si-vs { color: var(--text-tertiary); font-size: var(--text-sm); }
.si-date { color: var(--text-secondary); font-size: var(--text-sm); }

.si-col-writer { color: var(--text-secondary); }
.si-col-views { color: var(--text-primary); font-weight: 600; }

/* ---------- 본문 내용 폰트 한 단계 축소 (타이틀 제외) ---------- */
.content .icon-btn-ghost,
.content .chevron,
.content .program-thumb,
.content .program-sub,
.content .score-pill,
.content .rating-badge,
.content .panel-icon,
.content .list-rank,
.content .list-name,
.content .list-name small,
.content .list-date,
.content .chip-label,
.content .chip-label .bi,
.content .chip-delta,
.content .panel-foot,
.content .feed-time,
.content .feed-meta,
.content .banner-sub {
    font-size: var(--text-sm);
}

/* 숏팁 본문 설명 + 메타 행 폰트 한 단계 더 축소 */
.tip-item-desc,
.tip-item-foot {
    font-size: 0.8125rem;
}

.tip-item-foot .rating-badge {
    font-size: 0.8125rem;
}

.tip-like .bi {
    font-size: 0.85em;
    line-height: 1;
}

/* ---------- 클릭 가능한 리스트 행 ---------- */
.si-row-link { cursor: pointer; }

/* ---------- 경기 상세 (.sb-detail) ---------- */
.sb-detail-head {
    background: #fff;
    border: 1px solid var(--sb-border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.sb-detail-teams { font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); }
.sb-detail-vs { color: var(--text-tertiary); font-weight: 600; margin: 0 6px; }
.sb-detail-meta { margin-top: 4px; color: var(--text-secondary); }

.sb-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 767.98px) {
    .sb-detail-grid { grid-template-columns: 1fr; }
}

.sb-detail-team {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sb-detail-team-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--sb-row-alt);
    border: 1px solid var(--sb-border);
    border-radius: var(--radius-md);
}

.sb-detail-side {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    border-radius: 4px;
    padding: 2px 6px;
}

.sb-detail-team-name { font-weight: 700; color: var(--text-primary); }
.sb-detail-formation { margin-left: auto; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.sb-detail-section {
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--sb-border);
    border-radius: var(--radius-md);
}

.sb-detail-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.sb-detail-count {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 0 7px;
}

.sb-detail-player {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px dashed var(--sb-border);
}

.sb-detail-player:last-child { border-bottom: 0; }
.sb-detail-pname { font-weight: 600; color: var(--text-primary); }
.sb-detail-ppos { font-size: var(--text-sm); color: var(--text-secondary); }
.sb-detail-preason { margin-left: auto; font-size: var(--text-sm); color: var(--danger); white-space: nowrap; }
.sb-detail-impact { display: inline-flex; gap: 0.125rem; font-size: var(--text-sm); white-space: nowrap; flex-shrink: 0; }
.sb-detail-impact .bi-star-fill {
    color: #D2D5D5;
    /* 광택 없이 아래쪽 그림자로만 가벼운 입체감 */
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}
.sb-detail-impact .bi-star-fill.is-on {
    color: #F5C518;
    filter: drop-shadow(0 1px 1px rgba(150, 95, 0, 0.45));
}
.sb-detail-player--missing .sb-detail-pname { color: var(--text-secondary); }
.sb-detail-empty { color: var(--text-tertiary); font-size: var(--text-sm); padding: 4px 0; }

/* ===================== 데이터 로딩 오버레이 ===================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(247, 248, 248, 0.6);
    backdrop-filter: blur(0.125rem);
}
.loading-overlay.is-active { display: flex; }
.loading-overlay-img { width: 4.5rem; height: auto; }

/* ===================== 페이지 설명 콘텐츠 (관리자 입력, 본문 하단) ===================== */
.page-content {
    margin: 1.5rem 2rem 0;
    padding: 1.75rem 2rem;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: var(--text-sm);
}
.page-content-title {
    margin: 0 0 1rem;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--accent);
}
/* Quill 본문(HTML) — 소제목/문단/링크/리스트 기본 스타일. 인라인 색상(style)은 그대로 적용됨 */
.page-content-body h1,
.page-content-body h2,
.page-content-body h3 {
    margin: 1.4rem 0 0.6rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-left: 0.625rem;
    border-left: 0.1875rem solid var(--accent);
    line-height: 1.4;
}
.page-content-body h1 { font-size: 1.625rem; }
.page-content-body h2 { font-size: 1.25rem; }
.page-content-body h3 { font-size: 1.0625rem; }
.page-content-body p { margin: 0 0 0.65rem; }
.page-content-body a { color: var(--accent); text-decoration: underline; }
.page-content-body ul,
.page-content-body ol { margin: 0 0 0.75rem; padding-left: 1.5rem; }
.page-content-body img { max-width: 100%; height: auto; }
.page-content-body :first-child { margin-top: 0; }
.page-content-body :last-child { margin-bottom: 0; }
@media (max-width: 767.98px) {
    .page-content { margin: 1rem; padding: 1.25rem; }
}

/* ===================== 모바일 (≤767px): 사이드바 드로어 ===================== */
@media (max-width: 767.98px) {
    /* 루트 폰트 축소 → rem 기반 전체 폰트가 비례. 75% = 1rem이 12px */
    html { font-size: 75%; }

    /* 사이드바 슬롯이 자리를 차지하지 않게 → 본문 전체 폭 */
    .sidebar-slot { width: 0; }

    /* 사이드바를 화면 밖 드로어로 전환 */
    .sidebar {
        position: fixed;
        width: var(--sidebar-expanded);
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        z-index: 1050;
    }

    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(15, 23, 42, 0.22);
    }

    /* 햄버거 버튼 노출 */
    .topbar-hamburger { display: inline-flex; }

    /* 토바 간격/패딩 축소 + 보조 아이콘(테마·언어) 숨겨 공간 확보 */
    .topbar { gap: 8px; padding: 0 12px; }
    .topbar-actions { gap: 4px; }
    .topbar-icon-btn[aria-label="테마"],
    .topbar-icon-btn[aria-label="언어"] { display: none; }

    /* 본문 패딩 축소 + 메인/레일을 세로로 쌓아 레일을 하단에 배치 */
    .page-layout { padding: 16px; flex-direction: column; align-items: stretch; }
    .page-main { flex: 0 0 auto; }
    .page-rail {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
        align-self: stretch;
        position: static;
    }

    /* 스포츠 카테고리: 한 행에 6개 그리드 */
    .sb-cats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
    .sb-cat { min-width: 0; height: 46px; }
    .sb-cat-emoji { font-size: 1.6rem; }
    .sb-cat-ico .bi { font-size: 1.3rem; }
    .sb-cat-badge { right: 6px; }

    /* 와이드 테이블(Now/Wait On Air 등)은 가로 스크롤로 처리 */
    .sb-list { overflow-x: auto; overflow-y: hidden; }

    /* 스포츠정보: 카테고리 드롭다운으로 전환 */
    .si-tabbar { display: none; }
    .si-dropdown { display: block; }

    /* 스포츠중계 리스트: 리그 컬럼은 모바일에서만 숨김 (데스크톱은 유지) */
    .sb-col-league { display: none; }
    /* 좁은 화면에서 컬럼 여유 확보 */
    .sb-table th, .sb-table td { padding: 10px 6px; }

    /* 스포츠정보 테이블: 글쓴이·조회 숨김 + 팀 로고 위 / 팀명 아래로 스택 */
    .si-table { min-width: 0; }
    .si-col-writer, .si-col-views { display: none; }
    .si-table th, .si-table td { padding: 12px 8px; }
    .si-col-home, .si-col-away { text-align: center; }
    .si-team { flex-direction: column; gap: 4px; max-width: 100%; }
    .si-team--away { flex-direction: column-reverse; }
    .si-new { right: -8px; }

    /* 모바일에선 팀명이 좁은 셀에서 넘치지 않도록 줄바꿈 허용 (nowrap 해제) */
    .si-team-name {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: keep-all;
        max-width: 100%;
    }

    /* 푸터: rem 기반이라 루트폰트 75% 축소로 자동 비례 → 패딩/폰트 override 불필요.
       좌우 여백만 살짝 좁힘. */
    .footer-inner { padding-left: 1rem; padding-right: 1rem; }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
