/* ========================================================================
   YOUNGMAN — Minimal Design System
   Korean traditional + modern fusion. Hairline rules, generous whitespace,
   warm-cream surfaces, single seal-stamp red accent used very sparingly.
   ======================================================================== */

:root {
    /* Surface — slightly warm to harmonize with seal-red accent + calligraphy */
    --bg: #ffffff;
    --bg-subtle: #faf8f4;
    --bg-muted: #f4efe7;
    --bg-paper: #fbf7ef;

    /* Foreground */
    --fg: #0e0d0c;
    --fg-secondary: #4f4943;
    --fg-tertiary: #8a847e;
    --fg-quaternary: #c4beb7;

    /* Hairline borders */
    --border: rgba(20, 14, 8, 0.09);
    --border-strong: rgba(20, 14, 8, 0.16);
    --border-focus: rgba(14, 13, 12, 0.85);

    /* Single accent — seal-stamp red. Used sparingly: focus rings, active pills, key calls-to-action. */
    --accent: #c8362c;
    --accent-hover: #a82a21;
    --accent-soft: rgba(200, 54, 44, 0.08);
    --accent-deep: #7a1812;

    /* Status */
    --success: #047a55;
    --success-soft: rgba(4, 122, 85, 0.08);
    --warning: #b25e00;
    --warning-soft: rgba(178, 94, 0, 0.08);
    --danger: #c92a2a;
    --danger-soft: rgba(201, 42, 42, 0.06);

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Type */
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Pretendard",
        "Inter", "Helvetica Neue", Helvetica, Arial, "Apple SD Gothic Neo",
        "Malgun Gothic", sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    /* Motion */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: all 180ms var(--ease);

    /* Layout */
    --container: 1180px;
    --header-h: 64px;

    /* Subtle shadow only on overlays */
    --shadow-pop: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-overlay: 0 24px 60px rgba(0, 0, 0, 0.18);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: -0.005em;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--accent-soft); color: var(--accent-deep); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(20,14,8,0.14); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(20,14,8,0.24); border: 2px solid transparent; background-clip: padding-box; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button:focus-visible, a:focus-visible { outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

.hidden { display: none !important; }

/* ------------------------------------------------------------------ Typography */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.022em; color: var(--fg); }
h1 { font-size: 32px; line-height: 1.18; letter-spacing: -0.025em; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 17px; line-height: 1.3; }
small { color: var(--fg-tertiary); font-size: 13px; }

.eyebrow {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-tertiary);
}

/* ------------------------------------------------------------------ Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.header-container h1 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--fg);
    text-transform: none;
    margin: 0;
    flex-shrink: 0;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.brand-logo img {
    height: 44px;
    width: auto;
    display: block;
    user-select: none;
}
@media (max-width: 768px) {
    .brand-logo img { height: 36px; }
}

.header-container h1 .accent {
    display: inline-block;
    margin-left: 8px;
    padding: 0;
    background: transparent;
    color: var(--fg-tertiary);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* 주 기능 (관리대장 3종) — pill 버튼, 모두 동일 폭으로 시각 통일 */
.nav-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 132px;
    height: 38px;
    padding: 0 18px;
    background: var(--bg-muted);
    border: 1px solid transparent;
    color: var(--fg);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.nav-pill:hover {
    background: rgba(200, 54, 44, 0.08);
    color: var(--accent-deep, #8a2620);
}

.nav-pill.active {
    background: var(--fg);
    color: var(--bg);
    box-shadow: 0 1px 3px rgba(20, 14, 8, 0.18);
}

.nav-pill.active:hover {
    background: var(--fg);
    color: var(--bg);
    opacity: 0.94;
}

/* 메인 강조 pill — 고객 관리대장 */
.nav-pill-main {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(200, 54, 44, 0.25);
    font-weight: 700;
    font-size: 14px;
    padding: 0 22px;
    height: 40px;
}
.nav-pill-main:hover {
    background: var(--accent-hover, #a82a21);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(200, 54, 44, 0.32);
}
.nav-pill-main.active,
.nav-pill-main.active:hover {
    background: var(--accent-deep, #7a1812);
    color: #fff;
    border-color: var(--accent-deep, #7a1812);
}

/* 양식 선택 슬롯 pill — dropdown 호스트 */
.nav-pill-dropdown {
    position: relative;
}
.nav-pill-slot {
    border: 0;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nav-pill-slot .nav-pill-prefix {
    font-size: 11px;
    font-weight: 700;
    color: var(--fg-tertiary);
    letter-spacing: 0.04em;
    padding: 2px 6px;
    background: var(--bg);
    border-radius: 4px;
}
.nav-pill-slot.active .nav-pill-prefix {
    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
}
.nav-pill-slot .nav-pill-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--fg-secondary);
    margin-left: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(20, 14, 8, 0.05);
    transition: transform 200ms, background 160ms, color 160ms;
    cursor: pointer;
    min-width: 28px;
    min-height: 24px;
}
.nav-pill-slot .nav-pill-caret:hover {
    background: rgba(20, 14, 8, 0.12);
    color: var(--fg);
}
.nav-pill-slot.active .nav-pill-caret {
    background: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.95);
}
.nav-pill-slot.active .nav-pill-caret:hover {
    background: rgba(255, 255, 255, 0.32);
}
.nav-pill-dropdown.open .nav-pill-slot .nav-pill-caret {
    transform: rotate(180deg);
}
.nav-pill-dropdown .nav-dropdown-menu {
    top: 100%;
    /* 가운데 정렬 — pill 중앙에 dropdown 의 중앙 맞춤 */
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    padding-top: 6px;
}
.nav-pill-dropdown.open > .nav-dropdown-menu { display: block; }
.nav-pill-dropdown .nav-dropdown-item .nav-dropdown-icon { display: none; }

/* hover 영역 ↔ dropdown menu 사이 invisible bridge — 마우스 이동 중 hover 끊김 방지 */
.nav-pill-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
    pointer-events: auto;
}

/* 보조 기능 (마케팅 / Lotto / 명함 / 업로드 / 커뮤니티) — 우측에 작은 간격으로 */
.nav-secondary {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1 1 auto;
    justify-content: flex-end;
    margin-left: 14px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
    flex-wrap: nowrap;
    white-space: nowrap;
}
.nav-secondary > .nav-link,
.nav-secondary > .nav-dropdown > .nav-static {
    line-height: 1;
}

.nav-link {
    background: none;
    border: 0;
    color: var(--fg-tertiary);
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: -0.005em;
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--bg-muted);
    color: var(--fg);
}

.nav-link.active {
    color: var(--fg);
    font-weight: 600;
}

/* nav-secondary — 아이콘 위 / 텍스트 아래 stack 레이아웃 (모든 항목 동일 크기) */
.nav-secondary > .nav-link,
.nav-secondary > .nav-dropdown > .nav-static {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    line-height: 1;
    min-height: 50px;
}
.nav-secondary .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    line-height: 1;
    color: var(--fg-secondary);
    transition: color 160ms, transform 200ms;
}
.nav-secondary .nav-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}
.nav-secondary > .nav-link:hover .nav-icon,
.nav-secondary > .nav-dropdown:hover .nav-icon { color: var(--fg); transform: translateY(-1px); }

.nav-secondary .nav-label {
    font-size: 11.5px;
    font-weight: 500;
    text-align: center;
    line-height: 1.25;
    color: inherit;
}
.nav-secondary .nav-link.active .nav-label,
.nav-secondary .nav-dropdown.is-active .nav-label,
.nav-secondary .nav-link.active .nav-icon,
.nav-secondary .nav-dropdown.is-active .nav-icon {
    color: var(--fg);
}
.nav-secondary .nav-link.active .nav-label,
.nav-secondary .nav-dropdown.is-active .nav-label { font-weight: 700; }

/* 점 separator 제거 — 작은 gap 으로 대체 (커뮤니티 dropdown 과 정렬 일관성) */

/* multi-line 라벨도 다른 항목과 동일 사이즈 — 두 줄로 wrap 만 */

/* 커뮤니티 dropdown — hover 시 하위 메뉴 노출. 갭 없이 붙여서 마우스 이동 중 닫힘 방지 */
.nav-secondary .nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.nav-static {
    cursor: default;
    user-select: none;
}
.nav-secondary .nav-static:hover { background: var(--bg-muted); color: var(--fg); }
.nav-secondary .nav-dropdown.is-active .nav-static { color: var(--fg); font-weight: 600; }
.nav-secondary .nav-caret { display: none; }

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: max-content;   /* 내용 폭만큼만 — 너무 넓지 않게 */
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(20, 14, 8, 0.12);
    padding: 6px;
    margin-top: 8px;
    display: none;
    z-index: 200;
}

/* 갭 메우기 — 트리거와 메뉴 사이 마우스 이동 시 hover 유지되도록 invisible bridge */
.nav-secondary .nav-dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
    pointer-events: auto;   /* 호버 가능하지만 시각적으론 보이지 않음 */
}

