/* ══════════════════════════════════════════════════════════════════
   NLINK Hook (hook.nlink.kr) - 프리미엄 모던 스타일시트
   Simple is Best · 글래스모피즘 · 모바일 퍼스트 네이티브 UX
   ══════════════════════════════════════════════════════════════════ */

:root {
  --bg-main: #0b1120;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-sub: rgba(30, 41, 59, 0.7);
  --bg-soft: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-dialog: #0f172a;
  
  --border: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-dialog: rgba(255, 255, 255, 0.14);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  
  --accent: #38bdf8;
  --accent-blue: #0284c7;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-sub: #f1f5f9;
  --bg-soft: rgba(0, 0, 0, 0.04);
  --bg-card-hover: rgba(0, 0, 0, 0.06);
  --bg-dialog: #ffffff;
  
  --border: rgba(0, 0, 0, 0.1);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-dialog: rgba(0, 0, 0, 0.15);
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
}

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

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  
  /* 모바일 웹앱 터치 검색 방지 기본 적용 */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

input, textarea, code, pre, .selectable {
  -webkit-user-select: text;
  user-select: text;
}

/* 터치 스크롤 최적화 */
.touch-scroll-y {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ══════════════════════════════════════════════════════════════════
   1. 헤더 (Header)
   ══════════════════════════════════════════════════════════════════ */
.app-header, .landing-header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  min-width: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.brand-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-main);
  line-height: 1.15;
}
.brand-title span {
  color: var(--accent);
}

/* nlink 시그니처 BETA 뱃지 (로고 어깨 밀착형 · todolist 표준) */
.brand-beta-tag {
  position: relative;
  top: -4.5px;
  margin-left: 2.5px;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #38bdf8 100%);
  color: #ffffff !important;
  font-size: 7.5px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 1.5px 5px;
  border-radius: 9999px;
  border: 1px solid rgba(186, 230, 253, 0.85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 8px rgba(56, 189, 248, 0.45);
  pointer-events: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* todolist 표준 상단 PWA 안심 가이드 알약 버튼 */
.header-pwa-btn {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  font-size: 11.5px;
  font-weight: 700;
  height: 30px;
  box-sizing: border-box;
  padding: 0 9px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}
.header-pwa-btn:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.6);
  transform: translateY(-1px);
}

.badge-beta {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1.5px 5.5px;
  border-radius: 5px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  line-height: 1;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
  margin-top: 1px;
}

.header-actions, .landing-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* 알약 버튼 */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-soft);
  color: var(--text-muted);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.pill-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: rgba(56, 189, 248, 0.4);
}
.pill-btn.pwa-btn {
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}
.pill-btn.primary {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  border: 0;
  font-weight: 800;
}

.topbar-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-soft);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.topbar-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════════
   2. 비로그인 랜딩 페이지
   ══════════════════════════════════════════════════════════════════ */
.landing-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.hero-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.5px;
}

.hero-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 코드 프리뷰 박스 */
.code-preview-box {
  width: 100%;
  border-radius: 12px;
  background: #030712;
  border: 1px solid var(--border);
  overflow: hidden;
  text-align: left;
  margin-top: 8px;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  gap: 8px;
  flex-wrap: wrap;
}
.demo-tabs {
  display: flex;
  gap: 4px;
}
.demo-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.demo-tab:hover {
  color: var(--text-main);
}
.demo-tab.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}
.demo-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge-example {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.code-copy-btn {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  cursor: pointer;
}
.code-preview-box pre {
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
  overflow-x: auto;
  line-height: 1.55;
  white-space: pre-wrap;
}
.demo-hint-sub {
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 14px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.2);
}

/* 인증 카드 */
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: 10px;
}
.auth-tab {
  padding: 9px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.auth-tab.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
  text-align: left;
}
.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.form-group input {
  padding: 11px 12px;
  font-size: 13.5px;
  border-radius: 9px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}
.form-group input:focus {
  border-color: var(--accent);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-input-wrap input {
  width: 100%;
  padding-right: 42px !important;
  box-sizing: border-box;
}
.btn-toggle-pw {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s;
}
.btn-toggle-pw:hover {
  color: var(--text-main);
}

.form-options {
  margin: 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.remember-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.forgot-link-btn, .forgot-link {
  background: transparent;
  border: none;
  padding: 4px 6px;
  font-size: 12px;
  color: #38bdf8;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  border-radius: 4px;
  transition: all 0.15s ease;
  user-select: none;
}
.forgot-link-btn:hover, .forgot-link:hover {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.1);
}
.forgot-link-btn:active, .forgot-link:active {
  transform: scale(0.96);
}
.remember-label input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.primary-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  border: 0;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  transition: opacity 0.15s ease;
}
.primary-btn:hover {
  opacity: 0.93;
}

