/* =========================================================================
 *  /exchange — 포인트 머니환전 페이지
 *  - 디자인 톤: 토스 / 카카오뱅크 / 뱅크샐러드 풍 (Navy #323c46 액센트)
 *  - 모든 셀렉터 .ex- 프리픽스
 *  - 폰트: Pretendard / Noto Sans KR
 *  - JS 의존 클래스(.ex-co, .ex-modal__list, .is-active 등) 보존
 * ========================================================================= */
.ex-wrap {
    --ex-primary:        #3182f6;
    --ex-primary-hover:  #1b64da;
    --ex-primary-soft:   #eff6ff;
    --ex-primary-ring:   rgba(49, 130, 246, .18);
    --ex-primary-fg:     #ffffff;

    --ex-bg:             #ffffff;
    --ex-page-bg:        #ffffff;
    --ex-card-bg:        #ffffff;
    --ex-soft-bg:        #f8fafc;     /* 보조 카드 / 패널 배경 */
    --ex-soft-bg-2:      #f1f5f9;     /* 더 진한 그레이 톤 */

    --ex-text:           #0f172a;
    --ex-text-sub:       #64748b;
    --ex-text-mute:      #94a3b8;
    --ex-border:         #e2e8f0;
    --ex-border-strong:  #cbd5e1;

    --ex-shadow:         0 2px 8px rgba(15, 23, 42, .04);
    --ex-shadow-lift:    0 4px 14px rgba(15, 23, 42, .07);

    --ex-danger:         #ef4444;
    --ex-success:        #10b981;
    --ex-warning:        #f59e0b;
    --ex-info:           #3b82f6;

    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0 72px;
    font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ex-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ----- 다크모드 ----- */
html.dark-mode .ex-wrap {
    --ex-bg:             #0f172a;
    --ex-page-bg:        #0f172a;
    --ex-card-bg:        #111827;
    --ex-soft-bg:        #1f2937;
    --ex-soft-bg-2:      #374151;

    --ex-text:           #f1f5f9;
    --ex-text-sub:       #94a3b8;
    --ex-text-mute:      #64748b;
    --ex-border:         #1f2937;
    --ex-border-strong:  #374151;

    --ex-shadow:         0 2px 8px rgba(0, 0, 0, .25);
    --ex-shadow-lift:    0 4px 14px rgba(0, 0, 0, .35);

    --ex-primary-soft:   rgba(49, 130, 246, .14);
    --ex-primary-ring:   rgba(49, 130, 246, .30);
}

/* ---------- 모달 stacking 안전망 ---------- */
.ex-form-card { overflow: visible; }
.ex-modal[hidden] { display: none !important; }

/* ---------- 관리자 행 ---------- */
.ex-admin-row {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 12px;
}
.ex-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ex-text-sub);
    background: var(--ex-soft-bg);
    border: 1px solid var(--ex-border);
    border-radius: 999px;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.ex-admin-link:hover {
    background: var(--ex-primary);
    color: var(--ex-primary-fg);
    border-color: var(--ex-primary);
    text-decoration: none;
}

/* ---------- 페이지 헤더 ---------- */
.ex-header { margin: 4px 4px 22px; }
.ex-page-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    color: var(--ex-text);
    line-height: 1.25;
}
.ex-page-sub {
    font-size: 13.5px;
    color: var(--ex-text-sub);
    margin: 0;
    line-height: 1.6;
}

/* ---------- 보유 포인트 헤로 카드 ---------- */
.ex-balance {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 12px;
    margin: 0 0 24px;
}
.ex-balance-main {
    background: var(--ex-soft-bg);
    border: 1px solid var(--ex-border);
    border-radius: 20px;
    padding: 24px 24px 22px;
    position: relative;
    overflow: hidden;
}
.ex-balance-main::before {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, var(--ex-primary-soft) 0%, transparent 70%);
    pointer-events: none;
}
.ex-balance-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ex-text-sub);
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}
.ex-balance-value {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--ex-text);
    line-height: 1.1;
    margin-bottom: 10px;
}
.ex-balance-value small {
    font-size: 16px;
    font-weight: 700;
    color: var(--ex-primary);
    margin-left: 4px;
}
html.dark-mode .ex-balance-value small { color: #c7d3e1; }
.ex-balance-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--ex-text-sub);
    background: var(--ex-card-bg);
    border: 1px solid var(--ex-border);
    padding: 5px 10px;
    border-radius: 999px;
}
.ex-balance-meta i { color: var(--ex-primary); font-size: 11px; }
html.dark-mode .ex-balance-meta i { color: #c7d3e1; }

.ex-balance-side {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
}
.ex-mini-card {
    background: var(--ex-card-bg);
    border: 1px solid var(--ex-border);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ex-mini-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ex-text-sub);
    margin-bottom: 4px;
}
.ex-mini-value {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ex-text);
    line-height: 1.2;
}
.ex-mini-value small {
    font-size: 11px;
    color: var(--ex-text-sub);
    font-weight: 700;
    margin-left: 2px;
}

