/* ============================================================
 * 감탄크린 통합 SPA — Stripe Dashboard 스타일
 * SES-0527 사용자 결정: Stripe 톤 + Pretendard + 카드 섬세 그림자
 * spec: docs/superpowers/specs/2026-05-27-unified-onepage-design.md §4
 * ============================================================ */

:root {
  /* Stripe 시그니처 팔레트 */
  --bg: #f6f9fc;
  --surface: #ffffff;
  --surface-2: #f9fbfd;
  --ink: #0a2540;
  --ink-soft: #425466;
  --ink-faint: #8492a6;
  --accent: #635bff;
  --accent-hover: #5851ea;
  --accent-soft: #f4f3ff;

  /* 감탄 브랜드 보존 (형님 모드) */
  --gamtan: #2d5f3f;
  --gamtan-soft: #e8f0ea;
  --gamtan-deep: #1a2e1f;

  /* 상태 색상 */
  --success: #00d924;
  --success-soft: #e6fcec;
  --warn: #ed5f74;
  --warn-soft: #fdecef;
  --info: #1e88e5;
  --info-soft: #e3f2fd;
  --gold: #ffd54f;
  --gold-soft: #fff8e1;

  /* 보더 / 그림자 */
  --line: #e3e8ee;
  --line-strong: #cfd7df;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 8px -2px rgba(50, 50, 93, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 13px 27px -5px rgba(50, 50, 93, 0.15), 0 8px 16px -8px rgba(0, 0, 0, 0.2);

  /* 라운드 */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --header-h: 56px;
  --tabs-h: 48px;
}

* { box-sizing: border-box; }

/* ====== 다크모드 토큰 (SES-0528 B2 — admin only, Linear/Notion 톤 참고) ====== */
body[data-theme='dark']:not([data-role='brother']) {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2128;
  --ink: #e6edf3;
  --ink-soft: #9aa5b1;
  --ink-faint: #6e7681;
  --accent: #7c7dff;
  --accent-hover: #8a8bff;
  --accent-soft: rgba(124, 125, 255, 0.16);
  --line: #30363d;
  --line-strong: #484f58;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 13px 27px -5px rgba(0, 0, 0, 0.6), 0 8px 16px -8px rgba(0, 0, 0, 0.4);
}
body[data-theme='dark']:not([data-role='brother']) .badge.neutral { background: var(--surface-2); color: var(--ink-soft); border-color: var(--line); }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ====== 형님 모드 = 녹색 톤 (§0 가드레일 — 익숙한 톤 보존) ====== */
body[data-role='brother'] {
  --bg: #f7f5f0;
  --accent: var(--gamtan);
  --accent-soft: var(--gamtan-soft);
  --ink: var(--gamtan-deep);
}

/* ====== 로딩 오버레이 ====== */
#loading {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); z-index: 9999;
  font-size: 14px; color: var(--ink-faint);
}
#loading.hidden { display: none; }

/* ====== 로그인 오버레이 ====== */
#login-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 37, 64, 0.6);
  display: none;
  align-items: center; justify-content: center;
  z-index: 8000;
  backdrop-filter: blur(4px);
}
#login-overlay.show { display: flex; }

.login-card {
  background: var(--surface);
  padding: 32px;
  border-radius: var(--radius-lg);
  width: 360px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
}
.login-card h2 { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: var(--ink); }
.login-card p.hint { margin: 0 0 20px; color: var(--ink-faint); font-size: 13px; }
.login-card .login-tabs { display: flex; gap: 4px; margin-bottom: 16px; padding: 4px; background: var(--surface-2); border-radius: var(--radius); }
.login-card .login-tabs button {
  flex: 1; padding: 8px 12px; border: none; background: transparent;
  border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-size: 14px;
  color: var(--ink-soft); transition: all 0.15s;
}
.login-card .login-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.login-card input {
  width: 100%; padding: 12px 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: inherit; transition: border 0.15s;
}
.login-input-wrap { position: relative; }
.login-input-wrap input { padding-right: 44px; }
.login-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer;
  width: 36px; height: 36px; font-size: 18px; color: var(--ink-faint);
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.login-eye:hover { background: var(--surface-2); color: var(--ink); }
.login-eye.active { color: var(--accent); }
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card .login-error { min-height: 18px; margin-top: 8px; color: var(--warn); font-size: 13px; }

