:root {
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-blue-soft: rgba(0, 113, 227, 0.11);
  --apple-teal: #00c7be;
  --apple-green: #34c759;
  --apple-red: #ff3b30;
  --apple-orange: #ff9500;
  --apple-purple: #af52de;
  --bg-page: #f5f5f7;
  --bg-sidebar: rgba(245, 245, 247, 0.85);
  --bg-card: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #86868b;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.08), 0 2px 10px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-pill: 999px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* ============================================================================
   LOGIN VIEW (iCloud.com Aesthetic)
   ============================================================================ */
.login-view {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(circle at 20% 15%, #e4f0ff 0%, #f5f5f7 52%, #eef9f8 100%);
  overflow-y: auto;
}

.icloud-top-header {
  height: 54px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.icloud-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.icloud-brand svg {
  color: var(--apple-blue);
}

.brand-weight {
  font-weight: 500;
  color: var(--text-secondary);
}

.icloud-header-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.1);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 540px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 26px;
  box-shadow: var(--shadow-card);
  padding: 36px 38px 30px;
  text-align: center;
}

.login-cloud-hero {
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
}

.apple-cloud-emblem {
  width: 86px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 8px 16px rgba(0, 113, 227, 0.22));
}

.login-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.member-pills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.member-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.member-pill:hover {
  border-color: var(--apple-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 113, 227, 0.12);
}

.member-pill.active {
  background: var(--apple-blue-soft);
  border-color: var(--apple-blue);
  color: var(--apple-blue);
  font-weight: 600;
}

.pill-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pill-airdrop-tag {
  font-size: 11px;
  color: #009c95;
  background: rgba(0, 199, 190, 0.15);
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 600;
}

.apple-input-group {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
  text-align: left;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.apple-input-group:focus-within {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

.apple-input-row {
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.apple-input-row + .apple-input-row {
  border-top: 1px solid var(--border-subtle);
}

.apple-input-row input {
  width: 100%;
  height: 46px;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text-primary);
  background: transparent;
}

.apple-submit-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--apple-blue);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.apple-submit-arrow:hover {
  background: var(--apple-blue-hover);
  transform: scale(1.05);
}

.login-error {
  margin-top: 12px;
  font-size: 13px;
  color: var(--apple-red);
  background: rgba(255, 59, 48, 0.08);
  padding: 8px 12px;
  border-radius: 10px;
}

.login-footer-meta {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-muted);
}

.icloud-login-footer {
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================================
   MAIN WORKSPACE
   ============================================================================ */
.app-view {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.workspace-topbar {
  height: 56px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.workspace-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-drive {
  font-weight: 500;
  color: var(--apple-blue);
}

.topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  overflow-x: auto;
  white-space: nowrap;
}

.crumb-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.crumb-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.crumb-btn.current {
  color: var(--text-primary);
  font-weight: 600;
}

.crumb-sep {
  color: var(--text-muted);
  font-size: 12px;
}

.topbar-center {
  flex: 0 1 280px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(118, 118, 128, 0.11);
  border-radius: 10px;
  padding: 0 11px;
  height: 34px;
  color: var(--text-secondary);
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 13.5px;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.toolbar-icon-btn {
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toolbar-icon-btn:hover {
  background: #f5f5f7;
  border-color: var(--border-strong);
}

.toolbar-primary-pill {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--apple-blue);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.25);
  transition: background 0.15s ease;
}

.toolbar-primary-pill:hover {
  background: var(--apple-blue-hover);
}

.toolbar-airdrop-pill {
  height: 34px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 199, 190, 0.45);
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.09), rgba(0, 199, 190, 0.16));
  color: #006680;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toolbar-airdrop-pill:hover {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.16), rgba(0, 199, 190, 0.24));
  transform: translateY(-1px);
}

.view-toggle-group {
  display: inline-flex;
  background: rgba(118, 118, 128, 0.12);
  padding: 2px;
  border-radius: 9px;
}