/* ---------- 신청 카드 내 보유 포인트 ---------- */
.ex-form-balance {
    background: var(--ex-soft-bg);
    border: 1px solid var(--ex-border);
    border-radius: 16px;
    padding: 18px 22px;
    margin: 0 0 18px;
    position: relative;
    overflow: hidden;
}
.ex-form-balance::before {
    content: '';
    position: absolute;
    right: -30px;
    top: -30px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--ex-primary-soft) 0%, transparent 70%);
    pointer-events: none;
}
.ex-form-balance-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    position: relative;
}
.ex-form-balance-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--ex-text-sub);
    letter-spacing: -0.01em;
}
.ex-form-balance-value {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--ex-text);
    line-height: 1.1;
}
.ex-form-balance-value small {
    font-size: 17px;
    font-weight: 700;
    color: var(--ex-primary);
    margin-left: 4px;
}
html.dark-mode .ex-form-balance-value small { color: #c7d3e1; }

/* ---------- 우측 통계 카드 (누적/진행중) ---------- */
.ex-stats-card { padding: 14px; }
.ex-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ---------- 통합 요약 카드 (보유 + 누적 + 대기중) ---------- */
.ex-summary-card {
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    background: var(--ex-soft-bg);
}
.ex-summary-card::before {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, var(--ex-primary-soft) 0%, transparent 70%);
    pointer-events: none;
}
.ex-summary-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--ex-border);
    position: relative;
}
.ex-summary-main-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--ex-text-sub);
    letter-spacing: -0.01em;
}
.ex-summary-main-value {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--ex-text);
    line-height: 1.1;
}
.ex-summary-main-value small {
    font-size: 17px;
    font-weight: 700;
    color: var(--ex-primary);
    margin-left: 4px;
}
.ex-summary-sub {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 14px;
    position: relative;
}
.ex-summary-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--ex-card-bg);
    border: 1px solid var(--ex-border);
    border-radius: 12px;
}
.ex-summary-sub-ic {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ex-soft-bg-2);
    color: var(--ex-text-sub);
    border-radius: 999px;
    font-size: 14px;
}
.ex-summary-dot {
    flex: 0 0 auto;
    align-self: flex-start;
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 5px;
}
.ex-summary-dot-blue {
    background: var(--ex-primary);
}
.ex-summary-dot-gray  { background: #94a3b8; }
.ex-summary-dot-pulse { animation: ex-summary-dot-pulse 1.6s ease-in-out infinite; }
@keyframes ex-summary-dot-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(148, 163, 184, .55); }
    70%  { box-shadow: 0 0 0 6px rgba(148, 163, 184, 0);  }
    100% { box-shadow: 0 0 0 0   rgba(148, 163, 184, 0);  }
}
.ex-summary-sub-body { flex: 1 1 auto; min-width: 0; }
.ex-summary-sub-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ex-text-sub);
    margin-bottom: 3px;
    letter-spacing: -0.005em;
}
.ex-summary-sub-value {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ex-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ex-summary-sub-value small {
    font-size: 12px;
    color: var(--ex-text-sub);
    font-weight: 700;
    margin-left: 2px;
}
html.dark-mode .ex-summary-sub-item { background: var(--ex-card-bg); border-color: var(--ex-border); }
html.dark-mode .ex-summary-main-value small { color: #c7d3e1; }

/* ---------- 메인 2분할 그리드 (회원 전용) ---------- */
.ex-grid-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 0 0 24px;
    align-items: stretch;
}
.ex-grid-left > .ex-form-card { flex: 1; }
.ex-grid-aside > .ex-notice-card { flex: 1; display: flex; flex-direction: column; }
/* head 아래 마진 = card padding-bottom 으로 본문 위/아래 균형 */
.ex-grid-aside > .ex-notice-card .ex-card-head { margin-bottom: 22px; }
.ex-grid-aside > .ex-notice-card .ex-notice-list,
.ex-grid-aside > .ex-notice-card .ex-notice-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 0;
}

