:root {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #2563eb;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-elevated: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ================= HOVER & INTERACTION ================= */
button, input, select, .interactive-card, .mode-tab, .nav-btn, .photo-card, .zima-widget, .zima-storage-card {
  transition: var(--transition);
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-weight: 600;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* ================= COMPACT MODERN HEADER ================= */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  height: 60px;
}

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

.logo-badge {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.logo-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

/* Profile Avatar & Menu */
.user-controls {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-avatar-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.profile-avatar-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  width: 190px;
  padding: 6px;
  display: none;
  z-index: 100;
}

.profile-dropdown-item {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-main);
}

.profile-dropdown-item:hover {
  background: var(--bg-subtle);
}

.profile-dropdown-item.danger:hover {
  background: #fef2f2;
  color: var(--danger);
}

/* ================= 4-WAY SUB NAVIGATION BAR ================= */
.sub-nav-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.sub-nav-bar::-webkit-scrollbar {
  display: none;
}

.nav-tabs-wrapper {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  gap: 2px;
}

.mode-tab {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.mode-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.7);
}

.mode-tab.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

/* ================= MAIN CONTAINER ================= */
.main-content {
  flex: 1;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px 90px;
}

/* ================= SEARCH MODULE (USER RULE) ================= */
.search-container {
  position: relative;
  margin-bottom: 16px;
}

.search-bar {
  display: flex;
  gap: 8px;
  background: var(--bg-surface);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-subtle);
}

.search-input-wrap {
  position: relative;
  flex: 1;
}

.search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--bg-subtle);
  font-size: 13px;
  color: var(--text-main);
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--border-focus);
}

.search-icon-inside {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.search-btn {
  background: var(--primary);
  color: white;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.search-btn:hover {
  background: var(--primary-hover);
}

/* Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  max-height: 260px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.dropdown-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid #f8fafc;
}

.dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.dropdown-item .item-name {
  font-size: 13px;
  font-weight: 500;
}

.dropdown-item .item-path {
  font-size: 11px;
  color: var(--text-muted);
}

/* ================= ZIMA-STYLE DASHBOARD WIDGETS (BRIGHT & LUXURY) ================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.zima-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.zima-widget:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
  border-color: #cbd5e1;
}

.widget-label-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.widget-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.widget-sub {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-value-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.widget-huge-val {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.widget-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

.widget-ring-gauge {
  width: 50px;
  height: 50px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget-progress-line {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 6px;
}

.widget-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
}

/* Storage Cards */
.storage-section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  margin: 20px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.storage-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.zima-storage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

.zima-storage-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

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

.storage-badge-status {
  background: var(--success-light);
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.storage-dots-bar {
  display: flex;
  gap: 4px;
  margin: 12px 0 8px;
}

.storage-dot {
  flex: 1;
  height: 6px;
  border-radius: 2px;
  background: var(--bg-subtle);
}

.storage-dot.active {
  background: var(--success);
}

/* ================= SERVER PHOTO TIMELINE ================= */
.timeline-section {
  margin-bottom: 28px;
}

.timeline-header {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
}

.timeline-item, .timeline-photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #e2e8f0;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

.timeline-item:hover, .timeline-photo-item:hover {
  transform: scale(1.025);
  z-index: 2;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.timeline-item img, .timeline-item video,
.timeline-photo-item img, .timeline-photo-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
}

/* 썸네일 정중앙 프리미엄 원형 플레이 버튼 오버레이 */
.video-play-overlay { position: absolute; inset: 0; pointer-events: none; background: transparent; }

.timeline-item:hover .video-play-overlay,
.timeline-photo-item:hover .video-play-overlay { position: absolute; inset: 0; pointer-events: none; background: transparent; }

.play-btn-circle { display: none !important; }

.play-icon-triangle {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent #ffffff;
  margin-left: 3px;
}

.timeline-item:hover .play-btn-circle,
.timeline-photo-item:hover .play-btn-circle { display: none !important; }

.video-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  letter-spacing: 0.3px;
  pointer-events: none;
  z-index: 5;
}

.timeline-video-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

/* Empty State */
.empty-gallery-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 20px;
  text-align: center;
  box-shadow: var(--shadow-subtle);
}

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

.empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.empty-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 20px;
}

/* ================= PHONE UPLOAD PICKER MODE ================= */
.target-album-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.target-album-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.target-album-name {
  font-weight: 700;
  color: var(--primary);
}

.btn-small {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.btn-small:hover {
  background: #e2e8f0;
}

.upload-dropzone {
  background: var(--bg-surface);
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 16px;
}

.upload-dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.local-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.local-photo-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

.local-photo-card img, .local-photo-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
}