.view-toggle-btn {
  width: 30px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.view-toggle-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* User Avatar & Dropdown */
.user-menu-wrapper {
  position: relative;
}

.user-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 5px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--apple-blue);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: 42px;
  width: 240px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 6px;
  z-index: 100;
}

.dropdown-user-header {
  padding: 8px 10px;
}

.dropdown-user-title {
  font-size: 14px;
  font-weight: 700;
}

.dropdown-user-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.dropdown-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--apple-blue);
  color: #ffffff;
}

.dropdown-item.danger {
  color: var(--apple-red);
}

.dropdown-item.danger:hover {
  background: var(--apple-red);
  color: #ffffff;
}

/* ============================================================================
   SIDEBAR & BODY LAYOUT
   ============================================================================ */
.workspace-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.icloud-sidebar {
  width: 265px;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 18px;
}

.sidebar-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 10px 8px;
}

.sidebar-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 8px;
}

.sidebar-heading-row .sidebar-heading {
  padding: 0;
}

.sidebar-link-btn {
  border: none;
  background: transparent;
  color: var(--apple-blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-nav-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s ease;
  text-align: left;
}

.sidebar-nav-item:hover {
  background: rgba(0, 0, 0, 0.045);
}

.sidebar-nav-item.active {
  background: var(--apple-blue);
  color: #ffffff;
  font-weight: 600;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--apple-blue);
}

.sidebar-nav-item.active .nav-icon {
  color: #ffffff;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-meta-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
}

.sidebar-nav-item.active .nav-meta-pill {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.airdrop-badge {
  background: rgba(0, 199, 190, 0.18);
  color: #00857e;
}

.sidebar-family-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 8px;
}

.mini-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 4px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
}

.mini-member-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar Storage Widget */
.sidebar-storage-widget {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.storage-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.storage-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.storage-numbers {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.icloud-meter-bar {
  height: 7px;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 99px;
  overflow: hidden;
}

.icloud-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #0071e3, #00c7be);
  border-radius: 99px;
  min-width: 3px;
}

.family-pool-block {
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.icloud-segmented-bar {
  height: 7px;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 99px;
  overflow: hidden;
  display: flex;
}

.segment-piece {
  height: 100%;
  min-width: 2px;
}

.storage-pool-caption {
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ============================================================================
   MAIN FILE BROWSER CANVAS
   ============================================================================ */
.file-canvas-container {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 26px 40px;
  background: #ffffff;
}

.file-canvas-container.marquee-selecting,
.file-canvas-container.marquee-selecting * {
  user-select: none !important;
  -webkit-user-select: none !important;
}

.marquee-selection-box {
  position: absolute;
  pointer-events: none;
  z-index: 45;
  border: 1.5px solid rgba(0, 113, 227, 0.88);
  background: rgba(0, 113, 227, 0.14);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 113, 227, 0.12), inset 0 0 0 0.5px rgba(255, 255, 255, 0.35);
}

.scope-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.scope-banner h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.scope-banner p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.scope-banner-actions {
  display: flex;
  gap: 8px;
}

/* GRID VIEW */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.file-card {
  position: relative;
  border-radius: 14px;
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.14s ease;
  user-select: none;
}

.file-card:hover {
  background: rgba(0, 113, 227, 0.05);
  border-color: rgba(0, 113, 227, 0.15);
}

.file-icon-wrap {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.file-icon-wrap.has-miniature {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.10), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.miniature-fallback-svg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: opacity 0.16s ease;
}

.file-miniature-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.2s ease;
  position: relative;
  z-index: 2;
  display: block;
}

.file-miniature-img.loaded {
  opacity: 1;
}

.file-card:hover .file-miniature-img.loaded {
  transform: scale(1.04);
}

.miniature-video-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 1px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.list-miniature-img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  display: block;
}

.file-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.file-card-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.owner-badge-pill {
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
}