.nav-dropdown:hover > .nav-dropdown-menu,
.nav-dropdown:focus-within > .nav-dropdown-menu { display: block; }

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-secondary);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}
.nav-dropdown-item .nav-dropdown-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    line-height: 1;
    flex-shrink: 0;
    color: var(--fg-tertiary);
}
.nav-dropdown-item .nav-dropdown-icon svg { width: 18px; height: 18px; display: block; }
.nav-dropdown-item:hover .nav-dropdown-icon { color: var(--fg); }
.nav-dropdown-item:hover { background: var(--bg-muted); color: var(--fg); }
.nav-dropdown-item.active { color: var(--fg); font-weight: 600; background: var(--bg-muted); }

/* ==================== 커뮤니티 게시판 ==================== */
.board-shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}
.board-head { margin-bottom: 24px; }
.board-head h1 { font-size: 28px; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
.board-head .board-sub { color: var(--fg-secondary); font-size: 15.5px; margin: 8px 0 0; line-height: 1.55; font-weight: 500; }

.board-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.board-toolbar-spacer { flex: 1; }
.board-count {
    font-size: 14.5px;
    color: var(--fg-secondary);
    font-weight: 600;
}
.board-count b { color: var(--fg); font-weight: 700; }

.board-table-wrap {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.board-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
.board-table thead th {
    background: #fbfaf5;
    border-bottom: 1px solid var(--border);
    text-align: center;
    padding: 14px 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: -0.005em;
}
.board-table tbody td {
    padding: 14px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--fg);
    text-align: center;
    vertical-align: middle;
}
.board-table tbody tr:last-child td { border-bottom: 0; }
.board-table tbody tr {
    cursor: pointer;
    transition: background 120ms;
}
.board-table tbody tr:hover { background: #fbfaf5; }
.board-table .col-id { width: 70px; color: var(--fg-secondary); font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 500; }
.board-table .col-title { text-align: left !important; font-weight: 600; font-size: 15.5px; }
.board-table .col-author { width: 120px; color: var(--fg-secondary); font-size: 14px; font-weight: 500; }
.board-table .col-date { width: 110px; color: var(--fg-secondary); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.board-table .col-views { width: 70px; color: var(--fg-secondary); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.board-table .board-pin { color: var(--accent, #c8362c); font-size: 13px; font-weight: 700; }
.board-title-link { color: var(--fg); }
.board-table tbody tr:hover .board-title-link { color: var(--accent, #c8362c); }

.board-empty {
    padding: 80px 24px;
    text-align: center;
    color: var(--fg-secondary);
    font-size: 16px;
    font-weight: 500;
}

.board-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--fg-secondary);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}
.page-btn:hover { background: var(--bg-muted); color: var(--fg); }
.page-btn.active {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
    font-weight: 700;
}

/* 상세 */
.board-detail {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 36px;
}
.board-detail-head {
    border-bottom: 1px solid var(--border);
    padding-bottom: 18px;
    margin-bottom: 24px;
}
.board-detail-head h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.015em;
    word-break: keep-all;
}
.board-detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    color: var(--fg-secondary);
    font-size: 14px;
    font-weight: 500;
}
.board-detail-meta .dot { opacity: 0.5; }
.board-detail-meta b { color: var(--fg); font-weight: 700; }
.board-detail-body {
    min-height: 240px;
    line-height: 1.75;
    font-size: 16px;
    font-weight: 500;
    color: var(--fg);
    word-break: break-word;
    white-space: pre-wrap;
}
.board-detail-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

/* 글쓰기 */
.board-write-form {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 32px;
}
.board-write-form .form-group { margin-bottom: 18px; }
.board-write-form label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fg-secondary);
    margin-bottom: 6px;
}
.board-write-form input[type=text],
.board-write-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--fg);
    outline: none;
    background: #fff;
    transition: border-color 120ms;
}
.board-write-form textarea {
    line-height: 1.7;
    resize: vertical;
    min-height: 280px;
}
.board-write-form input[type=text]:focus,
.board-write-form textarea:focus { border-color: var(--fg); }

.board-forbidden {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 64px 24px;
    text-align: center;
}
.board-forbidden h3 { margin: 0 0 8px; font-size: 18px; }
.board-forbidden p { color: var(--fg-tertiary); margin: 0 0 20px; line-height: 1.6; }

@media (max-width: 640px) {
    .board-shell { padding: 24px 8px 60px; }
    .board-table .col-author, .board-table .col-views { display: none; }
    .board-table thead th, .board-table tbody td { padding: 10px 8px; font-size: 13px; }
    .board-detail { padding: 22px 20px; }
}

.header-auth-btn {
    background: var(--fg);
    color: var(--bg);
    border: 0;
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: -0.005em;
    white-space: nowrap;
}

.header-auth-btn:hover { opacity: 0.85; }

.user-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--fg-secondary);
    font-size: 12.5px;
    font-weight: 500;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    margin-left: 14px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
    white-space: nowrap;
}

.user-menu .user-display {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--fg);
    font-weight: 700;
    padding: 6px 8px;
    font-size: 13px;
}

.user-menu .user-menu-link,
.user-menu .user-menu-btn {
    background: transparent;
    color: var(--fg-tertiary);
    border: 0;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.user-menu #profile-link .profile-link-icon { display: none; }
.user-menu #profile-link .profile-link-icon svg { width: 16px; height: 16px; display: block; }

.user-menu .user-menu-link:hover,
.user-menu .user-menu-btn:hover {
    background: var(--bg-muted);
    color: var(--fg);
}

/* 인증 상태별 헤더 가시성 — body 의 is-anon / is-admin 으로 일괄 제어 (FOUC 방지) */
body.is-anon #user-menu { display: none; }
body:not(.is-anon) #open-login-btn { display: none; }
body.is-anon #open-login-btn { display: inline-flex; }
/* admin-only 메뉴 — 비admin/비로그인 시 강제 숨김.
   secondary nav 의 .nav-link CSS 가 specificity 가 더 높아 일반 규칙으로는 못 덮음. */
[data-admin-only] { display: none !important; }
body.is-admin [data-admin-only] { display: inline-flex !important; }
#admin-link { display: none !important; }
body.is-admin #admin-link { display: inline-flex !important; }

/* ------------------------------------------------------------------ Layout */
.dashboard {
    max-width: var(--container);
    margin: 0 auto;
    padding: 56px 24px 96px;
}

.content-section { animation: fadeIn 0.32s var(--ease); }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 0;
    border-bottom: 0;
}

.section-header h2 {
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -0.024em;
    color: var(--fg);
    font-weight: 600;
}

.title-group h2 { margin: 0; }
.title-group .subtitle,
.subtitle {
    margin-top: 6px;
    color: var(--fg-tertiary);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: -0.005em;
}

.controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ------------------------------------------------------------------ Inputs */
.search-box input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="search"],
textarea,
select {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--fg);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    outline: none;
    transition: var(--transition);
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

textarea {
    height: auto;
    min-height: 84px;
    padding: 10px 12px;
    line-height: 1.55;
    resize: vertical;
}

input::placeholder,
textarea::placeholder { color: var(--fg-quaternary); }

input:hover,
textarea:hover,
select:hover { border-color: rgba(20, 14, 8, 0.28); }

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-box { position: relative; }
.search-box input {
    width: 280px;
    padding-left: 34px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
    background-repeat: no-repeat;
    background-position: 12px center;
}

/* ------------------------------------------------------------------ Buttons */
.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    box-shadow: none;
    white-space: nowrap;
}

.primary-btn {
    background: var(--fg);
    color: var(--bg);
    box-shadow: 0 1px 2px rgba(20,14,8,0.08);
}

.primary-btn:hover {
    background: #1f1d1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20,14,8,0.12);
}
.primary-btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(20,14,8,0.08); }

.primary-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: 0 1px 2px rgba(20,14,8,0.04); }

.secondary-btn {
    background: var(--bg);
    color: var(--fg);
    border-color: var(--border-strong);
}

.secondary-btn:hover {
    background: var(--bg-muted);
    border-color: rgba(20, 14, 8, 0.22);
}

.ghost-btn {
    background: transparent;
    color: var(--fg-secondary);
}

.ghost-btn:hover {
    background: var(--bg-muted);
    color: var(--fg);
}

.danger-btn {
    background: var(--bg);
    color: var(--danger);
    border-color: rgba(201, 42, 42, 0.28);
}

.danger-btn:hover {
    background: var(--danger-soft);
    border-color: rgba(201, 42, 42, 0.4);
}

/* ------------------------------------------------------------------ Tables */
.table-wrapper {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background: transparent;
    padding: 12px 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--fg-tertiary);
    text-transform: none;
    letter-spacing: -0.005em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--fg);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: var(--bg-subtle); }

.data-table td strong {
    color: var(--fg);
    font-weight: 600;
}