/* "이용 시 참고사항" 카드 제목 — 라이트모드에서만 파란색 강조 */
html:not(.dark-mode) .ex-notice-card .ex-section-title{
    color: var(--ex-primary-hover);
}
.ex-grid-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ex-grid-left > .ex-card { margin-bottom: 0; }
.ex-grid-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ex-grid-aside > .ex-card { margin-bottom: 0; }
.ex-grid-main > .ex-form-card { margin-bottom: 0; }

/* ---------- 공통 카드 ---------- */
.ex-card {
    background: var(--ex-card-bg);
    border: 1px solid var(--ex-border);
    border-radius: 20px;
    padding: 22px;
    margin: 0 0 16px;
    box-shadow: var(--ex-shadow);
}
.ex-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
}
.ex-section-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--ex-text);
    margin: 0;
    letter-spacing: -0.015em;
    line-height: 1.3;
}
.ex-card-sub {
    font-size: 12px;
    color: var(--ex-text-sub);
    font-weight: 500;
}
.ex-card-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ex-primary);
    background: var(--ex-primary-soft);
    border-radius: 999px;
}
html.dark-mode .ex-card-tag { color: #c7d3e1; }

/* ---------- 로그인 안내 ---------- */
.ex-login-notice {
    background: var(--ex-soft-bg);
    border: 1px solid var(--ex-border);
    border-radius: 16px;
    padding: 18px 20px;
    color: var(--ex-text-sub);
    font-size: 13.5px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ex-login-notice i { color: var(--ex-primary); font-size: 16px; }
html.dark-mode .ex-login-notice i { color: #c7d3e1; }
.ex-login-notice a {
    color: var(--ex-primary);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid var(--ex-primary);
}
html.dark-mode .ex-login-notice a { color: #c7d3e1; border-bottom-color: #c7d3e1; }

/* ---------- 폼 ---------- */
.ex-form { display: block; }
.ex-field { margin-bottom: 18px; }
.ex-field:last-of-type { margin-bottom: 12px; }
.ex-label {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--ex-text);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}
.ex-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.ex-label-row .ex-label { margin-bottom: 0; }
.ex-input {
    display: block;
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ex-text);
    background: var(--ex-card-bg);
    border: 1.5px solid var(--ex-border);
    border-radius: 14px;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s, background .15s;
    font-family: inherit;
}
.ex-input::placeholder { color: var(--ex-text-mute); font-weight: 400; }
.ex-input:hover { border-color: var(--ex-border-strong); }
.ex-input:focus {
    outline: 0;
    border-color: var(--ex-primary);
    box-shadow: 0 0 0 4px var(--ex-primary-ring);
    background: var(--ex-card-bg);
}
select.ex-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='%23323c46'><path d='M0 0h12L6 8z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 10px 7px;
    padding-right: 36px;
}
.ex-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ex-text-sub);
    line-height: 1.5;
}
.ex-help-warn { color: var(--ex-danger); }

/* 금액 입력 — 우측 "원" 접미사 */
.ex-amount-wrap {
    position: relative;
}
.ex-input-amount {
    padding-right: 44px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: right;
}
.ex-amount-suffix {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 700;
    color: var(--ex-text-sub);
    pointer-events: none;
}
.ex-amount-preview {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ex-primary);
    min-height: 18px;
    text-align: right;
    letter-spacing: -0.01em;
}
html.dark-mode .ex-amount-preview { color: #c7d3e1; }

/* ---------- 빠른 입력 버튼 ---------- */
.ex-quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.ex-quick-btn {
    appearance: none;
    border: 1px solid var(--ex-border);
    background: var(--ex-soft-bg);
    color: var(--ex-text);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s, transform .1s;
    font-family: inherit;
    letter-spacing: -0.01em;
}
.ex-quick-btn:hover {
    background: var(--ex-primary);
    border-color: var(--ex-primary);
    color: var(--ex-primary-fg);
}
.ex-quick-btn:active { transform: scale(0.97); }
.ex-quick-btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px var(--ex-primary-ring);
}
.ex-quick-btn-reset {
    background: transparent;
    color: var(--ex-text-sub);
    border-style: dashed;
    margin-left: auto;
}
.ex-quick-btn-reset:hover {
    background: var(--ex-danger);
    border-color: var(--ex-danger);
    color: #fff;
    border-style: solid;
}
html.dark-mode .ex-quick-btn { background: var(--ex-soft-bg); color: var(--ex-text); }
html.dark-mode .ex-quick-btn-reset { background: transparent; color: var(--ex-text-sub); }

