/* =============================================
   styles.css - Liquid Glass + 실시간 편집
   ============================================= */

:root {
  --font: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #dbeafe;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-bg: rgba(255,255,255,0.72);
  --glass-border: rgba(255,255,255,0.5);
  --glass-blur: 20px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* ★ 높이 체인 시작 */
  height: 100%;
}

/* ========== 인증 오버레이 ========== */
.auth-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  transition: opacity 0.4s ease;
}
.auth-spinner-wrap { text-align: center; }
.auth-spinner-wrap p { margin-top: 16px; color: var(--gray-500); }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 로그인 ========== */
.login-container {
  display: none; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 50%, #ecfdf5 100%);
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 40px 32px; text-align: center;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.8);
}
.login-logo { font-size: 48px; margin-bottom: 12px; }
.login-card h1 {
  font-size: 22px; font-weight: 700; color: var(--gray-900);
  margin-bottom: 4px;
}
.login-subtitle { color: var(--gray-500); font-size: 14px; margin-bottom: 28px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 8px; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--gray-400); font-size: 13px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-200);
}

.btn-webauthn {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: white; font-weight: 600;
}
.btn-webauthn:hover { background: linear-gradient(135deg, #0f172a, #1e293b); }

/* ========== 강제 비밀번호 변경 ========== */
.force-pw-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
}
.force-pw-modal {
  width: 100%; max-width: 420px;
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius); padding: 36px 28px; text-align: center;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.5);
  animation: glassModalIn 0.4s var(--spring);
}
.force-pw-icon { font-size: 48px; margin-bottom: 12px; }
.force-pw-modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.force-pw-modal p { color: var(--gray-500); font-size: 13px; margin-bottom: 24px; line-height: 1.5; }
.force-pw-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 8px; }

/* ========== 접근 거부 ========== */
.access-denied {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
.denied-card {
  text-align: center; padding: 40px;
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.5);
}
.denied-icon { font-size: 64px; margin-bottom: 16px; }
.denied-card h2 { font-size: 20px; margin-bottom: 8px; }
.denied-card p { color: var(--gray-500); margin-bottom: 24px; }

/* ★ 앱 컨테이너 — height: 100vh (min-height 아님!) */
.app-container {
  display: flex; flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ========== 헤더 — Liquid Glass ========== */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.header-title { font-size: 18px; font-weight: 700; color: var(--gray-900); }

.btn-back {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--gray-100); cursor: pointer;
  color: var(--gray-600); transition: var(--transition);
  text-decoration: none;
}
.btn-back:hover { background: var(--gray-200); }

.user-badge {
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 4px 12px; border-radius: var(--radius-sm);
  background: var(--gray-50);
}
.user-name { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.user-role { font-size: 11px; color: var(--gray-500); }
.role-system_admin { color: #dc2626; font-weight: 600; }
.role-broker { color: #2563eb; }
.role-page_admin { color: #059669; }

.btn-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  color: var(--gray-500); transition: var(--transition);
  text-decoration: none;
}
.btn-icon:hover { background: rgba(0,0,0,0.06); color: var(--gray-700); transform: scale(1.08); }
.btn-icon:active { transform: scale(0.95); }

.admin-badge {
  padding: 4px 10px; border-radius: 4px;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px;
}

/* ========== 폼 ========== */
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--gray-700); margin-bottom: 6px;
}
.required { color: var(--danger); }
.optional { color: var(--gray-400); font-weight: 400; }
.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; display: block; line-height: 1.5; }

input[type="text"], input[type="password"], input[type="email"],
textarea, select {
  width: 100%; padding: 10px 14px;
  border: 1px solid rgba(0,0,0,0.12); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px;
  color: var(--gray-800);
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
  background: rgba(255,255,255,0.9);
}
textarea { resize: vertical; min-height: 60px; }

