/* ── 사이드바를 세로 플렉스로: 본문이 남는 공간을 채워 사용자 메뉴를 항상 맨 아래로 ── */
.sidebar { display: flex; flex-direction: column; }
.sidebar-body { flex: 1 0 auto; }
/* 하단 사용자 메뉴 호스트 — 플로팅(sticky) 아님. 마지막 메뉴와 100px 이상 띄우고 맨 아래에 배치 */
.user-menu-host {
  margin-top: 10px;
  padding-top: 16px; padding-bottom: 4px;
  border-top: 1px solid var(--line);
}

/* ── 공통 아바타 ── */
.user-avatar {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  font-family: var(--font-ui); font-weight: 700; font-size: 13px; line-height: 1;
}
/* 게스트 아바타 — 배경 없이 사람 아이콘만 테마색으로.
   위쪽 그룹 아이콘과 좌측·크기를 맞추기 위해 고정폭 해제 + 왼쪽 정렬 */
.user-avatar.guest {
  background: transparent; color: var(--title);
  width: 16px; height: auto; justify-content: flex-start;
}
/* 프로필 사진(예: 구글) 아바타 */
.user-avatar.photo { background: transparent; object-fit: cover; }

/* ── 로그아웃 상태: 로그인 박스 (로그인 상태 행과 동일한 은은한 형식) ── */
.user-loginbox-notice {
    font-size: 13px;
    color: var(--ink-3);
    text-align: justify;
    margin-bottom: 6px;
    padding:3px;
}

.user-loginbox {
    display: flex;
    align-items: center;
    gap: 8px;
    /* 안쪽 패딩(10px)으로 hover 테두리·배경이 아이콘에 붙지 않게 + 음수 마진으로
     박스를 좌우로 넓혀 hover 면이 벽에 붙지 않고 떠 보이게.
     결과적으로 아이콘 자체는 위쪽 메뉴 아이콘과 같은 선상에 정렬됨 */
    width: calc(100% + 20px);
    margin: 0 -10px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-family: var(--font-ui);
    text-align: left;
    transition: border-color .12s ease, background .12s ease;
}
.user-loginbox:hover { background: var(--surface); border-color: var(--line); }
/* 텍스트가 남는 폭을 채워 화살표를 오른쪽 끝으로 → 좌우 균형 */
.user-loginbox-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; flex: 1; }
/* '로그인' 글자 테마색 적용 */
.user-loginbox-title { font-size: 14px; font-weight: 700; color: var(--title); }
.user-loginbox-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
/* 우측 진입 화살표 (디자인 요소) — 박스 균형 + 클릭 유도 */
.user-loginbox-arrow { flex-shrink: 0; color: var(--ink-3); margin-right: 2px; transition: color .12s ease, transform .12s ease; }
.user-loginbox:hover .user-loginbox-arrow { color: var(--title); transform: translateX(2px); }

/* ── 로그인 상태: 사용자 행 + 계정 메뉴 ── */
.user-menu-wrap { position: relative; }
.user-row {
  display: flex; align-items: center; gap: 8px;
  /* 로그아웃 박스와 동일: 음수 마진으로 hover 면을 띄우고 아바타는 메뉴 아이콘과 정렬 */
  width: calc(100% + 20px); margin: 0 -10px;
  padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink); cursor: pointer;
  font-family: var(--font-ui); text-align: left; transition: background .12s ease;
}
.user-row:hover { background: var(--surface); border-color: var(--line); }
.user-row-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; flex: 1; }
.user-row-name { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-row-sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-row .user-chev { flex-shrink: 0; color: var(--ink-3); transition: transform .18s ease; }
.user-menu-wrap.open .user-chev { transform: rotate(180deg); }

/* ChatGPT 계정 팝업 형태: 크게 둥근 모서리(16px) · 넉넉한 패딩 · 긴 그림자 ·
   사이드바 폭을 꽉 채움(left/right:0). min-width 는 좁은 사이드바 넘침 방지용으로 작게 둠 */
.user-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 8px; min-width: 0;
  display: none; flex-direction: column; gap: 2px; z-index: 30;
}
.user-menu-wrap.open .user-menu { display: flex; }

