/*
 * mobile.css — 모바일(폭 992px 미만) 전용 공통 스타일
 *
 * 적용 범위
 *   - 사용자용 바탕 템플릿(menus/base1~3, pabo_base1~3, sudan_base1~3,
 *     sudan_jokbo_update_base1, family_tree_base)의 <body class="m-app"> 아래에서만 동작한다.
 *   - 관리자용 바탕 템플릿에는 연결하지 않는다. 관리자 화면과 함께 쓰는 템플릿
 *     (sudan_update_* 등)도 관리자 바탕에서 열리면 이 스타일의 영향을 받지 않는다.
 *   - PC(992px 이상) 화면은 건드리지 않는다.
 *
 * 기준 (docs: 모바일 개선안 "공통 기준")
 *   - 입력칸 글자 16px 이상(아이폰 자동 확대 방지) · 높이 48px
 *   - 버튼·쪽 번호 최소 48px
 *   - 본문 17px, 보조 설명 15px 이상
 */

@media screen and (max-width: 991.98px) {

  /* ---------------------------------------------------------------- 1. 본문 */
  .m-app {
    font-size: 1.0625rem;              /* 17px */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .m-app small,
  .m-app .small,
  .m-app .form-text,
  .m-app .form-label,
  .m-app .form-check-label,
  .m-app .text-cap,
  .m-app .list-sm,
  .m-app .link-sm,
  .m-app .fs-6,
  .m-app .card-subtitle,
  .m-app .check-error,
  .m-app .hcgp-option-label,
  .m-app [class*="jb-font-size-0"] {
    font-size: 0.9375rem;              /* 15px */
  }

  /* 한글이 글자 단위로 꺾이지 않도록 단어 단위로 줄바꿈 */
  .m-app p,
  .m-app li,
  .m-app label,
  .m-app th,
  .m-app td,
  .m-app h1, .m-app h2, .m-app h3, .m-app h4, .m-app h5, .m-app h6 {
    word-break: keep-all;
    overflow-wrap: anywhere;           /* break-word 로 두면 열이 많은 표 때문에 화면이 다시 넓어진다(실측) */
  }

  /* ------------------------------------------------------------ 2. 입력칸 */
  .m-app .form-control,
  .m-app .form-select,
  .m-app .input-group-text,
  .m-app input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="range"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="image"]),
  .m-app select,
  .m-app textarea {
    font-size: 1rem !important;        /* 16px: 아이폰은 16px 미만 입력칸을 누르면 화면을 확대한다 */
    min-height: 3rem;                  /* 48px */
  }

  .m-app input[type="file"].form-control {
    font-size: 1rem !important;
    min-height: 3rem;
    line-height: 2;
  }

  /* tom-select (검색형 선택 상자) */
  .m-app .ts-control,
  .m-app .ts-control input,
  .m-app .ts-dropdown {
    font-size: 1rem !important;
  }
  .m-app .ts-control {
    min-height: 3rem;
  }
  .m-app .ts-dropdown .option {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  /* 체크박스·라디오: 네모는 22px, 라벨까지 합쳐 44px 이상의 누르는 영역 */
  .m-app .form-check:not(.form-switch) > .form-check-input,
  .m-app td > .form-check-input,
  .m-app th > .form-check-input {
    width: 1.375rem;
    height: 1.375rem;
  }
  .m-app .form-check:not(.form-switch) {
    padding-left: 2rem;
    min-height: 2.75rem;
  }
  .m-app .form-check:not(.form-switch) > .form-check-input {
    margin-left: -2rem;
    margin-top: 0.6875rem;             /* (44 - 22) / 2 */
  }
  .m-app .form-check > .form-check-label {
    display: inline-block;             /* inline-flex 로 두면 라벨 안의 글자·span 이 세로 칸으로 쪼개진다 */
    min-height: 2.75rem;
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
  }
  .m-app .form-check-inline {
    margin-right: 1.25rem;
  }

  /* ------------------------------------------------------- 3. 버튼·쪽 번호 */
  /* display 는 바꾸지 않는다(숨김·접힘 상태를 깨뜨리지 않기 위해). 높이는 위아래 여백으로 맞춘다. */
  .m-app .btn:not(.btn-icon):not(.btn-close):not(.navbar-toggler) {
    min-height: 3rem;
    min-width: 3rem;
    line-height: 1.5;
    padding-top: calc((3rem - 1.5em - 2px) / 2);
    padding-bottom: calc((3rem - 1.5em - 2px) / 2);
  }
  .m-app .btn-xs:not(.btn-icon),
  .m-app .btn-sm:not(.btn-icon) {
    font-size: 0.9375rem;
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
  .m-app table td a.btn.btn-xs.btn-primary:not(.btn-icon):not(.btn-close):not(.navbar-toggler),
  .m-app table.m-story-list td a.btn.btn-xs.btn-warning:not(.btn-icon):not(.btn-close):not(.navbar-toggler),
  .m-app table.m-album-list td:last-child a.btn.btn-xs.btn-warning:not(.btn-icon):not(.btn-close):not(.navbar-toggler),
  .m-app table.m-lineage td a.btn.btn-xs.btn-info:not(.btn-icon):not(.btn-close):not(.navbar-toggler) {
    min-height: 0;
    min-width: 0;
    padding: 0.2rem 0.35rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
  .m-app .btn-icon {
    width: 3rem;
    height: 3rem;
    font-size: 1.125rem;
  }
  .m-app .btn-close {
    box-sizing: border-box;
    width: 3rem;
    height: 3rem;
    padding: 0;
    background-size: 1rem;
  }
  .m-app .navbar-toggler {
    min-width: 3rem;
    min-height: 3rem;
  }

  /* 나란히 놓인 버튼끼리 잘못 누르지 않도록 간격 */
  .m-app .btn + .btn,
  .m-app a.btn + a.btn {
    margin-left: 0.5rem;
  }
  .m-app .btn-group > .btn + .btn,
  .m-app .input-group > .btn + .btn,
  .m-app .d-grid > .btn + .btn,
  .m-app .d-flex.flex-column > .btn + .btn {
    margin-left: 0;
  }

  .m-app .page-link {
    min-width: 2.25rem;
    min-height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
  }
  .m-app .pagination {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .m-app .dropdown-menu .dropdown-item {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 1rem;
  }

  /* ---------------------------------------------------------------- 4. 표 */
  /* 줄바꿈 금지를 풀어 화면이 통째로 넓어지는 것을 줄인다(카드형 전환은 화면별 작업에서). */
  .m-app .table-nowrap th,
  .m-app .table-nowrap td,
  .m-app table .text-nowrap {
    white-space: normal !important;
  }
  .m-app .table > :not(caption) > * > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .m-app .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  /* ------------------------------------------------------------ 5. 그림 등 */
  .m-app img,
  .m-app svg,
  .m-app video,
  .m-app canvas,
  .m-app iframe {
    max-width: 100%;
  }
  .m-app img[height]:not([class*="avatar"]) {
    height: auto;
  }
  .m-app pre {
    white-space: pre-wrap;
    word-break: break-word;
  }

  /* --------------------------------------------------------------- 6. 팝업 */
  .m-app .modal {
    --bs-modal-margin: 0.5rem;         /* margin 을 직접 주면 태블릿에서 가운데 정렬(auto)이 풀린다 */
  }
  .m-app .modal-footer .btn {
    flex: 1 1 auto;
  }
}

/* ==================================================================== 7. 하단 탭
 * templates/menus/41_mobile_tabs.html
 * PC(992px 이상)와 인쇄에서는 보이지 않는다.
 */
.m-tabs {
  display: none;
}

@media screen and (max-width: 991.98px) {
  .m-app .m-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;                     /* 팝업(1050 이상)보다는 아래 */
    display: flex;
    background: #fff;
    border-top: 1px solid rgba(33, 50, 91, 0.12);
    box-shadow: 0 -2px 12px rgba(33, 50, 91, 0.06);
    padding-bottom: env(safe-area-inset-bottom, 0px);   /* 아이폰 홈 막대 영역 */
  }
  .m-app .m-tab {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    min-height: 3.5rem;                /* 56px */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    padding: 0.375rem 0.125rem;
    color: #677788;
    font-size: 0.875rem;               /* 14px */
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }
  .m-app .m-tab > i {
    font-size: 1.375rem;
    line-height: 1;
  }
  .m-app .m-tab.is-active {
    color: #377dff;
  }
  .m-app .m-tab:active {
    background: rgba(55, 125, 255, 0.08);
  }
  .m-app .m-tab-badge {
    position: absolute;
    top: 0.25rem;
    left: 50%;
    margin-left: 0.5rem;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.3125rem;
    border-radius: 0.5625rem;
    background: #ed4c78;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.125rem;
    text-align: center;
  }

  /* 모바일 탭 이동 상단 로딩 진행 바 */
  .m-tabs-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: #377dff;
    box-shadow: 0 0 8px rgba(55, 125, 255, 0.6);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
  }
  .m-tabs-progress.is-loading {
    opacity: 1;
    width: 85%;
    transition: width 1.2s cubic-bezier(0.1, 0.7, 0.1, 1);
  }

  /* 화면 이동 때 흰 화면이 번쩍이지 않게 앞 화면에서 다음 화면으로 부드럽게 넘긴다(지원하는 브라우저만).
     하단 탭은 이름을 주어 제자리에 그대로 있게 한다. */
  @view-transition {
    navigation: auto;
  }
  .m-app .m-tabs {
    view-transition-name: m-tabs;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.12s;
  }
  @media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
      animation: none !important;
    }
  }

  /* 탭에 본문·바닥글이 가리지 않도록 여백 */
  body.m-app {
    padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
  }
  /* 맨 위로 버튼은 탭 위로 */
  .m-app .js-go-to {
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)) !important;
    right: 1rem !important;
    width: 3rem;
    height: 3rem;
  }
}

