:root {
    --bg-outer: #F0F4F8;                       /* 콘텐츠 바깥 배경(시안 Container) */
    --bg-page: #F0F4F8;                        /* 콘텐츠 영역 배경 — 흰 카드가 뜨도록 푸른 회색(시안) */
    --bg-surface: #F7F8F8;
    --bg-surface-2: #F7F8F8;
    --bg-elevated: #F7F8F8;
    --bg-topbar: rgba(240, 244, 248, 0.97);    /* 탑바(시안 Header) */
    --bg-footer: rgba(240, 244, 248, 0.97);    /* 푸터 — 탑바와 통일(시안) */
    --border-subtle: rgba(15, 23, 42, 0.06);
    --border-default: rgba(15, 23, 42, 0.1);
    --border-strong: rgba(15, 23, 42, 0.18);
    /* ===== 컬러칩 스케일 (50~900) ===== */
    /* Primary — Blue (기준 #2563EB = blue-600) */
    --blue-50: #eff6ff;  --blue-100: #dbeafe; --blue-200: #bfdbfe; --blue-300: #93c5fd; --blue-400: #60a5fa;
    --blue-500: #3b82f6; --blue-600: #2563eb; --blue-700: #1d4ed8; --blue-800: #1e40af; --blue-900: #1e3a8a;
    --blue-soft: rgba(37, 99, 235, 0.1);
    /* Secondary — Teal/Cyan (기준 #0EA5A4 = teal-500) */
    --teal-50: #ecfdfb;  --teal-100: #cbf5f1; --teal-200: #9aeae3; --teal-300: #5fd9d0; --teal-400: #24bfb6;
    --teal-500: #0ea5a4; --teal-600: #0c8786; --teal-700: #0b6b6a; --teal-800: #0c5453; --teal-900: #0c4241;
    --teal-soft: rgba(14, 165, 164, 0.1);
    /* Anchor — Deep Navy (무게감) */
    --navy-700: #1b3a5b; --navy-800: #122a45; --navy-900: #0b2545;
    /* Neutral — Slate */
    --slate-50: #f8fafc;  --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1; --slate-400: #94a3b8;
    --slate-500: #64748b; --slate-600: #475569; --slate-700: #334155; --slate-800: #1e293b; --slate-900: #0f172a;
    /* Brand 부속(기존 유지·문서화) */
    --brand-orange: #1a2a80;   /* 토너먼트 */
    --live: #1faf5c;           /* 라이브 배지 */
    /* 카테고리 팔레트 (스포츠정보·결장정보) — colorhunt 인디고 4단 (#1A2A80 3B38A0 7A85C1 B2B0E8) */
    --cat-deep: #1a2a80; --cat-blue: #3b38a0; --cat-sky: #7a85c1; --cat-pale: #b2b0e8;
    --cat-grad: linear-gradient(135deg, #1a2a80, #6360d6);                                     /* 활성 탭/페이저/드롭다운 — 진한→밝은 인디고(그라데이션 또렷, 흰 글씨 대비 유지) */
    --cat-head: linear-gradient(180deg, rgba(122, 133, 193, 0.16), rgba(178, 176, 232, 0.34)); /* 리스트 헤더 틴트 */
    --cat-hover: rgba(79, 76, 192, 0.14);                                                      /* 탭/버튼 호버(또렷하게) */

    /* ===== 시맨틱 ===== */
    --success: #16a34a; --success-soft: rgba(22, 163, 74, 0.1);
    --warning: #d97706; --warning-soft: rgba(217, 119, 6, 0.1);
    --danger: #dc2626;  --danger-soft: rgba(220, 38, 38, 0.1);

    /* ===== 의미 별칭 (스케일로 재지정 — 계산값은 기존과 동일, 무회귀) ===== */
    --text-primary: var(--slate-900);     /* #0f172a */
    --text-secondary: var(--slate-600);   /* #475569 */
    --text-tertiary: var(--slate-400);    /* #94a3b8 */
    --accent: #4f4cc0;                    /* 인디고(밝은) — 버튼 기본은 가볍게, 호버에서 확실히 진해지도록 */
    --accent-hover: #1a2a80;              /* 호버 시 진한 인디고(#1A2A80) — 기본과 큰 대비 */
    --accent-soft: rgba(79, 76, 192, 0.12);
    /* primary 버튼 색(시안 파랑) — 버튼 전용. --accent(인디고)는 링크/사이드바/포커스 등 비버튼 용도 유지 */
    --btn-primary: #2563EB;
    --btn-primary-hover: #1D4ED8;
    --btn-primary-soft: #EFF4FF;   /* 연한 파랑(아바타 등 파랑 아이콘 배경) */
    --secondary: #7a85c1;                 /* 뮤트 라벤더블루(#7A85C1) */
    --secondary-hover: #3b38a0;
    --secondary-soft: rgba(122, 133, 193, 0.14);
    --ink: var(--slate-900);              /* 신규 — 강한 본문/제목 */
    --navy: var(--navy-900);              /* 신규 — 무게 앵커(헤더/푸터 강조 등) */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --topbar-height: 3.9375rem;   /* 63px (시안) — rem이라 모바일 루트폰트 축소 시 비례 */
    --sidebar-collapsed: 60px;
    --sidebar-expanded: 240px;    /* 좌측 사이드바 폭(시안 240px) */
    --frame-max: 100%;            /* 앱 프레임 풀블리드 — 사이드바 좌측 고정, 바깥(좌우) 여백 제거 */
    --content-max: 1440px;        /* 콘텐츠 열 최대 폭(시안) — page-layout·cm-main·page-content 공통 */
    --content-gutter: 2rem;       /* 콘텐츠 좌우 안쪽 여백 32px(시안) */
    --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: "Noto Sans KR", -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;       /* 폴백 */
    height: 100dvh;      /* 모바일 주소창/시스템 내비 변화 대응 — footer가 하단 UI에 잘리지 않게 */
}

.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: rgba(255, 255, 255, 0.9);   /* 시안: 사이드바 흰색(90%) */
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: var(--topbar-height);
    padding: 0 30px 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), #7a85c1);
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

