body {
    background: #f6f7f5;
}
.table-sm td, .table-sm th {
    vertical-align: middle;
}
.lane-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fff;
}
.lane-card h6 {
    color: #2f5233;
    font-weight: bold;
}
.badge-confirmed {
    background: #2f5233;
}
@media (max-width: 576px) {
    h1, h2, h3 { font-size: 1.2rem; }
    .table { font-size: 0.85rem; }
}

/* 대회소식(news) - 스마트폰 카드형 리스트 */
.news-card {
    background: #fff;
    border: 1px solid #e3e5e0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.news-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.news-card-badges .badge {
    font-weight: 500;
    margin-right: 4px;
}
.news-card-youtube {
    font-size: 1.1rem;
    text-decoration: none;
}
.news-card-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 6px;
}
.news-card-name a {
    color: #2f5233;
    text-decoration: none;
}
.news-card-info {
    font-size: 0.82rem;
    line-height: 1.5;
}

/* 대회소식(news) 표 - 태블릿/PC에서 컬럼 균형 배치 */
#news-table {
    table-layout: fixed;
    width: 100%;
}
#news-table th, #news-table td {
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
    vertical-align: middle;
}
#news-table .col-year   { width: 8%; }
#news-table .col-cat    { width: 8%; }
#news-table .col-seq    { width: 6%; }
#news-table .col-name   { width: 22%; }
#news-table .col-place  { width: 14%; }
#news-table .col-date   { width: 10%; }
#news-table .col-apply  { width: 14%; }
#news-table .col-relay  { width: 5%; }
#news-table .col-result { width: 5%; }
#news-table .col-action { width: 8%; }

/* 개최요강 리치텍스트 에디터 (엑셀 표 붙여넣기) */
.rt-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: #f6f7f5;
    border: 1px solid #ced4da;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: 4px;
}
.rt-toolbar button {
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.78rem;
    padding: 2px 8px;
    line-height: 1.6;
}
.rt-toolbar button:hover {
    background: #e9ecef;
}
.rt-sep {
    width: 1px;
    background: #ced4da;
    margin: 2px 2px;
}
.rt-editor {
    min-height: 140px;
    max-height: 420px;
    overflow-y: auto;
    border-radius: 0 0 4px 4px;
    background: #fff;
}
.rt-editor table,
.guideline-content table {
    border-collapse: collapse;
    margin: 6px 0;
}
.rt-editor table td, .rt-editor table th,
.guideline-content table td, .guideline-content table th {
    border: 1px solid #adb5bd;
    padding: 4px 8px;
}
.guideline-content {
    line-height: 1.6;
}
.guideline-content table {
    max-width: 100%;
}

/* 대회명 관리 테이블 - 스마트폰에서 컬럼 균형 배치 */
@media (max-width: 768px) {
    #tournaments-table {
        table-layout: fixed;
        width: 100%;
    }
    #tournaments-table th,
    #tournaments-table td {
        white-space: normal;
        word-break: break-word;
        font-size: 0.78rem;
        padding: 6px 4px;
    }
    #tournaments-table .col-category,
    #tournaments-table .col-year,
    #tournaments-table .col-seq { width: 8%; }
    #tournaments-table .col-name { width: 27%; }
    #tournaments-table .col-place { width: 12%; }
    #tournaments-table .col-date,
    #tournaments-table .col-apply { width: 14%; }
    #tournaments-table .col-actions { width: 15%; }
    #tournaments-table .action-cell .btn {
        font-size: 0.72rem;
        padding: 3px 6px;
        white-space: nowrap;
    }
}

/* 궁도회원 관리 표 - 태블릿/PC에서 입력칸이 너무 좁아지지 않도록 최소 너비 지정 */
#members-table input {
    min-width: 80px;
}
#members-table td:nth-child(3) input, /* 소속정 */
#members-table td:nth-child(6) input  /* 이름 */ {
    min-width: 100px;
}

/* 궁도회원 관리 - 스마트폰 카드 안 라벨/값 정렬표 */
.member-info-table {
    width: 100%;
    border-collapse: collapse;
}
.member-info-table tr:nth-child(odd) {
    background: #f6f7f5;
}
.member-info-table th {
    width: 92px;
    text-align: left;
    vertical-align: middle;
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    padding: 5px 6px;
    white-space: nowrap;
}
.member-info-table td {
    padding: 3px 4px;
    vertical-align: middle;
}
.member-info-table td input {
    width: 100%;
    font-size: 0.9rem;
    padding: 4px 8px;
}
.member-info-table .member-info-static {
    font-size: 0.9rem;
    padding: 4px 8px;
}