.owner-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.card-quick-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  display: flex;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.file-card:hover .card-quick-actions {
  opacity: 1;
  pointer-events: auto;
}

.card-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.card-action-btn:hover {
  color: var(--apple-blue);
  border-color: var(--apple-blue);
}

/* LIST VIEW */
.files-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.file-list-row {
  display: grid;
  grid-template-columns: 42px 1fr 140px 110px 140px 130px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.file-list-row:last-child {
  border-bottom: none;
}

.file-list-row:hover {
  background: rgba(0, 113, 227, 0.05);
}

.list-col-name {
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 12px;
}

.list-col-meta {
  color: var(--text-secondary);
  font-size: 12px;
}

.list-col-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* EMPTY STATE */
.empty-state {
  margin: 60px auto;
  text-align: center;
  max-width: 340px;
}

.empty-state-icon {
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================================================
   DRAG & DROP OVERLAY & UPLOAD TOAST
   ============================================================================ */
.dropzone-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 113, 227, 0.14);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dropzone-card {
  background: #ffffff;
  border: 2.5px dashed var(--apple-blue);
  border-radius: 24px;
  padding: 40px 56px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.dropzone-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-top: 12px;
}

.dropzone-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.upload-progress-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 340px;
  background: rgba(29, 29, 31, 0.94);
  backdrop-filter: blur(20px);
  color: #ffffff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
  z-index: 500;
}

.upload-toast-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.upload-toast-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  overflow: hidden;
}

.upload-toast-fill {
  height: 100%;
  background: linear-gradient(90deg, #409cff, #00c7be);
  transition: width 0.15s ease;
}

.upload-toast-meta {
  margin-top: 7px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.72);
}

/* ============================================================================
   MODALS (QuickLook, AirDrop Hub, Family Quotas)
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-window {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.quicklook-window {
  max-width: 860px;
}

.airdrop-window {
  max-width: 780px;
}

.family-window {
  max-width: 820px;
}

.small-window {
  max-width: 420px;
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.modal-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.airdrop-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(0, 113, 227, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close-x {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
}

.modal-close-x:hover {
  background: rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
}

.modal-content {
  padding: 20px 22px;
  overflow-y: auto;
}

/* QuickLook Preview Body */
.quicklook-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.quicklook-title-wrap h3 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ql-meta-badge {
  font-size: 11.5px;
  color: var(--text-secondary);
  background: #f5f5f7;
  padding: 3px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}

.quicklook-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.quicklook-body {
  padding: 24px;
  background: #f5f5f7;
  min-height: 340px;
  max-height: 72vh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ql-preview-image {
  max-width: 100%;
  max-height: 62vh;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.ql-preview-video {
  max-width: 100%;
  max-height: 62vh;
  border-radius: 10px;
  background: #000;
}

.ql-preview-text {
  width: 100%;
  background: #ffffff;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--text-primary);
  max-height: 60vh;
  overflow: auto;
}

/* AirDrop Modal Styles */
.airdrop-status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.08), rgba(0, 199, 190, 0.14));
  border: 1px solid rgba(0, 199, 190, 0.35);
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 18px;
}

.status-dot-pulse {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--apple-green);
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.22);
  flex-shrink: 0;
}

.status-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.status-banner-text span {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.airdrop-methods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.airdrop-method-card {
  background: #f8f9fb;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
}

.method-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.1);
  padding: 3px 9px;
  border-radius: 99px;
  margin-bottom: 8px;
}

.airdrop-method-card h4 {
  font-size: 15px;
  margin-bottom: 6px;
}

.airdrop-method-card p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.method-note {
  margin-top: 8px;
  font-size: 11.5px !important;
  color: var(--text-muted) !important;
}