.action-btns {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.edit-btn,
.delete-btn {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: var(--radius-xs);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    background: transparent;
    color: var(--fg-secondary);
}

.edit-btn:hover {
    background: var(--bg-muted);
    color: var(--fg);
}

.delete-btn {
    color: var(--danger);
}

.delete-btn:hover { background: var(--danger-soft); }

.empty-state {
    padding: 80px 24px;
    text-align: center;
    color: var(--fg-tertiary);
    font-size: 14px;
    background: var(--bg-subtle);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    line-height: 1.7;
}
.empty-state::before {
    content: '';
    display: block;
    width: 36px;
    height: 36px;
    margin: 0 auto 16px;
    border: 1.5px solid var(--accent-soft);
    border-top-color: var(--accent);
    border-radius: 50%;
    opacity: 0.4;
}
.empty-state p { margin: 0; }
.empty-state p + p { margin-top: 6px; font-size: 13px; opacity: 0.85; }

/* ------------------------------------------------------------------ Cards */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
}

.card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card .card-subtitle {
    color: var(--fg-tertiary);
    font-size: 13px;
    margin-bottom: 20px;
}

/* KPI cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.kpi-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 22px;
}

.kpi-card .kpi-label {
    font-size: 12px;
    color: var(--fg-tertiary);
    margin-bottom: 8px;
    font-weight: 500;
}

.kpi-card .kpi-value {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.022em;
    color: var(--fg);
    line-height: 1.1;
}

.kpi-card .kpi-delta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--fg-tertiary);
}

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

/* ------------------------------------------------------------------ Status pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg-secondary);
}

.pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fg-quaternary);
}

.pill.active::before { background: var(--success); }
.pill.suspended::before { background: var(--danger); }
.pill.admin::before { background: var(--accent); }

/* ------------------------------------------------------------------ Modal
   통일 시스템 — 사용 패턴:
     <div class="modal-backdrop hidden">
       <div class="modal-panel">
         <header class="modal-header"><h2>제목</h2><button class="close-btn">×</button></header>
         <div class="modal-body"> ... .modal-row 들 ... </div>
         <footer class="modal-footer"> 버튼들 </footer>
       </div>
     </div>
   .modal / .modal-content 는 레거시 alias (admin/index 호환).                  */
.modal-backdrop,
.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    overflow-y: auto;
}

.modal-backdrop.hidden,
.modal.hidden { display: none; }

.modal-panel,
.modal-content {
    box-sizing: border-box;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 48px);
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-overlay);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-panel.wide,
.modal-content.wide { max-width: 880px; }

.modal-panel.narrow,
.modal-content.narrow { max-width: 420px; }

.modal-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 28px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--fg);
    line-height: 1.3;
}

.modal-header .modal-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--fg-tertiary);
    line-height: 1.5;
    font-weight: 400;
}

.modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px 28px;
}

.modal-body > .modal-desc {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--fg-tertiary);
    line-height: 1.55;
}

.modal-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 28px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.modal-footer .modal-footer-spacer { margin-right: auto; }

/* .modal-row — 라벨 좌·컨트롤 우 가로 배치 (한국어 라벨이 절대 세로로 짜부라지지 않도록) */
.modal-row {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.modal-row:last-child { border-bottom: 0; }
.modal-row.align-start { align-items: start; }

.modal-row > .row-label,
.modal-row > label.row-label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-secondary);
    line-height: 1.4;
    word-break: keep-all;
}

.modal-row > .row-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.modal-row > .row-control.inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-row > .row-control input[type=text],
.modal-row > .row-control input[type=tel],
.modal-row > .row-control input[type=number],
.modal-row > .row-control input[type=date],
.modal-row > .row-control input[type=email],
.modal-row > .row-control input[type=password],
.modal-row > .row-control select,
.modal-row > .row-control textarea {
    width: 100%;
    box-sizing: border-box;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--fg);
    background: var(--bg);
    outline: none;
    transition: border-color 120ms;
}

.modal-row > .row-control textarea {
    height: auto;
    min-height: 84px;
    padding: 10px 12px;
    line-height: 1.55;
    resize: vertical;
}

.modal-row > .row-control input:focus,
.modal-row > .row-control select:focus,
.modal-row > .row-control textarea:focus {
    border-color: var(--fg);
}

.modal-row > .row-control .row-help {
    font-size: 12px;
    color: var(--fg-tertiary);
    line-height: 1.5;
}

@media (max-width: 640px) {
    .modal-backdrop, .modal { padding: 12px; }
    .modal-panel, .modal-content { max-height: calc(100vh - 24px); }
    .modal-header { padding: 18px 20px 12px; }
    .modal-body { padding: 16px 20px; }
    .modal-footer { padding: 12px 20px 14px; }
    .modal-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px 0;
    }
    .modal-row > .row-label { font-size: 12px; color: var(--fg-tertiary); }
}

.close-btn {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    color: var(--fg-tertiary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover { background: var(--bg-muted); color: var(--fg); }

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-secondary);
    letter-spacing: -0.005em;
}

.form-group input,
.form-group textarea,
.form-group select {
    background: var(--bg);
}

.form-help {
    margin-top: 6px;
    font-size: 12px;
    color: var(--fg-tertiary);
    line-height: 1.5;
}

.form-help.error { color: var(--danger); }
.form-help.success { color: var(--success); }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ------------------------------------------------------------------ Auth panel */
.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: max(24px, 6vh) 24px 24px;
    overflow-y: auto;
    background: rgba(10, 10, 10, 0.36);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auth-panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-overlay);
}

.auth-close-btn {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1300;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    color: var(--fg-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(20, 14, 8, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.auth-close-btn:hover { background: var(--bg-muted); color: var(--fg); }

.auth-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--fg);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.005em;
    margin-bottom: 24px;
}

.auth-brand span { color: var(--fg); }

.auth-brand strong {
    font-size: 11px;
    color: var(--fg-tertiary);
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-copy h1 {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 8px;
    letter-spacing: -0.022em;
}

.auth-copy p {
    color: var(--fg-secondary);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 24px;
}

.auth-form .primary-btn { width: 100%; height: 42px; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--fg-tertiary);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border);
}

.google-btn {
    width: 100%;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--fg);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.google-btn:hover { background: var(--bg-muted); }
.google-btn:disabled { opacity: 0.5; cursor: wait; }

.google-mark { width: 18px; height: 18px; flex: 0 0 auto; }

/* Pretty pill-style Google button (used in auth panel top) */
.google-btn-pill {
    height: 48px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    color: #1f1f1f;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.005em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.15s ease, border-color 0.15s ease;
}

.google-btn-pill:hover {
    background: #fafafa;
    border-color: rgba(0, 0, 0, 0.18);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.google-btn-pill:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.google-btn-pill .google-mark { width: 20px; height: 20px; }

/* Auth panel — tighter rhythm than the global form spacing */
.auth-form .form-group { margin-bottom: 12px; }
.auth-form .form-group label {
    margin-bottom: 6px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--fg);
}
.auth-form .form-group input,
.auth-form .form-group select {
    font-size: 15.5px;
    font-weight: 500;
    height: 44px;
    padding: 0 14px;
}
.auth-form .auth-divider { margin: 12px 0; }
.auth-form .signup-fields { margin-bottom: 0; }
.auth-form .availability-status { margin-top: 4px; min-height: 0; }
.auth-form .availability-status:empty { display: none; }
.auth-form .primary-btn { margin-top: 6px; height: 46px; font-size: 15.5px; font-weight: 700; }
.auth-form .auth-message { margin-top: 8px; min-height: 0; }
.auth-form .auth-message:empty { display: none; }

/* Availability indicator (email/nickname duplicate check) */
.availability-status {
    margin: 6px 0 0;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--fg-secondary);
    min-height: 1.2em;
}
.availability-status.checking { color: var(--fg-tertiary); }
.availability-status.success { color: var(--success); }
.availability-status.error { color: var(--danger); }

.auth-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    color: var(--fg-secondary);
    font-size: 14.5px;
    font-weight: 500;
}

.auth-switch button {
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 6px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.auth-switch button:hover { color: var(--accent-deep); }

.signup-fields { margin-bottom: 4px; }

.verify-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
}

.verify-row .secondary-btn {
    height: 38px;
    padding: 0 12px;
    white-space: nowrap;
}

.identity-status {
    margin-top: 6px;
    color: var(--fg-secondary);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
}

.identity-status.error { color: var(--danger); }
.identity-status.success { color: var(--success); }

.auth-message {
    min-height: 1.4em;
    margin-top: 10px;
    color: var(--fg-secondary);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.5;
}

.auth-message.error { color: var(--danger); }
.auth-message.success { color: var(--success); }

.auth-notice {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-muted);
}

.auth-notice p {
    margin: 0 0 12px;
    color: var(--fg);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
}

.auth-notice-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.auth-notice-actions button { height: 36px; }

/* ------------------------------------------------------------------ Tabs */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}

.tab {
    background: transparent;
    border: 0;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--fg-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: var(--transition);
    letter-spacing: -0.005em;
}

.tab:hover { color: var(--fg); }

.tab.active {
    color: var(--fg);
    border-bottom-color: var(--fg);
    font-weight: 600;
}

/* ------------------------------------------------------------------ Activity log */
.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

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

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

.activity-time {
    flex: 0 0 110px;
    font-size: 12px;
    color: var(--fg-tertiary);
    font-variant-numeric: tabular-nums;
    padding-top: 1px;
}

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

.activity-actor {
    font-size: 14px;
    font-weight: 500;
    color: var(--fg);
}