/* ============================================================ 8. 머리말(로고 줄)
 * 로고 링크가 w-25(폭 25%)로 잡혀 있어 좁은 화면에서 글자가 넘치고,
 * 오른쪽 '돌아가기' 버튼과 겹친다. 폭을 내용에 맞추고, 자리가 모자라면 다음 줄로 내린다.
 */
@media screen and (max-width: 991.98px) {
  .m-app #header .navbar-nav-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.25rem;
  }
  .m-app #header .navbar-brand.w-25 {
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    min-height: 3rem;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    margin-right: 0;
  }
  .m-app #header .navbar-brand.w-25 > img {
    width: 1.75rem !important;
    height: 1.75rem !important;
    flex: 0 0 auto;
  }
  .m-app #header .navbar-brand:empty {
    display: none;
  }
  .m-app #header .navbar-nav-wrap > a.btn {
    margin-left: auto;
    white-space: nowrap;
  }
}

/* ===================================================== 9. 머리말을 한 줄로
 * 'Top 메뉴(Topbar)' 줄과 로고 줄이 따로 쌓여 135~167px 를 차지했다.
 * Top 메뉴 버튼을 로고 줄 오른쪽으로 올려 한 줄(약 64px)로 만든다.
 * 본문 맨 위 여백은 mobile.js(fitHeaderOffset)가 머리말 높이에 맞춘다.
 */