/* 팝업 상단 계정 헤더 — 아바타 + 이름/부제 + 진입 화살표 (ChatGPT 형태) */
.user-menu-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 10px; background: transparent;
  color: var(--ink); font-family: var(--font-ui); cursor: pointer; text-align: left;
}
.user-menu-head:hover { background: var(--surface-2); }
.user-menu-head-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1; }
.user-menu-head-name { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu-head-sub { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu-head .umi-head-chev { flex-shrink: 0; color: var(--ink-3); }

.user-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 10px; background: transparent;
  color: var(--ink); font-family: var(--font-ui); font-size: 15px; line-height: 1.2; cursor: pointer; text-align: left;
}
.user-menu-item:hover { background: var(--surface-2); }
.user-menu-item .umi-ico { color: var(--ink-2); flex-shrink: 0; }
.user-menu-item.danger { color: var(--warn); }
.user-menu-item.danger .umi-ico { color: var(--warn); }
/* 그룹 구분선 — 헤더/일반/위험 항목 구획 분리 */
.user-menu-sep { height: 1px; margin: 4px 6px; background: var(--line); }

/* ── 축소 레일 상태: 아바타(사람 아이콘)만 중앙 표시 ── */
@media (min-width: 901px) {
  .app.sidebar-collapsed .user-menu-host {
    /* 본문이 숨겨져 채울 요소가 없으므로 auto 로 맨 아래 정렬 */
    margin-top: auto; padding: 10px 0; border-top: 0;
    display: flex; justify-content: center;
  }
  .app.sidebar-collapsed .user-loginbox,
  .app.sidebar-collapsed .user-row {
    width: 42px; height: 42px; margin: 0; padding: 0; justify-content: center; gap: 0; border-color: transparent;
  }
  /* 레일에서는 모든 글자(안내문구·이름·이메일)와 진입 화살표를 숨김 → 아이콘만 남김 */
  .app.sidebar-collapsed .user-loginbox-notice,
  .app.sidebar-collapsed .user-loginbox-text,
  .app.sidebar-collapsed .user-loginbox-arrow,
  .app.sidebar-collapsed .user-row-text,
  .app.sidebar-collapsed .user-row .user-chev { display: none; }
  /* 게스트(사람) 아이콘을 박스 중앙에 */
  .app.sidebar-collapsed .user-avatar.guest { width: auto; justify-content: center; }
  /* 계정 팝업 — 레일(width:58px, overflow:hidden)에 잘리므로 fixed 로 띄워
     하단 사용자 아이콘 위쪽으로 올려 전체가 보이게 한다 */
  .app.sidebar-collapsed .user-menu {
    position: fixed; left: 10px; right: auto; top: auto; bottom: 80px;
    min-width: 220px; z-index: 60;
  }
}

/* ============================================================
   로그인 팝업 (ChatGPT 로그인 페이지 형태)
   ============================================================ */
.auth-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(0,0,0,.45);
  opacity: 0; transition: opacity .18s ease;
}
.auth-backdrop.open { opacity: 1; }

.auth-card {
  position: relative; width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.28);
  padding: 28px 36px 36px;
  transform: translateY(8px) scale(.985); transition: transform .18s ease;
}
.auth-backdrop.open .auth-card { transform: translateY(0) scale(1); }

.auth-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-3); font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: background .12s ease, color .12s ease;
}
.auth-close:hover { background: var(--surface-2); color: var(--ink); }

/* 로고 + '하루' 브랜드 + 제목을 한 줄(가로)로 왼쪽 정렬 */
.auth-head { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin-bottom: 28px; }
.auth-logo { width: 34px; height: 34px; object-fit: contain; margin: 0; }
.auth-brand { font-family: var(--font-ui); font-size: 33px; font-weight: 800; color: var(--title); letter-spacing: -0.01em; }
.auth-title { font-family: var(--font-ui); font-size: 17px; font-weight: 600; color: var(--ink-2); margin: 0; letter-spacing: -0.01em; align-self: flex-end; padding-bottom: 2px; }
.auth-sub { font-size: 13.5px; color: var(--ink-2); margin: 8px 0 0; }

.auth-form { display: flex; flex-direction: column; gap: 4px; }
.auth-label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.auth-input {
  width: 100%; font-family: var(--font-ui); font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 13px 14px; margin-bottom: 8px;
}
.auth-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-err { font-size: 12px; color: var(--warn); margin: -4px 0 8px; }

