/**
 * 시안(styles.css)에 없는 실서비스 전용 컴포넌트만 추가한다.
 * styles.css 원본은 수정하지 않는다 — 시안 갱신 시 그대로 덮어쓸 수 있게 하기 위함.
 */

/* ===== 플래시 메시지 ===== */
.flash-wrap { display: flex; flex-direction: column; gap: 10px; margin: 20px auto 0; padding: 0 24px; max-width: 1200px; }
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14.5px; line-height: 1.6;
  border: 1px solid transparent;
}
.flash strong { font-weight: 700; }
.flash--success { background: #e7f6ee; border-color: #b7e3ca; color: #12603f; }
.flash--error   { background: #fdeceb; border-color: #f5c4c0; color: #97231c; }
.flash--warning { background: #fdf4e0; border-color: #f2dca6; color: #7a5510; }

/* ===== 로그인: 좌측 소개 영역을 뺀 1단 레이아웃 ===== */
.auth-layout--single { grid-template-columns: 1fr; }

/* ===== 목록 액션 영역 ===== */
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ===== 승인 대기 강조 ===== */
.badge--pending { background: #fdf4e0; color: #7a5510; }

/* ===== 데이터 없음 ===== */
.empty-state.is-compact { padding: 40px 20px; }

/* ===== 관리자 진입 링크 (헤더) ===== */
.header-actions .button--admin { background: #04263e; border-color: #04263e; color: #fff; }
.header-actions .button--admin:hover { background: #0b3d63; border-color: #0b3d63; }

@media (max-width: 880px) {
  .flash-wrap { padding: 0 16px; }
}

/* ===== 간편(소셜) 로그인 — 3사 공식 브랜드 버튼 (2026-08-24) =====
   심볼은 좌측 고정, 문구는 버튼 기준 가운데 정렬(각 사 공식 버튼과 동일한 배치). */
.social-btn {
  position: relative;
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding-inline: 52px;              /* 좌측 심볼·우측 배지 자리 확보 */
  font-size: 15px; font-weight: 700; letter-spacing: -.02em;
}
.social-btn-icon {
  position: absolute; left: 16px;
  display: flex; align-items: center; justify-content: center;
  width: 19px; height: 19px;
}
.social-btn-icon svg { display: block; }
.social-btn-label { min-width: 0; }

/* 카카오 — 배경 #FEE500, 심볼·문구 검정 85% */
.button--kakao { color: rgba(0, 0, 0, .85); border-color: #FEE500; background: #FEE500; }
.button--kakao:hover { color: rgba(0, 0, 0, .85); border-color: #f2d900; background: #f2d900; }

/* 네이버 — 배경 #03C75A, 심볼·문구 흰색 */
.button--naver { color: #fff; border-color: #03C75A; background: #03C75A; }
.button--naver:hover { color: #fff; border-color: #02b151; background: #02b151; }

/* 구글 — 흰 배경 + #dadce0 테두리, 문구 #3c4043 */
.button--google { width: 100%; color: #3c4043; border-color: #dadce0; background: #fff; }
.button--google:hover { color: #3c4043; background: #f7f8f8; border-color: #c9ccd1; }

/* 키 미등록 채널: 준비중 — 클릭 불가 */
.social-btn.is-pending { opacity: .48; cursor: not-allowed; pointer-events: none; }
.social-btn-badge {
  position: absolute; right: 14px;
  padding: 2px 8px; border-radius: 999px;
  background: rgb(0 0 0 / 14%); color: inherit;
  font-size: 11px; font-weight: 700; letter-spacing: 0;
}
.button--naver .social-btn-badge { background: rgb(255 255 255 / 26%); }

.social-buttons .button:disabled { opacity: .55; cursor: not-allowed; }

@media (max-width: 480px) {
  .social-btn { padding-inline: 46px; font-size: 14px; }
}

/* 연결된 소셜 계정 요약 카드 (가입 마무리 / 계정 연결 화면) */
.social-account-card {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0 4px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: #fbfcfd;
}
.social-account-card strong { display: block; color: var(--ink); font-size: 15px; }
.social-account-mail { color: var(--muted); font-size: 13px; word-break: break-all; }
.social-chip {
  flex: none; padding: 6px 12px; border: 1px solid transparent; border-radius: 999px;
  font-size: 12px; font-weight: 700; width: auto;
}

/* 라디오 / 체크 항목 (추가정보 동적 폼) */
.choice-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.choice-inline { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.choice-inline input { width: 16px; height: 16px; }

/* 마이페이지 - 연결된 계정 목록 */
.social-link-list { display: flex; flex-direction: column; gap: 10px; }
.social-link-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md);
}
.social-link-row .is-linked { color: #1f7a3d; font-size: 13px; }
.social-link-row .is-unlinked { color: var(--muted); font-size: 13px; }

/* ── 3단 메뉴: 소분류 서브내비 (2026-08-24) ───────────────── */
.subnav--sub { background: var(--soft, #f7f7fb); border-bottom: 1px solid var(--line); }
.subnav--sub .subnav-list { min-height: 48px; gap: 6px; }
.subnav--sub a { padding: 6px 14px; font-size: 13px; font-weight: 500; }


/* ------------------------------------------------------------------
   게시판 분류(카테고리) 탭 — 2026-08-24
   운영사이트(medinet.or.kr)의 전체/분류 탭 구성을 맞춘다.
------------------------------------------------------------------ */
.board-cates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--line, #e2e8f0);
}
.board-cate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 999px;
    background: #fff;
    color: var(--muted, #64748b);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.board-cate:hover { border-color: var(--purple, #4c6ef5); color: var(--purple, #4c6ef5); }
.board-cate.is-active {
    border-color: var(--purple, #4c6ef5);
    background: var(--purple, #4c6ef5);
    color: #fff;
}
.board-cate__num {
    font-size: 12px;
    font-weight: 700;
    opacity: .75;
}
.board-cate.is-active .board-cate__num { opacity: .9; }
.board-cate-none { color: var(--muted, #94a3b8); }
a.badge { text-decoration: none; }

@media (max-width: 720px) {
    .board-cates { gap: 6px; }
    .board-cate { padding: 7px 12px; font-size: 13px; }
}

/* ── 게시판 답글 (2026-08-25) ─────────────────────────────
   기존 사이트(KBoard)의 계층형 '답글쓰기' 를 신규 게시판에 이식하면서 추가. */

/* 목록: 답글 행 */
.data-table tr.is-reply td { background: #fbfcfe; }
.data-table tr.is-reply:hover td { background: var(--surface-soft); }
.data-table tr.is-reply a { font-weight: 500; }
.reply-indent { display: inline-block; width: calc(var(--reply-depth, 1) * 20px); }
.reply-mark { margin-right: 6px; color: var(--purple); font-weight: 700; }

/* 상세: 답글 배지 · 원글 링크 */
.badge--reply { color: #7a5510; background: #fdf4e0; }
.reply-parent { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.reply-parent a { color: var(--purple); font-weight: 600; }
.reply-parent a:hover { text-decoration: underline; }

/* 상세: 이 글에 달린 답글 목록 */
.reply-list { margin-top: 28px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fbfcfd; }
.reply-list__title { margin: 0 0 12px; color: var(--ink); font-size: 15px; font-weight: 700; }
.reply-list ul { margin: 0; padding: 0; list-style: none; }
.reply-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid #edf1f4; }
.reply-row:first-child { border-top: 0; }
.reply-row { padding-left: calc((var(--reply-depth, 1) - 1) * 20px); }
.reply-row > a { color: var(--ink); font-weight: 600; }
.reply-row > a:hover { color: var(--purple); text-decoration: underline; }
.reply-meta { color: var(--muted); font-size: 13px; }

/* 답글 작성 화면: 원글 인용 */
.reply-quote { display: grid; gap: 5px; margin: 0 0 22px; padding: 15px 18px; border-left: 3px solid var(--purple); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: #f4f8fb; }
.reply-quote__label { color: var(--purple); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.reply-quote__title { color: var(--ink); font-size: 15px; font-weight: 700; }
.reply-quote__title:hover { text-decoration: underline; }
.reply-quote__meta { color: var(--muted); font-size: 13px; }

/* ── 첨부파일 다운로드 — 마우스 오버·클릭 반응 (2026-08-25) ──── */
.attach-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: #e7f1f9; color: var(--purple); font-size: 12px; font-weight: 700; }
.attach-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.attach-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font-weight: 600;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.attach-item:hover,
.attach-item:focus-visible {
  border-color: var(--purple); background: #f4f8fb; color: var(--purple);
  box-shadow: 0 2px 10px rgb(0 103 180 / 10%);
}
.attach-item:active { background: #e9f2f9; }
.attach-icon { display: flex; flex: none; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: #eef4f9; color: var(--purple); transition: background-color .16s ease; }
.attach-item:hover .attach-icon { background: var(--purple); color: #fff; }
.attach-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-size { flex: none; color: var(--muted); font-size: 13px; font-weight: 500; }
.attach-state { display: none; flex: none; color: var(--purple); font-size: 13px; font-weight: 600; }
.attach-item.is-downloading { border-color: var(--purple); background: #f4f8fb; }
.attach-item.is-downloading .attach-size { display: none; }
.attach-item.is-downloading .attach-state { display: inline; }

/* 상세 하단 버튼 줄 — 좌우 정렬 + 여백 (2026-08-25) */
.board-toolbar--post { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); margin-bottom: 0; }
.board-toolbar--post .row-actions { gap: 8px; }

/* ghost 버튼에 hover 반응이 없어 클릭 가능해 보이지 않던 것 보완 */
.button--ghost:hover { border-color: #9eafbc; color: var(--ink); background: #f4f6f8; }

@media (max-width: 700px) {
  .attach-item { flex-wrap: wrap; }
  .attach-name { flex-basis: 100%; white-space: normal; word-break: break-all; }
  .board-toolbar--post { align-items: stretch; flex-direction: column; gap: 10px; }
  .board-toolbar--post .row-actions .button { flex: 1 1 auto; }
}

/* ── 모바일 전체메뉴 드로어 (2026-08-25) ────────────────────────
   기존 드로어는 .main-nav(대메뉴만)를 그대로 밀어 넣어서, 모바일에서는
   중분류·소분류에 도달할 방법이 없었다. 데스크톱 GNB 와 분리해
   대/중/소 3단을 아코디언으로 담는 전용 드로어를 둔다. */

.drawer-nav { display: none; }

@media (max-width: 880px) {
  /* 데스크톱 GNB 는 드로어가 대신하므로 감춘다 */
  .main-nav { display: none; }

  .drawer-nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 90;
    width: min(86vw, 340px);
    display: grid;
    align-content: start;
    gap: 2px;
    padding: 0 12px calc(24px + env(safe-area-inset-bottom));
    padding-right: calc(12px + env(safe-area-inset-right));
    background: #fff;
    box-shadow: -10px 0 34px rgb(0 0 0 / 20%);
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1), visibility .26s;
  }
  .drawer-nav.is-open { visibility: visible; transform: none; }

  .drawer-group { display: grid; }

  .drawer-root {
    min-height: 54px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; padding: 0 14px;
    border: 0; border-radius: var(--radius-sm);
    background: none; color: var(--ink);
    font-family: inherit; font-size: 16px; font-weight: 700; text-align: left;
  }
  .drawer-root:active { background: var(--surface-soft); }
  .drawer-root[aria-current="page"] { color: var(--purple); }

  .drawer-caret {
    flex: none; width: 8px; height: 8px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .2s ease;
    opacity: .55;
  }
  .drawer-group.is-open > .drawer-root .drawer-caret { transform: rotate(-135deg) translate(-2px, -2px); opacity: 1; }
  .drawer-group.is-open > .drawer-root { color: var(--purple); }

  .drawer-sub { display: none; padding: 2px 0 10px; }
  .drawer-group.is-open > .drawer-sub { display: grid; gap: 1px; }

  .drawer-item {
    min-height: 46px; display: flex; align-items: center; gap: 6px;
    padding: 0 12px 0 26px; border-radius: var(--radius-sm);
    color: var(--muted); font-size: 15px; font-weight: 500;
  }
  .drawer-item.is-deep { padding-left: 40px; font-size: 14px; }
  .drawer-item:active { background: var(--surface-soft); }
  .drawer-item.is-current { color: var(--purple); background: var(--surface-soft); font-weight: 700; }
  .drawer-ext { font-size: 11px; opacity: .6; }
}

/* ── 서브내비 가로 스크롤 힌트 (2026-08-25) ─────────────────────
   좁은 화면에서 중·소분류가 잘려도 표시가 없어 뒤쪽 항목이 없는 것처럼 보였다. */
.subnav { position: relative; }
.subnav .subnav-list { scroll-behavior: smooth; }
.subnav.is-scrollable .subnav-list { scroll-snap-type: x proximity; }
.subnav.is-scrollable .subnav-list > a { scroll-snap-align: start; }
.subnav.is-scrollable::after {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(to right, rgb(255 255 255 / 0%), var(--soft, #f7f7fb) 78%);
  content: ""; pointer-events: none;
  transition: opacity .18s ease;
}
.subnav.is-scrollable.at-end::after { opacity: 0; }
.subnav--sub.is-scrollable::after { background: linear-gradient(to right, rgb(247 247 251 / 0%), var(--soft, #f7f7fb) 78%); }

/* 가로 스크롤바는 숨기되 스크롤은 유지 */
.subnav .subnav-list { scrollbar-width: none; }
.subnav .subnav-list::-webkit-scrollbar { height: 0; }

/* 넘치는데 가운데 정렬이면 왼쪽으로 넘친 항목에 스크롤로 도달할 수 없다(flex 중앙정렬 함정).
   safe center 로 바꾸고, 구형 브라우저를 위해 넘침이 감지되면 flex-start 로도 내린다. */
/* safe center 는 넘치는 순간 알아서 start 정렬로 물러난다.
   is-scrollable 로 정렬까지 덮으면 클래스가 남았을 때 넓은 화면의 가운데 정렬이 깨진다. */
.subnav .subnav-list { justify-content: safe center; }

@media (max-width: 880px) {
  /* 중분류 바만 헤더에 붙여 고정한다 — 스크롤을 내려도 형제 메뉴로 이동할 수 있게.
     소분류(.subnav--sub)까지 고정하면 세로 공간을 너무 잠식하므로 :not() 으로 한정한다. */
  .subnav:not(.subnav--sub) { position: sticky; top: 62px; z-index: 55; }
}

/* ── 가입 완료 안내 (2026-08-25) ───────────────────────────── */
.signup-done-mark {
  width: 56px; height: 56px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 999px; background: #e7f6ee; color: #12603f;
  font-size: 26px; font-weight: 700;
}
.signup-steps { display: grid; gap: 10px; margin: 26px 0 18px; text-align: left; }
.signup-step {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: #fbfcfd;
}
.signup-step.is-current { border-color: var(--purple); background: #f4f8fb; }
.signup-step__no {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 999px; background: #e7f1f9; color: var(--purple);
  font-size: 13px; font-weight: 700;
}
.signup-step.is-current .signup-step__no { background: var(--purple); color: #fff; }
.signup-step strong { display: block; color: var(--ink); font-size: 15px; }
.signup-step p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