/* ---------- 업체 선택 (모달 트리거 영역) ---------- */
.ex-co { position: relative; }
.ex-co-unselected, .ex-co-selected { display: block; }
.ex-co-unselected[hidden], .ex-co-selected[hidden] { display: none !important; }

/* 미선택 — 큰 선택 버튼 (다른 ex-input 과 높이 일관) */
.ex-co-pick {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ex-text-mute);
    background: var(--ex-card-bg);
    border: 1.5px dashed var(--ex-border-strong);
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
    font-family: inherit;
    box-sizing: border-box;
}
.ex-co-pick:hover {
    border-color: #323c46;
    background: var(--ex-soft-bg);
    color: var(--ex-text);
}
.ex-co-pick:focus-visible {
    outline: 0;
    border-color: #323c46;
    box-shadow: 0 0 0 4px rgba(50, 60, 70, .15);
}
.ex-co-pick-txt { flex: 1 1 auto; min-width: 0; }
.ex-co-pick-arrow {
    flex: 0 0 auto;
    color: var(--ex-text-mute);
    font-size: 16px;
    transition: color .15s, transform .15s;
}
.ex-co-pick:hover .ex-co-pick-arrow { color: #323c46; transform: translateX(2px); }
html.dark-mode .ex-co-pick-arrow { color: var(--ex-text-mute); }

/* 선택 — 칩 + 액션 버튼 */
.ex-co-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--ex-primary-soft);
    border: 1.5px solid var(--ex-primary);
    border-radius: 14px;
    box-sizing: border-box;
    min-height: 50px;
}
html.dark-mode .ex-co-selected { background: rgba(49, 130, 246, .12); border-color: var(--ex-primary); }
.ex-co-chip {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--ex-primary-hover);
    background: transparent;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
    box-sizing: border-box;
}
.ex-co-chip::before {
    content: '\f00c';
    font-family: FontAwesome;
    display: inline-block;
    margin-right: 8px;
    font-size: 13px;
    color: var(--ex-primary);
    font-weight: normal;
}
html.dark-mode .ex-co-chip { color: #93c5fd; }
html.dark-mode .ex-co-chip::before { color: #93c5fd; }
.ex-co-actions {
    flex: 0 0 auto;
    display: inline-flex;
    gap: 6px;
}
.ex-co-btn {
    appearance: none;
    border: 1px solid var(--ex-border);
    background: var(--ex-card-bg);
    color: var(--ex-text);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: color .12s, border-color .12s, background .12s;
    font-family: inherit;
}
.ex-co-btn:hover {
    color: #323c46;
    border-color: #323c46;
    background: var(--ex-soft-bg);
}
.ex-co-btn-clear:hover {
    color: var(--ex-danger);
    border-color: var(--ex-danger);
    background: #fef2f2;
}
html.dark-mode .ex-co-btn-clear:hover { background: rgba(239, 68, 68, .12); }

/* ---------- 업체 선택 모달 ---------- */
.ex-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.ex-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
    cursor: pointer;
}
html.dark-mode .ex-modal__backdrop { background: rgba(0, 0, 0, .65); }
.ex-modal__panel {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: min(70vh, 560px);
    background: var(--ex-card-bg);
    border: 1px solid var(--ex-border);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ex-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--ex-border);
    flex: 0 0 auto;
}
.ex-modal__title {
    font-size: 16px;
    font-weight: 800;
    color: var(--ex-text);
    margin: 0;
    letter-spacing: -0.015em;
}
.ex-modal__close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--ex-text-mute);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: color .12s, background .12s;
    padding: 0;
    font-family: inherit;
}
.ex-modal__close:hover {
    color: var(--ex-text);
    background: var(--ex-soft-bg);
}
.ex-modal__body {
    padding: 14px 16px 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
.ex-modal__search {
    position: relative;
    flex: 0 0 auto;
    margin-bottom: 10px;
}
.ex-modal__search-ic {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ex-text-mute);
    font-size: 13px;
    pointer-events: none;
}
.ex-modal__search-input {
    display: block;
    width: 100%;
    padding: 12px 14px 12px 38px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ex-text);
    background: var(--ex-soft-bg);
    border: 1.5px solid var(--ex-border);
    border-radius: 12px;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s, background .15s;
    font-family: inherit;
}
.ex-modal__search-input::placeholder { color: var(--ex-text-mute); font-weight: 400; }
.ex-modal__search-input:focus {
    outline: 0;
    border-color: var(--ex-primary);
    background: var(--ex-card-bg);
    /* 외곽 링 제거 — 파란 테두리만 표시 */
}
.ex-modal__hint {
    font-size: 12px;
    color: var(--ex-text-sub);
    padding: 6px 4px;
    text-align: center;
    flex: 0 0 auto;
}
.ex-modal__hint[hidden] { display: none; }
.ex-modal__list {
    list-style: none;
    margin: 0;
    padding: 4px 0 0;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}
