/* public/css/app.css */
:root {
  --primary: #ff5252;
  --primary-hover: #ff3333;
  --primary-light: #ffebee;
  --bg-main: #f8f9fa;
  --bg-card: #ffffff;
  --text-main: #212529;
  --text-sub: #6c757d;
  --border-color: #dee2e6;
  --border-subtle: #f1f3f5;
  --sticky-header-bg: rgba(255, 255, 255, 0.92);
  --tabbar-bg: rgba(255, 255, 255, 0.95);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Pretendard", Roboto, "Segoe UI", sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #ff6b6b;
    --primary-hover: #ff5252;
    --primary-light: #2c1a1d;
    --bg-main: #121212;
    --bg-card: #1e1e1e;
    --text-main: #f1f3f5;
    --text-sub: #adb5bd;
    --border-color: #2c2c2c;
    --border-subtle: #222222;
    --sticky-header-bg: rgba(30, 30, 30, 0.92);
    --tabbar-bg: rgba(25, 25, 25, 0.95);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 16px;
  user-select: none;
  -webkit-user-select: none;
  overflow-x: hidden;
  padding-bottom: calc(64px + var(--safe-bottom));
}

/* 유틸리티 */
.hidden {
  display: none !important;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 16px;
  min-height: 48px;
  min-width: 48px;
  border-radius: 12px;
  transition: all 0.15s ease-in-out;
}

/* 상단 앱바 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--sticky-header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: calc(12px + var(--safe-top)) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-badge {
  font-size: 14px;
  font-weight: 600;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
}

/* 메인 뷰 컨테이너 */
.view-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: calc(100vh - 120px);
}

/* 하단 탭바 */
.bottom-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--tabbar-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: calc(60px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  max-width: 600px;
  margin: 0 auto;
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  border-radius: 0;
}

.tab-btn .icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 3px;
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.upload-btn {
  color: var(--primary);
}

.tab-btn.upload-btn .icon-circle {
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 10px rgba(255, 82, 82, 0.4);
  transform: translateY(-8px);
}

/* 로그인 화면 */
.login-screen {
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80vh;
}

.login-hero {
  text-align: center;
  margin-bottom: 32px;
}

.login-hero .logo {
  font-size: 56px;
  margin-bottom: 12px;
}

.login-hero h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
}

.login-hero p {
  color: var(--text-sub);
  font-size: 16px;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  font-size: 18px;
  border: 2px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
}