.local-photo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #94a3b8;
}

.local-photo-card.selected {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25), 0 4px 12px rgba(37, 99, 235, 0.15);
}

.local-photo-card .play-btn-circle { display: none !important; }

.local-photo-card:hover .play-btn-circle { display: none !important; }

.local-photo-card img, .local-photo-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.local-checkbox {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  z-index: 10;
}

.local-photo-card.selected .local-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.badge-status {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 3px 6px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  z-index: 10;
}

.badge-synced {
  background: rgba(16, 185, 129, 0.9);
  color: white;
}

.badge-new {
  background: rgba(245, 158, 11, 0.9);
  color: white;
}

.badge-uploading {
  background: rgba(37, 99, 235, 0.95);
  color: white;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.badge-failed {
  background: rgba(239, 68, 68, 0.95);
  color: white;
  font-weight: 700;
}

/* ================= FLOATING ACTION DOCK ================= */
.floating-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-elevated);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 40;
}

.dock-count-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.btn-dock {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.btn-dock-copy {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-dock-copy:hover {
  background: #e2e8f0;
}

.btn-dock-upload, .btn-dock-move {
  background: var(--primary);
  border: 1.5px solid var(--primary);
  color: white;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
  transition: all 0.15s ease;
}

.btn-dock-upload:hover, .btn-dock-move:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-dock-upload:active, .btn-dock-move:active {
  transform: translateY(0);
}

.btn-dock-clear {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #ef4444;
}

.btn-dock-clear:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #dc2626;
  transform: translateY(-1px);
}

.local-card-remove {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  z-index: 15;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
}

.local-card-remove:hover {
  background: #ef4444;
  transform: scale(1.15);
}

/* ================= LIGHTBOX VIEWER ================= */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 150;
  display: none;
  flex-direction: column;
}

.lightbox-topbar {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 10;
}

.lightbox-info {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  margin-right: 12px;
  letter-spacing: -0.2px;
}

.lightbox-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-lightbox-act {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  padding: 6px 14px !important;
  border-radius: var(--radius-full) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
  cursor: pointer;
}