.shortcut-steps {
  margin: 8px 0 10px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.code-copy-box {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.code-copy-box input {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  font-family: "SF Mono", monospace;
  font-size: 11.5px;
  background: #ffffff;
}

.section-header-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.airdrop-events-list {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  max-height: 170px;
  overflow-y: auto;
}

.airdrop-event-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12.5px;
}

.airdrop-event-row:last-child {
  border-bottom: none;
}

/* Family Quotas Modal */
.family-pool-summary-card {
  background: #f5f5f7;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.family-members-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.family-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.fm-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
}

.fm-bar-wrap {
  flex: 1;
}

.fm-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fm-input-small {
  width: 72px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font-size: 12px;
}

/* Buttons & Inputs */
.apple-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.14s ease;
}

.apple-btn.small {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 8px;
}

.apple-btn.primary {
  background: var(--apple-blue);
  color: #ffffff;
}

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

.apple-btn.secondary {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

.apple-btn.secondary:hover {
  background: rgba(0, 0, 0, 0.11);
}

.apple-btn.danger {
  background: rgba(255, 59, 48, 0.12);
  color: var(--apple-red);
}

.apple-btn.danger:hover {
  background: var(--apple-red);
  color: #ffffff;
}

.apple-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.apple-text-input {
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  font-size: 14px;
  outline: none;
}

.apple-text-input:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.modal-footer-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.form-feedback {
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: 8px;
}

/* ============================================================================
   MOBILE DRAWER TOGGLE & RESPONSIVE BREAKPOINTS
   ============================================================================ */
.mobile-sidebar-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.mobile-sidebar-toggle:hover {
  background: #f5f5f7;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
}

@media (max-width: 1024px) {
  .icloud-sidebar {
    width: 235px;
  }

  .btn-label-desktop {
    display: none;
  }

  .topbar-center {
    flex: 0 1 220px;
  }

  .file-list-row {
    grid-template-columns: 38px 1fr 90px 120px 115px;
  }

  .list-col-owner {
    display: none;
  }
}

@media (hover: none) {
  .card-quick-actions {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 768px) {
  body,
  .login-view,
  .app-view {
    height: 100dvh;
  }

  .mobile-sidebar-toggle {
    display: inline-flex;
  }

  .workspace-topbar {
    height: auto;
    min-height: 54px;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 8px 10px;
  }

  .topbar-left {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
  }

  .breadcrumbs {
    max-width: 100%;
    scrollbar-width: none;
  }

  .breadcrumbs::-webkit-scrollbar {
    display: none;
  }

  .topbar-right {
    flex: 0 0 auto;
    gap: 6px;
  }

  .topbar-center {
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
  }

  .toolbar-airdrop-pill span,
  .user-display-label {
    display: none;
  }

  .toolbar-airdrop-pill,
  .toolbar-icon-btn {
    padding: 0 9px;
  }

  .toolbar-primary-pill {
    padding: 0 11px;
  }

  .workspace-body {
    position: relative;
  }

  .icloud-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    max-width: 84vw;
    z-index: 100;
    background: rgba(245, 245, 247, 0.97);
    transform: translateX(-105%);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.15);
  }

  .icloud-sidebar.open {
    transform: translateX(0);
  }

  .file-canvas-container {
    padding: 16px 14px 32px;
  }

  .scope-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 14px;
  }

  .scope-banner h2 {
    font-size: 19px;
  }

  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 12px;
  }

  .card-quick-actions {
    opacity: 1;
    pointer-events: auto;
  }

  .file-list-row {
    grid-template-columns: 36px 1fr auto auto;
    gap: 8px;
    padding: 10px;
  }

  .list-col-owner,
  .list-col-date {
    display: none;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-window {
    max-height: 92dvh;
    border-radius: 16px;
  }

  .modal-header {
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  .modal-content {
    padding: 16px;
  }

  .quicklook-actions {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }

  .quicklook-body {
    padding: 14px;
    min-height: 220px;
  }

  .airdrop-status-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .airdrop-methods-grid {
    grid-template-columns: 1fr;
  }

  .family-member-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .fm-controls {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .icloud-top-header {
    height: auto;
    min-height: 50px;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .icloud-header-badge {
    font-size: 11px;
    padding: 4px 10px;
  }

  .login-main {
    padding: 12px;
  }

  .login-card {
    padding: 24px 18px 22px;
    border-radius: 22px;
  }

  .login-title {
    font-size: 22px;
  }

  .login-subtitle {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .member-pills-grid {
    gap: 6px;
    margin-bottom: 18px;
  }

  .member-pill {
    padding: 5px 10px 5px 6px;
    font-size: 12.5px;
  }

  .icloud-login-footer {
    padding: 12px;
    font-size: 11px;
  }

  .topbar-divider {
    display: none;
  }

  .breadcrumbs {
    display: none;
  }

  .toolbar-primary-pill span {
    display: none;
  }

  .toolbar-primary-pill {
    padding: 0 10px;
  }

  .files-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .file-card {
    padding: 12px 8px 10px;
  }

  .upload-progress-toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }

  .dropzone-card {
    padding: 26px 18px;
    margin: 0 14px;
  }
}

/* Stacked Navigation Back Button & Subtle Profile Dropdown Item */
.crumb-back-btn {
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--apple-blue);
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 7px;
  cursor: pointer;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  transition: all 0.14s ease;
}

.crumb-back-btn:hover {
  background: var(--apple-blue-soft);
  border-color: var(--apple-blue);
}

.dropdown-item-subtle {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============================================================================
   OS SELECTION, DRAG-TO-FOLDER, CONTEXT MENU, TOASTS & INLINE RENAME
   ============================================================================ */
.file-card,
.file-list-row {
  position: relative;
  outline: none;
  -webkit-touch-callout: none;
}

.file-card.selected {
  background: rgba(0, 113, 227, 0.13) !important;
  border-color: var(--apple-blue) !important;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.22);
}

.file-card.selected .file-card-name {
  color: var(--apple-blue);
  font-weight: 600;
}

.file-list-row.selected {
  background: rgba(0, 113, 227, 0.13) !important;
}

.file-list-row.selected .list-col-name {
  color: var(--apple-blue);
  font-weight: 600;
}

.selection-check-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.9);
  color: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 11;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  transition: all 0.12s ease;
}