/* 프로필 선택 그리드 */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.member-card {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.member-card:active {
  transform: scale(0.96);
}

.member-card .member-avatar {
  font-size: 30px;
  margin-bottom: 6px;
  transition: transform 0.2s;
}

.member-card .member-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

/* 선택된 카드: 다크모드/라이트모드 모두에서 눈에 확 띄는 강력한 하이라이트 */
.member-card.selected {
  border: 3px solid #ff5252 !important;
  background: rgba(255, 82, 82, 0.16) !important;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(255, 82, 82, 0.35);
}

.member-card.selected .member-avatar {
  transform: scale(1.15);
}

.member-card.selected .member-name {
  color: #ff5252 !important;
  font-weight: 800 !important;
}

/* 우측 상단 체크 뱃지 */
.member-card.selected::after {
  content: '✓';
  position: absolute;
  top: 5px;
  right: 6px;
  width: 20px;
  height: 20px;
  background: #ff5252;
  color: white;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 주요 동작 버튼 */
.btn-primary {
  width: 100%;
  height: 54px;
  background: var(--primary);
  color: white;
  font-size: 18px;
  font-weight: 700;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 82, 82, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary.btn-disabled {
  opacity: 0.6;
  filter: saturate(0.6);
  cursor: pointer;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-outline {
  width: 100%;
  height: 50px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 16px;
  font-weight: 600;
  border-radius: 14px;
}

.error-banner {
  background-color: #ffe3e3;
  color: #c92a2a;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 설정 뷰 */
.settings-view {
  padding: 20px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.settings-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.settings-info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 15px;
}

.settings-info-row:last-child {
  border-bottom: none;
}

/* 모달 팝업 (iOS 홈 화면 추가 안내 등) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-sheet {
  background: var(--bg-card);
  width: 100%;
  max-width: 500px;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 19px;
  font-weight: 800;
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  background: var(--border-subtle);
  color: var(--text-sub);
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-guide-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-badge {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.step-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-main);
  flex: 1;
}

/* 재시도 버튼 스타일 */
.btn-retry-member {
  margin-top: 10px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

/* ==========================================
   3단계: 사진 업로드 화면 스타일
   ========================================== */
.upload-view {
  padding: 16px;
}

.upload-dropzone {
  border: 2px dashed var(--primary);
  border-radius: 16px;
  padding: 32px 16px;
  text-align: center;
  background: var(--primary-light);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.upload-dropzone:active {
  transform: scale(0.99);
}

.upload-dropzone .upload-icon {
  font-size: 44px;
}

.upload-dropzone .upload-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.upload-dropzone .upload-hint {
  font-size: 13px;
  color: var(--text-sub);
}

/* 업로드 진행 상태 바 */
.upload-progress-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.2s ease;
}

.progress-stats {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 6px;
  display: flex;
  gap: 12px;
}

/* 대기열 다중 선택 및 개별 공개 범위 변경 툴바 */
.queue-selection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.queue-toolbar-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.queue-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.queue-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.queue-selected-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(255, 146, 43, 0.12);
  padding: 3px 8px;
  border-radius: 12px;
}

.btn-queue-vis {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  border: 1.5px solid var(--primary);
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-queue-vis:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

.btn-queue-vis:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #ced4da;
  color: #868e96;
  background: #f1f3f5;
}

/* 선택된 사진 미리보기 그리드 (3열) */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.preview-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #eee;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.preview-item:active {
  transform: scale(0.97);
}

.preview-item.is-selected {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 대기열 썸네일 체크박스 */
.preview-item .item-checkbox-wrapper {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  pointer-events: none;
}

.preview-item.is-selected .item-checkbox-wrapper {
  background: var(--primary);
  border-color: #ffffff;
}

.preview-item.is-selected .item-checkbox-wrapper::after {
  content: '✓';
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.preview-item .item-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 50%;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* 대기열 사진별 공개 범위 뱃지 */
.preview-item .item-vis-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  text-align: center;
  color: white;
  background: rgba(33, 37, 41, 0.85);
  backdrop-filter: blur(2px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  z-index: 1;
}

.preview-item .item-vis-badge.vis-all {
  background: rgba(54, 79, 107, 0.9);
}

.preview-item .item-vis-badge.vis-changwon {
  background: rgba(43, 138, 62, 0.9);
}

.preview-item .item-vis-badge.vis-busan {
  background: rgba(25, 113, 194, 0.9);
}

.preview-item .item-vis-badge.vis-custom {
  background: rgba(230, 119, 0, 0.9);
}

.preview-item .item-vis-badge.vis-private {
  background: rgba(73, 80, 87, 0.9);
}

.preview-item .item-status-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 8px;
  text-align: center;
  color: white;
  background: rgba(0, 0, 0, 0.75);
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.preview-item.status-uploading .item-status-badge {
  background: rgba(25, 113, 194, 0.9);
}

.preview-item.status-processing .item-status-badge {
  background: rgba(230, 119, 0, 0.9);
}

.preview-item.status-success .item-status-badge {
  background: rgba(43, 138, 62, 0.95);
}

.preview-item.status-error .item-status-badge {
  background: rgba(201, 42, 42, 0.95);
}

/* 업로드 전 공개 범위 사전 설정 박스 */
.upload-visibility-box {
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
}

.upload-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.upload-visibility-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-vis-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.upload-vis-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.upload-vis-label .vis-text {
  display: flex;
  flex-direction: column;
}

.upload-vis-label .vis-text strong {
  font-size: 14px;
  color: var(--text-main);
}

.upload-vis-label .vis-text span {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

.upload-vis-label:has(input:checked),
.upload-vis-label.active {
  border-color: var(--primary);
  background: rgba(255, 82, 82, 0.08);
}

.upload-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* ==========================================================================
   갤러리 뷰 (카카오톡 스타일 사진 앨범)
   ========================================================================== */
.gallery-view {
  padding-bottom: 90px;
}

/* 갤러리 상단 컨트롤 바 */
.gallery-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.gallery-total-text {
  font-size: 14px;
  color: var(--text-sub);
}

.gallery-total-text strong {
  color: var(--text-main);
  font-weight: 700;
}

.gallery-actions-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-select-mode {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-select-mode.active {
  background: var(--text-main);
  color: var(--bg-main);
  border-color: var(--text-main);
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}

/* 다중 선택 하단 플로팅 액션 바 */
.selection-action-bar {
  position: fixed;
  bottom: calc(70px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  max-width: 568px;
  margin: 0 auto;
  z-index: 120;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.selection-count-badge {
  font-size: 14px;
  font-weight: 700;
  color: #ff8787;
  padding-left: 4px;
}

.selection-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-selection-action {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-selection-action:active {
  transform: scale(0.97);
}

.btn-selection-action.danger {
  background: rgba(255, 82, 82, 0.85);
  color: white;
}

/* 선택 모드 시 사진 카드 스타일 */
.photo-card .select-checkbox {
  display: none;
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid white;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  z-index: 5;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: white;
}

.gallery-view.select-mode .photo-card .select-checkbox {
  display: flex;
}

.photo-card.selected {
  outline: 3px solid #ff5252;
  outline-offset: -3px;
}

.photo-card.selected .select-checkbox {
  background: #ff5252;
  border-color: #ff5252;
}

.photo-card.selected .select-checkbox::after {
  content: '✓';
}

.photo-card.selected img {
  opacity: 0.8;
}

/* 미지정 사진 안내 배너 */
.pending-notice {
  background: rgba(255, 146, 43, 0.12);
  border: 1px solid rgba(255, 146, 43, 0.4);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pending-notice .pending-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.pending-notice .pending-text span {
  font-size: 20px;
}

.pending-notice .pending-text strong {
  display: block;
  font-size: 14px;
  color: #d9480f;
}

.pending-notice .pending-text p {
  color: var(--text-sub);
  margin-top: 2px;
}

.btn-pending-action {
  background: #f76707;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

/* 빈 앨범 안내 */
.gallery-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-sub);
}

.gallery-empty .empty-icon {
  font-size: 50px;
  margin-bottom: 12px;
}

.gallery-empty h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.gallery-empty p {
  font-size: 14px;
  line-height: 1.5;
}

/* 날짜별 그룹 피드 */
.gallery-feed {
  display: flex;
  flex-direction: column;
}

.date-group {
  margin-bottom: 16px;
}

/* 카카오톡 스타일 Sticky 날짜 헤더 */
.date-header {
  position: sticky;
  top: 56px;
  z-index: 10;
  background: var(--sticky-header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.date-header .date-count {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 500;
}

/* 3열 사진 그리드 (인스타그램/카톡 스타일) */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.photo-card {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-card);
  overflow: hidden;
  cursor: pointer;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.photo-card:active img {
  transform: scale(0.96);
}

/* 우측 하단 공개 범위 아이콘 뱃지 */
.photo-card .photo-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ==========================================================================
   전체화면 사진 뷰어
   ========================================================================== */
.photo-viewer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.viewer-top-bar {
  padding: calc(12px + var(--safe-top)) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.viewer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.viewer-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.viewer-badge-visibility {
  background: #ff5252;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.viewer-btn-icon {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.viewer-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 60px 0;
}

.viewer-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-bottom-bar {
  padding: 12px 16px calc(16px + var(--safe-bottom));
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.viewer-action-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.viewer-action-btn.danger {
  color: #ff8787;
  background: rgba(201, 42, 42, 0.3);
}

/* ==========================================================================
   공개 범위 설정 모달
   ========================================================================== */
.visibility-intro {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 16px;
}

.visibility-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.visibility-option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.2s;
}

.visibility-option-item input[type="radio"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.visibility-option-item .option-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.visibility-option-item .option-desc {
  font-size: 13px;
  color: var(--text-sub);
}

/* 직접 선택 박스 */
.custom-members-box {
  background: rgba(0, 0, 0, 0.04);
  padding: 12px;
  border-radius: 10px;
  margin-top: 4px;
}

.custom-members-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.custom-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}

.custom-member-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  background: var(--bg-card);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.custom-member-label input {
  accent-color: var(--primary);
}