/* 브랜드 행 — 로고(홈 링크) 중앙 + 우측 시안 순환 화살표(절대배치라 로고 중앙정렬 유지) */
.sidebar-brand-row { position: relative; }
.brand-cycle {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    cursor: pointer;
    line-height: 1;
}
.brand-cycle:hover { background: var(--bg-surface-2); color: var(--text-primary); }

/* 사이드바 브랜드 로고 이미지 — 브랜드 바(56px) 안에 비율 유지하며 맞춤(사이드바 폭 200px 내) */
.sidebar-brand-img {
    max-width: 100%;
    max-height: 40px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.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: 2.6875rem;              /* 43px (시안) */
    padding: 0 0.75rem;             /* 좌우 12px */
    border-radius: 10px;            /* 시안 */
    color: rgba(58, 65, 78, 0.9);   /* 기본 회색(시안) */
    white-space: nowrap;
    transition: background-color 0.12s ease, color 0.12s ease;
    font-size: 0.9375rem;           /* 15px */
    font-weight: 500;
}
.sidebar-item .sidebar-icon { color: #98A0AE; }   /* 기본 아이콘 회색 */

.sidebar-item.is-hover {
    background: #F1F6FF;
    color: #1D4ED8;
}
.sidebar-item.is-hover .sidebar-icon { color: #1D4ED8; }

/* 현재 페이지(활성) + 아코디언 펼침(부모) → 시안 파랑 하이라이트(#EFF6FF) */
.sidebar-item.is-active,
.sidebar-item-parent[aria-expanded="true"] {
    background: #EFF6FF;
    color: #1D4ED8;
    font-weight: 700;
}
.sidebar-item.is-active .sidebar-icon,
.sidebar-item.is-active .sidebar-caret,
.sidebar-item-parent[aria-expanded="true"] .sidebar-icon,
.sidebar-item-parent[aria-expanded="true"] .sidebar-caret { color: #1D4ED8; }

.sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    font-size: 1.125rem;   /* 18px 아이콘 */
}

.sidebar-label {
    font-size: 0.9375rem;   /* 15px */
}

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

.sidebar-caret {
    margin-left: auto;
    transition: transform 0.18s ease;
    color: #C1C8D0;         /* 시안 기본 caret 회색 */
    font-size: 0.875rem;    /* 14px */
    flex-shrink: 0;
}

/* 펼침(열림)=위 화살표(180°), 접힘=아래 화살표(기본 bi-chevron-down) */
.sidebar-item-parent[aria-expanded="true"] .sidebar-caret {
    transform: rotate(180deg);
}

/* 하위 트리 — 좌측 세로선(#DBEAFE) + 들여쓰기(시안) */
.sidebar-subnav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0 4px 1.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid #DBEAFE;
}

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

/* 하위 항목 — 아이콘 없이 텍스트만(13px), 활성/hover 파랑 */
.sidebar-sub {
    height: auto;
    min-height: 2.125rem;          /* ~34px */
    padding: 0.4375rem 0.5rem;     /* 7px 8px */
    border-radius: 8px;
    font-weight: 400;
    color: #64748B;                /* 시안 하위 텍스트 */
}
.sidebar-sub .sidebar-label { font-size: 0.8125rem; }   /* 13px */
.sidebar-sub .sidebar-icon { display: none; }
.sidebar-sub.is-active { background: #EFF6FF; color: #1D4ED8; font-weight: 600; }
.sidebar-sub.is-hover { background: #F1F6FF; color: #1D4ED8; }

.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 2rem;   /* 시안 헤더 좌우 32px */
    background: var(--bg-topbar);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid #D8E3EF;   /* 시안 헤더 하단 보더 */
    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: 1024px) {
    .sidebar-backdrop { display: none !important; }
}

.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: 10px;   /* 시안 */
    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-icon-btn--dot { position: relative; }
.topbar-icon-btn--dot::after {
    content: "";
    position: absolute;
    top: 9px;
    right: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #E8632A;   /* 시안 알림 점(주황) */
}

/* 탑바 텍스트 링크(로그인/로그아웃) — 시안: 테두리 없는 회색 텍스트, hover 시 강조 */
.topbar-link {
    display: inline-flex;
    align-items: center;
    height: 2.4375rem;          /* 39px — 회원가입 버튼과 동일 높이(rem이라 모바일 루트폰트 축소 시 비례) */
    padding: 0 0.5rem;
    margin-left: 4px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.topbar-link:hover { background: var(--bg-surface-2); color: var(--text-primary); }
/* 탑바 회원가입 등 .btn 높이도 39px로 통일(.btn-sm 2.1rem 오버라이드) */
.topbar-actions .btn { height: 2.4375rem; }

.topbar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: 8px;
    border-radius: 50%;
    background: #EFF6FF;   /* 시안 아바타 연파랑 원 */
    color: #1D4ED8;        /* 시안 사람 아이콘 */
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
/* hover — 연한 파랑 진하게 + 포커스 링 */
.topbar-avatar:hover { background: #E0E9FF; box-shadow: 0 0 0 3px var(--btn-primary-soft); }

/* 계정 드롭다운 — person 아이콘 hover/focus/클릭 시 하단 레이어 */
.topbar-menu { position: relative; display: inline-flex; }
.topbar-dropdown {
    position: absolute; top: 100%; right: 0;
    padding-top: 0.5rem;            /* hover 브릿지(버튼-카드 사이 간격 메움) */
    min-width: 10rem; z-index: 1600;
    opacity: 0; visibility: hidden; transform: translateY(-0.375rem);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
/* 클릭/터치 토글(모든 기기) — JS가 .is-open 제어 */
.topbar-menu.is-open .topbar-dropdown { opacity: 1; visibility: visible; transform: none; }
/* hover/focus 표시는 마우스(호버 가능) 기기에서만 — 터치는 sticky hover로 안 닫히는 문제 방지 */
@media (hover: hover) and (pointer: fine) {
    .topbar-menu:hover .topbar-dropdown,
    .topbar-menu:focus-within .topbar-dropdown { opacity: 1; visibility: visible; transform: none; }
}
.td-card {
    background: #fff; border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 0.625rem 1.875rem rgba(26, 42, 128, 0.12);
    padding: 0.55rem;
}
.td-head { padding: 0.4rem 0.5rem 0.6rem; font-weight: 700; color: var(--text-primary); }
.td-nick { font-size: var(--text-sm); }
.td-cta { padding: 0.1rem 0.1rem 0.5rem; }
.td-list { border-top: 1px solid var(--border-subtle); padding-top: 0.35rem; display: flex; flex-direction: column; }
/* 헤더/버튼 없이 목록만 있을 때(로그인 상태)는 상단 구분선 제거 */
.td-card > .td-list:first-child { border-top: none; padding-top: 0; }
.td-item {
    display: block; text-align: center;
    padding: 0.55rem 0.6rem; border-radius: var(--radius-md);
    font-size: var(--text-sm); color: var(--text-primary); text-decoration: none;
    transition: background .12s ease, color .12s ease;
}
.td-item:hover { background: var(--cat-hover); color: var(--cat-deep); }

.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    margin-left: 4px;
}

/* 로그인 후 탑바 — 포인트 칩 + 닉네임 (Figma 03.메인 로그인후) */
.topbar-point {
    display: inline-flex;
    align-items: center;
    height: 2rem;                        /* 32px (시안 padding 6/10 기준) */
    padding: 0 0.625rem;                 /* 좌우 10px */
    background: #DBEAFE;                  /* 시안 포인트 배지 */
    border-radius: 10px;                 /* 시안 */
    font-size: 0.8125rem;                /* 13px */
    font-weight: 600;                    /* 시안 */
    line-height: 1.25rem;
    color: #1D4ED8;                      /* 시안 */
    white-space: nowrap;
}
.topbar-nick {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    font-size: 0.84375rem;               /* 13.5px */
    font-weight: 600;                    /* 시안 */
    line-height: 1.25rem;
    color: #1D4ED8;                      /* 닉네임 파랑(시안) */
    white-space: nowrap;
}
.topbar-nick-suffix { color: #1F2430; font-weight: 500; }  /* '님'(시안) */

/* 로그인/로그아웃·회원가입은 공통 .btn(.btn-ghost/.btn-primary)으로 통일 → _Layout 참조 */

/* ---------- 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;
    /* 얇은 커스텀 스크롤바(사이트 톤) — Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 110, 130, 0.35) transparent;
}

/* 얇은 커스텀 스크롤바 — Chrome/Safari/Edge */
.content::-webkit-scrollbar { width: 8px; height: 8px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: rgba(100, 110, 130, 0.35); border-radius: 999px; }
.content::-webkit-scrollbar-thumb:hover { background: rgba(100, 110, 130, 0.55); }

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

.page-layout {
    position: relative;
    display: flex;
    flex-direction: row;
    flex: 1 0 auto;            /* 콘텐츠가 짧아도 늘어나 푸터를 화면 하단으로 밀어줌 */
    align-items: flex-start;
    padding: 1.5rem var(--content-gutter) 3rem;   /* 시안: 상24 / 좌우32 / 하48 */
    gap: 24px;
    /* 콘텐츠 열 중앙정렬 — 최대 폭 1440px(시안), 좌우 안쪽 여백 32px(--content-gutter).
       게시판(.cm-main)·페이지설명(.page-content)도 같은 폭으로 통일. */
    width: 100%;
    max-width: var(--content-max);
    min-height: 30rem;
    margin-inline: auto;
}

.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.75rem var(--content-gutter) 1.5rem;   /* 시안 푸터 좌우 32px */
}

/* 로고 — 사이드바 로고와 동일 크기(max-height 40px). */
.footer-logo {
    display: block;
    line-height: 0;
    margin-bottom: 1rem;
}
.footer-logo img { max-width: 100%; max-height: 40px; width: auto; height: auto; object-fit: contain; }

/* 저작권/운영 안내 문구 */
.footer-desc {
    margin: 0 0 0.9rem;
    font-size: 0.75rem;
    line-height: 1.7;
    color: var(--text-muted);
    word-break: keep-all;
}

.footer-copy {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;             /* 카피라이트 강조 */
    color: var(--text-muted);
}

/* ---------- 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)); }
}

/* ---------- 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), #7a85c1);
    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; }

/* 광고배너(광고배너1·2) — 헤더 없이 이미지 1개 + 링크만. 배너 슬롯 높이 12rem. */
.ad-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 12rem;
    border: 1px solid var(--border-subtle);
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
    text-decoration: none;
}
.ad-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 이미지 전까지의 텍스트 플레이스홀더 */
.ad-banner-text { color: var(--text-tertiary); font-size: var(--text-sm); font-weight: 600; }

/* 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); }

/* 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), #7a85c1);
    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), #7a85c1);
    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; }

/* ---------- 본문 내용 폰트 한 단계 축소 (타이틀 제외) ---------- */
.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;
}

/* ===================== 스포츠 보드 공용 컨테이너 (.sb) — Broadcast·Info 공유 ===================== */
/* .sb는 두 페이지의 래퍼 + CSS변수(--sb-*) 정의처라 core 유지(스포츠중계 .sb-* / 스포츠정보 .sb-detail-*가 변수 참조).
   자식 사이 세로 gap(12px)이 종목/리그/리스트 간격을 만든다. */
.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);
}
.sb-list {
    background: var(--sb-bg);
    border: 1px solid var(--sb-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* ===================== 데이터 로딩 오버레이 ===================== */
.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; }

/* 시각적으로 숨긴 H1 (스크린리더·검색봇용) — 메인 seo-content 블록의 대표 제목.
   .page-content-body h1 스타일보다 우선하도록 특정 셀렉터도 함께 지정. */
.seo-h1,
.page-content-body h1.seo-h1 {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px; border: 0;
    overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%);
    white-space: nowrap;
}