/* ========== 버튼 — Liquid Glass ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 18px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.25s var(--spring);
  text-decoration: none; white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
  pointer-events: none; border-radius: inherit;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(59,130,246,0.3); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 4px 16px rgba(59,130,246,0.4); transform: translateY(-1px); }
.btn-secondary { background: rgba(0,0,0,0.04); color: var(--gray-700); backdrop-filter: blur(8px); border: 1px solid rgba(0,0,0,0.06); }
.btn-secondary:hover:not(:disabled) { background: rgba(0,0,0,0.08); transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; box-shadow: 0 2px 8px rgba(239,68,68,0.3); }
.btn-danger:hover:not(:disabled) { background: #dc2626; box-shadow: 0 4px 16px rgba(239,68,68,0.4); transform: translateY(-1px); }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon-text { font-size: 16px; }

/* ★ 대시보드 뷰 — 스크롤 가능 */
.dashboard-view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ========== 통계 ========== */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px; padding: 24px; padding-bottom: 0;
}
.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius);
  padding: 20px; text-align: center;
  box-shadow: var(--shadow); transition: all 0.35s var(--spring);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px) scale(1.02); }
.stat-icon { font-size: 28px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--gray-900); }
.stat-label { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* ========== 액션 바 ========== */
.action-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 24px; flex-wrap: wrap;
}
.action-left { flex: 1; min-width: 200px; }
.action-right { display: flex; gap: 8px; flex-shrink: 0; }
.search-input {
  width: 100%; max-width: 360px;
  padding: 10px 16px; border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font); font-size: 14px;
  transition: all 0.25s ease;
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.1);
  background: rgba(255,255,255,0.9);
}

/* ========== 시트 그리드 ========== */
.sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px; padding: 0 24px 24px;
}

.sheet-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  cursor: pointer; transition: all 0.35s var(--spring);
  display: flex; flex-direction: column;
}
.sheet-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px) scale(1.015); }
.sheet-card:active { transform: scale(0.98); }

.sheet-card-color { height: 4px; }
.sheet-card-body { padding: 20px; flex: 1; }
.sheet-card-name { font-size: 16px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.sheet-card-desc { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; }
.sheet-card-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.meta-item { font-size: 12px; color: var(--gray-400); }

.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 60px 20px;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { color: var(--gray-400); font-size: 14px; }

/* ★ 에디터 뷰 — flex 높이 체인 핵심 수정 */
.editor-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;  /* ★ flex 자식이 줄어들 수 있게 */
}

.editor-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid rgba(0,0,0,0.06);
  gap: 12px; flex-wrap: wrap;
  flex-shrink: 0;
}
.editor-toolbar-left { display: flex; align-items: center; gap: 12px; }
.editor-toolbar-right { display: flex; gap: 6px; }
.editor-sheet-name { font-size: 16px; font-weight: 700; }

.editor-save-status {
  font-size: 12px; padding: 3px 10px;
  border-radius: 999px; font-weight: 500;
}
.status-saved { background: #ecfdf5; color: #059669; }
.status-unsaved { background: #fef3c7; color: #d97706; }
.status-saving { background: #dbeafe; color: #2563eb; }
.status-error { background: #fee2e2; color: #dc2626; }

/* 탭 바 */
.tab-bar {
  display: flex; align-items: center;
  padding: 0 16px;
  background: rgba(0,0,0,0.02);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px 18px; border: none; background: transparent;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  color: var(--gray-500); cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.tab-btn:hover { color: var(--gray-700); background: rgba(0,0,0,0.03); }
.tab-btn.active {
  color: var(--primary); font-weight: 600;
  border-bottom-color: var(--primary);
  background: white;
}
.tab-add {
  font-size: 18px; padding: 8px 14px;
  color: var(--gray-400);
}
.tab-add:hover { color: var(--primary); }

/* ★ 스프레드시트 영역 — flex 체인의 핵심 */
.spreadsheet-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-height: 0;  /* ★ 핵심: flex 자식 축소 허용 */
}
#hotContainer {
  width: 100%;
  height: 100%;
  position: absolute;  /* ★ 부모 크기에 맞춤 */
  top: 0;
  left: 0;
}

/* Handsontable 프리텐다드 강제 */
.handsontable, .handsontable td, .handsontable th,
.handsontable .htCore td, .handsontable .htCore th {
  font-family: var(--font) !important;
}
.handsontable th {
  background: var(--gray-100) !important;
  color: var(--gray-600) !important;
  font-weight: 600 !important;
  font-size: 12px !important;
}
.handsontable td {
  border-color: var(--gray-200) !important;
}
.handsontable td.current {
  box-shadow: inset 0 0 0 2px var(--primary) !important;
}
.handsontable .wtBorder.current {
  background-color: var(--primary) !important;
}

.loading-sheet {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; gap: 12px; color: var(--gray-500);
}

/* 하단 상태바 */
.editor-statusbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 12px; color: var(--gray-500);
  flex-shrink: 0;
}

/* ★★★ 실시간 편집 — Presence (깜빡임 없음) ★★★ */

.presence-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  flex-shrink: 0;
  min-height: 0;
  overflow-x: auto;
  transition: min-height 0.3s ease, padding 0.3s ease;
}
.presence-bar:empty {
  min-height: 0;
  padding: 0 16px;
  border-bottom: none;
}
.presence-bar:not(:empty) {
  min-height: 32px;
}

.presence-user {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  color: white; white-space: nowrap;
  background: var(--p-color, #64748b);
  /* ★ 애니메이션 없음 — 깜빡임 방지 */
  transition: opacity 0.3s ease;
}
.presence-user .presence-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.8);
  /* ★ 부드러운 펄스만 유지 */
  animation: presenceSoftPulse 3s ease-in-out infinite;
}
.presence-editing {
  font-size: 10px; opacity: 0.8;
}