.auth-primary {
  width: 100%; font-family: var(--font-ui); font-weight: 600; font-size: 15px;
  background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  padding: 13px 16px; cursor: pointer; transition: background .15s ease; margin-top: 4px;
}
.auth-primary:hover { background: var(--accent-2); }

/* 이메일 표시 + 편집 (비밀번호 단계) */
.auth-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; margin-bottom: 14px; padding: 11px 14px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2);
  color: var(--ink); font-family: var(--font-ui); font-size: 14px; cursor: pointer; text-align: left;
}
.auth-pill:hover { border-color: var(--accent); }
.auth-pill-edit { color: var(--accent); font-size: 12.5px; font-weight: 600; flex-shrink: 0; }

.auth-foot { text-align: center; font-size: 13.5px; color: var(--ink-2); margin-top: 18px; }
.auth-link { color: var(--accent-2); font-weight: 600; }
.auth-link:hover { text-decoration: underline; }

.auth-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--ink-3); font-size: 12.5px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-social { display: flex; flex-direction: column; gap: 10px; }
.auth-social-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 16px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-family: var(--font-ui); font-size: 14px;
  cursor: pointer; transition: background .12s ease, border-color .12s ease;
}
.auth-social-btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.auth-social-btn svg { flex-shrink: 0; }
.auth-social-apple svg { color: var(--ink); }
.auth-social-err { margin-top: 10px; font-size: 12.5px; color: var(--warn); text-align: center; line-height: 1.4; }

@media (max-width: 480px) {
  .auth-card { padding: 24px 22px 28px; border-radius: 14px; }
  .auth-title { font-size: 18px; }
}

/* ============================================================
   옵션(설정) 팝업 — 좌측 내비 + 우측 콘텐츠 (ChatGPT 설정 형태)
   ============================================================ */
.opt-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(0,0,0,.45);
  opacity: 0; transition: opacity .18s ease;
}
.opt-backdrop.open { opacity: 1; }

.opt-card {
  position: relative; display: flex;
  width: 760px; max-width: 95vw; height: 600px; max-height: 86vh;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.28); overflow: hidden;
  transform: translateY(8px) scale(.985); transition: transform .18s ease;
}
.opt-backdrop.open .opt-card { transform: translateY(0) scale(1); }

.opt-close {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-3); font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: background .12s ease, color .12s ease;
}
.opt-close:hover { background: var(--surface-2); color: var(--ink); }

/* 좌측 내비 */
.opt-nav {
  flex-shrink: 0; width: 208px; padding: 16px 10px;
  background: var(--surface-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
}
.opt-nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 10px; background: transparent;
  color: var(--ink); font-family: var(--font-ui); font-size: 14px; cursor: pointer; text-align: left;
}
.opt-nav-item:hover { background: var(--surface); }
.opt-nav-item.active { background: var(--surface); font-weight: 600; }
.opt-nav-item .opt-nav-ico { color: var(--ink-2); flex-shrink: 0; }

/* 우측 콘텐츠 */
.opt-main { flex: 1; min-width: 0; padding: 26px 28px; overflow-y: auto; }
.opt-head { margin-bottom: 18px; }
.opt-title { font-family: var(--font-ui); font-size: 19px; font-weight: 700; color: var(--ink); margin: 0; }
.opt-sub { font-size: 13px; color: var(--ink-2); margin: 4px 0 0; }

.opt-note { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); margin: 12px 0; text-align: justify; }
.opt-note.muted { color: var(--ink-3); font-size: 12.5px; }
.opt-warn {
  font-size: 13px; line-height: 1.55; color: var(--warn); margin: 12px 0;
  padding: 10px 12px; border: 1px solid var(--warn); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
}

.opt-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0;padding-top:20px;padding-bottom:10px;border-top:1px solid var(--line);}

.opt-btn {
  font-family: var(--font-ui); font-weight: 600; font-size: 14px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 10px 18px; cursor: pointer; transition: background .12s ease, border-color .12s ease;
}
.opt-btn:hover { background: var(--surface-2); }
.opt-btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.opt-btn.primary:hover { background: var(--accent-2); }
.opt-btn.danger { color: var(--warn); border-color: var(--warn); background: transparent; }
.opt-btn.danger:hover { background: color-mix(in srgb, var(--warn) 12%, transparent); }
.opt-btn:disabled { opacity: .55; cursor: default; }