@media screen and (max-width: 991.98px) {
  .m-app #header {
    padding-top: 0.5rem;
    padding-bottom: 0.25rem;
  }
  .m-app #header > .navbar-topbar {
    position: absolute;
    top: 0.5rem;
    left: 0;
    right: 0;
    margin-top: 0 !important;
    z-index: 11;                          /* 로고 줄(nav, z-index 10)보다 위여야 버튼이 눌린다 */
    pointer-events: none;                 /* 빈 자리는 아래 로고가 눌리게 */
  }
  .m-app #header > .navbar-topbar .navbar-toggler,
  .m-app #header > .navbar-topbar .navbar-collapse {
    pointer-events: auto;
  }
  .m-app #header > .navbar-topbar > .navbar-nav-wrap > .navbar-toggler {
    min-height: 3rem;
    padding-left: 0.625rem;
    padding-right: 0.625rem;
    background: #fff;
  }
  /* 족보 화면의 로고 줄 메뉴(내 이름·족보 로그아웃)는 여는 버튼이 d-none 으로 숨겨져 있어
     좁은 화면에서는 로그아웃할 길이 없었다. 좁은 화면에서만 그 버튼을 보이게 한다. */
  .m-app #header > .container:not(.navbar-topbar) .navbar-toggler.d-none {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }
  .m-app #header > .container:not(.navbar-topbar) .navbar-collapse.show,
  .m-app #header > .container:not(.navbar-topbar) .navbar-collapse.collapsing {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(33, 50, 91, 0.15);
    padding: 0.5rem 0.75rem;
  }
  .m-app #header > .container:not(.navbar-topbar) .navbar-collapse .nav-link {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    font-size: 1rem;
  }
  /* 로고 줄에 햄버거 버튼이 있는 화면: Top 메뉴 버튼은 그 왼쪽에 */
  .m-app #header.m-has-burger > .navbar-topbar > .navbar-nav-wrap > .navbar-toggler {
    margin-right: 3.5rem;
  }
  .m-app #header > .container:not(.navbar-topbar) {
    margin-top: 0 !important;
  }
  .m-app #header > .container:not(.navbar-topbar) > .navbar-nav-wrap {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
  /* 머리말 앞의 날짜·시각 줄은 좁은 화면에서 로고와 겹치므로 숨긴다 */
  .m-app .ml-4.pt-3:has(+ #header),
  .m-app .ml-4.pt-3:has(+ header) {
    display: none;
  }
  .m-app #header .navbar-brand {
    font-size: 1.0625rem;
    padding-top: 0;
    padding-bottom: 0;
  }
  .m-app #header.m-has-topbar .navbar-brand.w-25 {
    max-width: calc(100% - 9.5rem);
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-app #header.m-has-topbar:not(.m-has-burger) .navbar-brand.w-25 {
    max-width: calc(100% - 6.5rem);
  }
  /* 펼쳐진 Top 메뉴는 화면 폭 전체를 쓴다 */
  .m-app #header > .navbar-topbar .navbar-collapse.show,
  .m-app #header > .navbar-topbar .navbar-collapse.collapsing {
    background: #fff;
    box-shadow: 0 0.5rem 1.5rem rgba(33, 50, 91, 0.15);
    border-radius: 0.5rem;
  }

  /* 옆 메뉴(전체 메뉴 버튼) 위의 빈 여백 없애기 */
  .m-app .col-md-3 > .container[class*="content-space-t"] {
    padding-top: 0 !important;
    padding-bottom: 0.5rem !important;
  }
  /* 화면 제목 상자(빵부스러기 띠)와 큰 머리 그림 여백 줄이기 */
  .m-app .navbar-dark.rounded[class*="bg-"] > .container,
  .m-app .navbar-dark.rounded[class*="bg-"] > [class*="content-space"] {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }
  .m-app .bg-img-start > [class*="content-space-t"] {
    padding-bottom: 1rem !important;
  }
}

/* ======================================================== 10. 표 → 카드
 * mobile.js(cardify)가 .m-cards / .m-kv / .m-scroll 을 붙인다.
 */