.activity-meta {
    margin-top: 2px;
    font-size: 13px;
    color: var(--fg-tertiary);
}

/* ------------------------------------------------------------------ Avatar */
.avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-muted);
    color: var(--fg-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.005em;
}

.avatar.lg { width: 72px; height: 72px; font-size: 22px; }

/* ------------------------------------------------------------------ Marketing iframe */
.marketing-frame-container {
    width: 100%;
    min-height: 1400px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg);
}

.marketing-frame {
    display: block;
    width: 100%;
    min-height: 1400px;
    border: 0;
}

/* ------------------------------------------------------------------ Profile / Admin layout */
.page-shell {
    max-width: var(--container);
    margin: 0 auto;
    padding: 56px 24px 96px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    line-height: 1.18;
    letter-spacing: -0.025em;
}

.page-header p {
    margin-top: 6px;
    color: var(--fg-tertiary);
    font-size: 15px;
}

.split-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 48px;
    align-items: start;
}

.side-nav {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.side-nav button,
.side-nav a {
    text-align: left;
    background: transparent;
    border: 0;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--fg-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: block;
    width: 100%;
}

.side-nav button:hover,
.side-nav a:hover { background: var(--bg-muted); color: var(--fg); }

.side-nav button.active,
.side-nav a.active {
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-weight: 700;
}

.section-stack > * + * { margin-top: 32px; }

.field-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.field-row:last-child { border-bottom: 0; }

.field-row .field-label {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--fg);
    padding-top: 10px;
    letter-spacing: -0.005em;
}

.field-row .field-control { display: flex; flex-direction: column; gap: 8px; }
.field-row .field-control input,
.field-row .field-control select {
    max-width: 420px;
    font-size: 15.5px;
    font-weight: 500;
    padding: 10px 12px;
}

.field-row .field-meta {
    font-size: 15px;
    color: var(--fg);
    font-weight: 500;
    padding-top: 10px;
}

/* ------------------------------------------------------------------ Toggle */
.toggle {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 auto;
    display: inline-block;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle .slider {
    position: absolute;
    inset: 0;
    background: var(--bg-muted);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    transition: var(--transition);
    cursor: pointer;
}

.toggle .slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.toggle input:checked + .slider {
    background: var(--fg);
    border-color: var(--fg);
}

.toggle input:checked + .slider::before { transform: translateX(16px); }

/* ------------------------------------------------------------------ Bar chart */
.spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 36px;
    margin-top: 12px;
}

.spark span {
    flex: 1;
    background: var(--fg);
    opacity: 0.85;
    border-radius: 2px;
    min-height: 3px;
}

.spark span:not(:last-child) { opacity: 0.18; }

/* ------------------------------------------------------------------ Mobile */
/* 데스크톱: 햄버거 / 드로어 / 백드롭 모두 숨김. body 안에 별도 렌더된 드로어는 안 보이게. */
.mobile-menu-toggle { display: none; }
.mobile-drawer-backdrop { display: none; }
.mobile-drawer { display: none !important; }
.mobile-drawer-head { display: none; }

@media (max-width: 860px) {
    .header-container {
        padding: 6px 0 6px 10px;
        padding-right: env(safe-area-inset-right, 0);
        gap: 4px;
        flex-wrap: nowrap;
        height: auto;
        min-height: 52px;
        align-items: center;
    }
    /* 모바일 헤더 순서: 로고(좌) → 로그인/사용자(중) → 햄버거(우 끝) */
    .header-container > h1 { order: 1; flex: 0 0 auto; display: flex; align-items: center; min-width: 0; }
    .brand-logo img { height: 36px; }
    #open-login-btn,
    #user-menu { order: 2; flex-shrink: 1; min-width: 0; margin-left: auto; }
    .mobile-menu-toggle { order: 3; flex-shrink: 0; margin-left: 0; margin-right: 0; padding-right: 0; }

    /* 모바일: 닉네임 + 내정보 만 노출. 관리자/로그아웃은 드로어에 */
    .app-header #user-menu #admin-link,
    .app-header #user-menu #logout-btn { display: none !important; }
    /* user-menu 좌측 구분선/패딩만 제거. margin-left: auto 는 보존 — 햄버거가 우측 끝에 붙도록 */
    #user-menu {
        padding-left: 0;
        padding-right: 0;
        border-left: 0;
        gap: 2px;
        margin-right: 0;
    }
    #user-menu .user-display {
        font-size: 11.5px;
        max-width: 64px;
        padding: 3px 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    #user-menu #profile-link {
        font-size: 12px;
        font-weight: 600;
        padding: 6px 9px;
        background: #f1f3f5;
        color: var(--fg, #1a1a1a);
        border: 1px solid var(--border, #e1e4e8);
        border-radius: 7px;
        gap: 4px;
        line-height: 1;
    }
    #user-menu #profile-link .profile-link-icon { display: inline-flex; }
    #user-menu #profile-link .profile-link-icon svg { width: 14px; height: 14px; }

    .header-auth-btn { padding: 6px 12px; font-size: 12px; }

    /* 햄버거 버튼 (3 가로선) */
    .mobile-menu-toggle {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        width: 40px;
        height: 40px;
        padding: 0;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 9px;
        cursor: pointer;
    }
    .mobile-menu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--fg);
        border-radius: 2px;
        transition: transform 200ms, opacity 200ms;
    }
    .mobile-menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .mobile-menu-toggle.open span:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    /* 모바일에서 헤더의 nav-primary / nav-secondary 는 숨김 — 드로어 안에 복제본 사용 */
    .app-header .nav-primary,
    .app-header .nav-secondary { display: none !important; }

    /* === 우측 사이드 드로어 (homedepothours.com 스타일) === */
    /* body 직속에 렌더됨. 평소 transform 으로 우측 밖에 숨김. open 시 슬라이드 in */
    .mobile-drawer {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        height: 100vh;
        width: 320px;
        max-width: 86vw;
        background: #fff;
        z-index: 1100;
        padding: 0;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: -10px 0 30px rgba(20, 14, 8, 0.12);
    }
    .mobile-drawer.open { transform: translateX(0); }

    /* backdrop — 드로어 뒤 어두운 오버레이 (헤더 위까지 덮음, z-index 1090) */
    .mobile-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(20, 14, 8, 0.45);
        z-index: 1090;
        opacity: 0;
        pointer-events: none;
        transition: opacity 240ms ease;
    }
    body.mobile-drawer-open .mobile-drawer-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    body.mobile-drawer-open { overflow: hidden; }

    /* drawer 헤더 — 제목 + 닫기 X */
    .mobile-drawer-head {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border);
        flex: 0 0 auto;
    }
    .mobile-drawer-title {
        font-size: 15px;
        font-weight: 700;
        color: var(--fg);
        letter-spacing: -0.01em;
    }
    .mobile-drawer-close {
        background: transparent;
        border: 0;
        font-size: 26px;
        line-height: 1;
        color: var(--fg-secondary);
        cursor: pointer;
        padding: 0 4px;
    }
    .mobile-drawer-close:hover { color: var(--fg); }

    /* drawer 안 nav 컨테이너 — 세로 1열, 빈 공간 늘어나지 않게 */
    .mobile-drawer .nav-primary,
    .mobile-drawer .nav-secondary {
        display: flex !important;
        flex-direction: column;
        flex: 0 0 auto !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        gap: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        white-space: normal;
        background: transparent;
    }

    /* 주 기능 (관리대장) — 큰 pill 풀너비 */
    .mobile-drawer .nav-primary {
        padding: 12px 16px;
        gap: 6px;
        border-bottom: 1px solid var(--border);
    }
    .mobile-drawer .nav-pill {
        width: 100%;
        min-width: 0;
        height: auto;
        padding: 14px 16px;
        border-radius: 10px;
        justify-content: flex-start;
        font-size: 14.5px;
    }

    /* drawer 안 양식 선택 슬롯 — accordion 형태 */
    .mobile-drawer .nav-pill-dropdown {
        display: block !important;
        width: 100%;
        position: static;
    }
    .mobile-drawer .nav-pill-dropdown::after {
        display: none !important;   /* desktop bridge 비활성 */
    }
    .mobile-drawer .nav-pill-slot {
        width: 100%;
        justify-content: space-between !important;
        padding: 14px 16px !important;
        gap: 8px !important;
    }
    .mobile-drawer .nav-pill-slot .nav-pill-prefix {
        font-size: 11px;
        padding: 3px 8px;
    }
    .mobile-drawer .nav-pill-slot .nav-pill-caret {
        margin-left: auto;
        font-size: 14px;
        padding: 2px 8px;
    }
    .mobile-drawer .nav-pill-dropdown .nav-dropdown-menu {
        position: static !important;
        display: none !important;
        background: var(--bg-muted) !important;
        margin: 4px 0 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        border-radius: 8px;
        overflow: hidden;
    }
    .mobile-drawer .nav-pill-dropdown.open > .nav-dropdown-menu {
        display: block !important;
    }
    .mobile-drawer .nav-pill-dropdown .nav-dropdown-item {
        padding: 13px 20px 13px 36px;
        background: transparent !important;
        border-bottom: 1px solid var(--border);
        border-radius: 0 !important;
        font-size: 14px;
        color: var(--fg-secondary);
    }
    .mobile-drawer .nav-pill-dropdown .nav-dropdown-item:last-child {
        border-bottom: 0;
    }
    .mobile-drawer .nav-pill-dropdown .nav-dropdown-item.active {
        color: var(--accent);
        font-weight: 700;
        background: rgba(200, 54, 44, 0.06) !important;
    }

    /* 보조 기능 — 행 단위 list */
    .mobile-drawer .nav-secondary > .nav-link,
    .mobile-drawer .nav-secondary > .nav-dropdown > .nav-static {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 14px 20px;
        border: 0;
        border-radius: 0;
        border-bottom: 1px solid var(--border);
        background: #fff;
        font-size: 14px;
    }
    .mobile-drawer .nav-secondary .nav-icon {
        width: 22px; height: 22px;
        flex-shrink: 0;
    }
    .mobile-drawer .nav-secondary .nav-icon svg { width: 22px; height: 22px; }
    .mobile-drawer .nav-secondary .nav-label {
        text-align: left;
        font-size: 14px;
        font-weight: 500;
    }
    .mobile-drawer .nav-secondary .nav-link-multi .nav-label { font-size: 13.5px; line-height: 1.3; }

    /* 커뮤니티 dropdown — 아코디언. 클릭 시 하위 메뉴 펼침 */
    .mobile-drawer .nav-dropdown {
        display: block !important;
        width: 100%;
        position: static;
    }
    .mobile-drawer .nav-dropdown::after { display: none !important; }   /* hover bridge 제거 */
    .mobile-drawer .nav-dropdown > .nav-static {
        cursor: pointer !important;
        position: relative;
    }
    .mobile-drawer .nav-dropdown > .nav-static::after {
        content: "▾";
        margin-left: auto;
        font-size: 11px;
        color: var(--fg-tertiary);
        transition: transform 200ms;
    }
    .mobile-drawer .nav-dropdown.expanded > .nav-static::after {
        transform: rotate(180deg);
    }
    .mobile-drawer .nav-dropdown-menu {
        display: none !important;
        position: static !important;
        transform: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: var(--bg-muted) !important;
        border: 0 !important;
        box-shadow: none !important;
        max-height: none;
    }
    .mobile-drawer .nav-dropdown.expanded > .nav-dropdown-menu {
        display: block !important;
    }
    .mobile-drawer .nav-dropdown-item {
        display: flex !important;
        align-items: center;
        gap: 12px;
        padding: 13px 20px 13px 44px;
        background: transparent !important;
        border-bottom: 1px solid var(--border);
        border-radius: 0 !important;
        font-size: 13.5px;
        color: var(--fg-secondary);
    }
    .mobile-drawer .nav-dropdown-item:last-child { border-bottom: 0; }
    .mobile-drawer .nav-dropdown-item .nav-dropdown-icon {
        width: 18px; height: 18px;
    }

    /* 드로어 계정 섹션 (모바일 전용) — 닉네임 + 내정보/관리자/로그아웃 또는 로그인 */
    .mobile-drawer-account {
        margin-top: auto;   /* 드로어 하단으로 밀어냄 */
        padding: 12px 16px 24px;
        border-top: 1px solid var(--border);
        background: #fbfaf5;
    }
    .mobile-drawer-account-name {
        font-size: 13px;
        font-weight: 600;
        color: var(--fg);
        padding: 6px 4px 12px;
    }
    .mobile-drawer-account-link {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        background: transparent;
        border: 0;
        padding: 12px 8px;
        font-size: 14px;
        color: var(--fg-secondary);
        cursor: pointer;
        text-decoration: none;
        font-family: inherit;
        text-align: left;
        border-radius: 8px;
    }
    .mobile-drawer-account-link:hover { background: rgba(20,14,8,0.04); color: var(--fg); }
    .mobile-drawer-account-link svg { width: 20px; height: 20px; flex-shrink: 0; }
    .mobile-drawer-account-link .mobile-drawer-icon {
        width: 20px; height: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        flex-shrink: 0;
    }

    /* 익명/admin 가시성 — body 클래스 따라 */
    body.is-anon .mobile-drawer [data-anon-hide] { display: none !important; }
    body:not(.is-anon) .mobile-drawer [data-anon-show] { display: none !important; }
    body:not(.is-admin) .mobile-drawer [data-admin-only] { display: none !important; }

    .dashboard, .page-shell { padding: 32px 10px 64px; }

    .section-header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .controls { width: 100%; flex-wrap: wrap; }
    .search-box, .search-box input { width: 100%; }
    .controls .primary-btn { width: 100%; }

    .split-layout { grid-template-columns: 1fr; gap: 16px; }
    .side-nav { position: static; flex-direction: row; gap: 6px; overflow-x: auto; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
    .side-nav button { white-space: nowrap; }
    .side-nav button.active { background: var(--bg-muted); }

    .field-row { grid-template-columns: 1fr; gap: 8px; padding: 14px 0; }
    .field-row .field-label { padding-top: 0; font-size: 14.5px; color: var(--fg); font-weight: 700; }
    .field-row .field-meta { padding-top: 0; font-size: 15px; }
    .field-row .field-control input,
    .field-row .field-control select { max-width: 100%; font-size: 16px; }

    .table-wrapper { border-radius: var(--radius-md); border: 1px solid var(--border); }
    .data-table thead { display: none; }
    .data-table tr { display: block; padding: 14px 16px; border-bottom: 1px solid var(--border); }
    .data-table tr:last-child { border-bottom: 0; }
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 6px 0;
        border-bottom: 0;
        font-size: 14px;
    }
    .data-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--fg-tertiary);
        font-size: 12px;
        font-weight: 500;
    }
    .data-table td.action-btns { justify-content: flex-end; padding-top: 10px; }
    .data-table td.action-btns::before { content: ""; }

    .auth-panel { padding: 28px 22px; }

    .marketing-frame-container { min-height: 1500px; margin: 0 -16px; border-left: 0; border-right: 0; border-radius: 0; }
    .marketing-frame { min-height: 1500px; }
}