/* 생성된 키 표시 + 복사 */
.opt-key-box {
  display: flex; align-items: stretch; gap: 8px; margin: 12px 0;
}
.opt-key-input {
  flex: 1; min-width: 0; font-family: var(--font-mono, monospace); font-size: 13.5px;
  color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 12px;
}
.opt-key-input:focus { outline: none; border-color: var(--accent); }
/* 작은 필드 변형 (식별 코드 · API KEY) — 높이 고정, 복사 버튼은 stretch 로 동일 높이 */
.opt-key-input.sm { box-sizing: border-box; height: 34px; font-size: 12px; padding: 0 10px; }

/* 키 라벨 (API KEY / 사용자 식별 코드) */
.opt-keylabel { font-size: 12px; font-weight: 700; color: var(--ink-3); margin: 0 0 4px; letter-spacing: .02em; }

/* 키 생성 화면: 식별 코드 + API KEY 를 묶는 카드 */
.opt-fieldgroup {
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 12px 14px; margin: 14px 0; display: grid; gap: 12px;
}
.opt-field { display: grid; gap: 0; }
.opt-field .opt-key-box { margin: 0; }

/* 안내 문구 묶음 */
.opt-notegroup { margin: 12px 0; display: grid; gap: 2px; }
.opt-notegroup .opt-note { margin: 2px 0; }

/* 등록된 키 메타 정보 (상태/등록일시/최근 발급) */
.opt-keymeta { margin: 10px 0 6px; display: grid; gap: 4px; }
.opt-keymeta-row { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.7; }
.opt-keymeta-k { flex-shrink: 0; width: 88px; color: var(--ink-3); }
.opt-keymeta-v { color: var(--ink); word-break: break-all; min-width: 0; }

.opt-icon-btn {
  flex-shrink: 0; font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 0 14px; cursor: pointer; transition: background .12s ease;
}
.opt-icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.opt-icon-btn.sm { font-size: 12px; padding: 0 10px; }

.opt-status { font-size: 13px; line-height: 1.5; margin: 6px 0; min-height: 18px; color: var(--ink-2); }
.opt-status.ok { color: var(--accent-2); }
.opt-status.err { color: var(--warn); }

/* 키 생성 ↔ 키 등록 구분선 */
.opt-sep { height: 1px; background: var(--line); margin: 20px 0; }

/* CAPTCHA 섹션 — 위 구분선으로 구획 분리 */
.opt-captcha-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

/* CAPTCHA(curl/봇 등록 차단) 자체 이미지 캡차 위젯 */
.opt-captcha { margin: 4px 0 0; min-height: 4px; font-size: 12.5px; color: var(--ink-2); }
.opt-captcha .opt-note { margin: 4px 0; }
.opt-captcha-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.opt-captcha-img {
  width: 170px; height: 40px; border: 1px solid var(--line-2); border-radius: 8px;
  background: #f5f6f8; cursor: pointer; image-rendering: -webkit-optimize-contrast;
}
.opt-captcha-input {
  box-sizing: border-box; height: 40px;
  font-family: var(--font-ui); font-size: 14px; letter-spacing: 2px; text-transform: uppercase;
  width: 130px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); color: var(--ink);
}
/* 캡차 새 이미지(↻) 버튼도 이미지 높이에 맞춤 */
.opt-captcha-row .opt-icon-btn { height: 40px; }

/* 임시: 현재 로그인 정보 표시 (확인용) */
.opt-userinfo {
  margin-top: 24px; padding: 12px 14px;
  border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2);
}
.opt-userinfo-title { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 8px; }
.opt-userinfo-row { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.7; }
.opt-userinfo-k { flex-shrink: 0; width: 72px; color: var(--ink-3); }
.opt-userinfo-v { color: var(--ink); font-family: var(--font-mono, monospace); word-break: break-all; min-width: 0; }