.btn-lightbox-act:hover {
  background: rgba(255, 255, 255, 0.32) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.btn-lightbox-act:active {
  transform: translateY(0);
}

.btn-lightbox-close {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  line-height: 1 !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-lightbox-close:hover {
  background: rgba(239, 68, 68, 0.85) !important;
  border-color: rgba(239, 68, 68, 1) !important;
  transform: scale(1.08) !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
}

.btn-lightbox-close:active {
  transform: scale(0.96) !important;
}

.lightbox-content-box {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

#lightboxMediaSlot {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.lightbox-img-zoomable {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  will-change: transform;
  transform-origin: center center;
  transition: transform 0.05s ease-out;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-img-zoomable:active {
  cursor: grabbing;
}

.lightbox-media {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

/* ================= VIDEO MODE & FORCED LANDSCAPE PLAYBACK ================= */
.lightbox-modal.video-mode {
  background: #000000;
}

.lightbox-modal.video-mode #lightboxMediaSlot video {
  width: 100%;
  height: 100%;
  max-width: 96vw;
  max-height: 88vh;
  object-fit: contain;
  background: #000000;
  border-radius: 4px;
}

.lightbox-modal.video-mode .nav-arrow {
  opacity: 0.35;
  transition: opacity 0.2s;
  z-index: 100;
}
.lightbox-modal.video-mode .nav-arrow:hover {
  opacity: 1;
}

/* ⚡ 모바일 동영상 모드: 겹침 없는 단정하고 깔끔한 상단바 분리 레이아웃 */
@media (orientation: portrait) {
  .lightbox-modal.video-mode {
    background: #000000 !important;
  }
  .lightbox-modal.video-mode .lightbox-topbar {
    position: relative !important;
    width: 100% !important;
    height: 48px !important;
    z-index: 200 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    transform: none !important;
  }
  .lightbox-modal.video-mode .lightbox-content-box {
    position: relative !important;
    width: 100% !important;
    height: calc(100vh - 48px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
  }
  .lightbox-modal.video-mode #lightboxMediaSlot {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .lightbox-modal.video-mode #lightboxMediaSlot video {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
  }
}

/* 기기가 실제로 가로모드(landscape)일 때 */
@media (orientation: landscape) {
  .lightbox-modal.video-mode .lightbox-content-box {
    width: 100vw !important;
    height: calc(100vh - 48px) !important;
    transform: none !important;
    padding: 0 !important;
  }

  .lightbox-modal.video-mode #lightboxMediaSlot video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: calc(100vh - 48px) !important;
    object-fit: contain !important;
    border-radius: 0 !important;
  }
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  z-index: 30;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.nav-arrow:hover {
  background: rgba(37, 99, 235, 0.9);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-50%) scale(1.1);
}

.nav-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.nav-arrow.prev { left: 16px; }
.nav-arrow.next { right: 16px; }

.lightbox-zoom-ctrls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.lightbox-zoom-btn {
  background: transparent;
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s, transform 0.15s;
}

.lightbox-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.lightbox-zoom-btn:active {
  transform: scale(0.95);
}

.lightbox-zoom-text {
  font-size: 11px;
  font-weight: 700;
  min-width: 38px;
  text-align: center;
  color: #f1f5f9;
}

/* ================= FILE TABLE ================= */
.file-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.file-table {
  width: 100%;
  border-collapse: collapse;
}

.file-table th {
  background: var(--bg-subtle);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.file-table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
}

.file-table tr:hover {
  background: var(--bg-subtle);
}

/* ================= MODAL BASE ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--bg-surface);
}

/* ================= MASTER STORAGE & ADMIN STYLES ================= */
.storage-switch-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.btn-storage-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-storage-tab:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-storage-tab.active {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.master-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
}

.breadcrumb-item {
  color: var(--primary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.breadcrumb-item:hover {
  background: #eff6ff;
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--text-muted);
  user-select: none;
}

.master-tools-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-tool-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tool-act:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.master-search-container {
  position: relative;
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-act {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-act:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-act-view { color: #2563eb; border-color: rgba(37,99,235,0.3); }
.btn-act-view:hover { background: #eff6ff; }
.btn-act-down { color: #059669; border-color: rgba(5,150,105,0.3); }
.btn-act-down:hover { background: #ecfdf5; }
.btn-act-edit { color: #d97706; border-color: rgba(217,119,6,0.3); }
.btn-act-edit:hover { background: #fffbeb; }
.btn-act-del { color: #dc2626; border-color: rgba(220,38,38,0.3); }
.btn-act-del:hover { background: #fef2f2; }

/* 등록된 사용자 카드 행 */
.user-manage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

.user-manage-row:hover {
  background: var(--bg-subtle);
}

.user-folder-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  margin-left: 6px;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .storage-cards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .timeline-folder-selector-wrap { width: 100%; }
  .app-header { padding: 8px 12px; }
  .logo-title { font-size: 15px; }
  .main-content { padding: 12px 10px 85px; }
  .mode-tab { padding: 6px 10px; font-size: 12px; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .zima-huge-val { font-size: 26px; }
  .timeline-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .local-photo-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .floating-dock { width: calc(100% - 24px); justify-content: space-between; padding: 6px 12px; }
  .btn-dock { padding: 6px 10px; font-size: 12px; }
}

/* ================= TIMELINE FILTER & GROUPING TOOLBAR ================= */
.timeline-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.timeline-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.timeline-filter-group::-webkit-scrollbar {
  display: none;
}

.filter-pill-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  padding: 2px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  gap: 2px;
  flex-shrink: 0;
}

.filter-pill {
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background: transparent;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.filter-pill:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

.filter-pill.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.timeline-folder-selector-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex: 1;
}

.btn-timeline-folder-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  max-width: 220px;
  user-select: none;
}

.btn-timeline-folder-pill:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.15);
}

.btn-timeline-folder-pill:active {
  transform: translateY(0);
}

.timeline-folder-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
  font-size: 13px;
}

#btnRefreshTimelineBar,
.btn-refresh-icon {
  margin-left: auto;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.btn-refresh-icon:hover {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.1) rotate(45deg);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
}

.btn-refresh-icon:active {
  transform: scale(0.95) rotate(180deg);
}

/* ================= TRASH MODAL & ITEMS ================= */
.trash-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.trash-item-row:hover {
  background: var(--bg-subtle);
}

.trash-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  flex: 1;
  margin-right: 12px;
}

.trash-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-all;
}

.trash-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ================= SCROLL TO TOP FLOATING BUTTON ================= */
.btn-scroll-top {
  position: fixed;
  right: 24px;
  bottom: 28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1.5px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 85;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, bottom 0.25s;
}

.btn-scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.btn-scroll-top:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-scroll-top:active {
  transform: translateY(0) scale(0.95);
}

/* 폰 사진 선택 도크가 떠 있을 때 도크 위로 부드럽게 상승 */
body.dock-active .btn-scroll-top {
  bottom: 84px;
}

@media (max-width: 600px) {
  .btn-scroll-top {
    right: 16px;
    bottom: 24px;
    width: 38px;
    height: 38px;
  }
  body.dock-active .btn-scroll-top {
    bottom: 78px;
  }
}

/* ================= FOLDER HIERARCHY TREE ================= */
.folder-tree-container::-webkit-scrollbar {
  width: 6px;
}
.folder-tree-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.folder-tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 2px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}
.folder-tree-row:hover {
  background: var(--bg-hover);
  transform: translateX(2px);
}
.folder-tree-row.active {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}
.folder-tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 10px;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.folder-tree-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-main);
}
.folder-tree-count {
  font-size: 10px;
  color: var(--text-muted);
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

/* ================= TOAST NOTIFICATION ================= */
.toast-container {
  position: fixed;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast-bubble {
  background: rgba(15, 23, 42, 0.92);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  animation: toastFadeIn 0.25s forwards;
  pointer-events: auto;
}
@keyframes toastFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= PWA INSTALL BUTTON & BANNER ================= */
.btn-install-pill {
  padding: 5px 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.12));
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
  user-select: none;
}

.btn-install-pill:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-install-pill:active {
  transform: translateY(0) scale(0.97);
}

.pwa-install-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  width: calc(100% - 32px);
  max-width: 460px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: bannerSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bannerSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 25px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ================= 10. 타임라인 다중 선택 및 플로팅 관리 액션 바 ================= */
.timeline-photo-item {
  position: relative;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.16s cubic-bezier(0.16, 1, 0.3, 1), outline-color 0.16s ease;
  user-select: none;
  -webkit-user-select: none;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.timeline-photo-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.timeline-photo-item.selected {
  outline: 3.5px solid var(--primary);
  outline-offset: -3.5px;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  transform: scale(0.975);
}

.timeline-select-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  z-index: 12;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.timeline-select-checkbox:hover {
  border-color: var(--primary);
  background: #ffffff;
  transform: scale(1.1);
}

.timeline-photo-item.selected .timeline-select-checkbox,
.timeline-select-checkbox.checked {
  background: var(--primary);
  border-color: #ffffff;
  color: #ffffff;
  transform: scale(1.08);
}

/* 타임라인 하단 플로팅 액션 독 */
.timeline-floating-dock {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 440px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.28), 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 12px 14px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: timelineDockSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-sizing: border-box;
}

@keyframes timelineDockSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 25px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.timeline-dock-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.timeline-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.timeline-dock-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.timeline-dock-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  display: inline-block;
}

.timeline-dock-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.btn-dock-action {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  padding: 9px 4px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  user-select: none;
}

.btn-dock-action:hover {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.btn-dock-action:active {
  transform: translateY(0);
}

.btn-dock-danger {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #ef4444;
  padding: 9px 4px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  user-select: none;
}

.btn-dock-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #dc2626;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.18);
}

.btn-dock-danger:active {
  transform: translateY(0);
}

.btn-dock-close {
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #64748b;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-dock-close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.08);
}

/* 태블릿 및 PC 가로 화면 (641px 이상) */
@media (min-width: 641px) {
  .timeline-floating-dock {
    width: auto;
    max-width: 90vw;
    border-radius: 9999px;
    padding: 8px 16px;
    bottom: 24px;
  }
  .timeline-dock-content {
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }
  .timeline-dock-header {
    padding: 0;
    gap: 12px;
    border-right: 1.5px solid var(--border-color);
    padding-right: 12px;
  }
  .timeline-dock-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
  }
  .btn-dock-action, .btn-dock-danger {
    padding: 8px 14px;
    border-radius: 9999px;
  }
}

.btn-act.select-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.btn-act.select-active:hover {
  background: var(--primary-hover);
  color: #ffffff;
}



/* ================= ACCESS LOGS SECTION ================= */
.access-log-stats-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.access-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.access-stat-pill.active-now {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.active-dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
  display: inline-block;
  animation: pulseGreenDot 2s infinite;
}

@keyframes pulseGreenDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.access-log-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.access-log-filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border-bottom: 1.5px solid var(--border-color);
  flex-wrap: wrap;
  gap: 8px;
}