/* 아주 작은 화면 (<420px) — 닉네임 숨겨서 로고+내정보+햄버거가 한 줄에 들어가도록 */
@media (max-width: 420px) {
    .header-container { padding: 5px 0 5px 8px; gap: 5px; }
    .brand-logo img { height: 32px; }
    #user-menu .user-display { display: none; }
    #user-menu #profile-link { padding: 5px 8px; font-size: 11.5px; }
    .mobile-menu-toggle { width: 38px; height: 38px; }
    .mobile-menu-toggle span { width: 19px; }
}

/* ------------------------------------------------------------------ Ledger: 다른 그룹 picker
   기본 그룹은 항상 표시. 나머지 그룹은 이 picker 안에 모음 → 클릭으로 펼침 → chip 토글로 표시 그룹 선택. */
.extra-groups {
    position: sticky;
    top: var(--header-h);
    z-index: 30;
    background: #fff;
    border: 1px solid rgba(20, 14, 8, 0.09);
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(20, 14, 8, 0.04);
}

.extra-groups.open {
    box-shadow: 0 6px 18px rgba(20, 14, 8, 0.08);
}

.extra-groups .extra-head {
    display: flex;
    align-items: stretch;
    gap: 6px;
    padding: 0 14px 0 0;
}

.extra-groups .extra-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border: 0;
    background: transparent;
    cursor: pointer;
    user-select: none;
    font-family: inherit;
    text-align: left;
    transition: background 160ms;
    color: inherit;
    min-width: 0;
}

.extra-groups .extra-toggle:hover { background: #fbfaf5; }

.extra-groups .extra-toggle h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #2a2520;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.extra-groups .extra-toggle h4 .extra-count {
    font-size: 13.5px;
    font-weight: 600;
    color: #c8362c;
}

.extra-groups .extra-toggle h4 .extra-count-sub {
    font-size: 12px;
    font-weight: 500;
    color: #8a847e;
}

.extra-groups .extra-arrow {
    font-size: 10px;
    color: #8a847e;
    width: 12px;
    text-align: center;
    transition: transform 200ms;
    flex-shrink: 0;
}