@media (max-width: 640px) {
  .opt-card { flex-direction: column; height: auto; max-height: 90vh; }
  .opt-nav { width: 100%; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .opt-nav-item { width: auto; white-space: nowrap; }
}

/* ============================================================
   페이지 내 확인 팝업 (window.confirm 대체) — ui-confirm.js
   ============================================================ */
.cfm-backdrop {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(0,0,0,.45);
  opacity: 0; transition: opacity .16s ease;
}
.cfm-backdrop.open { opacity: 1; }

.cfm-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.28);
  padding: 26px 26px 20px;
  transform: translateY(8px) scale(.985); transition: transform .16s ease;
}
.cfm-backdrop.open .cfm-card { transform: translateY(0) scale(1); }

.cfm-title { font-family: var(--font-ui); font-size: 17px; font-weight: 700; color: var(--ink); margin: 0 0 12px; }
.cfm-body { margin-bottom: 22px; }
.cfm-line { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); margin: 4px 0; }
.cfm-line:empty { height: 8px; margin: 0; }

.cfm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.cfm-btn {
  font-family: var(--font-ui); font-weight: 600; font-size: 14px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 9px 18px; cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.cfm-btn:hover { background: var(--surface-2); }
.cfm-btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.cfm-btn.primary:hover { background: var(--accent-2); }
.cfm-btn.danger { background: var(--warn); color: #fff; border-color: transparent; }
.cfm-btn.danger:hover { filter: brightness(.94); }
.cfm-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

/* ── 설정 창에 얹은 사이드바 옵션 위젯 ──
   ui-sidebar.js 의 위젯을 그대로 재사용하므로, 좁은 사이드바용으로 짜인 치수만 여기서 보정한다.
   설정 창은 폭이 훨씬 넓어 입력 요소를 늘리면 눌러야 할 곳이 멀어지므로 상한을 둔다. */
.opt-options { max-width: 420px; }
/* 항목 간격을 사이드바보다 조금 넉넉하게 */
.opt-options .side-group { margin-bottom: 18px; }
.opt-options .toggle-row { padding: 9px 0; }
.opt-options .slider-row { padding: 8px 0; }
/* 폴드(하위 묶음)는 넓은 화면에서 테두리가 과하게 보이므로 옅게 */
.opt-options .side-foldable { border-color: var(--line); }
.opt-options .side-foldable-head { background: var(--surface-2); }
/* 설정 창 안에서는 구분선을 위아래로 더 띄운다 */
.opt-options .side-divider { margin: 22px 0; }
/* 라벨은 설정 창 본문 색을 따르게 (사이드바보다 배경이 밝음) */
.opt-options .field-label { color: var(--ink); }

/* ── '보안 및 사용정보' 동작 목록 ──
   한 줄 = 제목 + 설명 + 실행 버튼. 설명이 길어도 버튼 폭은 유지되게 flex 로 나눈다. */
.opt-actions { display: flex; flex-direction: column; margin-top: 8px; }
.opt-action {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--line);
}
.opt-action:last-child { border-bottom: 1px solid var(--line); }
.opt-action-text { flex: 1; min-width: 0; }
.opt-action-label { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.opt-action-desc { font-size: 12.5px; line-height: 1.55; color: var(--ink-2); text-align: justify; }
/* 버튼은 줄바꿈 없이 오른쪽에 고정 */
.opt-action .opt-btn { flex-shrink: 0; white-space: nowrap; font-size: 13px; padding: 8px 14px; }
.opt-action .opt-btn:disabled { opacity: .55; cursor: default; }

@media (max-width: 640px) {
  /* 좁은 화면에서는 버튼을 아래로 내려 설명이 눌리지 않게 */
  .opt-action { flex-direction: column; align-items: stretch; gap: 10px; }
  .opt-action .opt-btn { align-self: flex-start; }
}

/* ── 다크 모드 보정 ──
   어두운 배경에서는 카드와 뒷면의 명도차가 작아 팝업이 떠 보이지 않는다 → 막을 더 어둡게 */
:root[data-scheme="dark"] .auth-backdrop,
:root[data-scheme="dark"] .opt-backdrop,
:root[data-scheme="dark"] .cfm-backdrop { background: rgba(0,0,0,.66); }
/* 캡차는 밝은 배경에 어두운 글자로 그려진 이미지라 흰 판을 그대로 둔다 */