/* ====== 상단 헤더 ====== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--gamtan));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 14px;
}
.header-right { display: flex; align-items: center; gap: 12px; }
.role-pill {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}
.btn-logout {
  padding: 6px 12px; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-size: 13px;
  color: var(--ink-soft); transition: all 0.15s;
}
.btn-logout:hover { background: var(--surface-2); border-color: var(--line-strong); }

/* ====== 모바일 헤더 — 글자 세로 밀림(감/탄/크/리) 방지 ====== */
@media (max-width: 600px) {
  .app-header { height: auto; min-height: var(--header-h); flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .brand { font-size: 15px; gap: 8px; }
  .header-right { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .role-pill { white-space: nowrap; padding: 3px 8px; font-size: 11px; }
  .btn-logout { white-space: nowrap; padding: 5px 9px; font-size: 12px; }
  #btn-kbd-help { display: none !important; } /* 폰에선 단축키 도움말 숨김 */
}
/* ====== 통계 표 모바일 가로 넘침 방지 ====== */
#stats-roi-root, #stats-calendar-root, #stats-funnel-root { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.roi-table { font-size: 13px; }
.roi-table th, .roi-table td { white-space: nowrap; padding: 8px 10px; }

/* ====== 탭 네비게이션 ====== */
.app-tabs {
  position: sticky; top: var(--header-h); z-index: 99;
  display: flex; gap: 0;
  height: var(--tabs-h);
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.app-tabs button {
  position: relative;
  padding: 0 16px;
  border: none; background: transparent;
  font: inherit; font-size: 14px; font-weight: 500;
  color: var(--ink-soft); cursor: pointer; transition: color 0.15s;
  white-space: nowrap;
}
.app-tabs button:hover { color: var(--ink); }
.app-tabs button.active { color: var(--accent); font-weight: 600; }
.app-tabs button.active::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}
/* SES-0530 — 카페 탭 강조 (노다지) */
.app-tabs button.tab-highlight {
  color: #e65100; font-weight: 800;
}
.app-tabs button.tab-highlight.active { color: #e65100; }
.app-tabs button.tab-highlight.active::after { background: #ff8f00; }

/* ====== 메인 콘텐츠 ====== */
main {
  max-width: 1280px; margin: 0 auto; padding: 24px;
}
.pane { display: none; }
.pane.active { display: block; }

/* ====== 카드 ====== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.card-title { margin: 0 0 12px; font-size: 16px; font-weight: 600; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-subtitle { margin: 0 0 16px; color: var(--ink-faint); font-size: 13px; }

/* ====== 그리드 ====== */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  main { padding: 16px; }
}

/* ====== KPI 숫자 ====== */
.kpi {
  display: flex; flex-direction: column; gap: 6px;
}
.kpi-num { font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1; }
.kpi-label { font-size: 13px; color: var(--ink-faint); }
.kpi-delta { font-size: 12px; font-weight: 500; }
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--warn); }

/* ====== 배지 ====== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}
.badge.success { background: var(--success-soft); color: #00882b; }
.badge.warn { background: var(--warn-soft); color: #c73a51; }
.badge.info { background: var(--info-soft); color: #0d47a1; }
.badge.gold { background: var(--gold-soft); color: #b8860b; }
.badge.neutral { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }

/* ====== 버튼 (SES-0528 A2 + SES-0529 B2: 글자 밀림 영구 fix — white-space nowrap) ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  border: none; background: var(--accent); color: #fff;
  border-radius: var(--radius); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
@media (pointer: coarse) {
  .btn { min-height: 48px; }
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn.success { background: var(--success); }
.btn.warn { background: var(--warn); }
.btn.lg { padding: 12px 20px; font-size: 15px; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.full { width: 100%; }

/* ====== 입력 ====== */
input[type='text'], input[type='password'], input[type='tel'], input[type='email'], input[type='number'], select, textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-size: 14px;
  background: var(--surface); color: var(--ink);
  transition: border 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 96px; resize: vertical; }
label { display: block; margin: 12px 0 4px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }

/* ====== 토스트 ====== */
.toast-area {
  position: fixed; top: 76px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 16px;
  background: var(--ink); color: #fff;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  animation: toast-in 0.2s ease-out;
}
.toast.success { background: var(--success); }
.toast.warn { background: var(--warn); }
.toast.info { background: var(--info); }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ====== 1-tap 블로그 카드 ====== */
.blog-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.2s;
}
.blog-card.expanded { box-shadow: var(--shadow-lg); border-color: var(--accent); }
.blog-card.highlighted { outline: 3px solid var(--accent); outline-offset: -1px; animation: pulse 2s ease-out 2; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 91, 255, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(99, 91, 255, 0); }
}
.blog-card-header {
  padding: 16px 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.blog-card-header:hover { background: var(--surface-2); }
.blog-card-title { font-weight: 600; font-size: 15px; color: var(--ink); flex: 1; }
.blog-card-meta { display: flex; gap: 6px; align-items: center; }
.blog-card-body {
  display: none;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.blog-card.expanded .blog-card-body { display: block; }
.blog-howto {
  font-size: 13px; line-height: 1.7; color: var(--ink);
  background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 12px;
}
.blog-primary-actions { display: grid; gap: 8px; margin-bottom: 10px; }
.blog-primary-actions .btn { width: 100%; }
.blog-primary-actions .share-btn { background: #03c75a; color: #fff; }
.blog-manual { margin-bottom: 4px; }
.blog-manual > summary { cursor: pointer; font-size: 13px; color: var(--ink-faint); padding: 6px 0; }
.wizard-dots { display: flex; gap: 6px; justify-content: center; margin: 10px 0 14px; flex-wrap: wrap; }
.wizard-dot {
  width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-faint); border: 1px solid var(--line);
}
/* .wizard-dot.now — SES-0601 패치에서 재정의됨 (하단 참고) */
.wizard-dot.done { background: var(--success-soft, #e6fcec); color: #00882b; border-color: #00882b; }
.wizard-now {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px;
}
.wizard-label { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.wizard-desc { font-size: 14px; line-height: 1.6; color: var(--ink); }
.cl-help { margin-top: 12px; font-size: 13px; }
.cl-help summary { cursor: pointer; color: var(--brand, #2d5f3f); font-weight: 600; }
.cl-help ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.9; }

/* ====== 광고 탭 — 입주 임박 추천 카드 ====== */
.ad-reco-card {
  background: var(--surface); border: 1px solid var(--line); border-left-width: 5px;
  border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
}
.ad-reco-card.ad-hot { border-left-color: #d32f2f; background: #fff5f5; }
.ad-reco-card.ad-warm { border-left-color: #ff8a80; }
.ad-reco-card.ad-post { border-left-color: #ffb74d; }
.ad-reco-card.ad-future { border-left-color: var(--line); opacity: 0.7; }
.ad-reco-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.ad-reco-sub { font-size: 13px; color: var(--ink-faint); margin: 4px 0 8px; }
.ad-reco-bid { font-size: 14px; color: var(--ink); margin-bottom: 10px; }
.ad-reco-bid strong { color: #00882b; font-size: 16px; }
.ad-mult { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.ad-mult.ad-hot { background: #d32f2f; color: #fff; }
.ad-mult.ad-warm { background: #ffebee; color: #c62828; }
.ad-mult.ad-post { background: #fff3e0; color: #e65100; }
.ad-mult.ad-future { background: var(--surface-2); color: var(--ink-faint); }
.ad-chip { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--success-soft, #e6fcec); color: #00882b; margin-left: 6px; }
.ad-chip.ad-chip-new { background: #fff3e0; color: #e65100; }
.ad-section-title { font-size: 15px; font-weight: 700; color: var(--ink); margin: 6px 0 10px; }
.ad-future-list { list-style: none; margin: 0; padding: 0; }
.ad-future-list li { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: 14px; background: var(--surface); }

/* ====== 광고 현황 한눈에 (overview) ====== */
.ad-ov-card { padding: 16px; }
.ad-ov-head { margin-bottom: 12px; }
.ad-ov-status { font-size: 17px; font-weight: 800; color: var(--ink); }
.ad-ov-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 480px) { .ad-ov-grid { grid-template-columns: repeat(4, 1fr); } }
.ad-ov-cell { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ad-ov-label { font-size: 12px; color: var(--ink-faint); margin-bottom: 4px; }
.ad-ov-num { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.ad-action { margin-top: 12px; background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 12px; padding: 14px 16px; }
.ad-action-text { font-size: 15px; line-height: 1.6; color: var(--ink); }
.ad-action .btn { width: 100%; }
details.ads-console { margin-top: 18px; }
details.ads-console > summary { cursor: pointer; font-size: 13px; color: var(--ink-faint); padding: 8px 0; font-weight: 600; }
details.ads-console[open] > summary { color: var(--ink); }

/* ====== 소개(중개) 탭 ====== */
.relay-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.relay-card.relay-st-completed { border-left: 4px solid #00882b; }
.relay-card.relay-st-contracted { border-left: 4px solid #fb8c00; }
.relay-card.relay-st-cancelled { opacity: 0.6; }
.relay-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.relay-sub { font-size: 13px; color: var(--ink-faint); margin-top: 3px; }
.relay-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.relay-tag { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #fff8e1; color: #8a6d00; border: 1px solid #ffe082; }
.relay-badge { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-faint); margin-left: 6px; }
.relay-partner-list { display: grid; gap: 8px; }
.relay-partner { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14px; }
.relay-partner.inactive { opacity: 0.5; }

/* ====== 상황판 (전광판) ====== */
.board-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 12px; margin-bottom: 8px; background: var(--surface); cursor: pointer; }
.board-item.bd-urgent { border-left-color: #d32f2f; background: #fff5f5; }
.board-item.bd-high { border-left-color: #fb8c00; }
.board-item.bd-normal { border-left-color: #2d5f3f; }
.board-item.bd-info { border-left-color: var(--line); }
.board-icon { font-size: 22px; }
.board-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.board-detail { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }
.board-go { margin-left: auto; font-size: 20px; color: var(--ink-faint); }
.board-sugg, .board-anom { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }

/* ====== 단지 탭 ====== */
.cx-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cx-chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; cursor: pointer; color: var(--ink); }
.cx-chip.active { background: var(--brand, #2d5f3f); color: #fff; border-color: var(--brand, #2d5f3f); }
.cx-group { margin-bottom: 16px; }
.cx-group-title { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.cx-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: var(--surface); cursor: pointer; }
.cx-item:hover { background: var(--surface-2); }
.cx-sub { font-size: 13px; color: var(--ink-faint); margin-top: 3px; }
.cx-badge { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }

/* ====== 문의 카드 ====== */
.inq-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: var(--surface); }
.inq-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inq-head a { font-weight: 600; }
.inq-sub { font-size: 13px; color: var(--ink-faint); margin-top: 4px; }
.inq-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.inq-tag { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.inq-tag.interior { background: #fff8e1; color: #8a6d00; border-color: #ffe082; }
.inq-memo { font-size: 13px; color: var(--ink); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.inq-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.one-tap-actions {
  display: grid; gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 12px;
}
.one-tap-actions .btn.primary-1tap {
  grid-column: 1 / -1;
  padding: 14px 16px;
  font-size: 15px;
  background: linear-gradient(135deg, var(--accent), var(--gamtan));
}
.one-tap-actions .btn.publish-done {
  grid-column: 1 / -1;
  background: var(--success);
  padding: 14px 16px;
  font-size: 15px;
}
.blog-preview {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px; color: var(--ink-soft);
  max-height: 160px; overflow-y: auto;
  white-space: pre-wrap;
}

/* ====== 통계 통장 카드 (gold) ====== */
.kpi-gold {
  background: linear-gradient(135deg, var(--gold-soft), #ffe8a3);
  border-color: #f0d97a;
}
.kpi-gold .kpi-num { color: #b8860b; }

/* ====== 형님 모드 강조 (큰 버튼/큰 폰트) ====== */
body[data-role='brother'] .card { padding: 20px; border-radius: 16px; }
body[data-role='brother'] .btn { padding: 12px 18px; font-size: 15px; min-height: 48px; border-radius: 12px; }
body[data-role='brother'] .btn.lg { padding: 16px 22px; font-size: 17px; min-height: 56px; }
body[data-role='brother'] .blog-card-title { font-size: 16px; }
body[data-role='brother'] .kpi-num { font-size: 32px; }

/* ====== 빈 상태 ====== */
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 14px;
}
.empty-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.5; }

/* ====== 표 ====== */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th { padding: 10px 12px; text-align: left; color: var(--ink-faint); font-weight: 600; border-bottom: 1px solid var(--line); background: var(--surface-2); }
table td { padding: 12px; border-bottom: 1px solid var(--line); color: var(--ink); }
table tr:hover td { background: var(--surface-2); }

/* ====== #6 채널 ROI 표 ====== */
.roi-table th.num, .roi-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.roi-table td:first-child { font-weight: 600; }

/* ====== 도구 패널 (admin 전용) ====== */
.tool-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tool-tile {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none; color: inherit;
  transition: all 0.15s;
  cursor: pointer;
}
.tool-tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tool-tile-icon { font-size: 28px; }
.tool-tile-name { font-weight: 600; font-size: 15px; }
.tool-tile-desc { font-size: 13px; color: var(--ink-faint); }

/* ====== 하단 고정 바 (형님 모드 전용) ====== */
.bottom-bar-mobile {
  display: none;
}
@media (max-width: 600px) {
  body[data-role='brother'] .bottom-bar-mobile {
    display: grid;
    position: fixed; left: 0; right: 0; bottom: 0;
    grid-template-columns: 1fr 1fr;
    gap: 8px; padding: 10px 12px;
    background: rgba(247, 245, 240, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(8px);
    z-index: 50;
  }
  body[data-role='brother'] main { padding-bottom: 80px; }
}

/* ====== utility ====== */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-soft { color: var(--ink-soft); }
.text-faint { color: var(--ink-faint); }
.text-sm { font-size: 13px; }
.text-lg { font-size: 17px; }
.fw-700 { font-weight: 700; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
[hidden] { display: none !important; }

/* ============================================================
 * SES-0528 신규 컴포넌트
 * ============================================================ */

/* ====== PWA iOS 안내 배너 ====== */
.ios-install-banner {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 9000;
  max-width: 92vw;
}
.ios-install-content { display: flex; flex-direction: column; gap: 2px; flex: 1; }

/* ====== Offline 배너 ====== */
.offline-banner {
  position: fixed; left: 0; right: 0; top: 0;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 8px 16px;
  background: var(--warn); color: #fff;
  font-size: 14px; font-weight: 600;
  z-index: 9500;
}

/* ====== 커스텀 모달 (Stripe 톤, A3) ====== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 37, 64, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 8500;
  backdrop-filter: blur(4px);
}
.modal-dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 420px; max-width: 92vw;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.modal-dialog h3 { margin: 0 0 8px; font-size: 18px; }
.modal-dialog .modal-body { margin: 0 0 20px; color: var(--ink-soft); line-height: 1.6; }
.modal-dialog .modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ====== SVG 차트 (B8) ====== */
.chart-wrap { padding: 12px 0; }
.chart-svg { width: 100%; height: auto; }
.chart-bar { fill: var(--accent); transition: fill 0.2s; }
.chart-bar:hover { fill: var(--accent-hover); }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-label { font: 12px Pretendard, sans-serif; fill: var(--ink-soft); }
.chart-value { font: 700 13px Pretendard, sans-serif; fill: var(--ink); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.chart-legend span::before { content: '■'; margin-right: 4px; color: var(--accent); }

/* ====== 검색 필터 (B5) ====== */
.search-wrap {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.search-input {
  padding: 9px 14px 9px 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%238492a6' stroke-width='2'><circle cx='7' cy='7' r='5'/><line x1='11' y1='11' x2='14' y2='14'/></svg>");
  background-repeat: no-repeat;
  background-position: 12px center;
}
.search-count { font-size: 13px; color: var(--ink-faint); white-space: nowrap; }

/* ====== 카드 핀 (C2) ====== */
.blog-card.pinned { border-color: var(--gold); border-width: 2px; }
.btn-pin {
  background: transparent; color: var(--ink-faint); border: none;
  cursor: pointer; padding: 4px 8px; font-size: 18px; line-height: 1;
  border-radius: 6px;
}
.btn-pin:hover { background: var(--surface-2); color: var(--gold); }
.btn-pin.active { color: var(--gold); }

/* ====== 빈 상태 SVG 일러스트 (C4) ====== */
.empty-illustration {
  width: 96px; height: 96px; margin: 0 auto 16px;
  opacity: 0.6;
}

/* ====== 단축키 도움말 (B1) ====== */
.kbd-help-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 37, 64, 0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 8800; backdrop-filter: blur(4px);
}
.kbd-help-dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 480px; max-width: 92vw;
  box-shadow: var(--shadow-lg);
}
.kbd-help-dialog h3 { margin: 0 0 16px; }
.kbd-help-table { width: 100%; border-collapse: collapse; }
.kbd-help-table td { padding: 8px 0; }
.kbd-help-table td:first-child { width: 120px; }
kbd {
  display: inline-block;
  padding: 3px 8px;
  font: 600 12px 'JetBrains Mono', SF Mono, monospace;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  margin-right: 4px;
}

/* ====== 다크모드 토글 버튼 (헤더) ====== */
.theme-toggle {
  background: transparent; border: 1px solid var(--line);
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 16px; color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); }

/* ====== Focus visible (B3 접근성) ====== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible { outline-offset: 3px; }

/* ====== Undo 토스트 (C1) ====== */
.toast.with-action {
  display: flex; align-items: center; gap: 12px;
  padding-right: 8px;
}
.toast-action {
  background: rgba(255,255,255,0.2); border: none; color: #fff;
  padding: 6px 12px; border-radius: 4px;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.toast-action:hover { background: rgba(255,255,255,0.3); }

/* ====== 외부 채널 허브 (C3) ====== */
.channel-link-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none; color: inherit;
  transition: all 0.15s;
}
.channel-link-tile:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.channel-link-icon { font-size: 24px; }
.channel-link-name { font-weight: 600; }
.channel-link-handle { font-size: 13px; color: var(--ink-faint); }

/* ====== Sr-only (접근성) ====== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
 * SES-0529 — 형님 자율 운영 패러다임 — 카드 재설계
 * ============================================================ */

/* ====== SES-0529 폰트 스케일 (형님 70세 시력 배려, 가-/가+ 버튼) ======
 * body[data-fs="1"|"2"|"3"] — 1=보통(18px) 2=크게(21px) 3=아주크게(24px)
 * 카드 주요 텍스트가 단계별 확대. localStorage 영속. */
body { --card-font: 18px; --card-channel-font: 20px; }
body[data-fs='2'] { --card-font: 21px; --card-channel-font: 23px; }
body[data-fs='3'] { --card-font: 24px; --card-channel-font: 27px; }

/* 카드 헤더 — 채널명 + 인덱스 배지 + 펼치기 화살표 (가로) */
.brother-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-left: 6px solid var(--warn);   /* 안 한 것 = 주황 막대 (눈에 확 띔) */
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.brother-card.expanded { border-color: var(--accent); border-left-color: var(--accent); box-shadow: var(--shadow-md); }
/* SES-0529 — 완료 = 연녹색 배경 + 녹색 막대 (회색 흐림 X, 색으로 명확 구분) */
.brother-card.done {
  background: #eaf7ec;
  border-left-color: var(--success);
  border-color: #c3e6c9;
}
.brother-card.active-view { box-shadow: 0 0 0 4px var(--accent-soft); }

.brother-card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.brother-card-head:hover { background: var(--surface-2); }
.brother-card.done .brother-card-head:hover { background: #e0f2e3; }

.card-index-badge {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; height: 36px;
  padding: 0 10px;
  background: var(--warn-soft); color: #c73a51;
  border-radius: 18px;
  font-size: 16px; font-weight: 900;
  letter-spacing: -0.02em;
}
.brother-card.done .card-index-badge { background: var(--success-soft); color: #00882b; }

.card-channel-name {
  flex: 1;
  font-size: var(--card-channel-font); font-weight: 800;
  color: var(--ink);
  word-break: keep-all;
  line-height: 1.35;
}
.brother-card.done .card-channel-name { color: #1b5e20; }

/* 완료/미완료 상태 칩 (채널명 옆) */
.card-status-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 14px; font-weight: 800;
  vertical-align: middle;
}
.card-status-chip.todo { background: var(--warn-soft); color: #c73a51; }
.card-status-chip.done { background: var(--success-soft); color: #00882b; }

.card-expand-arrow {
  flex-shrink: 0;
  font-size: 18px; color: var(--ink-faint);
  transition: transform 0.2s;
}
.brother-card.expanded .card-expand-arrow { transform: rotate(180deg); }

/* 카드 본문 (펼침 시) */
.brother-card-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.brother-card.expanded .brother-card-body { display: block; }

.card-preview {
  margin: 14px 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--card-font); line-height: 1.7;
  white-space: pre-wrap; word-break: keep-all;
  max-height: 280px; overflow-y: auto;
}

.card-steps-list {
  margin: 14px 0;
  padding: 14px 16px;
  background: #fff8e1;
  border: 2px solid #ffe082;
  border-radius: var(--radius);
  font-size: var(--card-font);
  list-style: none;
  counter-reset: step;
}
.card-steps-list li {
  position: relative;
  padding: 9px 0 9px 40px;
  counter-increment: step;
  line-height: 1.6;
  word-break: keep-all;
}
.card-steps-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: 8px;
  width: 28px; height: 28px;
  background: #ff8f00; color: #fff;
  border-radius: 50%;
  font: 900 15px/28px Pretendard;
  text-align: center;
}

.card-tip {
  margin: 10px 0 14px;
  padding: 10px 14px;
  background: #e3f2fd;
  color: #0d47a1;
  border-radius: 8px;
  font-size: calc(var(--card-font) - 2px);
  line-height: 1.6;
}

/* 카드 액션 버튼 — 모바일 세로 stack, 데스크탑 가로 */
.card-action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}
@media (min-width: 481px) {
  .card-action-grid { grid-template-columns: 1fr 1fr; }
  .card-action-grid .btn-publish-open { grid-column: 1 / -1; }
  .card-action-grid .btn-card-done { grid-column: 1 / -1; }
}
.btn-publish-open {
  background: linear-gradient(135deg, var(--accent), var(--gamtan));
  padding: 16px 16px;
  font-size: calc(var(--card-font) + 1px);
  font-weight: 800;
  min-height: 56px;
}
.btn-card-done {
  background: var(--success);
  padding: 16px 16px;
  font-size: calc(var(--card-font) + 1px);
  font-weight: 800;
  min-height: 56px;
}
.card-action-grid .btn.secondary {
  font-size: var(--card-font);
  min-height: 52px;
}

/* ====== SES-0529 글자 크기 +/- 버튼 (헤더) ====== */
.font-size-controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 8px;
}
.font-size-controls button {
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 17px; font-weight: 800;
  color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
}
.font-size-controls button:hover { background: var(--surface-2); color: var(--ink); }
.font-size-controls button:active { background: var(--accent-soft); }

/* 카드 그룹 sticky 헤더 — 「오늘 꼭 올릴 카드」 같은 상위 라벨 (클릭 = 세트 접기/펼치기) */
.card-group-header {
  position: sticky;
  top: calc(var(--header-h) + var(--tabs-h));
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: none; border-bottom: 1px solid var(--line);
  font-family: inherit; font-size: 14px; font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer; text-align: left;
  min-height: 44px;
}
.card-group-header:active { background: var(--surface-2); }
.card-group-left { display: inline-flex; align-items: center; gap: 6px; }
.card-group-arrow {
  font-size: 11px; color: var(--ink-faint);
  display: inline-block; transition: transform .15s ease;
}
.card-group:not(.collapsed) .card-group-arrow { transform: rotate(90deg); }
.card-group.collapsed .brother-card { display: none; }
.card-group-progress {
  font-size: 13px;
  color: var(--accent);
}

/* 진행률 바 (상단 sticky) — 현재 보고 있는 카드 위치 */
.progress-bar-wrap {
  position: sticky;
  top: calc(var(--header-h) + var(--tabs-h));
  z-index: 60;
  height: 4px;
  background: var(--line);
  margin: 0 0 8px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gamtan));
  transition: width 0.3s ease-out;
  width: 0%;
}
.progress-bar-text {
  position: sticky;
  top: calc(var(--header-h) + var(--tabs-h) + 4px);
  z-index: 59;
  padding: 4px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-faint);
  text-align: right;
}

/* ====== SES-0529 C1 — 플로팅 바 스마트화 (default 숨김, 스크롤 끝에서만) ====== */
@media (max-width: 600px) {
  body[data-role='brother'] .bottom-bar-mobile {
    transform: translateY(120%);
    transition: transform 0.3s ease-out;
  }
  body[data-role='brother'] .bottom-bar-mobile.show {
    transform: translateY(0);
  }
  body[data-role='brother'].always-show-bottom-bar .bottom-bar-mobile {
    transform: translateY(0) !important;
  }
}

/* ====== SES-0529 D3 — 수석 설정 collapse 섹션 ====== */
.advanced-settings {
  margin-top: 24px;
  padding: 16px;
  background: #fafbfc;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}
.advanced-settings-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  background: transparent; border: none; cursor: pointer;
  padding: 4px 0;
  font: inherit; font-size: 15px; font-weight: 700;
  color: var(--ink-soft);
  text-align: left;
}
.advanced-settings-toggle:hover { color: var(--ink); }
.advanced-settings-arrow { font-size: 14px; transition: transform 0.2s; }
.advanced-settings.open .advanced-settings-arrow { transform: rotate(90deg); }
.advanced-settings-body {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.advanced-settings.open .advanced-settings-body { display: block; }

/* 설정 항목 (수석 전용 + 형님이 토글하는 옵션) */
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: none; }
.setting-label { flex: 1; font-size: 14px; color: var(--ink); }
.setting-desc { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }

/* 토글 스위치 */
.toggle-switch {
  position: relative; display: inline-block;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  inset: 0;
  background: var(--line-strong);
  border-radius: 12px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* 「새 문의는 무엇?」 안내 */
.section-hint {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

/* ============================================================
 * SES-0531 — 전화중심 CS + 오늘 할 일 네비게이션 + 빠른 접수
 * ============================================================ */

/* 미처리 카드 (고객 탭) — 색깔로 클레임/문의 + 경과일 진하기 */
.pending-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-left: 8px solid var(--warn);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  padding: 16px;
}
.pending-card.urgent-0 { border-left-color: #ed5f74; background: #fff5f6; }
.pending-card.urgent-1 { border-left-color: #e53935; background: #ffebee; }
.pending-card.urgent-3 { border-left-color: #b71c1c; background: #ffcdd2; }
.pending-card.normal { border-left-color: #ff9800; background: #fff8f0; }
.pending-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pending-type { font-size: var(--card-font); font-weight: 800; }
.pending-type.claim { color: #c62828; }
.pending-type.inquiry { color: #e65100; }
.pending-elapsed { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.pending-name { font-size: var(--card-font); font-weight: 700; color: var(--ink); }
.pending-meta { font-size: calc(var(--card-font) - 2px); color: var(--ink-soft); margin-top: 4px; }
.pending-memo { margin-top: 8px; padding: 10px; background: var(--surface); border-radius: 8px; font-size: var(--card-font); line-height: 1.5; word-break: keep-all; }
.pending-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.pending-actions .btn { min-height: 52px; font-size: var(--card-font); }

/* 오늘 할 일 네비게이션 (홈 최상단) */
.today-todo-box {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.today-todo-title { font-size: var(--card-channel-font); font-weight: 800; color: var(--ink); margin-bottom: 12px; }
.todo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 12px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  border-left: 6px solid var(--line);
  -webkit-tap-highlight-color: transparent;
}
.todo-item:active { transform: scale(0.99); }
.todo-red { background: #ffebee; border-left-color: #e53935; }
.todo-orange { background: #fff8f0; border-left-color: #ff9800; }
.todo-blue { background: #e3f2fd; border-left-color: #1e88e5; }
.todo-green { background: #e8f5e9; border-left-color: #43a047; }
.todo-num {
  flex-shrink: 0; width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff; border-radius: 50%;
  font-weight: 900; font-size: 15px;
}
.todo-icon { font-size: 22px; flex-shrink: 0; }
.todo-text { flex: 1; font-size: var(--card-font); color: var(--ink); line-height: 1.4; }
.todo-sub { font-size: calc(var(--card-font) - 3px); color: var(--ink-soft); }
.todo-arrow { font-size: 24px; color: var(--ink-faint); flex-shrink: 0; }

/* 빠른 접수 모달 버튼 그룹 */
.intake-field { margin-bottom: 14px; }
.intake-field label { display: block; margin-bottom: 6px; font-size: var(--card-font); font-weight: 700; color: var(--ink); }
.intake-btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.intake-btn {
  flex: 1; min-width: 70px; min-height: 48px;
  padding: 8px 10px;
  border: 2px solid var(--line); background: var(--surface);
  border-radius: var(--radius); cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--ink-soft);
}
.intake-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 800; }
#intake-complex, #intake-phone, #intake-memo { font-size: var(--card-font); min-height: 48px; }

/* ============================================================
 * SES-0601 — UI/UX 개선 패치
 * ============================================================ */

/* ====== 형님 카드 헤더 터치 피드백 강화 ====== */
.brother-card-head {
  transition: background-color 0.15s ease;
}
.brother-card-head:active {
  background-color: var(--gamtan-soft);
  transform: scale(0.995);
}

/* ====== 카드 액션 버튼 간격 확대 (오터치 방지) ====== */
.card-action-grid {
  gap: 12px;
}

/* ====== 상황판 board-item 호버/클릭 전환 효과 ====== */
.board-item {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.board-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.board-item:active {
  transform: translateY(0);
}
/* 긴급 항목 펄스 애니메이션 */
.board-item.bd-urgent {
  animation: board-urgent-pulse 2.5s ease-in-out infinite;
}
@keyframes board-urgent-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
  50% { box-shadow: 0 0 0 6px rgba(211, 47, 47, 0.15); }
}

/* ====== 발행 도우미 현재 스텝 강조 ====== */
.wizard-dot.now {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  transform: scale(1.15);
  transition: all 0.2s ease;
  z-index: 1;
  position: relative;
}
.wizard-dot.done {
  opacity: 0.55;
}

/* ====== 빈 상태(empty) CTA 강화 ====== */
.empty-cta {
  margin-top: 12px;
  padding: 8px 20px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.empty-cta:hover { background: var(--accent); color: #fff; }

/* ====== 협력업체 카테고리 필터 ====== */
#partner-category-filter {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
}

/* ====== 빠른 단지 선택 버튼 그룹 (빠른 접수 모달) ====== */
#intake-complex-quick {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 8px;
}
#intake-complex-quick .intake-btn {
  flex: none;
  min-width: auto;
  padding: 8px 14px;
  font-size: 14px;
}
/* 기타 선택 시 select 표시 */
#intake-complex.show-fallback {
  display: block !important;
  margin-top: 6px;
}

/* ============================================================
 * SES-CAFE-REFORM — 카페 카드 보강 + 관리자 카페 관리 탭
 * ============================================================ */

/* 카페 카드 헤더 — D-day 색상 뱃지 */
.cafe-dday-badge {
  display: inline-block; padding: 1px 7px; border-radius: 12px;
  font-size: 0.75rem; font-weight: 700; margin-right: 4px; vertical-align: middle;
}
.cafe-dday-hot    { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.cafe-dday-warm   { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.cafe-dday-future { background: #f3e5f5; color: #6a1b9a; border: 1px solid #ce93d8; }
.cafe-dday-muted  { background: var(--surface-2, #f5f5f5); color: var(--ink-faint, #757575); border: 1px solid var(--line, #e0e0e0); }

/* 동 레이블 */
.cafe-dong-label { font-size: 0.8rem; color: var(--ink-faint, #757575); font-weight: 400; margin-left: 3px; }

/* 세대수 뱃지 */
.cafe-units-badge {
  display: inline-block; padding: 1px 6px; border-radius: 10px;
  font-size: 0.72rem; background: #e3f2fd; color: #1565c0; margin-left: 4px; vertical-align: middle;
}

/* 핀 고정 단지 카드 강조 */
.brother-card.pinned { border-left: 3px solid #ffd600; background: #fffde7; }
.cafe-pin-badge {
  display: inline-block; background: #ffd600; color: #5d4037;
  font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 10px; margin-right: 4px; vertical-align: middle;
}

/* 핀 고정 버튼 활성 (단지 탭 data-cx-pin) */
.btn-pin-active { background: #ffd600 !important; color: #5d4037 !important; }

/* 단지 탭 — 연차 단계 섹션 */
.cx-stage-section { margin-bottom: 16px; }
.cx-stage-header {
  padding: 8px 12px; background: var(--surface-2, #fff); border-radius: 8px;
  margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cx-stage-desc { font-size: 0.75rem; color: var(--ink-faint, #757575); margin-left: auto; }

/* SES-CAFE-REFORM2 — 카페 탭 신축/구축 섹션 헤더 */
.cafe-section-head {
  font-size: 1rem; font-weight: 800; padding: 10px 4px 6px;
  margin: 8px 0 4px; border-bottom: 2px solid var(--line, #e0e0e0);
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.cafe-section-head.cafe-sec-new { color: #2d5f3f; border-color: #2d5f3f; }
.cafe-section-head.cafe-sec-old { color: #e65100; border-color: #e65100; margin-top: 20px; }
.cafe-sec-sub { font-size: 0.78rem; font-weight: 500; color: var(--ink-faint, #757575); }

/* SES-CAFE-REFORM3 — 단지 탭 세대수 강조 + 액션 */
.cx-units-badge { display:inline-block; padding:1px 7px; border-radius:10px; font-size:0.72rem; font-weight:700; margin-left:4px; vertical-align:middle; }
.cx-units-big { background:#fff3e0; color:#e65100; border:1px solid #ffb74d; }
.cx-units-mid { background:#e3f2fd; color:#1565c0; }
.cx-units-sm  { background:var(--surface-2,#f5f5f5); color:var(--ink-faint,#757575); }
.cx-item-big { border-left:3px solid #e65100; background:#fffaf3; }
.cx-item-head { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.cx-tip-big { font-size:0.78rem; color:#e65100; font-weight:600; margin-top:3px; }
.cx-item-actions { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
.cx-item-actions .btn { font-size:0.78rem; }

/* SES-CAFE-REFORM4 — 카페 온/오프/광고 투트랙 */
.cafe-track { border-radius:10px; padding:10px 12px; margin:8px 0; }
.cafe-track-on { background:#e8f5e9; border-left:3px solid #2d5f3f; }
.cafe-track-off { background:#fff3e0; border-left:3px solid #e65100; }
.cafe-track-ad { background:#e3f2fd; border-left:3px solid #1565c0; }
.cafe-track-title { font-weight:700; font-size:0.92rem; margin-bottom:4px; }
.cafe-track .card-steps-list { margin:4px 0 8px; padding-left:18px; font-size:0.85rem; line-height:1.7; }

@keyframes spin { to { transform: rotate(360deg); } }

/* SES-CAFE-REFORM4 — 단지 카드 연차별 공략 안내 */
.cx-play { font-size:0.8rem; border-radius:8px; padding:6px 10px; margin:6px 0; line-height:1.5; }
.cx-play-new { background:#e8f5e9; color:#2d5f3f; }
.cx-play-old { background:#fff3e0; color:#bf5000; }