/* ===================== 페이지 설명 콘텐츠 (관리자 입력, 본문 하단) ===================== */
.page-content {
    /* page-layout 안쪽 콘텐츠(콘텐츠열-좌우여백) 폭에 맞춰 테두리 정렬 + 항상 32px 좌우 여백 */
    width: calc(100% - 2 * var(--content-gutter));
    max-width: calc(var(--content-max) - 2 * var(--content-gutter));
    margin: 1.5rem auto;
    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; }
/* h4 — 소제목(사이트찾기 '1단계. ~ 4단계.'). 위 h1~h3 규칙의 대상이 아니라 **브라우저 기본값**(상·하 1.33em)을
   쓰고 있었고, 그 아래쪽 여백이 제목과 본문 사이를 개행 하나만큼 벌려 놓았다(2026-10-06 지시로 붙임).
   ⚠ 아래 여백은 0 이어야 제목과 설명이 한 덩어리로 읽힌다(`p` 도 margin:0 이라 그 둘이 바로 붙는다).
   ⚠ 위 여백은 남긴다 — 앞 단계의 설명 문단과 다음 단계 제목이 붙어 버리면 단계 구분이 사라진다.
   ⚠ `.page-content-body` 전 행 공통 규칙이다 — 지금 h4 를 쓰는 행은 `/site-find` 하나뿐(실측)이지만
     다른 행이 h4 를 쓰기 시작하면 함께 적용된다. */