.selection-mode-active .file-card .selection-check-badge,
.file-card.selected .selection-check-badge {
  display: inline-flex;
}

.file-card.selected .selection-check-badge {
  background: var(--apple-blue);
  border-color: var(--apple-blue);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.35);
}

/* Drag and Drop onto Folders / Breadcrumbs */
.file-card.dragging,
.file-list-row.dragging {
  opacity: 0.45;
  transform: scale(0.97);
}

.file-card.drop-target-active,
.file-list-row.drop-target-active {
  background: rgba(0, 113, 227, 0.16) !important;
  border-color: var(--apple-blue) !important;
  box-shadow: 0 0 0 2.5px var(--apple-blue) !important;
  transform: scale(1.03);
}

.crumb-btn.drop-target-active,
.crumb-back-btn.drop-target-active {
  background: var(--apple-blue) !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.35);
}

/* Synced Soft-Link Badge */
.synced-badge-pill {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(0, 113, 227, 0.1);
  color: var(--apple-blue);
}

/* Double-Click Inline Folder Rename on Scope Title */
.scope-title-editable {
  cursor: text;
  border-radius: 7px;
  padding: 1px 6px;
  margin-left: -6px;
  display: inline-block;
  transition: background 0.14s ease;
}

.scope-title-editable:hover {
  background: rgba(0, 113, 227, 0.08);
}

.inline-folder-rename-input {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  background: #ffffff;
  border: 2px solid var(--apple-blue);
  border-radius: 8px;
  padding: 2px 8px;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
  max-width: 100%;
}