/* ================================================================
   플랫폼 메인화면 (k-hwal.com 루트)
   ================================================================ */
.kh-hero {
    /* A안 '한지·화피' — 아이보리 → 연황토 (활을 감싼 벚나무 껍질·한지 톤) */
    background: linear-gradient(135deg, #fdf9f0 0%, #f6ead0 55%, #ecd6a8 100%);
    border: 2px solid #c9973a;                 /* '등록 대회' 버튼과 같은 황동색 테두리 */
    border-radius: 16px;
    color: #4a2e1e;
    padding: 48px 20px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.kh-hero::after {             /* 좌측 상단 k-hwal 로고 (한지색 원형 바탕 위) */
    content: "";
    position: absolute;
    left: -30px; top: -30px;
    width: 170px; height: 170px;
    border-radius: 50%;
    background:
        url("../img/hero-logo.png") 42% 58% / 66% auto no-repeat,
        radial-gradient(circle, rgba(255,253,247,.95) 0 58%, rgba(255,253,247,.55) 66%, rgba(255,253,247,0) 71%);
    opacity: .95;
    pointer-events: none;
}
@media (max-width: 575.98px) {
    .kh-hero::after { left: -26px; top: -26px; width: 130px; height: 130px; }
}
.kh-hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.kh-hero-badge {
    display: inline-block;
    background: rgba(142,31,31,.06);
    border: 1px solid rgba(142,31,31,.25);
    color: #4a2e1e;
    border-radius: 999px;
    padding: 4px 14px;
    font-size: .85rem;
    margin-bottom: 14px;
}
.kh-hero-title { font-size: 2.2rem; font-weight: 800; line-height: 1.3; margin-bottom: 12px; word-break: keep-all; }
.kh-hero-desc  { color: #7a5c44; font-size: .95rem; margin-bottom: 0; word-break: keep-all; }
.kh-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}
.kh-stat {
    flex: 1 1 0;
    max-width: 160px;
    background: rgba(255,255,255,.6);
    border: 1px solid #e2cc9c;
    border-radius: 12px;
    padding: 10px 6px;
}
.kh-stat-num   { font-size: 1.6rem; font-weight: 800; color: #8e1f1f; line-height: 1.1; }
.kh-stat-label { font-size: .8rem; color: #7a5c44; }

.kh-step {
    display: flex; gap: 12px; align-items: flex-start;
    background: #fff;
    border: 1px solid #e3e5e0;
    border-radius: 12px;
    padding: 14px 16px;
    height: 100%;
    word-break: keep-all;
}
.kh-step-no {
    flex: 0 0 32px; height: 32px;
    border-radius: 50%;
    background: #2f5233; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}

/* ---- 협회 블록: 협회 테마색으로 테두리 구분 ---- */
.kh-org {
    --org-color: #2f5233;
    height: 100%;
    display: flex; flex-direction: column;
    background: #fff;
    border: 3px solid var(--org-color);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .15s, box-shadow .15s;
}
.kh-org:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.kh-org-head {
    background: var(--org-color);
    color: #fff;
    padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.kh-org-name { font-size: 1.1rem; font-weight: 700; word-break: keep-all; }
.kh-org-body { padding: 14px 16px; flex: 1 1 auto; }
.kh-org-meta {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px;
    font-size: .82rem;
    padding-bottom: 8px; margin-bottom: 10px;
    border-bottom: 1px dashed #dee2e6;
}
.kh-org-meta b { color: var(--org-color); }
.kh-org-open a {
    display: block;
    font-size: .88rem;
    color: #212529;
    text-decoration: none;
    padding: 4px 0;
    word-break: keep-all;
}
.kh-org-open a:hover { text-decoration: underline; }
.kh-org-menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 2px solid var(--org-color);
}
.kh-org-menu a {
    display: flex; flex-direction: column; align-items: center;
    padding: 10px 4px;
    font-size: 1.15rem;
    text-decoration: none;
    color: #212529;
}
.kh-org-menu a + a { border-left: 1px solid #e9ecef; }
.kh-org-menu a span { font-size: .82rem; font-weight: 600; margin-top: 2px; }
.kh-org-menu a:hover { background: var(--org-color); color: #fff; }

.kh-join {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
    background: #fff;
    border: 1px dashed #adb5bd;
    border-radius: 12px;
    padding: 16px 20px;
}
.kh-footer {
    text-align: center;
    color: #868e96;
    padding: 24px 0 calc(24px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e3e5e0;
    margin-top: 24px;
}

/* ---- 이용 안내 모달 ---- */
.kh-guide-tabs .nav-link { color: #1b1f2a; font-weight: 600; }
.kh-guide-tabs .nav-link.active { background: #1b1f2a; color: #fff; }
.kh-guide-list { padding-left: 0; list-style: none; counter-reset: g; }
.kh-guide-list > li {
    counter-increment: g;
    position: relative;
    padding: 0 0 4px 44px;
    margin-bottom: 10px;
}
.kh-guide-list > li::before {
    content: counter(g);
    position: absolute; left: 0; top: 0;
    width: 30px; height: 30px; border-radius: 50%;
    background: #2f5233; color: #fff; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.kh-guide-list p { font-size: .9rem; color: #495057; margin: 4px 0 0; word-break: keep-all; }
.kh-guide-box { background: #f6f7f5; border: 1px solid #e3e5e0; border-radius: 10px; padding: 12px 14px; height: 100%; }

@media (max-width: 576px) {
    .kh-hero::after { width: 112px; height: 112px; right: -8px; top: -8px; background-size: 74% auto, auto; background-position: 46% 54%, center; }
    .kh-hero { padding: 32px 14px 20px; border-radius: 12px; }
    .kh-hero-title { font-size: 1.6rem; }
    .kh-stat-num { font-size: 1.3rem; }
}
@media (max-width: 576px) {
    .kh-guide-tabs .nav-link { font-size: .8rem; padding: 6px 4px; white-space: nowrap; }
}

/* ================================================================
   대회소식 공통 탭 (_news_tabs.html)
   ================================================================ */
.nt-box {
    background: #fff;
    border: 1.5px solid #9aa596;   /* 테두리 선명하게 (기존 1px #e3e5e0) */
    border-radius: 12px;
    padding: 12px;
}
.nt-head { display: flex; align-items: flex-start; gap: 8px; }
.nt-cur { margin-top: 12px; padding-top: 10px; border-top: 1.5px solid #c3cbc0; }   /* 점선 → 실선 */
.nt-cur .nt-info { margin-bottom: 8px; }
.nt-pickrow { display: flex; align-items: center; gap: 8px; }
.nt-pick-label { flex: 0 0 auto; font-size: .82rem; font-weight: 700; color: #2f5233; margin: 0; }
.nt-pickrow .form-select { flex: 1 1 auto; min-width: 0; }
.nt-name { flex: 1 1 auto; font-size: 1.05rem; font-weight: 700; color: #2f5233; line-height: 1.4; word-break: keep-all; }
.nt-name .badge { font-size: .7rem; vertical-align: 2px; }
.nt-change {
    flex: 0 0 auto; font-size: .8rem; text-decoration: none; white-space: nowrap;
    border: 1px solid #ced4da; border-radius: 6px; padding: 2px 8px; color: #495057;
}
.nt-hint {
    margin-top: 10px; padding: 8px 10px;
    background: #fff8e1; border-radius: 8px;
    font-size: .82rem; color: #6b5300; word-break: keep-all;
}
/* 대회목록 (_news_list.html) */
.nl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px; margin-bottom: 10px; scroll-margin-top: 10px; }
.nl-card { position: relative; cursor: pointer; }
.nl-card .nl-over { position: relative; z-index: 2; }
.nl-card.selected { border: 2px solid #198754; background: #f1faf4; }
.nl-row { cursor: pointer; }
.nl-row.selected > td { background: #e3f4e8 !important; }
.nt-info {
    display: flex; flex-wrap: wrap; gap: 4px 14px;
    font-size: .82rem; color: #555;
    margin: 8px 2px 10px;
}
.nt-info a { text-decoration: none; }
.nt-tabs {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}
.nt-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 8px 2px;
    border: 1.5px solid #9aa596;   /* 테두리 선명하게 (기존 1px #d9ddd5) */
    border-radius: 10px;
    background: #f8f9f7;
    color: #333;
    text-decoration: none;
    font-size: .82rem; font-weight: 600;
    text-align: center; word-break: keep-all; line-height: 1.25;
}
.nt-tab i { font-style: normal; font-size: 1.15rem; line-height: 1.2; margin-bottom: 2px; }
.nt-tab:hover { border-color: #2f5233; color: #2f5233; background: #eef4ee; }
.nt-tab.active { background: #2f5233; border-color: #2f5233; color: #fff; }
.nt-tab.hot:not(.active) { border-color: #198754; box-shadow: inset 0 0 0 1px #198754; color: #198754; }
.nt-tab.disabled { opacity: .4; pointer-events: none; }
.nt-sched {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    margin-top: 10px; padding-top: 10px;
    border-top: 1px dashed #dee2e6;
}
.nt-title { margin: 4px 0 12px; font-weight: 700; }
@media (max-width: 767.98px) {
    .nt-tabs { grid-template-columns: repeat(4, 1fr); }
    .nt-tab { font-size: .78rem; padding: 7px 2px; }
}

/* 대회목록 탭: 선택된 '대회목록' 외 나머지 탭은 테두리 없이 */
.nt-tabs.list-mode .nt-tab:not(.active) { border-color: transparent; box-shadow: none; background: #f8f9f7; color: #333; }
/* 대회목록 (간단 목록) */
/* 대회마다 테두리 박스로 구별 */
.nl-simple { display: flex; flex-direction: column; gap: 8px; }
.nl-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    color: #212529; text-decoration: none;
    background: #fff;
    border: 1.5px solid #9aa596; border-radius: 10px;
}
.nl-item:hover { border-color: #2f5233; }
.nl-item:hover { background: #f3f8f4; }
.nl-main { flex: 1 1 auto; min-width: 0; }
.nl-name { font-weight: 700; line-height: 1.4; word-break: keep-all; }
.nl-meta { font-size: .8rem; color: #6c757d; margin-top: 2px; }
.nl-side { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.nl-arrow { font-size: 1.4rem; color: #adb5bd; line-height: 1; }

/* 상단 '나가기' 버튼 */
.kh-exit-btn { white-space: nowrap; font-size: .8rem; padding: 2px 10px; }
/* 단체 관리자 탭: 모바일에서 글자가 세로로 쪼개지지 않게 가로 스크롤 */
.admin-tabs { overflow-y: hidden; }
.admin-tabs .nav-link { white-space: nowrap; }
@media (max-width: 991.98px) {
    /* 협회명이 길어도 [나가기][메뉴] 버튼과 한 줄에 놓이도록 */
    .navbar > .container-fluid > .navbar-brand {
        flex: 1 1 0; min-width: 0; margin-right: 6px;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        font-size: 1.05rem;
    }
    .navbar > .container-fluid > .ms-auto { margin-left: 0 !important; }
}

/* 플랫폼 상단 메뉴바 좌측 K 로고 */
.kh-nav-logo { width: 30px; height: 30px; margin-right: 8px; flex: 0 0 auto; }
/* 플랫폼 하단 푸터 K 로고 */
.kh-foot-logo { width: 22px; height: 22px; margin-right: 6px; flex: 0 0 auto; }
/* 작대표·시수표: "N번 작대" 제목 강조 (녹색 테두리 + 연녹색 바탕) */
.lane-no-title {
    display: inline-block;
    border: 2px solid #2f5233;
    background: #e6f0e6;
    color: #2f5233;
    border-radius: 8px;
    padding: 3px 12px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .5px;
    margin: 2px 0 6px;
}

/* 메인 '이용 안내' 버튼 — 작고 엷은 회색 */
.kh-guide-btn {
    background: #eceeef;
    border: 1.5px solid #9aa1a6;
    color: #444;
    border-radius: 999px;
    padding: 5px 18px;
    font-size: .95rem;
}
.kh-guide-btn:hover, .kh-guide-btn:focus { background: #e1e4e6; color: #222; border-color: #6c757d; }

/* 협회 페이지 하단 고정 탭 (base.html) — 전체 협회 보기 · 단체 관리자 · 나가기 */
body.has-tabbar { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
.kh-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    display: flex;
    background: #fff;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 8px rgba(0,0,0,.06);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.kh-tab {
    flex: 1 1 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 60px;
    background: none; border: 0;
    color: #555; text-decoration: none;
    font-size: .78rem; font-weight: 600;
}
.kh-tab i { font-style: normal; font-size: 1.15rem; line-height: 1.2; }
.kh-tab:hover, .kh-tab:focus { color: #2f5233; background: #f4f6f4; }
.kh-tab.active { color: #2f5233; }
.kh-tab + .kh-tab { border-left: 1px solid #f0f0f0; }
/* 앱 설치 배너가 하단 탭을 가리지 않도록 위로 */
body.has-tabbar .kh-ib { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