@media screen and (max-width: 991.98px) {
  /* --- 목록 표: 줄 하나가 카드 한 장 --- */
  .m-app table.m-cards,
  .m-app table.m-cards > tbody,
  .m-app table.m-cards > tbody > tr,
  .m-app table.m-cards > tbody > tr > td,
  .m-app table.m-cards > tbody > tr > th {
    display: block;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }
  .m-app table.m-cards {
    width: 100% !important;
    border: 0;
    background: transparent;
  }
  .m-app table.m-cards > thead,
  .m-app table.m-cards > colgroup {
    display: none;
  }
  .m-app table.m-cards > tbody > tr {
    position: relative;
    margin: 0 0 0.625rem;
    padding: 0.625rem 0.875rem;
    background: #fff;
    border: 1px solid rgba(33, 50, 91, 0.12);
    border-radius: 0.625rem;
    box-shadow: 0 1px 3px rgba(33, 50, 91, 0.05);
  }
  .m-app table.m-cards > tbody > tr.m-row-link {
    padding-right: 2rem;
    cursor: pointer;
  }
  .m-app table.m-cards > tbody > tr.m-row-link::after {
    content: "›";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8c98a4;
    font-size: 1.5rem;
    line-height: 1;
  }
  .m-app table.m-cards > tbody > tr > td,
  .m-app table.m-cards > tbody > tr > th {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.3125rem 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: left !important;
    white-space: normal !important;
    min-height: 1.75rem;
    font-size: 1rem;
    font-weight: 400;
  }
  .m-app table.m-cards > tbody > tr > [data-label]::before {
    content: attr(data-label);
    flex: 0 0 5.5rem;
    color: #677788;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.6;
    word-break: keep-all;
  }
  .m-app table.m-cards.m-relatives > tbody > tr > [data-label] {
    gap: 0.25rem;
  }
  .m-app table.m-cards.m-relatives > tbody > tr > [data-label]::before {
    content: attr(data-label) ":";
    flex: 0 0 auto;
  }
  .m-app table.m-cards.m-relatives .btn.btn-xs {
    min-width: 0;
    min-height: 2rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.2;
  }
  .m-app table.m-cards.m-family-list > tbody > tr > td:not(.m-c-title):not(.m-c-photo):not(:last-child) {
    color: rgba(var(--bs-primary-rgb), 1);
    gap: 0.3125rem;
  }
  .m-app table.m-cards.m-family-list > tbody > tr > td:not(.m-c-title):not(.m-c-photo):not(:last-child)::before {
    content: attr(data-label) ':';
    flex: 0 0 auto;
  }
  .m-app table.m-cards.m-family-list > tbody > tr > td:last-child {
    justify-content: flex-end;
  }
  .m-app table.m-cards.m-family-list > tbody > tr > td:last-child::before {
    display: none;
  }
  .m-app table.m-cards.m-family-list > tbody > tr.m-row-link {
    padding-right: 0.875rem;
  }
  .m-app table.m-cards.m-family-list > tbody > tr.m-row-link::after {
    display: none;
  }
  .m-app table.m-cards > tbody > tr > [data-label=""]::before {
    display: none;
  }
  .m-app table.m-cards > tbody > tr > .m-empty {
    display: none;
  }
  .m-app table.m-cards > tbody > tr.m-row-plain > td {
    display: block;
  }
  .m-app table.m-cards > tbody > tr.m-head-row {
    display: none;
  }
  .m-app table.m-cards img {
    max-width: 4rem;
    max-height: 4rem;
    width: auto;
    height: auto;
  }

  /* --- 줄인 카드: 제목(이름) 한 줄 + 짧은 값은 나란히, 사진은 왼쪽 (mobile.js 가 .m-compact 를 붙인다) --- */
  .m-app table.m-cards > tbody > tr.m-compact {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.875rem;
  }
  .m-app table.m-cards > tbody > tr.m-compact > td,
  .m-app table.m-cards > tbody > tr.m-compact > th {
    flex: 0 0 100%;
  }
  .m-app table.m-cards > tbody > tr.m-compact > .m-c-title {
    order: -2;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1e2022;
  }
  .m-app table.m-cards > tbody > tr.m-compact > .m-c-title::before,
  .m-app table.m-cards > tbody > tr.m-compact > .m-c-photo::before {
    display: none;
  }
  .m-app table.m-cards > tbody > tr.m-compact > .m-c-chip {
    order: -1;
    flex: 0 1 auto;
    gap: 0.3125rem;
    min-height: 0;
    padding: 0.125rem 0 !important;
    font-size: 0.9375rem;
    align-items: baseline;
  }
  .m-app table.m-cards > tbody > tr.m-compact > .m-c-chip::before {
    flex: 0 0 auto;
    font-size: 0.8125rem;
  }
  .m-app table.m-cards.m-lineage > tbody > tr.m-compact > td:nth-child(2),
  .m-app table.m-cards.m-lineage > tbody > tr.m-compact > td:nth-child(5),
  .m-app table.m-cards.m-lineage > tbody > tr.m-compact > td:nth-child(6),
  .m-app table.m-cards.m-lineage > tbody > tr.m-compact > td:nth-child(7),
  .m-app table.m-cards.m-lineage > tbody > tr.m-compact > td:nth-child(8) {
    order: -1;
    flex: 0 1 auto;
    gap: 0.3125rem;
    color: rgba(var(--bs-primary-rgb), 1);
  }
  .m-app table.m-cards.m-lineage > tbody > tr.m-compact > td:nth-child(7) {
    order: 0;
  }
  .m-app table.m-cards.m-lineage > tbody > tr.m-compact > td:nth-child(n+9) {
    order: 1;
  }
  .m-app table.m-cards.m-lineage > tbody > tr > td:last-child {
    justify-content: flex-end;
  }
  .m-app table.m-cards.m-lineage > tbody > tr > td:last-child > .btn {
    width: 6rem;
  }
  .m-app table.m-cards.m-lineage > tbody > tr.m-compact > td:nth-child(2)::before,
  .m-app table.m-cards.m-lineage > tbody > tr.m-compact > td:nth-child(5)::before,
  .m-app table.m-cards.m-lineage > tbody > tr.m-compact > td:nth-child(6)::before,
  .m-app table.m-cards.m-lineage > tbody > tr.m-compact > td:nth-child(7)::before,
  .m-app table.m-cards.m-lineage > tbody > tr.m-compact > td:nth-child(8)::before {
    content: attr(data-label) ':';
    flex: 0 0 auto;
  }
  .m-app table.m-cards > tbody > tr.m-compact > .m-c-title a[href] {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
  }
  /* 사진이 있으면 첫 줄은 [사진][이름], 그 아래로 짧은 값·나머지 줄이 카드 폭을 다 쓴다 */
  .m-app table.m-cards > tbody > tr.m-compact > .m-c-photo {
    order: -3;
    flex: 0 0 3.75rem;
    align-self: center;
    padding: 0 !important;
  }
  .m-app table.m-cards > tbody > tr.m-compact.m-has-photo > .m-c-title {
    flex: 1 0 calc(100% - 4.75rem);   /* 사진 옆 나머지 폭을 다 써서 짧은 값은 다음 줄로 */
    align-self: center;
  }
  .m-app table.m-cards > tbody > tr.m-compact > .m-c-photo img {
    max-width: 3.75rem;
    max-height: 4rem;
  }

  /* --- '항목 : 값' 표: 한 줄에 항목–값 한 쌍 --- */
  .m-app table.m-kv,
  .m-app table.m-kv > tbody,
  .m-app table.m-kv > tbody > tr {
    display: block;
    width: 100% !important;
  }
  .m-app table.m-kv > colgroup {
    display: none;
  }
  .m-app table.m-kv > tbody > tr {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(33, 50, 91, 0.08);
  }
  .m-app table.m-kv > tbody > tr > td,
  .m-app table.m-kv > tbody > tr > th {
    display: block;
    flex: 1 1 60%;
    width: auto !important;
    min-width: 0;
    padding: 0.4375rem 0.25rem !important;
    border: 0 !important;
    text-align: left !important;
    white-space: normal !important;
    font-size: 1rem;
  }
  .m-app table.m-kv > tbody > tr > .m-k {
    flex: 0 0 34%;
    color: #677788;
    font-size: 0.9375rem;
  }
  .m-app table.m-kv > tbody > tr > .m-k + td,
  .m-app table.m-kv > tbody > tr > .m-k + th {
    flex: 1 1 60%;
  }
  .m-app table.m-kv > tbody > tr > .m-empty {
    display: none;
  }
  .m-app table.m-kv > tbody > tr > .m-kvi {
    flex: 0 0 100%;
  }

  /* --- 그대로 두는 넓은 표: 옆으로 밀기 --- */
  .m-app .m-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    background:
      linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) left center / 2rem 100% no-repeat local,
      linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right center / 2rem 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(33, 50, 91, 0.18), transparent) left center / 0.75rem 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(33, 50, 91, 0.18), transparent) right center / 0.75rem 100% no-repeat scroll;
  }
  .m-app .m-scroll > table {
    min-width: max-content;
  }
  .m-app .m-scroll > table th,
  .m-app .m-scroll > table td {
    overflow-wrap: normal;
  }

  /* ------------------------------------------------- 11. 긴 안내문 접기 */
  .m-app .m-clamp:not(.m-clamp-open) {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }
  .m-app .m-more {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 0.75rem;
    margin: 0 0 0.5rem;
    border: 0;
    background: transparent;
    color: #377dff;
    font-size: 0.9375rem;
    font-weight: 600;
  }
}