/* Floating Multi-Selection Action Bar */
.selection-action-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: rgba(29, 29, 31, 0.94);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  color: #ffffff;
  border-radius: 999px;
  padding: 7px 10px 7px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.12);
  z-index: 260;
  max-width: calc(100vw - 24px);
}

.selection-count-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: #ffffff;
}

.selection-bar-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sel-action-btn {
  height: 32px;
  padding: 0 11px;
  border-radius: 99px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background 0.14s ease;
}

.sel-action-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.sel-action-btn.danger {
  background: rgba(255, 59, 48, 0.24);
  color: #ff6961;
}

.sel-action-btn.danger:hover {
  background: var(--apple-red);
  color: #ffffff;
}

.sel-clear-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sel-clear-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

/* Right-Click Context Menu */
.file-context-menu {
  position: fixed;
  min-width: 210px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 13px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 5px;
  z-index: 950;
  user-select: none;
}

.ctx-menu-header {
  padding: 6px 10px 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 230px;
}

.ctx-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  text-align: left;
}

.ctx-menu-item:hover {
  background: var(--apple-blue);
  color: #ffffff;
}

.ctx-menu-item.danger {
  color: var(--apple-red);
}

.ctx-menu-item.danger:hover {
  background: var(--apple-red);
  color: #ffffff;
}

.ctx-menu-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 2px;
}

/* Custom Notification Toasts */
.toast-container {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 980;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

.custom-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 390px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 15px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  animation: toastSlideIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(0, 113, 227, 0.11);
  color: var(--apple-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-icon.danger {
  background: rgba(255, 59, 48, 0.12);
  color: var(--apple-red);
}

.toast-icon.success {
  background: rgba(52, 199, 89, 0.14);
  color: var(--apple-green);
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.toast-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.toast-action-btn {
  border: none;
  background: rgba(0, 113, 227, 0.11);
  color: var(--apple-blue);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.toast-action-btn:hover {
  background: var(--apple-blue);
  color: #ffffff;
}

@media (max-width: 600px) {
  .sel-action-btn span {
    display: none;
  }
  .sel-action-btn {
    padding: 0 10px;
  }
  .toast-container {
    right: 12px;
    left: 12px;
    top: auto;
    bottom: 76px;
  }
  .custom-toast {
    max-width: 100%;
  }
}

/* ============================================================================
   GOOGLE PHOTOS IMPORTER MODAL & BUTTON STYLES
   ============================================================================ */
.gphotos-window {
  width: min(920px, 95vw);
  max-height: 90vh;
}

.gphotos-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.gphotos-modal-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gphotos-step1-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.08), rgba(52, 168, 83, 0.08));
  border: 1px solid rgba(0, 113, 227, 0.16);
}

.gphotos-step1-info h4 {
  font-size: 14.5px;
  margin: 4px 0;
  color: var(--text-primary);
}

.gphotos-step1-info p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.gphotos-step1-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.gphotos-drop-card {
  border: 1.5px dashed rgba(0, 113, 227, 0.35);
  background: rgba(0, 113, 227, 0.025);
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gphotos-drop-card.dragover {
  border-color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.09);
  transform: scale(1.01);
}

.gphotos-feature-list {
  margin: 8px 0 14px;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.gphotos-drop-cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gphotos-download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.gphotos-cmd-block {
  margin-top: 8px;
}

.gphotos-cmd-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.gphotos-jobs-section {
  background: #f5f5f7;
  border-radius: 13px;
  padding: 12px 15px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.gphotos-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.gphotos-job-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 13px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gphotos-job-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.gphotos-job-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 768px) {
  .gphotos-step1-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .gphotos-step1-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* ============================================================================
   DISABLED SHARE BUTTONS, QUICKLOOK OPTIONS DROPDOWN, FULLSCREEN & METADATA
   ============================================================================ */
.card-action-btn:disabled,
.card-action-btn.disabled {
  opacity: 0.36;
  cursor: not-allowed;
  pointer-events: auto;
  color: var(--text-muted) !important;
  border-color: var(--border-subtle) !important;
}

.sel-action-btn:disabled,
.sel-action-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ctx-menu-item:disabled,
.ctx-menu-item.disabled,
.dropdown-item:disabled,
.dropdown-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent !important;
  color: var(--text-muted) !important;
}

.ql-shared-state-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.11);
  padding: 3px 9px;
  border-radius: 99px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ql-options-wrapper {
  position: relative;
}

.ql-options-dropdown {
  position: absolute;
  right: 0;
  top: 36px;
  width: 215px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  box-shadow: var(--shadow-card);
  padding: 6px;
  z-index: 360;
}

.ql-options-dropdown a.dropdown-item {
  display: block;
  text-decoration: none;
}

/* QuickLook Main Area + Metadata Drawer */
.quicklook-main-area {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #f5f5f7;
}

.quicklook-main-area .quicklook-body {
  flex: 1;
  min-width: 0;
}

.ql-metadata-panel {
  width: 290px;
  background: #ffffff;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.ql-meta-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ql-meta-panel-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.ql-metadata-list {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ql-meta-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ql-meta-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ql-meta-key {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.ql-meta-val {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
}

/* Full Screen Preview Mode */
#quicklook-modal.fullscreen-backdrop {
  padding: 0 !important;
}