@keyframes presenceSoftPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* 셀 위 사용자 이름 — p-lbl 클래스 */
.p-lbl {
  position: absolute;
  top: -16px; left: -1px;
  padding: 1px 6px;
  border-radius: 3px 3px 0 0;
  font-size: 10px; font-weight: 700;
  color: white; white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  line-height: 14px;
}

/* ========== 모달 — Liquid Glass ========== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 20px;
}
.modal-overlay.active { display: flex; animation: glassOverlayIn 0.35s ease; }
.modal-overlay.closing { animation: glassOverlayOut 0.3s ease forwards; }

@keyframes glassOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes glassOverlayOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.modal {
  width: 100%; max-width: 600px; max-height: 90vh;
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.5);
  display: flex; flex-direction: column;
  animation: glassModalIn 0.4s var(--spring);
  overflow: hidden;
}
.modal-sm { max-width: 480px; }

@keyframes glassModalIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-overlay.closing .modal {
  animation: glassModalOut 0.25s ease forwards;
}
@keyframes glassModalOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(0.97); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid rgba(0,0,0,0.06);
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--gray-100);
  color: var(--gray-500); cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-700); }

.modal-body {
  padding: 24px; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-actions {
  display: flex; justify-content: flex-end;
  gap: 8px; margin-top: 20px;
}

/* 색상 선택기 */
.color-picker { display: flex; gap: 8px; }
.color-dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid transparent; cursor: pointer;
  transition: var(--transition);
}
.color-dot:hover { transform: scale(1.15); }
.color-dot.selected { border-color: var(--gray-800); box-shadow: 0 0 0 2px white inset; }

/* 업로드 영역 */
.upload-dropzone {
  border: 2px dashed rgba(0,0,0,0.15);
  border-radius: var(--radius);
  padding: 40px 20px; text-align: center;
  cursor: pointer; transition: all 0.3s var(--spring);
  background: rgba(0,0,0,0.01);
}
.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(59,130,246,0.06);
  transform: scale(1.01);
}
.upload-icon { font-size: 40px; margin-bottom: 12px; }
.upload-text { font-size: 15px; font-weight: 600; color: var(--gray-700); }
.upload-hint { font-size: 13px; color: var(--gray-400); margin-top: 4px; }