/* ============================================ 12. 수단 등재양식: 한 번에 한 묶음
 * mobile.js(sudanWizard). 탭 자리에 '이전 / 다음' 막대가 온다.
 */
.m-wz-bar {
  display: none;
}
@media screen and (max-width: 991.98px) {
  .m-app.m-wz .m-tabs {
    display: none;
  }
  .m-app .m-sub-off,
  .m-app .m-wz-hide {
    display: none !important;
  }
  .m-app .m-wz-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid rgba(33, 50, 91, 0.12);
    box-shadow: 0 -2px 12px rgba(33, 50, 91, 0.08);
  }
  .m-app .m-wz-bar > button {
    flex: 1 1 0;
    min-height: 3rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(33, 50, 91, 0.2);
    background: #fff;
    color: #1e2022;
    font-size: 1.0625rem;
    font-weight: 600;
  }
  .m-app .m-wz-bar > .m-wz-next {
    flex: 1.6 1 0;
    background: #377dff;
    border-color: #377dff;
    color: #fff;
  }
  .m-app .m-wz-bar > .m-wz-next.m-wz-save {
    background: #00c9a7;
    border-color: #00c9a7;
  }
  .m-app .m-wz-bar > button:disabled {
    opacity: 0.4;
  }
  .m-app .m-wz-pos {
    flex: 0 0 4.25rem;
    text-align: center;
    font-size: 0.9375rem;
    color: #677788;
  }
  .m-app .m-wz-pos > b {
    display: block;
    font-weight: 600;
  }
  .m-app .m-wz-pos > i {
    display: block;
    height: 0.25rem;
    margin-top: 0.25rem;
    border-radius: 0.125rem;
    background: rgba(33, 50, 91, 0.12);
    overflow: hidden;
  }
  .m-app .m-wz-pos > i > s {
    display: block;
    height: 100%;
    background: #377dff;
    transition: width 0.2s;
  }
  body.m-app.m-wz {
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  }
  .m-app.m-wz .js-go-to {
    display: none !important;
  }

  /* 양식 안의 여러 칸 가로 배치는 한 줄에 하나씩 */
}
@media screen and (max-width: 575.98px) {
  /* 입력칸이 든 가로 칸(.col-6 등)은 휴대폰에서 한 줄에 하나씩 */
  .m-app .row > [class*="col-"]:not(.col-12):not(.col-auto):has(.form-control, .form-select, .form-check-input) {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }
}

/* ====================================================== 13. 화면별 보정 */
.m-fab,
.m-copy,
.m-copy-row,
.m-more,
.m-select-all,
.m-empty-note {
  display: none;
}
@media screen and (max-width: 991.98px) {
  /* 카드 아랫줄의 버튼 묶음(쪽지 읽기 등): 좁으면 다음 줄로 넘기고 버튼 글자는 꺾지 않는다 */
  .m-app .card-footer.d-flex {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .m-app .card-footer .btn {
    white-space: nowrap;
  }
  /* 통계 원 그래프 여러 개: 화면 밖으로 나가지 않게 줄바꿈 */
  .m-app .stats-progress {
    flex-wrap: wrap;
    row-gap: 0.75rem;
  }
  /* 작은 글자 링크(보기·수정·삭제 등)를 누를 수 있는 크기로 */
  .m-app a.link-sm,
  .m-app a.link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding-right: 0.75rem;
    font-size: 1rem;
  }
  .m-app a.link.btn {
    padding-right: 0.875rem;
  }

  /* 카드로 바뀐 표의 '전체 선택' (제목 줄에 있던 체크박스를 대신 눌러 준다) */
  .m-app .m-select-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    margin: 0 0 0.5rem;
    font-size: 1rem;
  }
  .m-app .m-select-all > input {
    width: 1.375rem;
    height: 1.375rem;
  }

  /* 장바구니: 제출하러 가기 */
  .m-app .m-fab {
    position: fixed;
    right: 0.75rem;
    bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
    z-index: 1029;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 3rem;
    padding: 0 1.125rem;
    border: 0;
    border-radius: 1.5rem;
    background: #377dff;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 0.375rem 1rem rgba(55, 125, 255, 0.35);
  }
  .m-app .m-fab.m-fab-off {
    display: none;
  }

  /* 청구서 */
  .m-app .invoice-header-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.125rem 0.5rem;
  }
  .m-app .invoice-header-label {
    white-space: nowrap;
  }
  .m-app .m-copy {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 0.875rem;
    margin-left: 0.5rem;
    border: 1px solid #377dff;
    border-radius: 0.5rem;
    background: #fff;
    color: #377dff;
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
  }
  .m-app .m-copy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: #fff;
    border: 1px solid rgba(33, 50, 91, 0.12);
    color: #1e2022;
    font-size: 1.0625rem;
  }

  /* 홈 공지 팝업: 화면 위쪽을 덮지 않고 아래에서 올라오는 창으로 */
  .m-app .hcgp-popup.hcgp-popup-layer {
    position: fixed !important;
    left: 0.5rem !important;
    right: 0.5rem !important;
    top: auto !important;
    bottom: calc(4rem + env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: 46vh;
    display: flex;
    flex-direction: column;
    transform: none !important;
    z-index: 1040;
  }
  .m-app .hcgp-popup.hcgp-popup-layer[style*="display: none"],
  .m-app .hcgp-popup.hcgp-popup-layer[style*="display:none"] {
    display: none;
  }
  .m-app .hcgp-popup .hcgp-popup-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
  }
  .m-app .hcgp-popup .hcgp-popup-close-btn {
    min-width: 2.75rem;
    min-height: 2.75rem;
    font-size: 1.5rem;
  }
  .m-app .hcgp-popup label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 2.75rem;
    font-size: 0.9375rem;
  }
  .m-app .hcgp-popup input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
  }
  .m-app .hcgp-modal-box {
    max-width: calc(100vw - 1rem) !important;
    max-height: 80vh;
    overflow-y: auto;
  }

  /* 지도 */
  .m-app .root_daum_roughmap {
    max-width: 100% !important;
  }
  .m-app .root_daum_roughmap .wrap_map {
    max-width: 100%;
  }
}