.page-content-body h4 { margin: 1rem 0 0; }
.page-content-body p { margin: 0; }   /* 문단 간격 제거(br처럼 촘촘하게) */
/* 본문 링크 — 밑줄 없음(2026-10-06 지시). accent 색만으로 링크임을 알린다.
   ⚠ `text-decoration` 선언 자체를 지우면 안 된다 — 브라우저 기본값이 underline 이라
     빼는 순간 밑줄이 되살아난다. `none` 을 명시해야 없어진다. */
.page-content-body a { color: var(--accent); text-decoration: none; }
.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; }
/* 구분선 — 기본 3D 선 대신 얇고 밝은 회색 라인 */
.page-content-body hr { border: 0; border-top: 1px solid rgba(15, 23, 42, 0.06); margin: 1rem 0; }
.page-content-body :first-child { margin-top: 0; }
.page-content-body :last-child { margin-bottom: 0; }
@media (max-width: 767.98px) {
    .page-content { width: auto; margin: 1rem; padding: 1.25rem; }
}

/* ===== 태블릿·좁은 창 (≤1023.98px): 사이드바를 드로어로 — 본문이 너무 좁아지지 않게 ===== */
@media (max-width: 1023.98px) {
    /* 사이드바 슬롯이 자리를 차지하지 않게 → 본문 전체 폭 */
    .sidebar-slot { width: 0; }

    /* 사이드바를 화면 밖 드로어로 전환 (햄버거로 열기) */
    .sidebar {
        position: fixed;
        width: var(--sidebar-expanded);
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        z-index: 1050;
        background: #fff;   /* 드로어는 불투명 — 뒤 화면 비침 방지(데스크톱은 90% 반투명 유지) */
    }

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

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

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

    /* 토바 간격/패딩 축소 + 보조 아이콘(테마·언어) 숨겨 공간 확보 */
    .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; }

    /* (스포츠중계 .sb / 스포츠정보 .si 모바일 규칙은 broadcast.css / info.css로 이동 — 기본 규칙 뒤에 와야 캐스케이드 정상) */

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

