* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  background: #0f172a;
  color: #f8fafc;
  overflow: hidden;
  position: fixed; /* iOS 사파리에서 화면 전체가 위로 밀리는 윈도우 스크롤을 원천 고정 */
  top: 0;
  left: 0;
}

#app-container {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* 상단 헤더 (아이폰 노치 / 다이내믹 아일랜드 영역 자동 계산) */
.app-header {
  height: calc(52px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: 0;
  background: #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334155;
  z-index: 10;
  flex-shrink: 0;
  gap: 8px;
  overflow: hidden;
}

/* 좌측 공사 현장명 (긴 텍스트 1줄 유지 및 말줄임 처리) */
.site-header-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-header-title span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* 우측 도구 모음 (무조건 1줄 가로 정렬 고정) */
.header-right-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.user-badge {
  font-size: 12.5px;
  background: #334155;
  color: #f8fafc;
  padding: 5px 9px;
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid #475569;
}

/* [신규] 좌측 공사 현장명 (긴 이름 자동 말줄임 말끔 처리) */
.site-header-title {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
}

/* [신규] 우측 도구 모음 컨테이너 */
.header-right-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* 온라인 상태 점 */
.status-indicator {
  font-size: 12px;
  color: #22c55e;
  font-weight: 700;
  padding: 0 2px;
}

/* 관리자 톱니바퀴 버튼 (iOS 사파리 기본 흰색 버튼 덮어쓰기) */
.btn-header-admin {
  -webkit-appearance: none;
  appearance: none;
  background: #334155 !important;
  border: 1px solid #475569 !important;
  color: #f8fafc !important;
  font-size: 16px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.btn-header-admin:active { background: #475569 !important; }

/* 단계별 공통 뷰 */
.step-view {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
}

.step-view.active {
  display: flex;
}

.step-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #38bdf8;
}

.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.btn-back {
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  border: 1px solid #475569;
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.btn-back:active {
  transform: scale(0.96);
  border-color: #38bdf8;
}

.current-selection {
  font-size: 13.5px;
  color: #facc15;
  font-weight: 800;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  padding: 4px 10px;
  border-radius: 99px;
}

/* 1단계 구분: 다크 글래스 벤토 카드 리스트 */
.category-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
}

.cat-item-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.cat-btn {
  flex: 1;
  min-height: 88px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 20px rgba(2, 6, 23, 0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.cat-btn:active {
  transform: scale(0.98);
}

/* 기본 3대 부서 및 추가 부서 컬러 테마 */
.cat-const {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
  border-color: rgba(96, 165, 250, 0.45);
}
.cat-quality {
  background: linear-gradient(135deg, #064e3b 0%, #059669 100%);
  border-color: rgba(52, 211, 153, 0.45);
}
.cat-safety {
  background: linear-gradient(135deg, #78350f 0%, #d97706 100%);
  border-color: rgba(251, 191, 36, 0.45);
}
.cat-custom, .cat-custom-violet {
  background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%);
  border-color: rgba(167, 139, 250, 0.45);
}
.cat-custom-cyan {
  background: linear-gradient(135deg, #164e63 0%, #0891b2 100%);
  border-color: rgba(34, 211, 238, 0.45);
}
.cat-custom-rose {
  background: linear-gradient(135deg, #881337 0%, #e11d48 100%);
  border-color: rgba(251, 113, 133, 0.45);
}
.cat-custom-indigo {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-color: rgba(148, 163, 184, 0.4);
}

.cat-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.cat-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cat-name {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.cat-tag-badge {
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

.cat-desc {
  font-size: 12.5px;
  color: rgba(248, 250, 252, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 즐겨찾기로 고정된 부서 카드 골드 하이라이트 */
.cat-btn.is-fav {
  border: 1.5px solid #facc15 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 18px rgba(250, 204, 21, 0.28), 0 8px 20px rgba(2, 6, 23, 0.5);
}

.cat-fav-pill {
  font-size: 10px;
  font-weight: 800;
  background: rgba(250, 204, 21, 0.22);
  border: 1px solid rgba(250, 204, 21, 0.6);
  color: #fde047;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

.cat-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cat-fav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.cat-fav-btn:active {
  transform: scale(0.88);
}

.cat-fav-btn.active {
  background: rgba(250, 204, 21, 0.22);
  border-color: #facc15;
  color: #facc15;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.45);
}

.cat-chevron {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  flex-shrink: 0;
}

/* 1단계 세부 항목(태그): 좌측 네온 액센트 바 + 우측 셰브론 리스트 버튼 */
.tag-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 20px;
}

.tag-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 16px;
  background: linear-gradient(90deg, #1e293b 0%, #162032 100%);
  border: 1px solid #334155;
  border-left: 4px solid #38bdf8;
  border-radius: 12px;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.tag-btn:active {
  transform: scale(0.98);
  background: #0f172a;
  border-color: #38bdf8;
}

.tag-btn-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.tag-bullet {
  font-size: 15px;
  flex-shrink: 0;
}

.tag-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-chevron {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0f172a;
  border: 1px solid #334155;
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  flex-shrink: 0;
  margin-left: 8px;
}

/* 2단계 하단: 3D 에메랄드 그라데이션 촬영 시작 메인 CTA 버튼 */
.btn-cta-start {
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 1px solid rgba(110, 231, 183, 0.45);
  border-radius: 14px;
  color: #ffffff;
  font-size: 16.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 18px rgba(16, 185, 129, 0.38);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-cta-start:active {
  transform: scale(0.98);
}

.cta-arrow-badge {
  background: rgba(0, 0, 0, 0.22);
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 900;
}

/* =======================================================
   4단계 카메라 뷰
   ======================================================= */
#step-camera.active {
  display: flex !important;
  flex-direction: column !important;
  flex: 1;
  padding: 8px 14px 14px 14px !important;
  background: #111827 !important;
  overflow: hidden !important;
  box-sizing: border-box;
}

/* 1. 상단 바: ◀ 취소 (좌) + 메타 정보 (우) */
.camera-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 2px;
  flex-shrink: 0;
}

.btn-top-cancel {
  background: #253346;
  border: 1px solid #38495f;
  color: #e2e8f0;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.btn-top-cancel:active {
  background: #1a2533;
}

.camera-top-meta {
  color: #facc15;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-align: right;
  flex: 1;
  margin-left: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 2. 뷰파인더 뷰포트 (오버레이 기준점: relative 강제) */
.camera-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  background: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#camera-stream {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  object-fit: cover !important; /* 남는 공간 없이 뷰박스를 100% 꽉 채움 */
  display: block;
  transform-origin: center center;
  will-change: transform;
}

/* 15초 녹화 진행 바 */
.recording-gauge-wrap {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  overflow: hidden;
  z-index: 25;
}

.recording-gauge-bar {
  height: 100%;
  width: 0%;
  background: #ef4444;
  transition: width 0.1s linear;
}

.gauge-time {
  position: absolute;
  right: 6px;
  top: 8px;
  font-size: 11px;
  color: white;
  font-weight: bold;
}

/* 4. 하단 버튼 바 (프로 카메라 스타일 택타일 셔터) */
.camera-controls {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 4px;
  flex-shrink: 0;
  margin-top: 8px;
}

.btn-shutter-photo {
  flex: 1;
  max-width: 170px;
  height: 50px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #38bdf8;
  color: #f8fafc;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 12px rgba(2, 132, 199, 0.25);
  transition: transform 0.1s ease;
}
.btn-shutter-photo:active {
  transform: scale(0.96);
}

.btn-shutter-video {
  flex: 1.2;
  max-width: 195px;
  height: 50px;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  border: 1px solid #fca5a5;
  color: #ffffff;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 14px rgba(220, 38, 38, 0.45);
  transition: transform 0.1s ease;
}
.btn-shutter-video:active {
  transform: scale(0.96);
}
.btn-shutter-video:disabled {
  opacity: 0.55;
}

.rec-dot-white {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
  display: inline-block;
  animation: recDotPulse 1.4s infinite ease-in-out;
}

@keyframes recDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.75); opacity: 0.45; }
}

.btn-rec-mic {
  height: 50px;
  padding: 0 12px;
  background: linear-gradient(180deg, #15803d 0%, #166534 100%);
  border: 1px solid #4ade80;
  color: #ffffff;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  min-width: 72px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 10px rgba(21, 128, 61, 0.3);
  transition: all 0.12s ease;
}
.btn-rec-mic.muted {
  background: linear-gradient(180deg, #475569 0%, #334155 100%);
  border-color: #94a3b8;
  color: #e2e8f0;
  box-shadow: none;
}
.btn-rec-mic:active {
  transform: scale(0.96);
}

/* 업로드 오버레이 */
.upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  text-align: center;
  padding: 20px;
}

.upload-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #334155;
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

/* 모달 레이아웃 공통 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.modal-card, .call-alert-card {
  background: #1e293b;
  width: 85%;
  max-width: 340px;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
}

.modal-card input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  background: #0f172a;
  border: 1px solid #334155;
  color: white;
  border-radius: 6px;
  font-size: 15px;
}

.btn-modal-confirm {
  width: 100%;
  padding: 12px;
  background: #0284c7;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.btn-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
}

/* =======================================================
   관리자 보안 인증 모달 (PIN / 생체)
   ======================================================= */
.auth-modal-card { max-width: 330px !important; padding: 20px 16px !important; }
.auth-guide { font-size: 13px; color: #94a3b8; margin-bottom: 12px; }
.pin-indicator { display: flex; justify-content: center; gap: 12px; margin-bottom: 16px; }
.pin-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  background: transparent;
  transition: all 0.15s ease;
}
.pin-circle.active { background: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.7); }

.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.btn-num {
  -webkit-appearance: none;
  appearance: none;
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  font-size: 20px;
  font-weight: 700;
  height: 48px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-num:active { background: #38bdf8; color: #0f172a; }
.btn-num.key-action { font-size: 15px; color: #94a3b8; }

.btn-biometric {
  width: 100%;
  height: 42px;
  background: #0369a1;
  border: none;
  color: white;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 12px;
}
.btn-biometric:active { background: #0284c7; }

.auth-sub-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #94a3b8;
}
.auth-sub-nav span:not(.sep) { cursor: pointer; text-decoration: underline; }
.sep { color: #475569; }

.modal-dual-btns { display: flex; gap: 8px; margin-top: 10px; }
.btn-modal-gray {
  flex: 1;
  background: #475569;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px;
  font-weight: bold;
  cursor: pointer;
}

/* =======================================================
   관리자 설정 모달 (현장명 / 권한 / 부서)
   ======================================================= */
.admin-setting-card {
  max-width: 360px !important;
  width: 92% !important;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  text-align: left !important;
  padding: 18px 16px !important;
}
.setting-scroll-body {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 2px;
}
.setting-group {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
}
.group-label {
  font-size: 13.5px;
  font-weight: 700;
  color: #38bdf8;
  display: block;
  margin-bottom: 8px;
}
.field-info { font-size: 11px; color: #64748b; margin-top: 4px; }
.setting-group input[type="text"], .setting-group input[type="password"] {
  background: #1e293b;
  border: 1px solid #475569;
  color: #ffffff;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  flex: 1;
  margin: 0;
}

.btn-inline-save {
  background: #0284c7;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-inline-full {
  background: #0284c7;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.role-radio-group { display: flex; gap: 12px; font-size: 13px; color: #cbd5e1; margin: 4px 0; }
.role-radio-group label { display: flex; align-items: center; gap: 4px; cursor: pointer; }

.managed-list-box {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  max-height: 110px;
  overflow-y: auto;
  margin-top: 8px;
}
.managed-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid #334155;
  font-size: 12.5px;
}
.managed-item-row:last-child { border-bottom: none; }
.btn-item-remove {
  background: #dc2626;
  border: none;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

/* ★ 관리자 스마트폰 전용: 등록 직원 기기잠금/미등록 배지 및 초기화 카드 스타일 */
.m-worker-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1e293b;
  border: 1px solid #2d3d59;
  border-radius: 8px;
  padding: 9px 10px;
  gap: 6px;
}
.m-device-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  margin-left: 4px;
  white-space: nowrap;
}
.m-device-badge.bound {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}
.m-device-badge.unbound {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.btn-m-device-reset {
  background: #eab308;
  color: #0f172a;
  border: none;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-m-device-reset.inactive {
  background: #334155;
  color: #cbd5e1;
}
.btn-m-device-reset:active {
  transform: scale(0.96);
}

.call-alert-card {
  border: 2px solid #ef4444;
  animation: shake 0.5s infinite;
}

.alert-icon { font-size: 40px; margin-bottom: 8px; }
.call-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn-call-accept { flex: 1; background: #16a34a; color: white; border: none; padding: 14px; border-radius: 8px; font-weight: bold; }
.btn-call-reject { flex: 1; background: #475569; color: white; border: none; padding: 14px; border-radius: 8px; }

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* =======================================================
   OneField 인앱 스플래시 화면 (초기 잔상 완전 제거 & 3박자 무작위 조각 점등)
   ======================================================= */
#onefield-splash {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  animation: splashBgToDark 0.38s ease-in-out 0.02s forwards;
  transition: opacity 0.45s ease-in-out, visibility 0.45s ease-in-out;
}

#onefield-splash.splash-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-inner {
  text-align: center;
  width: 100%;
  max-width: 400px;
  padding: 24px 20px;
}

/* [ONE FIELD 타이틀] 초기에는 완전 투명(opacity: 0)으로 숨겨 두어 암전 시 어두운 그림자 원천 차단 */
.splash-logo {
  font-size: 50px;
  font-weight: 900;
  letter-spacing: 0.14em;
  margin: 0 0 26px 0;
  line-height: 1.1;
}

.logo-space {
  display: inline-block;
  width: 0.28em;
}

.logo-char {
  opacity: 0;
  text-shadow: none;
}

/* ONE 영역 알파벳(처음부터 순백색으로 투명도만 0 -> 1 점등) */
.logo-char.char-one {
  color: #ffffff;
  animation-name: charRevealOne;
  animation-duration: 0.50s;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
}

/* FIELD 영역 알파벳(처음부터 스카이 블루로 투명도만 0 -> 1 점등) */
.logo-char.char-field {
  color: #38bdf8;
  animation-name: charRevealField;
  animation-duration: 0.50s;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
}

/* 과거(0.38초) · 현재(0.80초) · 미래(1.22초)와 1:1로 맞물리는 3단계 타이밍 */
.logo-char.char-stage-1 {
  animation-delay: 0.38s;
}

.logo-char.char-stage-2 {
  animation-delay: 0.80s;
}

.logo-char.char-stage-3 {
  animation-delay: 1.22s;
}

/* [과거 · 현재 · 미래] 3대 키워드 중후한 제자리 조명 점등 */
.splash-keywords {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 36px;
}

.kw-item {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0;
  white-space: nowrap;
}

.kw-dot {
  font-size: 18px;
  font-weight: 900;
  color: #475569;
  opacity: 0;
  animation: kwDotAppear 0.35s ease-in-out 0.38s forwards;
}

/* 1박자: '과거' 점등 (0.38초) */
.kw-item.kw-past {
  color: #f8fafc;
  animation: kwLightPast 0.50s ease-in-out 0.38s forwards;
}

/* 2박자: '현재' 점등 (0.80초) */
.kw-item.kw-present {
  color: #38bdf8;
  animation: kwLightPresent 0.50s ease-in-out 0.80s forwards;
}

/* 3박자: '미래' 점등 (1.22초) */
.kw-item.kw-future {
  color: #facc15;
  animation: kwLightFuture 0.50s ease-in-out 1.22s forwards;
}

/* 하단 로딩 게이지 바 (암전 완료 후 0.35초에 트랙 노출) */
.splash-loader {
  width: 240px;
  height: 4px;
  background: rgba(148, 163, 184, 0.14);
  border-radius: 99px;
  margin: 0 auto;
  overflow: hidden;
  opacity: 0;
  animation: loaderTrackAppear 0.3s ease-in-out 0.35s forwards;
}

.splash-loader-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #f8fafc 0%, #38bdf8 50%, #facc15 100%);
  border-radius: 99px;
  animation: splashProgress 1.40s ease-in-out 0.35s forwards;
}

@keyframes splashBgToDark {
  0% { background-color: #ffffff; }
  100% { background-color: #0f172a; }
}

@keyframes loaderTrackAppear {
  to { opacity: 1; }
}

@keyframes charRevealOne {
  0% {
    opacity: 0;
    text-shadow: none;
  }
  100% {
    opacity: 1;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.35), 0 4px 16px rgba(0, 0, 0, 0.45);
  }
}

@keyframes charRevealField {
  0% {
    opacity: 0;
    text-shadow: none;
  }
  100% {
    opacity: 1;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.5), 0 4px 16px rgba(0, 0, 0, 0.45);
  }
}

@keyframes kwDotAppear {
  to { opacity: 0.75; }
}

@keyframes kwLightPast {
  0% {
    opacity: 0;
    text-shadow: none;
  }
  100% {
    opacity: 1;
    text-shadow: 0 0 14px rgba(248, 250, 252, 0.4);
  }
}

@keyframes kwLightPresent {
  0% {
    opacity: 0;
    text-shadow: none;
  }
  100% {
    opacity: 1;
    text-shadow: 0 0 16px rgba(56, 189, 248, 0.55);
  }
}

@keyframes kwLightFuture {
  0% {
    opacity: 0;
    text-shadow: none;
  }
  100% {
    opacity: 1;
    text-shadow: 0 0 16px rgba(250, 204, 21, 0.55);
  }
}

@keyframes splashProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* =======================================================
   OneField 2단계 시계열 인텔리전스 브리핑 카드 스타일
   ======================================================= */
.onefield-insight-card {
  background: linear-gradient(145deg, #0f172a 0%, #17253b 100%);
  border: 1px solid #38bdf8;
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.5);
}

.insight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.insight-title {
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: -0.2px;
}

.insight-badge {
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: #e2e8f0;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.insight-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.4;
}

.insight-empty {
  color: #94a3b8;
  font-size: 11.5px;
  text-align: center;
  padding: 4px 0;
}

.insight-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px 8px;
  border-radius: 6px;
  border-left: 3px solid #64748b;
}
.insight-row.row-past { border-left-color: #94a3b8; }
.insight-row.row-present { border-left-color: #38bdf8; }
.insight-row.row-future { border-left-color: #facc15; background: rgba(250, 204, 21, 0.07); }

.insight-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}
.row-past .insight-tag { background: #334155; color: #cbd5e1; }
.row-present .insight-tag { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.row-future .insight-tag { background: rgba(250, 204, 21, 0.2); color: #facc15; }

.insight-text {
  color: #e2e8f0;
  font-size: 11.5px;
  flex: 1;
  word-break: keep-all;
}

/* =======================================================
   [신규] 2단계 대형 UI + 마이크 음성 입력 + 현황판 AI 스캔
   ======================================================= */
.field-input-card {
  background: #1e293b;
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid #334155;
}

.field-input-label {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 8px;
}

.input-with-mic-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}

.field-text-input {
  flex: 1;
  min-width: 0;
  padding: 14px 12px;
  background: #0f172a;
  border: 1.5px solid #475569;
  color: #ffffff;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
}
.field-text-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.btn-mic-inline {
  width: 52px;
  min-height: 50px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid #38bdf8;
  border-radius: 10px;
  color: #f8fafc;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2);
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn-mic-inline:active {
  transform: scale(0.94);
}
.btn-mic-inline.listening {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  border-color: #fca5a5;
  animation: recDotPulse 1s infinite ease-in-out;
}

.btn-ai-board-scan {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: 1px solid #a5b4fc;
  color: #ffffff;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.btn-ai-board-scan:active {
  transform: scale(0.96);
}

.chip-guide-label {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 8px;
}

.chip-list-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
}

/* =======================================================
   [신규] 실제 아이폰 카메라 UI (회전 시 중앙 축소 현상 원천 제거 + 100% 즉시 밀착)
   ======================================================= */
/* 1. 카메라 진입 시 상단 현장명 헤더(#main-header) 숨김 및 전체 화면 100% 고정 (100vw/100dvh 지연 제거) */
body.camera-active #main-header {
  display: none !important;
}

body.camera-active,
body.camera-active #app-container {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: #000000 !important;
  overflow: hidden !important;
}

body.camera-active #step-camera.active {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #000000 !important;
  z-index: 1000 !important;
  overflow: hidden !important;
  display: block !important;
  transition: none !important;
}

/* 2. 뷰파인더 & 비디오 스트림: 최초 구동 및 가로↔세로 회전 시 아이폰 블러 디졸브 애니메이션 적용 */
body.camera-active #step-camera .camera-viewport {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  z-index: 10 !important;
  background: #000000 !important;
  transition: none !important;
}

body.camera-active #step-camera #camera-stream {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  transform-origin: center center !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  filter: blur(0px) brightness(1);
  opacity: 1;
  transition: filter 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.38s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* ★ 카메라 최초 구동 대기 중: 초기 작은 프레임이 보이지 않도록 확대·블러·투명 상태로 대기 */
body.camera-active #step-camera.is-starting #camera-stream {
  filter: blur(28px) brightness(0.5) !important;
  opacity: 0 !important;
  transform: scale(1.32) !important;
  transition: none !important;
}

/* ★ 카메라 첫 프레임 수신 직후 & 세로↔가로 회전 순간 작동하는 아이폰 스타일 소프트 블러 디졸브 */
body.camera-active #step-camera.is-rotating #camera-stream {
  filter: blur(24px) brightness(0.75) !important;
  opacity: 0.85 !important;
  transform: scale(1.28) !important;
  transition: filter 0.04s linear, opacity 0.04s linear, transform 0.04s linear !important;
}

body.camera-active #step-camera.is-starting .camera-top-bar,
body.camera-active #step-camera.is-starting .watermark-preview-box,
body.camera-active #step-camera.is-starting .ios-vf-bottom-float,
body.camera-active #step-camera.is-starting .camera-controls,
body.camera-active #step-camera.is-rotating .camera-top-bar,
body.camera-active #step-camera.is-rotating .watermark-preview-box,
body.camera-active #step-camera.is-rotating .ios-vf-bottom-float,
body.camera-active #step-camera.is-rotating .camera-controls {
  opacity: 0.35 !important;
  transition: opacity 0.08s ease !important;
}

body.camera-active #step-camera .camera-top-bar,
body.camera-active #step-camera .watermark-preview-box,
body.camera-active #step-camera .ios-vf-bottom-float,
body.camera-active #step-camera .camera-controls {
  transition: opacity 0.28s ease;
}

.ios-camera-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  background-position: center center;
}

/* 3. 상단 플로팅 바 (아이폰 상단 원형 아이콘 + 공종 캡슐) */
body.camera-active #step-camera .camera-top-bar {
  position: fixed !important;
  top: max(12px, env(safe-area-inset-top)) !important;
  left: max(14px, env(safe-area-inset-left)) !important;
  right: max(14px, env(safe-area-inset-right)) !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 160 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  pointer-events: none;
}

body.camera-active #step-camera .btn-top-cancel {
  pointer-events: auto;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  background: rgba(25, 25, 28, 0.68) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  transform-origin: center center !important;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

body.camera-active #step-camera #mic-level-wrap {
  pointer-events: auto;
  backdrop-filter: blur(8px);
  flex-shrink: 0 !important;
}

body.camera-active #step-camera .camera-top-meta {
  background: rgba(25, 25, 28, 0.68) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(250, 204, 21, 0.35) !important;
  padding: 6px 12px !important;
  border-radius: 99px !important;
  margin-left: auto !important;
  flex: 0 1 auto !important;
  text-align: right !important;
  font-size: 12.5px !important;
}

body.camera-active #step-camera .recording-gauge-wrap {
  position: fixed !important;
  top: calc(max(12px, env(safe-area-inset-top)) + 48px) !important;
  left: 14px !important;
  right: 14px !important;
  z-index: 155 !important;
}

/* 4. 워터마크 프리뷰 (세로 모드 기본: 상단 아래) */
body.camera-active #step-camera .watermark-preview-box {
  position: fixed !important;
  top: calc(max(12px, env(safe-area-inset-top)) + 56px) !important;
  bottom: auto !important;
  left: 14px !important;
  right: 14px !important;
  background: rgba(15, 15, 18, 0.56) !important;
  backdrop-filter: blur(6px);
  border-left: 4px solid #facc15 !important;
  border-radius: 8px !important;
  padding: 6px 10px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  z-index: 100 !important;
  pointer-events: none !important;
}

.wm-line-title {
  color: #facc15;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wm-line-sub {
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 5. 세로 모드 하단 플로팅 셔터 영역 */
body.camera-active #step-camera .ios-vf-bottom-float {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 64px) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 14px !important;
  z-index: 140 !important;
  pointer-events: none;
}

.ios-zoom-pill {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: rgba(25, 25, 28, 0.68);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #facc15;
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform-origin: center center !important;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cam-shutter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 310px;
  padding: 0 20px;
  pointer-events: none;
}

.cam-side-slot {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-ios-shutter {
  pointer-events: auto;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(30, 30, 34, 0.55);
  backdrop-filter: blur(6px);
  border: 3px solid rgba(255, 255, 255, 0.88);
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.btn-ios-shutter:active {
  transform: scale(0.92);
}

.btn-ios-shutter:disabled {
  opacity: 0.65;
}

.ios-shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ffffff;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ios-shutter.mode-video .ios-shutter-inner {
  background: #ef4444;
}

.btn-ios-shutter.mode-video.recording .ios-shutter-inner {
  width: 50%;
  height: 50%;
  border-radius: 8px;
  background: #ef4444;
}

.btn-ios-mic {
  pointer-events: auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(25, 25, 28, 0.72);
  backdrop-filter: blur(8px);
  border: 1.5px solid #facc15;
  color: #ffffff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform-origin: center center !important;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.15s ease;
}

.btn-ios-mic.muted {
  border-color: rgba(255, 255, 255, 0.22);
  opacity: 0.75;
}

.btn-ios-mic.hidden-in-photo {
  visibility: hidden;
  pointer-events: none;
}

/* 6. 세로 모드 맨 아래 블랙 바: [ 비디오 | 사진 ] 캡슐 스위치 */
body.camera-active #step-camera .camera-controls {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 150 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 10px 16px max(18px, env(safe-area-inset-bottom)) 16px !important;
  background: rgba(0, 0, 0, 0.78) !important;
  backdrop-filter: blur(8px);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.cam-mode-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(38, 38, 42, 0.92);
  padding: 4px;
  border-radius: 99px;
}

.cam-mode-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13.5px;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: 99px;
  cursor: pointer;
  letter-spacing: -0.2px;
  transition: all 0.18s ease;
}

.cam-mode-btn.active {
  background: rgba(72, 72, 78, 0.95);
  color: #facc15;
  font-weight: 800;
}

/* 세로 화면 잠금 상태에서 폰만 기울였을 때 아이콘 90도 회전 */
#step-camera.tilt-90 .btn-top-cancel,
#step-camera.tilt-90 .ios-zoom-pill,
#step-camera.tilt-90 .btn-ios-mic {
  transform: rotate(90deg) !important;
}

#step-camera.tilt-minus-90 .btn-top-cancel,
#step-camera.tilt-minus-90 .ios-zoom-pill,
#step-camera.tilt-minus-90 .btn-ios-mic {
  transform: rotate(-90deg) !important;
}