.quicklook-window.fullscreen-active,
.quicklook-window:fullscreen {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
}

.quicklook-window.fullscreen-active .quicklook-body,
.quicklook-window:fullscreen .quicklook-body {
  max-height: calc(100dvh - 60px) !important;
  height: calc(100dvh - 60px) !important;
}

.quicklook-window.fullscreen-active .ql-preview-image,
.quicklook-window:fullscreen .ql-preview-image,
.quicklook-window.fullscreen-active .ql-preview-video,
.quicklook-window:fullscreen .ql-preview-video {
  max-height: calc(100dvh - 96px) !important;
}

@media (max-width: 768px) {
  .quicklook-main-area {
    flex-direction: column;
  }
  .ql-metadata-panel {
    width: 100%;
    max-height: 240px;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
}

/* ============================================================================
   QUICKLOOK HEADER STACKING, UNCLIPPED DROPDOWN & RESPONSIVE CONTROLS
   ============================================================================ */
.quicklook-window {
  overflow: visible !important;
}

.quicklook-window > .modal-header {
  position: relative;
  z-index: 80;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
}

.quicklook-window.fullscreen-active > .modal-header,
.quicklook-window:fullscreen > .modal-header {
  border-radius: 0;
}

.quicklook-main-area {
  position: relative;
  z-index: 1;
  border-radius: 0 0 20px 20px;
  overflow: hidden;
}

.quicklook-window.fullscreen-active .quicklook-main-area,
.quicklook-window:fullscreen .quicklook-main-area {
  border-radius: 0;
}

.quicklook-actions,
.quicklook-actions button,
.quicklook-actions a,
.ql-options-dropdown,
.ql-options-dropdown button,
.ql-options-dropdown a {
  pointer-events: auto;
}

@media (max-width: 640px) {
  .quicklook-window > .modal-header {
    padding: 12px 14px;
    gap: 8px;
  }

  .quicklook-title-wrap {
    flex: 1 1 auto;
    min-width: 120px;
  }

  .quicklook-title-wrap h3 {
    font-size: 15px;
  }

  .quicklook-actions {
    width: auto !important;
    margin-left: auto;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    gap: 5px !important;
  }

  #ql-btn-info span,
  #ql-fullscreen-label {
    display: none;
  }

  #ql-btn-info,
  #ql-btn-fullscreen {
    padding: 0 8px;
  }

  .ql-options-dropdown {
    right: 0;
    left: auto;
    max-width: calc(100vw - 32px);
  }
}