.extra-groups.open .extra-arrow { transform: rotate(90deg); color: #c8362c; }

.extra-groups .extra-toggle .count-pill { display: none; }

/* 주요 메뉴 (관리대장) 표 — 모든 항목 가운데 정렬 (페이지 inline CSS 가 left 로 잡혀있어서 !important) */
.ledger-tbl thead th,
.ledger-tbl tbody td {
    text-align: center !important;
}
.ledger-tbl tbody td input,
.ledger-tbl tbody td select,
.ledger-tbl tbody td textarea {
    text-align: center !important;
}
.ledger-tbl .col-no,
.ledger-tbl .col-check,
.ledger-tbl .col-action { text-align: center !important; }

/* read-only 셀 표시 — 인라인 편집 비활성화 후 */
.ledger-tbl tbody td .cell-text {
    display: inline-block;
    font-size: 13px;
    color: var(--fg);
    line-height: 1.4;
    word-break: break-word;
}
.ledger-tbl tbody td .cell-multiline {
    white-space: pre-wrap;
    text-align: left !important;
    max-width: 320px;
    font-size: 12.5px;
    color: var(--fg-secondary);
}
.ledger-tbl tbody td .cell-empty {
    color: #c4bfb8;
    font-size: 13px;
}
.ledger-tbl tbody td .level-pill {
    padding: 3px 10px;
    background: rgba(200, 54, 44, 0.06);
    color: #8a2620;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
}

/* 행 액션 버튼 — 아이콘 + 텍스트 */
.ledger-tbl .col-action { width: 130px !important; white-space: nowrap; }
.row-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px !important;
    font-size: 12px;
    font-weight: 500;
}
.row-action-btn .ico { font-size: 13px; line-height: 1; }
.row-action-btn .lbl { font-size: 11.5px; }
.row-action-btn.danger:hover { color: #c8362c; background: rgba(200, 54, 44, 0.06); }

/* 모달 안 read-only span (담당자 직함 등) */
.modal-row .row-static {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 12px;
    color: var(--fg-secondary);
    font-size: 13.5px;
    font-weight: 500;
}

/* ==================== 필드 관리 (사용자 정의 필드) ==================== */
.field-mgr-list {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 6px;
    margin-bottom: 10px;
}
.field-mgr-row {
    display: grid;
    grid-template-columns: 1fr 80px 60px;
    gap: 10px;
    align-items: center;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.field-mgr-row:last-child { border-bottom: 0; }
.field-mgr-row.built-in { background: #fbfaf5; color: var(--fg-secondary); }
.field-mgr-row .field-mgr-name { font-weight: 500; color: var(--fg); }
.field-mgr-row .field-mgr-type { font-size: 11.5px; color: var(--fg-tertiary); text-align: center; }
.field-mgr-row .field-mgr-tag {
    font-size: 11px;
    color: var(--fg-tertiary);
    padding: 2px 8px;
    background: var(--bg-muted);
    border-radius: 99px;
    text-align: center;
    justify-self: end;
}
.field-mgr-row .field-mgr-del {
    border: 0;
    background: transparent;
    color: #c8362c;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    justify-self: end;
    padding: 4px 8px;
    border-radius: 6px;
}
.field-mgr-row .field-mgr-del:hover { background: rgba(200, 54, 44, 0.08); }
.field-mgr-add {
    display: grid;
    grid-template-columns: 1fr 110px auto;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
}
.field-mgr-add input,
.field-mgr-add select {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}
.field-mgr-add input:focus,
.field-mgr-add select:focus { outline: 0; border-color: var(--fg); }
.field-mgr-help {
    font-size: 12px;
    color: var(--fg-tertiary);
    margin: 8px 0 0;
}

.extra-groups .extra-side-btn {
    align-self: center;
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 12px;
    padding: 7px 12px;
}

/* 조직도에서 현장 만들기 — picker 모달 row */
.org-pick-list { display: flex; flex-direction: column; gap: 6px; }
.org-pick-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(20, 14, 8, 0.09);
    border-radius: 8px;
    background: #fff;
    color: #0e0d0c;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 160ms;
}
.org-pick-item:hover:not([disabled]) { background: #fbf7ef; border-color: rgba(200, 54, 44, 0.4); }
.org-pick-item[disabled] { cursor: not-allowed; background: #fbfaf5; opacity: 0.7; }
.org-pick-item .org-pick-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.org-pick-item .org-pick-name { font-size: 14px; font-weight: 600; color: #0e0d0c; }
.org-pick-item .org-pick-preview { font-size: 11.5px; color: #8a847e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-pick-item .org-pick-count {
    flex-shrink: 0;
    padding: 3px 9px;
    background: #fbf7ef;
    border: 1px solid rgba(20, 14, 8, 0.09);
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    color: #4f4943;
    font-variant-numeric: tabular-nums;
}
.org-pick-item .org-pick-badge {
    margin-left: auto;
    padding: 3px 9px;
    background: rgba(200, 54, 44, 0.08);
    color: #8a2620;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
}
.org-pick-item .org-pick-badge.dim { background: #f4efe7; color: #8a847e; }

/* 그룹 카드 헤더 — 제목 옆 갯수 inline */
.accordion-head h3 .head-count {
    margin-left: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #8a847e;
    letter-spacing: 0;
}

/* '내 직책' 라벨 (조직도 카드 헤더) */
.accordion-head .role-label {
    font-size: 11.5px;
    font-weight: 500;
    color: #8a847e;
    letter-spacing: -0.005em;
    margin-left: 8px;
    margin-right: -2px;
}

/* 그룹 owner_role select — 카드 헤더에 inline */
.accordion-head .owner-role-select {
    flex: 0 0 auto;
    width: auto;
    height: 24px;
    line-height: 1;
    padding: 0 20px 0 8px;
    border: 1px solid rgba(20, 14, 8, 0.16);
    border-radius: 99px;
    background: #fff;
    color: #4f4943;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'><path fill='%238a847e' d='M4 5L0 0h8z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 7px center;
    transition: all 160ms;
}
.accordion-head .owner-role-select:hover { background-color: #fbf7ef; color: #0e0d0c; }
.accordion-head .owner-role-select:focus { outline: 0; border-color: #c8362c; }

/* 수수료 입력 그리드 — 본부장/팀장/팀원 라벨+input 세로 정렬 */
.comm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
}
.comm-grid.role-lead { grid-template-columns: repeat(2, 1fr); }
.comm-grid.role-lead [data-role-cell="head"] { display: none; }
.comm-cell { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.comm-cell .comm-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #4f4943;
    margin: 0;
}
.comm-cell input {
    width: 100%;
    box-sizing: border-box;
    height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(20, 14, 8, 0.16);
    border-radius: 7px;
    font-size: 13.5px;
    font-family: inherit;
    color: #0e0d0c;
    outline: none;
}
.comm-cell input:focus { border-color: #0e0d0c; }

/* ------------------------------------------------------------------ Ledger 토글 스위치
   동그란 thumb 좌우 슬라이드. on/off 색상 variant 가능 (.pay-toggle 등). */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    line-height: 0;
}
.toggle-switch .toggle-track {
    display: inline-block;
    width: 36px;
    height: 20px;
    background: #cfcabf;
    border-radius: 99px;
    position: relative;
    transition: background 200ms;
    flex-shrink: 0;
}
.toggle-switch .toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 200ms;
}
.toggle-switch.on .toggle-thumb { transform: translateX(16px); }
.toggle-switch .toggle-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}
.toggle-switch:hover .toggle-track { filter: brightness(0.95); }

/* 켜짐 기본 색상 — 연노랑 (관리 토글 / 수수료 토글 공통) */
.toggle-switch.on .toggle-track { background: #fbc400; }
.toggle-switch.on .toggle-label { color: #8a6500; }
.toggle-switch.off .toggle-label { color: #8a847e; }
.toggle-switch.pay-toggle.off .toggle-track { background: #d7d2c8; }

.extra-groups .extra-picker {
    display: none;
    padding: 4px 14px 14px;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid rgba(20, 14, 8, 0.06);
}

.extra-groups.open .extra-picker { display: flex; padding-top: 12px; }

.group-chip {
    padding: 7px 14px;
    border: 1px solid rgba(20, 14, 8, 0.16);
    background: #fff;
    color: #4f4943;
    border-radius: 99px;
    cursor: pointer;
    font-size: 12.5px;
    font-family: inherit;
    font-weight: 500;
    transition: all 160ms;
}

.group-chip:hover { background: #fbf7ef; color: #0e0d0c; }
.group-chip.active { background: #c8362c; color: #fff; border-color: #c8362c; }
.group-chip.active:hover { background: #8a2620; border-color: #8a2620; }
.group-chip.main { cursor: default; opacity: 1; }
.group-chip.main:hover { background: #c8362c; border-color: #c8362c; }
.group-chip[disabled] { cursor: default; }

/* 메인그룹 체크박스 — 그룹 카드 헤더에 라디오처럼 단일 선택 */
.accordion-head .main-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid rgba(20, 14, 8, 0.16);
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 500;
    color: #8a847e;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: all 160ms;
}

.accordion-head .main-checkbox:hover { background: #fbf7ef; color: #0e0d0c; }

.accordion-head .main-checkbox input {
    width: 13px;
    height: 13px;
    margin: 0;
    accent-color: #c8362c;
    cursor: pointer;
}

.accordion-head .main-checkbox:has(input:checked) {
    background: rgba(200, 54, 44, 0.08);
    color: #8a2620;
    border-color: rgba(200, 54, 44, 0.3);
    font-weight: 700;
}

/* ------------------------------------------------------------ Excel import preview */
.import-preview-modal .modal-panel { width: min(900px, 96vw); }
.import-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 8px 12px; background: #fbf7ef;
    border: 1px solid rgba(20, 14, 8, 0.06); border-radius: 8px;
    font-size: 12.5px; color: #4f4943; margin-bottom: 14px; }
.import-meta b { color: #0e0d0c; font-weight: 600; }
.import-meta .im-skipped { color: #8a2620; font-weight: 600; }

.import-mapping { border: 1px solid rgba(20, 14, 8, 0.09); border-radius: 8px; overflow: hidden; }
.import-mapping .im-head, .import-mapping .im-row {
    display: grid; grid-template-columns: 1.2fr 1.4fr 1.4fr; gap: 12px;
    align-items: center; padding: 9px 14px; font-size: 13px;
}
.import-mapping .im-head { background: #fbf7ef; color: #4f4943;
    font-weight: 600; font-size: 12px; letter-spacing: 0.02em; border-bottom: 1px solid rgba(20, 14, 8, 0.09); }
.import-mapping .im-row + .im-row { border-top: 1px solid rgba(20, 14, 8, 0.05); }
.import-mapping .im-row:hover { background: #fbfaf5; }
.import-mapping .im-h { font-weight: 600; color: #0e0d0c; word-break: break-all; }
.import-mapping .im-s { color: #6e655c; font-size: 12.5px; word-break: break-all;
    overflow: hidden; text-overflow: ellipsis; }
.import-mapping select { width: 100%; height: 32px; padding: 0 10px;
    border: 1px solid rgba(20, 14, 8, 0.12); border-radius: 6px;
    background: #fff; font-family: inherit; font-size: 13px; color: #0e0d0c; outline: none; }
.import-mapping select:focus { border-color: #0e0d0c; }

.import-sample { margin-top: 14px; }
.import-sample summary { cursor: pointer; font-size: 12.5px; color: #4f4943;
    padding: 6px 4px; user-select: none; }
.import-sample summary:hover { color: #0e0d0c; }
.im-sample-wrap { overflow-x: auto; max-height: 240px; overflow-y: auto;
    border: 1px solid rgba(20, 14, 8, 0.09); border-radius: 8px; margin-top: 6px; }
.im-sample-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.im-sample-tbl th { background: #fbf7ef; padding: 6px 10px; text-align: left;
    font-weight: 600; color: #4f4943; border-bottom: 1px solid rgba(20, 14, 8, 0.09);
    white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.im-sample-tbl td { padding: 5px 10px; border-bottom: 1px solid rgba(20, 14, 8, 0.05);
    color: #2a2520; vertical-align: top; max-width: 220px; word-break: break-word; }
.im-sample-tbl tr:last-child td { border-bottom: 0; }

.im-progress { display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; margin-top: 14px;
    background: #fbf7ef; border: 1px solid rgba(20, 14, 8, 0.09); border-radius: 8px;
    font-size: 13px; color: #4f4943; font-weight: 500; }
.im-progress-text { flex: 0 1 auto; min-width: 0; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; }
.im-progress-bar { flex: 1; height: 6px; background: rgba(20, 14, 8, 0.08);
    border-radius: 99px; overflow: hidden; }
.im-progress-bar > span { display: block; height: 100%; width: 0%;
    background: linear-gradient(90deg, #c8362c, #8a2620);
    transition: width 200ms ease; }
.im-spinner { flex-shrink: 0; width: 16px; height: 16px;
    border: 2px solid rgba(20, 14, 8, 0.12); border-top-color: #c8362c;
    border-radius: 50%; animation: imSpin 0.8s linear infinite; }
@keyframes imSpin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Accordion collapse */
.accordion-card:not(.open) .accordion-body { display: none; }
.accordion-card:not(.open) { box-shadow: 0 1px 3px rgba(20, 14, 8, 0.04); }
.accordion-card:not(.open) .accordion-head { background: #fff; }

/* ------------------------------------------------------------ Payment history (그룹별) */
.history-batch { border: 1px solid rgba(20, 14, 8, 0.09); border-radius: 10px;
    overflow: hidden; margin-bottom: 12px; background: #fff; }
.history-batch.open { box-shadow: 0 4px 14px rgba(20, 14, 8, 0.06); }
.history-batch-head { width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: #fbf7ef; border: 0; cursor: pointer;
    font-family: inherit; text-align: left; transition: background 120ms; }
.history-batch-head:hover { background: #f4efe7; }
.history-batch.open .history-batch-head { background: linear-gradient(180deg, #fbf7ef 0%, #fff 100%); border-bottom: 1px solid rgba(20, 14, 8, 0.09); }
.history-arrow { font-size: 11px; color: #8a847e; transition: transform 160ms; flex-shrink: 0; }
.history-batch.open .history-arrow { transform: rotate(90deg); color: #c8362c; }
.history-date { font-weight: 700; color: #0e0d0c; font-size: 14px; font-variant-numeric: tabular-nums; }
.history-meta { color: #6e655c; font-size: 12.5px; }
.history-totals { margin-left: auto; font-size: 12.5px; font-variant-numeric: tabular-nums;
    display: flex; gap: 12px; align-items: baseline; }
.history-totals b { font-size: 14px; font-weight: 700; }
.history-batch-body { display: none; padding: 14px 16px; background: #fff; }
.history-batch.open .history-batch-body { display: block; }
.history-batch-body .settle-emp { padding: 10px 0; border-bottom: 1px dashed rgba(20, 14, 8, 0.06); }
.history-batch-body .settle-emp:last-child { border-bottom: 0; }

/* ------------------------------------------------------------ Sweep toast */
.sweep-toast {
    position: fixed; top: 80px; right: 24px;
    background: #0e0d0c; color: #fff;
    padding: 11px 16px; border-radius: 10px;
    font-size: 13px; font-weight: 500;
    box-shadow: 0 8px 24px rgba(20, 14, 8, 0.18);
    opacity: 0; transform: translateY(-6px);
    transition: opacity 200ms ease, transform 200ms ease;
    z-index: 200; pointer-events: none;
}
.sweep-toast.show { opacity: 1; transform: translateY(0); }

/* ------------------------------------------------------------ Mobile fixed bottom nav */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 860px) {
    body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        width: 100vw;
        max-width: 100vw;
        box-sizing: border-box;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-height: 64px;
        padding: 7px 6px calc(7px + env(safe-area-inset-bottom, 0px));
        background: rgba(214, 208, 199, 0.96);  /* 본문(베이지/흰) 과 구분되는 짙은 회색 톤 */
        border-top: 1px solid rgba(20, 14, 8, 0.18);
        box-shadow: 0 -10px 28px rgba(20, 14, 8, 0.14);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .mobile-bottom-nav-item {
        min-width: 0;
        height: 52px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        border-radius: 10px;
        text-decoration: none;
        color: #6e655c;
        font-size: 10.5px;
        font-weight: 650;
        line-height: 1.1;
        letter-spacing: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-bottom-nav-icon {
        width: 23px;
        height: 23px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: currentColor;
    }

    .mobile-bottom-nav-icon svg {
        width: 22px;
        height: 22px;
        display: block;
    }

    .mobile-bottom-nav-label {
        width: 100%;
        overflow: hidden;
        text-align: center;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .mobile-bottom-nav-item.active,
    .mobile-bottom-nav-item:active {
        color: var(--accent, #c8362c);
        background: rgba(255, 255, 255, 0.55);
    }
    /* 고객관리대장 = bottom-nav 의 메인 — 빨강으로 강조 */
    .mobile-bottom-nav-item.main {
        color: var(--accent, #c8362c);
        font-weight: 800;
    }
    .mobile-bottom-nav-item.main.active {
        background: var(--accent, #c8362c);
        color: #fff;
    }

    .mobile-drawer {
        padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    }
}

/* ============================================================ Site footer
   사이트 전체 공통 footer — auth-shared.js 의 mountAppFooter() 가 inject. */
.app-footer {
    margin-top: 64px;
    padding: 32px 24px 40px;
    background: #0e0d0c;
    border-top: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    line-height: 1.65;
}
.app-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: start;
}
.app-footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.01em;
}
.app-footer-brand img {
    height: 22px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}
.app-footer-info {
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12.5px;
}
.app-footer-info span { white-space: nowrap; }
.app-footer-info span + span::before {
    content: "·";
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.25);
}
.app-footer-info a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}
.app-footer-info a:hover {
    color: rgba(255, 255, 255, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.35);
}
.app-footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 13px;
}
.app-footer-links a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: var(--transition);
}
.app-footer-links a:hover { color: var(--accent); }
.app-footer-bottom {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.35);
    font-size: 12px;
}
@media (max-width: 720px) {
    .app-footer-inner {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .app-footer-info span + span::before { display: none; }
    .app-footer-info span {
        display: block;
        margin-top: 2px;
        white-space: normal;
    }
}

/* ============================================================ Policy pages
   이용약관 / 개인정보처리방침 문서 페이지 스타일. */
.policy-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 56px 24px 40px;
    color: var(--fg);
}
.policy-head { margin-bottom: 32px; }
.policy-head h1 {
    margin: 0;
    font-size: 32px;
    letter-spacing: -0.03em;
    line-height: 1.2;
}
.policy-meta {
    margin: 8px 0 0;
    color: var(--fg-tertiary);
    font-size: 13px;
}
.policy-section {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.policy-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
.policy-section h2 {
    margin: 0 0 12px;
    font-size: 18px;
    letter-spacing: -0.01em;
}
.policy-section h3 {
    margin: 18px 0 6px;
    font-size: 14.5px;
    color: var(--fg-secondary);
    font-weight: 600;
}
.policy-section p,
.policy-section li {
    color: var(--fg-secondary);
    font-size: 14.5px;
    line-height: 1.75;
}
.policy-section p + p { margin-top: 10px; }
.policy-section ul,
.policy-section ol {
    margin: 8px 0 0;
    padding-left: 20px;
}
.policy-section li + li { margin-top: 4px; }
.policy-section li ul,
.policy-section li ol { margin-top: 6px; }
.policy-section b { color: var(--fg); font-weight: 600; }
.policy-section a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-soft);
}
.policy-section a:hover { border-bottom-color: var(--accent); }
.policy-callout {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--fg-secondary);
}
.policy-table-wrap {
    margin-top: 12px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.policy-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 13.5px;
}
.policy-table th,
.policy-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    color: var(--fg-secondary);
}
.policy-table th {
    background: var(--bg-subtle);
    font-weight: 600;
    color: var(--fg);
}
.policy-table tr:last-child td { border-bottom: 0; }
.policy-foot-note {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--fg-tertiary);
    font-size: 12.5px;
}
@media (max-width: 640px) {
    .policy-page { padding: 32px 18px 32px; }
    .policy-head h1 { font-size: 26px; }
    .policy-section { margin-top: 28px; padding-top: 22px; }
}

/* ============================================================ Signup agreements
   회원가입 / 소셜 추가정보 단계 하단 동의 체크박스. login 모드에서는 hidden 클래스로 숨김. */
.signup-agreements {
    margin-top: 6px;
    padding: 16px 0 6px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.agreement-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14.5px;
    color: var(--fg);
    line-height: 1.55;
}
.agreement-row input[type="checkbox"] {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin-top: 1px;
    accent-color: var(--accent);
    cursor: pointer;
}
.agreement-row label {
    flex: 1;
    cursor: pointer;
    color: inherit;
    margin: 0;
    font-weight: 500;
    letter-spacing: -0.005em;
}
.agreement-row .agreement-tag {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
    vertical-align: 1px;
}
.agreement-row .agreement-tag.req {
    background: var(--accent-soft);
    color: var(--accent-deep);
}
.agreement-row .agreement-tag.opt {
    background: var(--bg-muted);
    color: var(--fg-secondary);
}
.agreement-row a {
    color: var(--fg);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
    text-underline-offset: 3px;
}
.agreement-row a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.signup-agreements-all {
    margin-bottom: 4px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
    font-weight: 600;
    color: var(--fg);
}

/* ============================================================ Ledger mobile cards
   모바일에선 별도의 카드 DOM(.ledger-cards / .ledger-card) 으로 렌더.
   데스크탑은 기존 .ledger-tbl 그대로 유지 — 양쪽이 따로 살아서 가로 스크롤 발생 안 함. */
.ledger-cards {
    display: none;     /* 데스크탑 기본 숨김 — *.js 가 모바일에선 이쪽만 렌더 */
}
@media (max-width: 640px) {
    .tbl-wrap { overflow-x: visible; padding: 0; }
    .ledger-tbl { display: none !important; }
    .ledger-cards { display: block; padding: 4px 6px 2px; }
    .ledger-card {
        position: relative;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 10px;
        margin-bottom: 5px;
        box-shadow: 0 1px 2px rgba(20, 14, 8, 0.04);
        overflow: hidden;
    }
    .ledger-card.row-dead,
    .ledger-card.row-paid,
    .ledger-card.row-cancel {
        background: var(--bg-muted);
        opacity: 0.78;
    }
    .ledger-card-head {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 8px;
        padding: 8px 10px 8px 12px;
    }
    .ledger-card-check {
        margin: 0;
        width: 18px;
        height: 18px;
        accent-color: var(--accent);
        flex: 0 0 auto;
    }
    .ledger-card-summary {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }
    .ledger-card-title {
        font-size: 19px;
        font-weight: 700;
        color: var(--fg);
        letter-spacing: -0.01em;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .ledger-card-sub {
        display: flex;
        flex-direction: column;
        gap: 2px;
        font-size: 15px;
        color: var(--fg);
        line-height: 1.3;
    }
    .ledger-card-sub-item {
        display: flex;
        gap: 8px;
        align-items: baseline;
    }
    .ledger-card-sub-label {
        flex: 0 0 auto;
        min-width: 56px;
        color: var(--fg-tertiary);
        font-size: 13px;
        font-weight: 600;
        letter-spacing: -0.005em;
    }
    .ledger-card-sub-val {
        flex: 1;
        color: var(--fg);
        font-size: 15.5px;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .ledger-card-toggle {
        flex: 0 0 auto;
        min-width: 64px;
        height: 38px;
        padding: 0 12px;
        border: 1px solid var(--border-strong);
        border-radius: 10px;
        background: var(--bg);
        color: var(--fg);
        font-size: 14.5px;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
        transition: background 160ms, color 160ms, border-color 160ms;
        white-space: nowrap;
    }
    .ledger-card-toggle:hover {
        background: var(--bg-muted);
        border-color: var(--fg-secondary);
    }
    .ledger-card-toggle .toggle-label-close { display: none; }
    .ledger-card.expanded .ledger-card-toggle {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
    }
    .ledger-card.expanded .ledger-card-toggle .toggle-label-open { display: none; }
    .ledger-card.expanded .ledger-card-toggle .toggle-label-close { display: inline; }
    .ledger-card-body {
        display: none;
        padding: 2px 12px 10px;
        border-top: 1px solid var(--border);
        background: var(--bg-subtle);
    }
    .ledger-card.expanded .ledger-card-body { display: block; }
    .ledger-card-field {
        display: grid;
        grid-template-columns: 96px 1fr;
        gap: 10px;
        align-items: baseline;
        padding: 7px 0;
        border-bottom: 1px dashed var(--border);
        font-size: 18px;
        line-height: 1.35;
    }
    .ledger-card-field:last-of-type { border-bottom: 0; }
    .ledger-card-label {
        color: var(--fg-secondary);
        font-size: 16px;
        font-weight: 700;
        letter-spacing: -0.005em;
        padding-top: 1px;
    }
    .ledger-card-value {
        color: var(--fg);
        font-size: 18px;
        font-weight: 600;
        line-height: 1.35;
        word-break: break-word;
    }
    .ledger-card-value .cell-empty { color: var(--fg-quaternary); font-size: 17px; font-weight: 500; }
    .ledger-card-value .cell-text { font-size: 18px; font-weight: 600; line-height: 1.55; }
    .ledger-card-value .cell-multiline {
        white-space: pre-wrap;
        max-width: none;
        font-size: 17.5px;
        font-weight: 500;
    }
    .ledger-card-value .level-pill {
        padding: 4px 12px;
        font-size: 14px;
        font-weight: 700;
    }
    .ledger-card-value .level-pill {
        display: inline-block;
        padding: 2px 8px;
        font-size: 11.5px;
    }
    .ledger-card-actions {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--border);
        display: flex;
        gap: 8px;
        justify-content: flex-end;
    }
    .ledger-card-actions .row-action-btn {
        padding: 7px 14px !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        min-height: 36px;
    }
    .ledger-card-actions .row-action-btn .ico { font-size: 15px; }
    .ledger-card-actions .row-action-btn .lbl { display: inline !important; }
    .ledger-cards-empty {
        padding: 28px 16px;
        text-align: center;
        color: var(--fg-tertiary);
        font-size: 13px;
    }
    /* 그룹 액션 바 (+ 행 추가) 모바일 정렬 */
    .ledger-cards-toolbar {
        display: flex;
        justify-content: flex-end;
        padding: 6px 8px;
        border-bottom: 1px solid var(--border);
        background: var(--bg-subtle);
    }
    .ledger-cards-toolbar .tiny-btn {
        padding: 7px 12px !important;
        font-size: 13.5px !important;
        font-weight: 600 !important;
    }

    /* 그룹 헤더 — 모바일에선 제목 한 줄 + 액션 버튼 다음 줄에 wrap. 글자 세로로 깨지지 않게 */
    .accordion-head {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 12px 14px !important;
        align-items: center !important;
    }
    .accordion-head h3 {
        flex: 1 1 auto !important;
        font-size: 17px !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        min-width: 0;
    }
    .accordion-head h3 .head-count {
        font-size: 13.5px !important;
    }
    .accordion-head .main-checkbox {
        flex: 0 0 auto;
        font-size: 12.5px !important;
    }
    .accordion-head .role-label,
    .accordion-head .owner-role-select {
        font-size: 12.5px !important;
    }
    /* 액션 버튼 묶음 — 한 줄 가득 차지하면서 wrap, 각 버튼은 nowrap */
    .head-actions {
        flex: 1 0 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        margin-top: 4px;
    }
    .head-actions button,
    .head-actions .tiny-btn {
        flex: 0 1 auto;
        padding: 7px 10px !important;
        font-size: 12.5px !important;
        line-height: 1.3 !important;
        white-space: nowrap !important;
        min-width: 0;
        word-break: keep-all;
    }
}