.ex-modal__item {
    padding: 12px 14px;
    font-size: 14px;
    color: var(--ex-text);
    cursor: pointer;
    line-height: 1.4;
    border-radius: 10px;
    font-weight: 600;
    transition: background .12s, color .12s;
    letter-spacing: -0.01em;
}
.ex-modal__item:hover {
    background: var(--ex-soft-bg);
}
.ex-modal__item.is-active {
    background: rgba(50, 60, 70, .08);
    color: #323c46;
    font-weight: 700;
}
html.dark-mode .ex-modal__item.is-active {
    background: rgba(255, 255, 255, .06);
    color: #f1f5f9;
}
.ex-modal__match {
    font-weight: 800;
    color: #323c46;
}
html.dark-mode .ex-modal__match { color: #c7d3e1; }

/* ---------- 금액 인라인 경고 ---------- */
.ex-amount-warn {
    margin-top: 8px;
    padding: 8px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    line-height: 1.5;
    letter-spacing: -0.01em;
}
.ex-amount-warn[hidden] { display: none !important; }
html.dark-mode .ex-amount-warn {
    color: #fca5a5;
    background: rgba(239, 68, 68, .10);
    border-color: rgba(239, 68, 68, .25);
}

/* ---------- 액션 ---------- */
.ex-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
}
.ex-btn {
    appearance: none;
    border: 0;
    padding: 0 24px;
    height: 58px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 16px;
    cursor: pointer;
    transition: background-color .15s, opacity .15s, transform .1s, box-shadow .15s;
    color: var(--ex-primary-fg);
    font-family: inherit;
    letter-spacing: -0.015em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}
.ex-btn:disabled { opacity: .45; cursor: not-allowed; }
.ex-btn-primary {
    background: var(--ex-primary);
    box-shadow: 0 2px 6px rgba(50, 60, 70, .18);
}
.ex-btn-primary:hover:not(:disabled) {
    background: var(--ex-primary-hover);
    box-shadow: 0 4px 12px rgba(50, 60, 70, .25);
}
.ex-btn-primary:active:not(:disabled) {
    transform: scale(0.99);
}
.ex-btn i { font-size: 14px; }