.upload-file-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--gray-50);
  border-radius: var(--radius-sm); border: 1px solid var(--gray-200);
  margin-top: 12px;
}
.file-icon { font-size: 20px; }
.file-name { flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 12px; color: var(--gray-400); }
.btn-remove {
  width: 24px; height: 24px; border-radius: 50%;
  border: none; background: var(--gray-200); color: var(--gray-600);
  cursor: pointer; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.btn-remove:hover { background: var(--danger); color: white; }

.info-box {
  padding: 14px 16px; background: #eff6ff;
  border: 1px solid #bfdbfe; border-radius: var(--radius-sm);
  font-size: 13px; color: #1e40af; line-height: 1.6;
  margin-top: 12px;
}

/* ========== 설정 섹션 ========== */
.settings-section {
  padding: 24px 0; border-bottom: 1px solid var(--gray-200);
}
.settings-section:first-child { padding-top: 0; }
.settings-section:last-child { border-bottom: none; }
.settings-section h3 {
  font-size: 16px; font-weight: 700; margin-bottom: 16px;
}
.settings-desc { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; }

.webauthn-count {
  display: inline-block; padding: 4px 10px;
  background: var(--gray-100); border-radius: 999px;
  font-size: 13px; color: var(--gray-600); margin-bottom: 12px;
}

/* ========== 관리자 콘솔 ========== */
.admin-container {
  display: flex; flex-direction: column; min-height: 100vh;
}
.admin-header { background: linear-gradient(135deg, #1e293b, #334155); }
.admin-header .header-title { color: white; }
.admin-header .btn-back { background: rgba(255,255,255,0.1); color: white; }
.admin-header .btn-back:hover { background: rgba(255,255,255,0.2); }

.admin-content { padding: 24px; max-width: 1200px; margin: 0 auto; width: 100%; }

.admin-section {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius);
  padding: 24px; margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-header h2 { font-size: 18px; font-weight: 700; }

.account-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.account-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.account-table th {
  padding: 12px 16px; text-align: left;
  background: var(--gray-50); color: var(--gray-600);
  font-weight: 600; font-size: 13px;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
.account-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.account-table tr:hover td { background: var(--gray-50); }
.row-admin td { background: #fef2f2 !important; }
.loading-cell { text-align: center; color: var(--gray-400); padding: 40px !important; }

.role-tag {
  display: inline-block; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.role-system_admin { background: #fee2e2; color: #dc2626; }
.role-broker { background: #dbeafe; color: #2563eb; }
.role-page_admin { background: #ecfdf5; color: #059669; }

.status-badge {
  display: inline-block; padding: 3px 8px;
  border-radius: 4px; font-size: 12px; font-weight: 500;
}
.status-badge.ok { background: #ecfdf5; color: #059669; }
.status-badge.warning { background: #fef3c7; color: #d97706; }

.text-muted { color: var(--gray-400); font-size: 13px; }

.action-dropdown { position: relative; display: inline-block; }
.action-trigger { min-width: auto; }
.action-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.4);
  min-width: 200px; z-index: 50;
  overflow: hidden;
}
.action-menu.open { display: block; animation: glassModalIn 0.2s var(--spring); }
.action-menu button {
  display: block; width: 100%; padding: 10px 16px;
  border: none; background: transparent;
  font-family: var(--font); font-size: 13px;
  color: var(--gray-700); text-align: left;
  cursor: pointer; transition: var(--transition);
}
.action-menu button:hover { background: var(--gray-50); }
.action-menu button.danger { color: var(--danger); }
.action-menu button.danger:hover { background: #fef2f2; }
.menu-divider { height: 1px; background: var(--gray-100); margin: 4px 0; }

.actions-cell { white-space: nowrap; }

.activity-log, .admin-log-list {
  max-height: 400px; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.activity-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--gray-100);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.activity-content { flex: 1; min-width: 0; }
.activity-user { font-weight: 600; color: var(--gray-700); font-size: 13px; }
.activity-detail { font-size: 13px; color: var(--gray-600); }
.activity-time { display: block; font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.activity-loading, .activity-empty {
  text-align: center; padding: 30px; color: var(--gray-400);
}

/* ========== 확인 팝업 — Liquid Glass ========== */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 20px; animation: glassOverlayIn 0.3s ease;
}
.confirm-overlay.closing { animation: glassOverlayOut 0.25s ease forwards; }

.confirm-box {
  width: 100%; max-width: 400px;
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius); padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.5);
  animation: glassModalIn 0.35s var(--spring);
}
.confirm-icon { font-size: 40px; margin-bottom: 12px; }
.confirm-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.confirm-box p { font-size: 14px; color: var(--gray-600); margin-bottom: 12px; line-height: 1.5; }
.confirm-warning {
  padding: 12px; background: #fef3c7; border-radius: var(--radius-sm);
  font-size: 13px; color: #92400e; margin-bottom: 20px; line-height: 1.5;
}
.confirm-buttons { display: flex; gap: 8px; justify-content: center; }

/* ========== 토스트 ========== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 5000; display: flex; flex-direction: column-reverse;
  gap: 8px; pointer-events: none;
}
.toast {
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px; font-weight: 500;
  pointer-events: auto;
  max-width: 360px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: toastGlassIn 0.4s var(--spring);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.4);
}
.toast-success { background: rgba(236,253,245,0.85); color: #065f46; border: 1px solid rgba(167,243,208,0.6); }
.toast-error { background: rgba(254,242,242,0.85); color: #991b1b; border: 1px solid rgba(254,202,202,0.6); }
.toast-info { background: rgba(239,246,255,0.85); color: #1e40af; border: 1px solid rgba(191,219,254,0.6); }
.toast-warning { background: rgba(254,243,199,0.85); color: #92400e; border: 1px solid rgba(253,230,138,0.6); }

.toast-exit { animation: toastGlassOut 0.3s ease forwards; }

@keyframes toastGlassIn {
  from { opacity: 0; transform: translateX(40px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastGlassOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(40px) scale(0.9); }
}

/* ========== 컨텍스트 메뉴 ========== */
.context-menu {
  position: fixed; z-index: 500;
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.4);
  min-width: 180px; overflow: hidden;
  animation: glassModalIn 0.2s var(--spring);
}
.context-item {
  display: block; width: 100%; padding: 10px 16px;
  border: none; background: transparent;
  font-family: var(--font); font-size: 13px;
  color: var(--gray-700); text-align: left;
  cursor: pointer; transition: var(--transition);
}
.context-item:hover { background: var(--gray-50); }
.context-item.danger { color: var(--danger); }
.context-item.danger:hover { background: #fef2f2; }
.context-divider { height: 1px; background: var(--gray-100); margin: 4px 0; }

/* ========== 모바일 반응형 ========== */
@media (max-width: 768px) {
  .app-header { padding: 10px 16px; }
  .header-title { font-size: 15px; }
  .user-badge { display: none; }

  .stats-row {
    grid-template-columns: repeat(3, 1fr);
    padding: 16px;
    gap: 10px;
  }
  .stat-card { padding: 14px 10px; }
  .stat-icon { font-size: 22px; margin-bottom: 4px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 11px; }

  .action-bar {
    padding: 12px 16px;
    flex-direction: column;
    gap: 10px;
  }
  .action-left { min-width: 100%; }
  .search-input { max-width: 100%; }
  .action-right { width: 100%; }
  .action-right .btn { flex: 1; font-size: 13px; padding: 10px 12px; }

  .sheet-grid {
    grid-template-columns: 1fr;
    padding: 0 16px 16px;
    gap: 12px;
  }
  .sheet-card-body { padding: 16px; }
  .sheet-card-name { font-size: 15px; }

  .editor-toolbar {
    padding: 8px 12px;
    flex-wrap: wrap;
  }
  .editor-toolbar-left { width: 100%; }
  .editor-toolbar-right { width: 100%; justify-content: flex-end; }
  .editor-sheet-name { font-size: 14px; }

  .tab-bar { padding: 0 8px; }
  .tab-btn { padding: 8px 14px; font-size: 12px; }

  .modal { max-height: 95vh; margin: 10px; }
  .modal-body { padding: 20px 16px; }

  .admin-content { padding: 16px; }
  .admin-section { padding: 16px; }
  .account-table { font-size: 13px; }
  .account-table th, .account-table td { padding: 10px 12px; }

  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }

  .presence-bar { padding: 4px 12px; }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .stat-card { padding: 12px 8px; }
  .stat-value { font-size: 18px; }

  .action-right { flex-direction: column; }
  .action-right .btn { width: 100%; }

  .editor-toolbar-right .btn-sm { padding: 6px 8px; font-size: 12px; }

  .force-pw-modal { padding: 28px 20px; }

  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; }
}

@media print {
  .app-header, .action-bar, .editor-toolbar,
  .tab-bar, .editor-statusbar, .toast-container,
  .presence-bar { display: none !important; }
  .spreadsheet-wrapper { overflow: visible !important; }
}

/* ========== 서식 툴바 — Glass ========== */
.format-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.format-toolbar::-webkit-scrollbar { display: none; }

.format-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.format-divider {
  width: 1px;
  height: 24px;
  background: rgba(0,0,0,0.08);
  margin: 0 6px;
  flex-shrink: 0;
}

.fmt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-600);
  transition: all 0.2s var(--spring);
}
.fmt-btn:hover {
  background: rgba(0,0,0,0.06);
  color: var(--gray-800);
  transform: scale(1.05);
}
.fmt-btn:active {
  transform: scale(0.95);
}
.fmt-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(59,130,246,0.2);
}

.fmt-color-trigger {
  position: relative;
}

.fmt-color-swatch {
  display: block;
  width: 16px; height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.15);
  margin-bottom: 2px;
}

.fmt-text-swatch {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.fmt-select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--gray-700);
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}
.fmt-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ========== 커스텀 컬러 피커 ========== */
.color-picker-panel {
  position: fixed;
  z-index: 1100;
  display: none;
  width: 250px;
  padding: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.5);
}
.color-picker-panel.active {
  display: block;
  animation: glassModalIn 0.3s var(--spring);
}