.auth-error {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 12px;
}

.legal-notice {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 14px;
  text-align: center;
}
.legal-notice a {
  color: var(--accent);
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════════
   3. 로그인 사용자 메인 뷰 (채팅방 중심 2단계 UX + 하단 네비게이션)
   ══════════════════════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  position: relative;
  background: var(--bg-main);
}

.app-main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* 탭 전환 컨테이너 */
.nav-tab-pane {
  display: none;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}
.nav-tab-pane.active {
  display: flex;
  flex-direction: column;
}

.tab-pane-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 14px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  box-sizing: border-box;
}

/* ──────────────────────────────────────────────────────────────────
   [TAB 1] 💬 알림 (채팅방 2단계 구조)
   ────────────────────────────────────────────────────────────────── */
.chats-view-layer {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.chat-rooms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  flex-shrink: 0;
}
.crh-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.crh-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}
.crh-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.icon-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s;
}
.icon-text-btn:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.chat-rooms-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 개별 봇 채팅방 카드 (카카오톡/텔레그램 방 목록 형태) */
.room-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.room-card:active {
  transform: scale(0.985);
  background: var(--bg-soft);
}
.room-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.room-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.room-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 20px;
}
.room-active-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--bg-card);
}

.room-main-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.room-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.room-title-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.room-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-role-pill {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}
.room-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.room-snippet-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.room-last-msg {
  font-size: 12.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.room-last-msg.urgent {
  color: #f87171;
  font-weight: 600;
}
.room-unread-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────────────
   [2단계] 특정 봇 1:1 대화방 타임라인 뷰
   ────────────────────────────────────────────────────────────────── */
.chat-room-timeline-layer {
  position: absolute;
  inset: 0;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.chat-room-timeline-layer[hidden] {
  display: none !important;
}

.timeline-topbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.timeline-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px 6px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.timeline-back-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
}

.timeline-bot-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  padding: 0 10px;
}
.timeline-bot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.timeline-bot-meta {
  min-width: 0;
}
.timeline-bot-meta b {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timeline-bot-meta small {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
}

.timeline-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 타임라인 말풍선 스크롤 영역 */
.timeline-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.timeline-messages .loading-spinner {
  padding: 40px 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* 메시지 버블 카드 (말풍선) */
.timeline-bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 92%;
  align-self: flex-start;
}
.tb-date-separator {
  align-self: center;
  padding: 3px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin: 8px 0;
}
.timeline-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 4px 16px 16px 16px;
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.timeline-bubble.urgent {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
}
.tb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
}
.tb-urgent-tag {
  background: #ef4444;
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 800;
}
.tb-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.4;
}
.tb-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}
.tb-time {
  font-size: 10px;
  color: var(--text-faint);
  align-self: flex-end;
  margin-top: 2px;
}

/* 타임라인 하단 Webhook 빠른 복사 툴바 */
.timeline-bottom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.tb-wh-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  background: #030712;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 5px 8px;
}
.tb-wh-tag {
  font-size: 9.5px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}
.tb-wh-preview code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* ──────────────────────────────────────────────────────────────────
   [TAB 3] AI 마스터키 & 발송 정책 카드
   ────────────────────────────────────────────────────────────────── */
.api-master-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.amc-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.amc-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.amc-meta b {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
}
.amc-meta small {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
  display: block;
}
.amc-key-box {
  background: #030712;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.amc-key-box code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-policy-card {
  background: rgba(56, 189, 248, 0.04);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.apc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.policy-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.policy-list li {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  padding-left: 14px;
  position: relative;
}
.policy-list li::before {
  content: "•";
  position: absolute;
  left: 3px;
  color: #38bdf8;
}
.policy-list li b {
  color: var(--text-main);
}

/* ──────────────────────────────────────────────────────────────────
   [TAB 4] 설정 그룹 카드
   ────────────────────────────────────────────────────────────────── */
.settings-card-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.scg-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  padding: 0 4px;
}

/* ──────────────────────────────────────────────────────────────────
   📱 하단 4-Tab 썸존 네비게이션 바 (chat.nlink.kr 규격)
   ────────────────────────────────────────────────────────────────── */
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  height: calc(58px + env(safe-area-inset-bottom));
  padding: 4px 6px env(safe-area-inset-bottom);
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  user-select: none;
}

.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 50px;
  padding: 4px 2px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.bnav-item:hover {
  background: var(--bg-soft);
  color: var(--text-main);
}
.bnav-item:active {
  transform: scale(0.94);
}