.ex-message {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.ex-message:empty { display: none; }
.ex-message-info    { color: var(--ex-text-sub); }
.ex-message-success { color: var(--ex-success); }
.ex-message-error   { color: var(--ex-danger); }

/* ---------- 내 전환 내역 ---------- */
.ex-history-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.ex-history-refresh,
.ex-rank-btn {
    appearance: none;
    border: 1px solid var(--ex-border);
    background: var(--ex-card-bg);
    color: var(--ex-text-sub);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color .15s, border-color .15s, background .15s;
    font-family: inherit;
    text-decoration: none;
}
.ex-history-refresh:hover,
.ex-rank-btn:hover {
    color: var(--ex-primary);
    border-color: var(--ex-primary);
    background: var(--ex-primary-soft);
}
html.dark-mode .ex-history-refresh:hover,
html.dark-mode .ex-rank-btn:hover { color: #c7d3e1; border-color: var(--ex-border-strong); }
.ex-history-wrap {
    overflow-x: auto;
    margin: 0 -4px;
}
.ex-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.ex-history-table thead th {
    background: transparent;
    color: var(--ex-text-mute);
    font-weight: 700;
    font-size: 11.5px;
    padding: 0 8px 10px;
    text-align: center;
    border-bottom: 1px solid var(--ex-border);
    white-space: nowrap;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.ex-history-table tbody td {
    padding: 14px 8px;
    border-bottom: 1px solid var(--ex-border);
    text-align: center;
    color: var(--ex-text);
    vertical-align: middle;
    font-weight: 500;
}
.ex-history-table tbody tr:last-child td { border-bottom: 0; }
.ex-history-table tbody tr:hover td { background: var(--ex-soft-bg); }
.ex-history-empty {
    text-align: center;
    color: var(--ex-text-mute);
    padding: 36px 0 !important;
    font-size: 13px;
    font-weight: 500;
}
.ex-col-dt   { color: var(--ex-text-sub); font-size: 12.5px; }
.ex-col-co   { font-weight: 700; }
.ex-col-uid  { color: var(--ex-text-sub); font-size: 12.5px; }
.ex-col-amt  { font-weight: 800; letter-spacing: -0.01em; }
.ex-col-amt small { color: var(--ex-text-mute); margin-left: 2px; font-weight: 500; font-size: 11px; }

/* 상태 칩 */
.ex-st {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.4;
}
.ex-st-pending  { background: #f1f5f9; color: #64748b; }
.ex-st-approved { background: #d1fae5; color: #065f46; }
.ex-st-rejected { background: #fee2e2; color: #991b1b; }
html.dark-mode .ex-st-pending  { background: rgba(148, 163, 184, .18); color: #cbd5e1; }
html.dark-mode .ex-st-approved { background: rgba(16, 185, 129, .15); color: #34d399; }
html.dark-mode .ex-st-rejected { background: rgba(239, 68, 68, .15); color: #f87171; }

/* 지급거절 사유 행 — 본 행과 한 덩어리로 보이도록 배경/border 제거, 행 전체 폭 중앙 */
.ex-history-table tbody tr.ex-row-with-reason > td {
    border-bottom: 0;
    padding-bottom: 6px;
}
.ex-history-table tbody tr.ex-history-reason-row > td {
    border-top: 0;
    padding: 0 12px 14px;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
    white-space: normal;
}

/* status 별 행 배경 — 칩 색과 동일 톤(연하게) */
.ex-history-table tbody tr.ex-row-st-pending  > td { background: #f8fafc; }
.ex-history-table tbody tr.ex-row-st-approved > td { background: #ecfdf5; }
.ex-history-table tbody tr.ex-row-st-rejected > td { background: #fef2f2; }
.ex-history-table tbody tr.ex-row-st-pending:hover  > td { background: #f1f5f9; }
.ex-history-table tbody tr.ex-row-st-approved:hover > td { background: #d1fae5; }
.ex-history-table tbody tr.ex-row-st-rejected:hover > td { background: #fee2e2; }
html.dark-mode .ex-history-table tbody tr.ex-row-st-pending  > td { background: rgba(148, 163, 184, .08); }
html.dark-mode .ex-history-table tbody tr.ex-row-st-approved > td { background: rgba(16, 185, 129, .08); }
html.dark-mode .ex-history-table tbody tr.ex-row-st-rejected > td { background: rgba(239, 68, 68, .08); }

/* 거절+사유는 한 세트 — 둘 중 하나에 hover 시 두 행 모두 동일 배경(따로 강조돼 분리돼 보이지 않게) */
.ex-history-table tbody tr.ex-row-with-reason:hover > td,
.ex-history-table tbody tr.ex-row-with-reason:hover + tr.ex-history-reason-row > td,
.ex-history-table tbody tr.ex-history-reason-row:hover > td {
    background: #fee2e2;
}
/* 사유 행 hover 시 바로 위 본 행도 함께 강조 (:has 미지원 시 이 규칙만 무시, 본행-hover는 정상) */
.ex-history-table tbody tr.ex-row-with-reason:has(+ .ex-history-reason-row:hover) > td {
    background: #fee2e2;
}

/* 거절 칩 자체를 클릭 토글로 — 별도 텍스트 없이 칩 위치/열 정렬 유지. 사유 행은 평소 숨김 */
.ex-history-reason-row[hidden] { display: none; }
button.ex-st-toggle {
    border: 0;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    vertical-align: middle;
}
.ex-st-caret {
    font-size: 8px;
    line-height: 1;
    opacity: .65;               /* 칩 글자색(어두운 톤) 상속 */
    transition: transform .15s ease;
}
.ex-st-toggle[aria-expanded="true"] .ex-st-caret { transform: rotate(180deg); }
.ex-history-reason-label {
    font-weight: 700;
    color: var(--ex-danger);
    margin-right: 4px;
}
.ex-history-reason-text {
    color: #991b1b;
    font-weight: 500;
}
html.dark-mode .ex-history-reason-text  { color: #fca5a5; }
html.dark-mode .ex-history-reason-label { color: #f87171; }

/* 페이저 */
.ex-history-pager {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.ex-history-pager button {
    appearance: none;
    border: 1px solid var(--ex-border);
    background: var(--ex-card-bg);
    color: var(--ex-text-sub);
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
    font-family: inherit;
}
.ex-history-pager button:hover {
    color: var(--ex-primary);
    border-color: var(--ex-primary);
}
.ex-history-pager button.is-active {
    background: var(--ex-primary);
    color: var(--ex-primary-fg);
    border-color: var(--ex-primary);
    font-weight: 800;
}

/* ---------- 이용 안내 ---------- */
.ex-notice-body {
    font-size: 13.5px;
    color: var(--ex-text-sub);
    line-height: 1.75;
}
.ex-notice-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ex-notice-list li {
    position: relative;
    padding: 8px 0 8px 22px;
    font-size: 13.5px;
    color: var(--ex-text-sub);
    line-height: 1.6;
}
.ex-notice-list li + li { border-top: 1px dashed var(--ex-border); }
.ex-dot {
    position: absolute;
    left: 4px;
    top: 16px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ex-primary);
    opacity: .55;
}

/* ---------- 랭킹 진입 카드 ---------- */
.ex-rank-card .ex-card-head { align-items: flex-start; flex-direction: column; gap: 4px; }
.ex-rank-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.ex-rank-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px;
    background: var(--ex-soft-bg);
    color: var(--ex-text);
    border: 1px solid var(--ex-border);
    border-radius: 16px;
    text-decoration: none;
    transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.ex-rank-link:hover,
.ex-rank-link:focus {
    background: var(--ex-card-bg);
    border-color: var(--ex-primary);
    color: var(--ex-text);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--ex-shadow-lift);
}
.ex-rank-link-ic {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--ex-primary);
    color: var(--ex-primary-fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.ex-rank-link-txt {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.ex-rank-link-txt strong {
    font-size: 14px;
    font-weight: 800;
    color: var(--ex-text);
    letter-spacing: -0.015em;
}
.ex-rank-link-txt small {
    font-size: 11.5px;
    color: var(--ex-text-sub);
    font-weight: 500;
}
.ex-rank-link-arrow {
    flex: 0 0 auto;
    color: var(--ex-text-mute);
    font-size: 16px;
}
.ex-rank-link:hover .ex-rank-link-arrow { color: var(--ex-primary); }
html.dark-mode .ex-rank-link:hover .ex-rank-link-arrow { color: #c7d3e1; }

/* =========================================================================
 *  태블릿
 * ========================================================================= */
@media (max-width: 768px) {
    .ex-wrap { padding: 16px 14px 64px; max-width: 100%; }
    .ex-page-title { font-size: 22px; }
    .ex-balance { grid-template-columns: 1fr; }
    .ex-balance-main { padding: 22px 20px 20px; border-radius: 18px; }
    .ex-balance-value { font-size: 30px; }
    .ex-balance-side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
    .ex-form-balance { padding: 14px 16px 12px; border-radius: 14px; margin: 0 0 14px; }
    .ex-form-balance-value { font-size: 24px; }
    .ex-stats-card { padding: 12px; }
    .ex-card { padding: 20px 18px 22px; border-radius: 18px; }
    .ex-section-title { font-size: 16px; }
    .ex-grid-main { grid-template-columns: 1fr; gap: 12px; }
    .ex-grid-aside { gap: 12px; }
}

/* =========================================================================
 *  모바일
 * ========================================================================= */
@media (max-width: 480px) {
    .ex-wrap { padding: 14px 12px 56px; }
    .ex-page-title { font-size: 20px; }
    .ex-page-sub { font-size: 12.5px; }

    .ex-balance-main { padding: 20px 18px 18px; border-radius: 16px; }
    .ex-balance-value { font-size: 28px; }
    .ex-balance-value small { font-size: 14px; }
    .ex-balance-side { gap: 8px; }
    .ex-mini-card { padding: 12px 14px; border-radius: 14px; }
    .ex-mini-value { font-size: 16px; }

    .ex-card { padding: 18px 16px 20px; border-radius: 16px; margin-bottom: 12px; }
    .ex-card-head { margin-bottom: 14px; }
    .ex-section-title { font-size: 15.5px; }

    .ex-input { padding: 12px 14px; font-size: 14.5px; border-radius: 12px; }
    .ex-input-amount { font-size: 17px; padding-right: 40px; }
    .ex-amount-suffix { right: 14px; font-size: 13px; }

    .ex-btn { height: 54px; font-size: 15px; border-radius: 14px; }

    .ex-quick-btn { padding: 7px 12px; font-size: 12px; }

    .ex-history-table { font-size: 12.5px; }
    .ex-history-table thead th { font-size: 10.5px; padding: 0 4px 8px; }
    .ex-history-table tbody td { padding: 12px 4px; }
    .ex-col-uid { word-break: break-all; }
    .ex-st-reason { max-width: 110px; }

    .ex-rank-links { grid-template-columns: 1fr; }
    .ex-rank-link { padding: 14px 14px; }
    .ex-rank-link-ic { width: 36px; height: 36px; font-size: 14px; }

    .ex-modal { padding: 0; align-items: flex-end; }
    .ex-modal__panel {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 18px 18px 0 0;
    }
    .ex-modal__head { padding: 16px 18px 12px; }
    .ex-modal__title { font-size: 15px; }
    .ex-modal__body { padding: 12px 14px 14px; }
    .ex-modal__item { padding: 11px 12px; font-size: 13.5px; }
    .ex-co-pick { padding: 12px 14px; font-size: 14.5px; border-radius: 12px; }
    .ex-co-selected { padding: 10px 12px; border-radius: 12px; min-height: 46px; }
    .ex-co-chip { font-size: 14px; padding: 0; }
    .ex-co-chip::before { font-size: 12px; margin-right: 6px; }
    .ex-co-btn { padding: 5px 10px; font-size: 11.5px; }
}

/* ============================================
   상단 배너 (자유게시판 fb-banner와 동일 사이즈)
   ============================================ */
.ex-banner { padding: 0; background: transparent; border: none; border-radius: 0; margin-bottom: 14px; }
.ex-banner-inner {
	position: relative; display: flex; align-items: center; justify-content: space-between;
	padding: 28px 32px; background: linear-gradient(135deg, #34d399 0%, #10b981 55%, #047857 100%);
	border-radius: 16px; overflow: hidden; min-height: 100px;
}
.ex-banner-deco { position: absolute; border-radius: 50%; opacity: 0.1; background: #fff; }
.ex-banner-deco--1 { width: 180px; height: 180px; top: -60px; right: 60px; }
.ex-banner-deco--2 { width: 100px; height: 100px; bottom: -30px; right: -10px; }
.ex-banner-content { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; }
.ex-banner-badge {
	display: inline-flex; align-items: center; width: fit-content; padding: 3px 10px;
	background: rgba(255,255,255,0.2); border-radius: 20px; font-size: 10.5px; font-weight: 700;
	color: #fff; letter-spacing: 1.5px; backdrop-filter: blur(4px);
}
.ex-banner-title { font-size: 17px; font-weight: 800; color: #fff; margin: 0; letter-spacing: -0.5px; line-height: 1.35; }
.ex-banner-desc { font-size: 12.5px; font-weight: 400; color: rgba(255,255,255,0.78); margin: 0; letter-spacing: -0.2px; }
.ex-banner-icon-area {
	position: relative; z-index: 1; display: flex; align-items: center; justify-content: center;
	width: 52px; height: 52px; min-width: 52px;
	background: rgba(255,255,255,0.15); border-radius: 14px; color: #fff; font-size: 24px; backdrop-filter: blur(4px);
}
@media (max-width: 575px) {
	.ex-banner-inner { padding: 22px 20px; min-height: 85px; }
	.ex-banner-title { font-size: 15px; }
	.ex-banner-icon-area { width: 44px; height: 44px; min-width: 44px; font-size: 20px; }
}