.cp-section {
  margin-bottom: 8px;
}
.cp-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cp-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  margin-bottom: 4px;
}
.cp-dot {
  width: 20px; height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.15s var(--spring);
  padding: 0;
}
.cp-dot:hover {
  transform: scale(1.3);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.cp-dot.selected {
  border: 2px solid var(--gray-800);
  box-shadow: 0 0 0 2px white inset;
  transform: scale(1.15);
}
.cp-actions {
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.cp-clear-btn {
  width: 100%;
  padding: 6px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  background: transparent;
  font-family: var(--font);
  font-size: 12px;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
}
.cp-clear-btn:hover {
  background: rgba(0,0,0,0.04);
}

/* ========== 필터 상태 바 ========== */
.filter-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  background: rgba(59,130,246,0.06);
  border-bottom: 1px solid rgba(59,130,246,0.1);
  flex-shrink: 0;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}
.filter-status svg { flex-shrink: 0; }
.filter-status-text { flex: 1; }
.filter-clear-btn {
  border: none; background: none;
  font-family: var(--font); font-size: 12px;
  color: var(--gray-500); cursor: pointer;
  padding: 2px 8px; border-radius: 4px;
  transition: var(--transition);
}
.filter-clear-btn:hover { background: rgba(0,0,0,0.06); color: var(--danger); }

/* ========== Microsoft Excel 스타일 필터 패널 ========== */
.filter-panel {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  z-index: 1100;
  width: 520px; max-width: 95vw;
  max-height: 70vh;
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.5);
  flex-direction: column;
  overflow: hidden;
  transform: translate(-50%, -50%);
}
.filter-panel.active {
  display: flex;
  animation: filterPanelIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes filterPanelIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.fp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.fp-header h3 { font-size: 15px; font-weight: 700; margin: 0; }
.fp-close {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.05);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); transition: var(--transition);
}
.fp-close:hover { background: rgba(0,0,0,0.1); }