.bnav-item.selected {
  color: #38bdf8;
}
.bnav-item.selected .bnav-label {
  font-weight: 800;
  color: #38bdf8;
}
.bnav-item.selected svg {
  stroke: #38bdf8;
  stroke-width: 2.35;
}

.bnav-icon-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 24px;
}
.bnav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.bnav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.bnav-badge[hidden],
.bnav-badge.badge-zero {
  display: none !important;
}

/* 기존 대시보드 호환 스타일 */
.dashboard-main {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

/* AI 마스터 키 배너 */
.master-key-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.28);
  flex-wrap: wrap;
}
.mk-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}
.mk-info code {
  font-family: var(--font-mono);
  color: #38bdf8;
  font-weight: 700;
}
.mk-actions {
  display: flex;
  gap: 6px;
}
.mini-pill-btn {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  cursor: pointer;
}
.mini-pill-btn:hover {
  border-color: var(--accent);
}

.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}
.section-header h2 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}
.text-btn {
  background: transparent;
  border: 0;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

/* 봇 카드 그리드 */
.bots-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 600px) {
  .bots-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.bot-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease;
}
.bot-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

.bot-card-top {
  display: flex;
  align-items: center;
  gap: 9px;
}
.bot-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.bot-card-meta {
  flex: 1;
  min-width: 0;
}
.bot-card-meta b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bot-card-meta small {
  font-size: 11px;
  color: var(--text-muted);
}

.bot-stat-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.bot-webhook-box {
  background: #030712;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  width: 100%;
}
.bot-webhook-box code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #38bdf8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.copy-icon-btn {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  cursor: pointer;
  white-space: nowrap;
}

.bot-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 11.5px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  flex-wrap: wrap;
  gap: 6px;
}
.bot-card-actions .act-btn {
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}
.bot-card-actions .act-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}
.bot-card-actions .act-btn.danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
  margin-left: auto;
}
.bot-card-actions .act-btn.danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* 실시간 알림 피드 */
.notifications-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notif-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}
.notif-bot-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--text-main);
}
.notif-urgent-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}
.notif-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-state {
  padding: 30px 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* ══════════════════════════════════════════════════════════════════
   4. 슬라이드 네이티브 메뉴 (Drawer)
   ══════════════════════════════════════════════════════════════════ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  overflow: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.app-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 86%;
  max-width: 360px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-dialog);
  border-left: 1px solid var(--border-dialog);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.drawer-backdrop.open .app-drawer {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card-sub);
  flex-shrink: 0;
}
.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}
.drawer-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.drawer-profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(15, 23, 42, 0.9));
  color: #38bdf8;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.drawer-profile-info b {
  display: block;
  font-size: 14px;
  font-weight: 800;
}
.drawer-profile-info small {
  font-size: 11px;
  color: var(--text-muted);
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.drawer-section-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-left: 2px;
}

.drawer-card-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dcard-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}
.dcard-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.dcard-key-row code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #38bdf8;
  font-weight: 700;
}
.mini-btn {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  cursor: pointer;
}
.dcard-hint {
  font-size: 10.5px;
  color: var(--text-faint);
  line-height: 1.4;
}

.drawer-list {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}
.drawer-list-item {
  display: flex;
  align-items: center;
  padding: 11px 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.drawer-list-item:last-child {
  border-bottom: 0;
}
.drawer-list-item:hover {
  background: var(--bg-card-hover);
}
.dlist-icon {
  font-size: 15px;
  margin-right: 9px;
}
.dlist-label {
  flex: 1;
}
.dlist-value {
  font-size: 11px;
  color: var(--text-muted);
}
.dlist-badge {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

/* 기기 세션 목록 */
.device-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sess-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
}
.sess-item b {
  color: var(--text-main);
}
.sess-current-badge {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-weight: 700;
}
.drawer-btn-danger-outline {
  width: 100%;
  padding: 8px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  cursor: pointer;
  margin-top: 4px;
}

.drawer-footer {
  margin-top: auto;
}
.drawer-logout-btn {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════
   5. 모달 공통 (PWA 안심 모달, 약관 모달, 봇 생성)
   ══════════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.modal-backdrop[hidden] {
  display: none !important;
}

.modal-box {
  width: 100%;
  max-width: 440px;
  max-height: 86vh;
  max-height: 86dvh;
  background: var(--bg-dialog);
  border: 1px solid var(--border-dialog);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pwa-modal-box {
  max-width: 480px;
}
.legal-modal-box {
  max-width: 520px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  flex-shrink: 0;
}
.modal-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
  flex-shrink: 0;
}

/* PWA 모달 스타일 */
.pwa-reassurance-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.55;
}
.pwa-reassurance-card strong {
  color: #10b981;
}

.pwa-info-block {
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pwa-info-block-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}
.pwa-info-block.pros {
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.04);
}
.pwa-info-block.pros .pwa-info-block-title {
  color: #38bdf8;
}
.pwa-info-block.cons {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.04);
}
.pwa-info-block.cons .pwa-info-block-title {
  color: #f59e0b;
}