.access-user-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.access-tab-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.access-tab-btn:hover {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.access-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.access-log-table-wrap {
  max-height: 340px;
  overflow-y: auto;
  overflow-x: auto;
}

.access-log-table {
  width: 100%;
  border-collapse: collapse;
}

.access-log-table tr {
  transition: background 0.15s ease;
}

.access-log-table tbody tr:hover {
  background: #f8fafc;
}

.badge-log-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.badge-log-action.action-login { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-log-action.action-upload { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.badge-log-action.action-download { background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.badge-log-action.action-trash { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-log-action.action-default { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }

.badge-log-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-log-status.status-success { background: #ecfdf5; color: #047857; }
.badge-log-status.status-fail { background: #fef2f2; color: #b91c1c; }


/* ⚡ 라이트박스 & 전체화면 모드 상단 슬림 오버레이 엔진 */
.lightbox-topbar {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  padding: 8px 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  color: white !important;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.35) 60%, rgba(0, 0, 0, 0) 100%) !important;
  border-bottom: none !important;
  z-index: 210 !important;
  pointer-events: none !important;
  box-sizing: border-box !important;
}

.lightbox-topbar > * {
  pointer-events: auto !important;
}

.lightbox-info {
  flex: 1 !important;
  min-width: 0 !important;
  margin-right: 12px !important;
}

.lightbox-content-box {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 100 !important;
}

.lightbox-modal.video-mode .lightbox-topbar {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: auto !important;
  z-index: 210 !important;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.35) 60%, rgba(0, 0, 0, 0) 100%) !important;
  pointer-events: none !important;
}

.lightbox-modal.video-mode .lightbox-content-box {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.btn-lightbox-close {
  background: rgba(0, 0, 0, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 50% !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  color: #ffffff !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.2s ease !important;
}

.btn-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  transform: scale(1.08) !important;
}


/* === PREMIUM UI & UX UPGRADE v79.0 === */
.ui-svg-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: -3px;
}

.app-header, .sub-nav-bar {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
}
.mode-tab:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.2);
}
.mode-tab.active {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
}
.filter-pill:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--primary-light);
  color: var(--primary);
}