/* 홈 화면 토너먼트 미니 카드(제목/일정/게임사) — 좌측 오렌지 액센트 */
.tn-mini {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border-left: 0.1875rem solid #1a2a80;
    text-decoration: none;
}
.tn-mini:hover { border-color: var(--border-default); border-left-color: #1a2a80; box-shadow: var(--shadow-sm); }
.tn-mini-head {
    display: flex;
    flex-direction: column;          /* 게임사(상단) → 제목 순으로 세로 배치 */
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 0;
}
.tn-mini-logo {
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.tn-mini-title {
    margin: 0;
    max-width: 100%;
    color: var(--text-primary);
    font-size: 0.9286rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;             /* 길면 한 줄 말줄임(...) */
    overflow: hidden;
    text-overflow: ellipsis;
}
.tn-mini-date {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.tn-mini-date .bi { color: #1a2a80; font-size: 0.9rem; }

/* 토너먼트 미니 카드: PC는 card-grid-3(3열) 유지, 모바일만 1열(긴 제목 줄바꿈 여유). 일반 card-grid-3 모바일 2열 규칙을 소스순서로 오버라이드 */
@media (max-width: 767.98px) {
    .tn-mini-grid { grid-template-columns: 1fr; }
}

/* ===== 공통 버튼 .btn — 픽스터 버튼을 표준으로 전역 통일(shimmer 스윕 + 그림자 리프트) =====
   변형: .btn-primary(채움) · .btn-ghost(아웃라인) · .btn-danger(레드) · .btn-secondary(서피스) · .btn-sm(소형) · .btn-block(가로꽉)
   disabled/.is-disabled는 hover·스윕 비활성. 레이아웃(폭/정렬)은 각 컨테이너(.acc-actions·.gua-card 등)가 담당. */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    height: 2.625rem; padding: 0 1.5rem; border-radius: var(--radius-md);
    font-size: var(--text-sm); font-weight: 700; line-height: 1.2; letter-spacing: 0.02em;
    text-decoration: none; cursor: pointer; border: 1px solid transparent;
    white-space: nowrap; flex-shrink: 0;
    position: relative; overflow: hidden;
    transition: box-shadow .18s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
/* 호버 shimmer 스윕 */
.btn::after {
    content: ''; position: absolute; top: 0; left: -80%;
    width: 55%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
    transition: left .45s ease; pointer-events: none;
}
.btn:not(:disabled):not(.is-disabled):hover::after { left: 130%; }
.btn:disabled, .btn.is-disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

/* primary 버튼 색 = 시안 파랑(#2563EB). 토큰은 :root --btn-primary/-hover. (링크·사이드바 등 --accent 인디고와 분리) */
.btn-primary { background: var(--btn-primary); border-color: var(--btn-primary); color: #fff; box-shadow: 0 0.125rem 0.5rem rgba(37, 99, 235, .26); }
.btn-primary:not(:disabled):not(.is-disabled):hover { background: var(--btn-primary-hover); border-color: var(--btn-primary-hover); box-shadow: 0 0.25rem 1rem rgba(37, 99, 235, .36); color: #fff; }
.btn-primary:active { box-shadow: 0 0.0625rem 0.375rem rgba(37, 99, 235, .22); }

.btn-ghost { background: transparent; border-color: var(--border-default); color: var(--text-secondary); }
.btn-ghost:not(:disabled):not(.is-disabled):hover { background: var(--cat-hover); border-color: var(--accent); color: var(--cat-deep); }

.btn-secondary { background: var(--bg-surface); border-color: var(--border-default); color: var(--text-primary); }
.btn-secondary:not(:disabled):not(.is-disabled):hover { background: var(--cat-hover); border-color: var(--accent); color: var(--cat-deep); }

.btn-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 55%, #b91c1c 100%); border-color: transparent; color: #fff; box-shadow: 0 0.125rem 0.5rem rgba(220,38,38,.3); }
.btn-danger:not(:disabled):not(.is-disabled):hover { background: linear-gradient(135deg, #f15a5a 0%, #ef4444 55%, #dc2626 100%); box-shadow: 0 0.25rem 1rem rgba(220,38,38,.42); color: #fff; }

.btn-sm { height: 2.1rem; padding: 0 1.1rem; font-size: 0.86rem; }
.btn-block { width: 100%; }

/* ===== 공통 유틸리티 (전 섹션 공통 규칙 — WEB.md '공통 적용사항' 참조) ===== */
/* 1줄 말줄임 — 카드 제목·경기명·유저명 등 */
/* ===== 공통 페이지 타이틀 (_PageTitle.cshtml — 대표 H2, 결장정보 타이틀과 동일 룩) ===== */
.page-title-box { display: flex; flex-direction: column; gap: 0.286rem; /* 4px */ margin: 0 0 0.857rem; /* 12px 하단 여백 */ }
.page-title-label {
    font-size: 0.893rem;         /* 12.5px */
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #98A0AE;
}
/* 제목 + (선택)보조 설명 한 줄 */
.page-title-main { display: flex; align-items: center; gap: 0.571rem; flex-wrap: wrap; }
.page-title {
    display: flex;
    align-items: center;
    gap: 0.571rem;               /* 8px */
    margin: 0;
    font-size: 1.375rem;         /* 22px (루트 16px 기준) */
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #1F2430;
}
/* 제목 옆 보조 설명(예: "경기 라인업 · 프리뷰") */
.page-title-sub { font-size: 0.929rem; font-weight: 700; color: #98A0AE; }
.page-title-bar {
    display: inline-block;
    flex: none;
    width: 0.286rem;             /* 4px */
    height: 1.429rem;            /* 20px */
    border-radius: 999px;
    background: #1A56DB;
}
@media (max-width: 767.98px) { .page-title { font-size: 1.25rem; } }   /* 20px */

.u-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 2줄 말줄임 — 뉴스 제목/본문 등 */
.u-ellipsis-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}
/* 빈 상태 — "정보 없음" + 레이아웃 높이 유지(영역이 접히지 않게 최소 높이) */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 8rem;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    text-align: center;
}

/* ===== 로딩 스켈레톤 (shimmer placeholder) =====
   사용법: 자리에 들어갈 요소에 .skeleton(+크기). 편의 크기 .skeleton-line / .skeleton-block.
   실제 콘텐츠가 오면 스켈레톤 노드를 제거(또는 .is-loading 토글)한다. */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--bg-surface-2, #eef0f2);
    border-radius: var(--radius-sm);
}
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    animation: skeletonShimmer 1.3s ease-in-out infinite;
}
@keyframes skeletonShimmer { 100% { transform: translateX(100%); } }
.skeleton-line { height: 0.85em; margin: 0.45em 0; border-radius: 0.25rem; }
.skeleton-line.is-title { height: 1.1em; width: 70%; }
.skeleton-line.is-short { width: 50%; }
.skeleton-block { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-md); }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }

/* ===== 에러 상태 (불러오기 실패 — 안내 + 재시도). 빈 상태(.empty-state, 정상 0건)와 구분 =====
   마크업 예: <div class="error-state"><i class="bi bi-exclamation-triangle error-state-icon"></i>
              <p class="error-state-msg">정보를 불러오지 못했습니다.</p>
              <a class="btn btn-ghost btn-sm" href="...">다시 시도</a></div> */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-height: 8rem;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}
.error-state-icon { font-size: 1.75rem; line-height: 1; color: var(--danger, #dc2626); }
.error-state-msg { margin: 0; color: var(--text-primary); }

/* ===== 메인 팝업 (고정 레이어, 가로 나열) ===== */
.popup-layer {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 100vh;                 /* 폴백 */
    height: 100dvh;                /* 모바일 주소창/시스템 내비 변화 대응(가시영역 기준) */
    z-index: 1500;                 /* 로딩 오버레이(2000) 아래 */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;       /* 가로 중앙 */
    align-items: center;           /* 세로 중앙 */
    align-content: center;         /* 여러 줄일 때도 중앙 */
    gap: 1rem;
    padding: 1rem;
    pointer-events: none;          /* 박스 사이 빈 공간은 페이지 클릭 통과 */
}
.popup-box {
    pointer-events: auto;          /* 박스는 클릭 가능 */
    width: 20rem;
    max-width: 90vw;
    background: #fff;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: 0 0.5rem 1.75rem rgba(15, 23, 42, 0.25);
    overflow: hidden;
    animation: popupIn 0.25s ease both;
}
@keyframes popupIn { from { opacity: 0; transform: translateY(-0.5rem); } to { opacity: 1; transform: none; } }
.popup-img { display: block; line-height: 0; }
.popup-img a { display: block; }
.popup-img img { display: block; width: 100%; height: auto; }
.popup-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #1b1f24;
}
.popup-bar button {
    background: none;
    border: 0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: #cfd4db;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.popup-bar .popup-hide:hover, .popup-bar .popup-close:hover { color: #fff; background: rgba(255, 255, 255, 0.15); text-decoration: none; }
.popup-bar .popup-close { font-weight: 600; }

@media (max-width: 767.98px) {
    /* 모바일은 한 번에 1개만 표시(home.js) → 가운데 정렬. wrap은 꺼서 가로 펼침/스크롤 차단. */
    .popup-layer {
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: center;
        gap: 0.75rem;
        padding: 0.75rem;
        /* 하단은 시스템 내비(삼선·홈·백)/주소창 영역만큼 추가 여백 → 닫기 버튼이 가려지지 않게 */
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: auto;
    }
    /* 박스는 세로 flex — 이미지 높이를 제한하고 버튼 바를 항상 화면 안에 둔다.
       (이미지가 화면 전체 높이를 먹으면 그 아래 닫기 바가 화면 밖으로 밀려 사라짐) */
    .popup-box { width: 100%; max-width: 26rem; display: flex; flex-direction: column; }
    .popup-img { flex: 0 1 auto; min-height: 0; overflow: hidden; }
    .popup-img img { width: 100%; max-height: 70dvh; object-fit: contain; }
    .popup-bar { flex: 0 0 auto; }
}

/* ===== 공통 SweetAlert2 알림/확인 디자인 (common.js showAlert/showConfirm) =====
   네이비 헤더 바(제목) + 흰 본문 + 풀폭 라운드 버튼 + 헤더 우측 X. (기존 .site-confirm 모달 대체) */
/* 팝업 — 폭/기본폰트 축소(기본 32em·1.125rem은 너무 큼) */
.swal2-popup.showAlert-popup { width: 20rem !important; max-width: calc(100vw - 2rem); font-size: 0.875rem !important; border-radius: 10px; padding: 0 !important; overflow: hidden; }
.showAlert-popup.swal2-popup { grid-template-columns: 1fr; row-gap: 0 !important; gap: 0 !important; }
/* 헤더(제목 바) — 네이비. 기본 아이콘은 표시 안 함(common.js에서 icon 미지정) */
.showAlert-popup .swal2-header { position: relative; padding: 0 !important; margin: 0 !important; background: #35499C; display: block; }
.showAlert-popup .swal2-icon { display: none !important; }
.showAlert-title { background: #35499C; color: #fff; margin: 0 !important; padding: 0.7em 1em !important; font-size: 1rem; font-weight: 600; width: 100%; box-sizing: border-box; text-align: center; }
/* 본문 */
/* ⚠ `white-space: pre-line` 은 장식이 아니다 — 제재 안내 문구가 `\n` 으로 사유 줄을 나눈다
     (`SanctionService.BuildMessage`). 빼면 "이용이 제한된 계정입니다. (…) 사유: …" 가 한 줄로 붙는다.
     인라인 문구 시절 `.acc-msg` 가 같은 선언을 갖고 있었고, 모달로 옮기며 그 역할을 여기로 넘겼다. */
.showAlert-html { font-size: 0.95rem; line-height: 1.5; margin: 0 !important; padding: 1.6em 1.4em 0.2em !important; color: #333; text-align: center; white-space: pre-line; }
/* 액션(버튼) 영역 */
.showAlert-actions { width: 100%; padding: 0.8em 1.1em 1.1em !important; margin: 0 !important; box-sizing: border-box; gap: 0.5em; }
/* 버튼 — 풀폭 라운드(확인=인디고, 취소=흰색 보더) */
.showAlert-confirm, .showAlert-cancel { flex: 1 1 0; font-size: 0.9rem; font-weight: 600; padding: 0.7em 1em !important; border-radius: 10px !important; margin: 0 !important; box-shadow: none !important; }
.showAlert-confirm { background: #4D6BE2 !important; color: #fff !important; }
.showAlert-confirm:hover { background: #3f5bcc !important; }
.showAlert-cancel { background: #fff !important; color: #333 !important; border: 1px solid #d7dbe6 !important; }
.showAlert-cancel:hover { background: #f3f5fa !important; }
/* X 닫기 — 헤더 우측 중앙, 흰색 */
.showAlert-close { position: absolute !important; top: 1.25rem !important; right: 0.5rem !important; width: 1.5em !important; height: 1.5em !important; font-size: 1.4rem !important; line-height: 1 !important; transform: translateY(-50%) !important; color: #fff !important; box-shadow: none !important; z-index: 2; }
.showAlert-close:hover { color: #e0e0e0 !important; }

/* ===== 공통 토스트 알림 (common.js showToast — 우상단 스택) ===== */
.noti-toast-stack {
    position: fixed;
    top: 4.5rem;            /* 상단 topbar 아래 */
    right: 1rem;
    z-index: 1980;          /* 페이지 위, 로딩 오버레이(2000) 아래 */
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: 20rem;
    max-width: calc(100vw - 2rem);
    pointer-events: none;   /* 스택 여백은 클릭 통과, 카드만 클릭 수신 */
}
.noti-toast {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.875rem 2rem 0.875rem 0.875rem;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1.5rem rgba(17, 24, 39, 0.12);
    opacity: 0;
    transform: translateX(1rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.noti-toast.is-in { opacity: 1; transform: translateX(0); }
.noti-toast.is-leaving { opacity: 0; transform: translateX(1rem); }
.noti-toast-ico {
    flex: 0 0 auto;
    width: 2rem; height: 2rem;
    border-radius: 50%;
    background: #F26522;    /* 주황 벨 (시안) */
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
}
.noti-toast-body { flex: 1 1 auto; min-width: 0; }
.noti-toast-title {
    font-size: 0.9rem; font-weight: 700; color: #1f2937; margin-bottom: 0.15rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.noti-toast-desc { font-size: 0.8rem; color: #6b7280; line-height: 1.4; word-break: break-word; }
.noti-toast-time { margin-top: 0.35rem; font-size: 0.72rem; color: #9ca3af; text-align: right; }
.noti-toast-close {
    position: absolute; top: 0.5rem; right: 0.5rem;
    border: 0; background: transparent; cursor: pointer;
    font-size: 1.1rem; line-height: 1; color: #9ca3af; padding: 0.15rem;
}
.noti-toast-close:hover { color: #4b5563; }
.noti-toast.is-clickable .noti-toast-body { cursor: pointer; }

/* 정책상 필수 안내(게시물 조치·계정 조치) — 붉은색 기반 (2026-09-17 지시).
   ⚠ DB `notify_type.toast_tone='ALERT'` 이 이 변형을 고른다 — CSS 에 종류를 박지 않는다.
   ⚠⚠ **색만으로 구분하지 않는다** — `common.js` 가 아이콘도 벨→경고표시로 바꾼다(정책 9절 접근성).
   ⚠ 카드 바탕은 흰색을 유지한다 — 전체를 빨갛게 칠하면 본문 대비가 떨어지고, 같은 자리에 쌓이는
     일반 알림과 높이·여백이 달라 보인다. 강조는 **좌측 띠 + 아이콘 + 제목**으로 준다.
   ⚠ `#D64545` 는 이 저장소가 이미 쓰는 오류색이다(입력 오류 문구와 같은 계열) — 새 빨강을 만들지 않는다. */
.noti-toast--alert { border-color: #F3C9C9; box-shadow: 0 0.5rem 1.5rem rgba(214, 69, 69, 0.18); }
.noti-toast--alert::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 0.25rem;
    border-radius: 0.75rem 0 0 0.75rem;   /* 카드 라운드와 좌측만 맞춘다 */
    background: #D64545;
}
.noti-toast--alert .noti-toast-ico { background: #D64545; }
.noti-toast--alert .noti-toast-title { color: #B02A2A; }
@media (max-width: 767.98px) {
    .noti-toast-stack { top: 4rem; right: 0.5rem; left: 0.5rem; width: auto; }
}