/* =======================================================
   ★ [핵심] 가로(Landscape) 회전 시에도 100vw/100dvh 없이
   100% 비율로 즉시 대응하여 중앙 축소 현상 원천 차단
   ======================================================= */
@media (orientation: landscape) {
  /* 1. 상단 바: 좌측 다이내믹 아일랜드(68px)를 피해서 상단에 배치 */
  body.camera-active #step-camera .camera-top-bar {
    top: 10px !important;
    left: max(68px, env(safe-area-inset-left)) !important;
    right: calc(max(12px, env(safe-area-inset-right)) + 190px) !important;
  }

  body.camera-active #step-camera .recording-gauge-wrap {
    top: 54px !important;
    left: max(68px, env(safe-area-inset-left)) !important;
    right: calc(max(12px, env(safe-area-inset-right)) + 190px) !important;
  }

  /* 2. 워터마크 박스: 다이내믹 아일랜드(좌측 중앙)를 피해 좌측 하단에 배치 */
  body.camera-active #step-camera .watermark-preview-box {
    top: auto !important;
    bottom: 12px !important;
    left: max(68px, env(safe-area-inset-left)) !important;
    right: calc(max(12px, env(safe-area-inset-right)) + 200px) !important;
    width: auto !important;
    padding: 5px 10px !important;
    background: rgba(15, 15, 18, 0.52) !important;
  }

  /* 3. 원형 셔터(⚪) + 1x 배지 + 마이크: 충전단자 쪽(우측)에 고정 */
  body.camera-active #step-camera .ios-vf-bottom-float {
    top: 50% !important;
    bottom: auto !important;
    left: auto !important;
    right: calc(max(10px, env(safe-area-inset-right)) + 92px) !important;
    transform: translateY(-50%) !important;
    flex-direction: row !important;
    align-items: center !important;
    width: auto !important;
    gap: 12px !important;
  }

  body.camera-active #step-camera .cam-shutter-row {
    flex-direction: column !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    gap: 16px !important;
  }

  /* 4. [비디오 | 사진] 캡슐 바: 우측 벽에 100% 높이로 고정 (100dvh 제거) */
  body.camera-active #step-camera .camera-controls {
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: calc(84px + env(safe-area-inset-right, 0px)) !important;
    height: 100% !important;
    padding: 12px max(10px, env(safe-area-inset-right)) 12px 8px !important;
    background: rgba(0, 0, 0, 0.78) !important;
  }

  body.camera-active #step-camera .cam-mode-switcher {
    flex-direction: column !important;
    padding: 4px !important;
    border-radius: 18px !important;
  }

  body.camera-active #step-camera .cam-mode-btn {
    padding: 10px 6px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }
}