.search-input:hover, .form-input:hover, select:hover {
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.search-drop-item:hover {
  background: var(--primary-light) !important;
  color: var(--primary);
}
.search-btn:hover {
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.file-table tbody tr {
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}
.file-table tbody tr:hover {
  background-color: #f0f6ff !important;
}
.btn-act:hover, .btn-small:hover, .btn-timeline-folder-pill:hover {
  border-color: rgba(37, 99, 235, 0.4) !important;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

/* Skeleton Shimmer for Photo Cards */
@keyframes shimmerBg {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.photo-card {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmerBg 1.4s ease-in-out infinite;
  border: 1px solid rgba(226, 232, 240, 0.9);
}
.photo-card:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

/* Timeline Year Scrubber (스크롤 시에만 표시, 멈추면 자동 숨김) */
.timeline-year-scrubber {
  position: fixed;
  right: 10px;
  top: 52%;
  transform: translateY(-50%) translateX(16px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 4px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
  max-height: 68vh;
  overflow-y: auto;
  scrollbar-width: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.timeline-year-scrubber.visible,
.timeline-year-scrubber:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}
.timeline-year-scrubber::-webkit-scrollbar { display: none; }
.timeline-year-btn {
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 999px;
  line-height: 1.1;
  transition: all 0.15s ease;
}
.timeline-year-btn:hover, .timeline-year-btn.active {
  background: var(--primary);
  color: #ffffff;
  transform: scale(1.06);
}

/* Lightbox Video Loader Overlay */
.lightbox-video-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.lightbox-video-loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.lightbox-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: lbSpin 0.8s linear infinite;
}
@keyframes lbSpin {
  to { transform: rotate(360deg); }
}
.lightbox-loader-text {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: rgba(15, 23, 42, 0.65);
  padding: 6px 14px;
  border-radius: 999px;
}

/* Lightbox Info Button & Floating Panel */
.btn-lightbox-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  border-radius: 8px;
  padding: 6px 9px;
}
.btn-lightbox-info:hover, .btn-lightbox-info.active {
  background: var(--primary);
  border-color: var(--primary) !important;
}
.lightbox-info-panel {
  position: absolute;
  right: 16px;
  bottom: 20px;
  width: min(320px, calc(100vw - 32px));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-main);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.25);
  z-index: 30;
  display: none;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}
.lightbox-info-panel.open {
  display: flex;
}
.lb-info-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  padding-bottom: 6px;
}
.lb-info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.lb-info-label {
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}
.lb-info-val {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}


/* === S.M.A.R.T. DISK HEALTH STRIP === */
.smart-health-strip {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.smart-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
}
.smart-good { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.smart-warn { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.smart-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.smart-unknown { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.smart-metric strong { color: var(--text-main); font-weight: 700; }