@media screen and (max-width: 991.98px) {
  /* 접었다 펴는 목록(약관·도움말·자주 하는 질문) */
  .m-app .accordion-button {
    min-height: 3rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 1rem;
  }
  /* 글 편집 도구 */
  .m-app .ql-toolbar.ql-snow button {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.625rem;
  }
  .m-app .ql-toolbar.ql-snow .ql-picker {
    height: 2.75rem;
  }
  .m-app .ql-toolbar.ql-snow .ql-picker-label {
    display: flex;
    align-items: center;
  }
  .m-app .ql-editor {
    font-size: 1rem;
  }
  /* 사람 이름 링크(나의 가계 등): 줄 전체 높이로 */
  .m-app a.d-inline-block.link-dark:not(.d-none),
  .m-app a.d-inline-block.text-dark:not(.d-none),
  .m-app li > a:only-child:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.d-none) {
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
  }
  .m-app .breadcrumb {
    align-items: center;
  }
  .m-app .myfamily-members a.d-inline-block.link-dark:not(.d-none),
  .m-app .myfamily-members a.d-inline-block.text-dark:not(.d-none) {
    min-height: 0;
  }
  /* 화면보다 몇 px 넓어지는 요소 */
  .m-app [class*="jb-font-size"].ms-1 {
    max-width: calc(100% - 0.25rem);
    box-sizing: border-box;
  }
  .m-app .my-line-scroll-body {
    min-width: 0 !important;
    width: auto !important;
    overflow-x: hidden;
  }
  .m-app table.m-cards {
    min-width: 0 !important;
  }
  /* 입력칸 + 버튼 묶음이 카드 밖으로 넘치지 않게 */
  .m-app .input-group > .form-control,
  .m-app .input-group > .form-select {
    min-width: 0;
  }
  .m-app .input-group > .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media screen and (max-width: 991.98px) {
  /* 옆 메뉴(전체 메뉴)를 펼쳤을 때의 항목: 누르기 쉬운 높이로 */
  .m-app #sidebarNav a,
  .m-app .navbar-vertical a {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-size: 1rem;
  }
  /* 촌수 고르기 같은 알약 모양 탭 */
  .m-app .nav-segment .nav-link,
  .m-app .nav-pills .nav-link,
  .m-app .nav-tabs .nav-link {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
  }
  /* 내용이 없는 표: 제목 줄만 좁게 꺾여 보이던 것 대신 안내 한 줄 */
  .m-app table.m-no-rows {
    display: none;
  }
  .m-app .m-empty-note {
    display: block;
    padding: 1rem 0.75rem;
    border: 1px dashed rgba(33, 50, 91, 0.2);
    border-radius: 0.625rem;
    color: #677788;
    font-size: 1rem;
    text-align: center;
  }
}

@media print {
  .m-tabs {
    display: none !important;
  }
}

/* ============================================= 14. 서랍 메뉴 · 접는 구획 · 화면별 기능
 * mobile.js 8~13 구획이 만든 요소들. PC(992px 이상)에서는 만들어지지 않지만, 혹시 남아도 보이지 않게 한다.
 */