.pwa-diff-item {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}
.pwa-diff-item strong {
  color: var(--text-main);
}
.pwa-diff-item b {
  color: #38bdf8;
}

.pwa-pros-list, .pwa-cons-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}
.pwa-pros-list b, .pwa-cons-list b {
  color: var(--text-main);
}

.pwa-device-guide-box {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px dashed var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* 약관 2-in-1 탭 */
.legal-tabs {
  display: flex;
  gap: 6px;
}
.legal-tab {
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.legal-tab.active {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--text-main);
}

/* 아이콘 셀렉터 */
.icon-selector {
  display: flex;
  gap: 8px;
}
.icon-selector label {
  cursor: pointer;
}
.icon-selector input {
  display: none;
}
.icon-selector span {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 18px;
  transition: all 0.15s ease;
}
.icon-selector input:checked + span {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.15);
}

/* 토스트 */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-dialog);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 20000;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.toast[hidden] {
  display: none !important;
}

/* 갤럭시 S24 가로 360px 이하 반응형 */
@media (max-width: 380px) {
  .app-header {
    padding: 6px 8px;
  }
  .brand-title {
    font-size: 14px;
  }
  .brand-beta-tag {
    font-size: 6.5px;
    padding: 1px 4px;
    top: -4px;
  }
  .brand-sub {
    max-width: 90px;
  }
  .pill-btn.pwa-btn span {
    display: none;
  }
}

/* Turnstile 래퍼 (모바일 시인성 & 최소 높이 확보) */
.turnstile-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 65px;
  margin: 10px 0 14px;
}

/* 봇 카드 자동 보호 잠금 상태 */
.bot-card-locked {
  border-color: rgba(239, 68, 68, 0.45) !important;
  background: rgba(239, 68, 68, 0.04);
}
.bot-abuse-lock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  font-size: 12px;
  color: #fca5a5;
  font-weight: 600;
}
.mini-btn-warning {
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.mini-btn-warning:hover {
  opacity: 0.9;
}

/* 대시보드 운영 정책 안내 배너 */
.policy-notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 12px;
}
.policy-notice-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  line-height: 1.4;
}
.policy-badge {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
}
.policy-notice-left b {
  color: #f1f5f9;
}
.policy-link-btn {
  color: #38bdf8;
  font-weight: 700;
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: all 0.15s;
}
.policy-link-btn:hover {
  background: rgba(56, 189, 248, 0.2);
}
@media (max-width: 500px) {
  .policy-notice-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── 👥 5인 팀원 공유 및 관리 모달 스타일 ── */
.bot-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bot-role-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 999px;
  line-height: 1.2;
}
.pill-owner {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.pill-member {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.team-act-btn {
  background: rgba(56, 189, 248, 0.08) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
}
.team-act-btn:hover {
  background: rgba(56, 189, 248, 0.18) !important;
}

.team-modal-box {
  max-width: 480px;
}
.team-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.team-bot-icon {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.team-summary-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  margin-bottom: 16px;
}
.team-summary-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.team-count-badge {
  font-size: 15px;
  font-weight: 800;
  color: #38bdf8;
}
.team-summary-text {
  font-size: 11.5px;
  color: var(--text-muted);
}

.mini-btn-primary {
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.mini-btn-primary:hover {
  background: #0369a1;
}
.mini-btn-disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: not-allowed;
  white-space: nowrap;
}

.team-section-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.bot-team-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.team-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.tm-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.tm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
.tm-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tm-email-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tm-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}
.tm-tag-me {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  font-weight: 700;
}
.tm-role-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}
.tm-role-tag.role-owner {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.tm-role-tag.role-member {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.tm-joined {
  font-size: 11px;
  color: var(--text-muted);
}

.mini-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.mini-btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
}

.team-policy-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── 💻 봇 발송 예제 & 바이브 코더 프롬프트 모달 ── */
.snippet-modal-box {
  max-width: 560px;
}
.snippet-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 12px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.snippet-tabs::-webkit-scrollbar {
  display: none;
}
.snippet-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.snippet-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}
.snippet-tab.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.snippet-desc-line {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
}
.snippet-code-pre {
  background: #030712;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
  line-height: 1.6;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