.fp-body {
  display: flex; flex: 1; min-height: 0; overflow: hidden;
}
.fp-columns {
  width: 180px; border-right: 1px solid rgba(0,0,0,0.06);
  display: flex; flex-direction: column; overflow: hidden;
}
.fp-values {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.fp-section-label {
  font-size: 11px; font-weight: 600; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 10px 14px 6px;
}
.fp-col-list {
  flex: 1; overflow-y: auto; padding: 0 6px 6px;
}
.fp-col-btn {
  display: block; width: 100%;
  padding: 7px 10px; margin-bottom: 2px;
  border: none; border-radius: 6px;
  background: transparent; text-align: left;
  font-family: var(--font); font-size: 13px;
  color: var(--gray-700); cursor: pointer;
  transition: var(--transition);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fp-col-btn:hover { background: rgba(0,0,0,0.04); }
.fp-col-btn.active {
  background: var(--primary-light);
  color: var(--primary); font-weight: 600;
}

.fp-search {
  margin: 0 14px 8px;
  height: 30px; padding: 0 10px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  font-family: var(--font); font-size: 13px;
  outline: none; background: rgba(255,255,255,0.6);
  width: calc(100% - 28px);
}
.fp-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}

.fp-val-list {
  flex: 1; overflow-y: auto; padding: 0 14px 8px;
}
.fp-val-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 4px;
  cursor: pointer; font-size: 13px;
  transition: background 0.15s ease;
}
.fp-val-item:hover { background: rgba(0,0,0,0.03); }
.fp-val-item input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--primary);
}
.fp-val-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-val-count {
  margin-left: auto; font-size: 11px; color: var(--gray-400);
  flex-shrink: 0;
}
.fp-val-all { font-weight: 600; border-bottom: 1px solid rgba(0,0,0,0.06); margin-bottom: 4px; padding-bottom: 8px; }
.fp-hint { padding: 20px; text-align: center; color: var(--gray-400); font-size: 13px; }