.m-drawer,
.m-chips,
.m-seg,
.m-fold-toggle,
.m-zoom,
.m-pager,
.m-photo-hint,
.m-edit-toggle,
.m-quick,
.m-pw-rules,
.m-count {
  display: none;
}
@media screen and (max-width: 991.98px) {
  /* --- 서랍 메뉴 --- */
  .m-app .m-drawer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1045;                      /* 하단 탭(1030) 위, 팝업(1055) 아래 */
  }
  .m-app .m-drawer[hidden] {
    display: none;
  }
  .m-app .m-drawer-back {
    position: absolute;
    inset: 0;
    background: rgba(19, 33, 68, 0.45);
  }
  .m-app .m-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(86vw, 22rem);
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: -0.5rem 0 1.5rem rgba(19, 33, 68, 0.18);
  }
  .m-app .m-drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.375rem 0.375rem 1rem;
    border-bottom: 1px solid rgba(33, 50, 91, 0.1);
    font-size: 1.0625rem;
  }
  .m-app .m-drawer-close,
  .m-app .m-zoom-close {
    width: 3rem;
    height: 3rem;
    border: 0;
    background: transparent;
    font-size: 1.25rem;
    color: inherit;
  }
  .m-app .m-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  .m-app .m-drawer-title {
    padding: 1rem 1rem 0.25rem;
    color: #377dff;
    font-size: 0.875rem;
    font-weight: 700;
  }
  .m-app .m-drawer-title:not(:first-child) {
    margin-top: 0.5rem;
    border-top: 0.5rem solid #f4f6fa;
  }
  .m-app .m-menu-head {
    padding: 0.75rem 1rem 0.125rem;
    color: #677788;
    font-size: 0.8125rem;
  }
  .m-app .m-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 3rem;
    padding: 0.5rem 1rem;
    border: 0;
    background: transparent;
    color: #1e2022;
    font-size: 1rem;
    line-height: 1.35;
    text-align: left;
    text-decoration: none;
  }
  .m-app .m-menu-item.is-active {
    background: rgba(55, 125, 255, 0.07);
    color: #377dff;
    font-weight: 600;
  }
  .m-app .m-menu-badge {
    flex: 0 0 auto;
    min-width: 1.5rem;
    padding: 0.0625rem 0.4375rem;
    border-radius: 1rem;
    background: #eef1f6;
    color: #51596c;
    font-size: 0.8125rem;
    text-align: center;
  }
  .m-app.m-drawer-open {
    overflow: hidden;
  }
  /* 팝업이 열려 있는 동안에는 하단 탭·떠 있는 버튼이 팝업 아래쪽 버튼을 가리지 않게 감춘다 */
  .m-app.modal-open .m-tabs,
  .m-app.modal-open .m-fab,
  .m-app.modal-open .m-wz-bar {
    display: none !important;
  }
  /* 서랍이 대신하는 기존 여는 버튼과 접힌 메뉴 */
  .m-app.m-has-drawer #header .navbar-topbar,
  .m-app.m-has-drawer #navbarNavDropdown,
  .m-app.m-has-drawer #sidebarNav,
  .m-app.m-has-drawer [data-bs-target="#sidebarNav"],
  .m-app .m-drawer-hide {
    display: none !important;
  }

  /* --- 접는 구획 --- */
  .m-app .m-fold-off {
    display: none !important;
  }
  .m-app .m-fold-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 3.25rem;
    margin: 0 !important;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(33, 50, 91, 0.12);
    cursor: pointer;
  }
  .m-app .m-fold-head::after {
    content: "";
    flex: 0 0 auto;
    width: 0.625rem;
    height: 0.625rem;
    margin-right: 0.375rem;
    border-right: 2px solid #8c98a4;
    border-bottom: 2px solid #8c98a4;
    transform: rotate(45deg);
    transition: transform 0.15s;
  }
  .m-app .m-fold-head.is-open::after {
    transform: rotate(-135deg);
  }
  .m-app .m-fold-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
    min-height: 3rem;
    margin: 0.5rem 0 0.75rem;
    border: 1px solid rgba(55, 125, 255, 0.4);
    border-radius: 0.5rem;
    background: #fff;
    color: #377dff;
    font-size: 1rem;
    font-weight: 600;
  }

  /* --- 구분 탭(구획 바로가기) --- */
  .m-app .m-chips {
    position: sticky;
    top: 0;
    z-index: 6;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    margin: 0 -0.75rem 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.96);
    scrollbar-width: none;
  }
  .m-app .m-chips::-webkit-scrollbar {
    display: none;
  }
  .m-app .m-chip {
    flex: 0 0 auto;
    min-height: 2.75rem;
    padding: 0 1rem;
    border: 1px solid rgba(33, 50, 91, 0.18);
    border-radius: 1.5rem;
    background: #fff;
    color: #51596c;
    font-size: 0.9375rem;
    white-space: nowrap;
  }
  .m-app .m-sudan-chips .m-chip {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .m-app .m-chip.is-active {
    border-color: #377dff;
    background: #377dff;
    color: #fff;
    font-weight: 600;
  }
  .m-app .m-seg {
    display: flex;
    gap: 0.25rem;
    margin: 0.75rem;
    padding: 0.25rem;
    border-radius: 0.625rem;
    background: #eef1f6;
  }
  .m-app .m-seg > button {
    flex: 1 1 0;
    min-height: 2.75rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: #51596c;
    font-size: 0.9375rem;
  }
  .m-app .m-seg > button.is-active {
    background: #fff;
    color: #377dff;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(33, 50, 91, 0.15);
  }

  /* --- 앨범: 2열 격자, 사진 확대·넘기기 --- */
  .m-app .m-album {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.625rem;
    margin-left: 0;
    margin-right: 0;
  }
  .m-app .m-album > [class*="col-"] {
    width: auto;
    max-width: none;
    margin: 0 !important;
    padding: 0;
  }
  .m-app .m-album .card-img-top {
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }
  .m-app .m-album .card-body {
    padding: 0.5rem 0.625rem;
  }
  .m-app .m-album .card-title {
    margin-bottom: 0.125rem;
    font-size: 0.9375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .m-app .m-album .card-text {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .m-app .m-album .card .btn {
    width: 100%;
  }
  .m-app .m-tap {
    cursor: zoom-in;
  }
  .m-app .m-album .m-tap {
    cursor: pointer;
  }
  .m-app .m-zoom {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: #000;
  }
  .m-app .m-zoom[hidden] {
    display: none;
  }
  .m-app .m-zoom-scroll {
    width: 100%;
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .m-app .m-zoom-scroll img {
    display: block;
    width: 220%;
    max-width: none;
    height: auto;
  }
  .m-app .m-zoom-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 1;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
  }
  .m-app .m-photo-hint {
    display: block;
    margin: 0.375rem 0 0;
    color: #677788;
    font-size: 0.875rem;
    text-align: center;
  }
  .m-app .m-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
  }
  .m-app .m-pager-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 2.75rem;
    padding: 0 0.875rem;
    border: 1px solid rgba(33, 50, 91, 0.18);
    border-radius: 0.5rem;
    background: #fff;
    color: #377dff;
    font-size: 0.9375rem;
    text-decoration: none;
  }
  .m-app .m-pager-btn.is-off {
    color: #bdc5d1;
  }
  .m-app .m-pager-count {
    color: #677788;
    font-size: 0.875rem;
  }

  /* --- 쪽지함: 편집을 눌렀을 때만 체크박스, 읽기 화면의 버튼은 아래에 붙인다 --- */
  .m-app.m-msg-list:not(.m-msg-edit) table.m-cards .m-c-check,
  .m-app.m-msg-list:not(.m-msg-edit) .m-select-all,
  .m-app.m-msg-list:not(.m-msg-edit) .m-edit-only {
    display: none !important;
  }
  .m-app table.m-cards > tbody > tr > .m-c-check {
    order: -4;
    min-height: 2.75rem;
    align-items: center;
    cursor: pointer;
  }
  .m-app table.m-cards > tbody > tr > .m-c-check::after {
    content: "선택";
    color: #677788;
    font-size: 0.875rem;
  }
  .m-app .m-c-check input[type="checkbox"],
  .m-app .m-select-all input[type="checkbox"] {
    width: 1.5rem;
    height: 1.5rem;
    margin: 0;
  }
  .m-app .m-edit-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    margin-right: 0.5rem;
    padding: 0 1rem;
    border: 1px solid rgba(33, 50, 91, 0.18);
    border-radius: 0.5rem;
    background: #fff;
    color: #377dff;
    font-size: 0.9375rem;
  }
  .m-app .card-footer.m-actions {
    position: sticky;
    bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px));
    z-index: 5;
    background: #fff !important;
    box-shadow: 0 -0.25rem 0.75rem rgba(33, 50, 91, 0.08);
  }

  /* --- 나의 프로필: 내 정보 관리 목록 --- */
  .m-app .m-quick {
    display: block;
    margin: 0.75rem 0 1rem;
    border: 1px solid rgba(33, 50, 91, 0.12);
    border-radius: 0.75rem;
    background: #fff;
    overflow: hidden;
  }
  .m-app .m-quick-title {
    margin: 0;
    padding: 0.875rem 1rem 0.25rem;
    font-size: 1.0625rem;
  }
  .m-app .m-quick .m-menu-item {
    border-top: 1px solid rgba(33, 50, 91, 0.06);
  }
  .m-app .m-quick .m-menu-item::after {
    content: "›";
    margin-left: auto;
    color: #8c98a4;
    font-size: 1.25rem;
    line-height: 1;
  }
  .m-app .m-quick .m-menu-badge {
    margin-left: auto;
  }
  .m-app .m-quick .m-menu-badge + ::after,
  .m-app .m-quick .m-menu-item:has(.m-menu-badge)::after {
    margin-left: 0.5rem;
  }

  /* --- 비밀번호 조건, 글자 수 --- */
  .m-app .m-pw-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.875rem;
    margin: 0.25rem 0 0.75rem;
    padding: 0;
    list-style: none;
    color: #8c98a4;
    font-size: 0.875rem;
  }
  .m-app .m-pw-rules li::before {
    content: "○ ";
  }
  .m-app .m-pw-rules li.is-ok {
    color: #00a47c;
    font-weight: 600;
  }
  .m-app .m-pw-rules li.is-ok::before {
    content: "✓ ";
  }
  .m-app .m-count {
    display: block;
    margin-top: 0.25rem;
    color: #677788;
    font-size: 0.875rem;
    text-align: right;
  }

  /* --- 화면별 보정 --- */
  /* 머리말 상자: 제목이 버튼 옆에서 한 글자씩 꺾이지 않게 한 줄을 다 쓴다 */
  .m-app .navbar-dark .row.align-items-center > .col:has(h1) {
    flex: 0 0 100%;
  }
  .m-app .navbar-dark .row.align-items-center > .col h1 {
    margin-bottom: 0.5rem !important;
    font-size: 1.25rem;
  }
  /* 사진 상세처럼 제목이 PC 전용으로만 들어 있는 머리말 상자 */
  .m-app .navbar-dark .col > .d-none.d-lg-block:only-child:has(h1, h2) {
    display: block !important;
  }
  .m-app .navbar-dark .col > .d-none.d-lg-block:only-child h2 {
    margin: 0 0 0 0.5rem !important;
    font-size: 1.125rem;
  }
  /* 통계: 원 그래프는 두 개씩, 막대 카드는 낮게 */
  .m-app .stats-progress > .js-circle {
    flex: 0 0 50%;
    display: flex;
    justify-content: center;
  }
  .m-app.m-p-stats .card.card-bordered {
    margin-bottom: 0.375rem !important;
  }
  .m-app.m-p-stats .card.card-bordered > .card-body {
    padding: 0.5rem 0.75rem !important;
  }
  .m-app.m-p-stats .card.card-bordered > .card-body > * {
    margin-top: 0 !important;
    margin-bottom: 0.125rem !important;
  }
  .m-app.m-p-stats .row.mx-n2 > [class*="col-"] {
    flex: 0 0 50%;
    max-width: 50%;
  }
  /* 쪽 번호가 아주 많을 때(검색 결과 등): 앞뒤 몇 쪽만 보인다 (mobile.js trimPager) */
  .m-app .pagination .m-page-gap > * {
    min-width: 1.5rem !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border: 0 !important;
    background: transparent !important;
    pointer-events: none;
  }
  /* 나의 프로필: 등록된 개인 사진 줄 */
  .m-app .d-flex.justify-content-center > .mx-5.text-center {
    margin-left: 0.625rem !important;
    margin-right: 0.625rem !important;
  }
  .m-app .d-flex.justify-content-center > .mx-5.text-center .form-check-label {
    white-space: nowrap;
  }
  /* 현황(청구서·연회비·기부금): 금액은 크게 */
  .m-app table.m-cards > tbody > tr > td[data-label*="금액"] {
    font-size: 1.0625rem;
    font-weight: 700;
  }
}