.fp-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

/* ========== 되돌리기/다시실행 버튼 비활성 ========== */
.fmt-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ========== 글자색 버튼 (색상 바 표시) ========== */
.fmt-text-color-btn {
  flex-direction: column;
  gap: 1px;
  padding: 4px;
}
.fmt-text-label {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: var(--gray-700);
}
.fmt-text-bar {
  display: block;
  width: 18px; height: 3px;
  border-radius: 1px;
  transition: background 0.2s ease;
}

/* ========== 배경색 그룹 간격 ========== */
.fmt-color-group {
  gap: 4px;
}
.fmt-color-group .fmt-color-swatch {
  display: block;
  width: 16px; height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.15);
}
.fmt-color-group .fmt-btn.fmt-color-trigger {
  gap: 5px;
}

/* 모바일 서식 툴바 */
@media (max-width: 768px) {
  .format-toolbar {
    padding: 4px 8px;
    gap: 2px;
  }
  .fmt-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .format-divider {
    margin: 0 3px;
  }
  .color-picker-panel {
    width: 220px;
    padding: 10px;
    left: 4px !important;
    right: 4px;
  }
  .cp-dot {
    width: 18px;
    height: 18px;
  }
  .filter-panel {
    width: 95vw;
    max-height: 80vh;
  }
  .fp-body {
    flex-direction: column;
  }
  .fp-columns {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    max-height: 120px;
  }
  .fp-col-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .fp-col-btn {
    display: inline-block;
    width: auto;
    padding: 5px 10px;
    font-size: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 999px;
    margin-bottom: 0;
  }
  .fp-col-btn.active {
    border-color: var(--primary);
  }
  .fp-values {
    min-height: 200px;
  }
  .fp-search {
    margin: 8px 10px;
    width: calc(100% - 20px);
  }
  .fp-val-list {
    padding: 0 10px 8px;
  }
  .fp-val-item {
    padding: 6px 8px;
    font-size: 13px;
  }
  .filter-status {
    padding: 4px 12px;
    font-size: 11px;
  }
  .fmt-text-color-btn {
    width: 28px;
    height: 28px;
  }
  .fmt-text-label {
    font-size: 12px;
  }
  .fmt-text-bar {
    width: 14px;
    height: 2px;
  }
}

@media (max-width: 480px) {
  .filter-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-height: 75vh;
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .filter-panel.active {
    animation: filterSlideUp 0.35s var(--spring) both;
  }
  @keyframes filterSlideUp {
    from { opacity: 0; transform: translateY(30%); }
    to { opacity: 1; transform: translateY(0); }
  }
  .fp-columns {
    max-height: 100px;
  }
  .fp-col-btn {
    font-size: 11px;
    padding: 4px 8px;
  }
  .color-picker-panel {
    position: fixed;
    left: 50% !important;
    top: auto !important;
    bottom: 10px;
    transform: translateX(-50%);
    width: calc(100vw - 16px);
    max-width: 280px;
  }
}