/* ============================================
   SnapMeasure — Mobile-first annotation tool
   ============================================ */

/* --- Reset & Base --- */

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

:root {
  --color-bg: #1a1a2e;
  --color-surface: #16213e;
  --color-surface-hover: #1f3056;
  --color-primary: #4cc9f0;
  --color-primary-hover: #72d6f4;
  --color-text: #e8e8e8;
  --color-text-muted: #8892a4;
  --color-danger: #f07070;
  --color-success: #70f0a0;
  --toolbar-height: 60px;
  --toolbar-bottom-height: 80px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);

  /* Prevent text selection on UI elements */
  -webkit-user-select: none;
  user-select: none;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  touch-action: none;
}

.hidden {
  display: none !important;
}

/* --- App Layout --- */

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
}

/* --- Top Toolbar --- */

#toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--safe-area-top) 10px 0;
  min-height: calc(var(--toolbar-height) + var(--safe-area-top));
  background: var(--color-surface);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  z-index: 10;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 3px;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.toolbar-btn:hover {
  background: var(--color-surface-hover);
}

.toolbar-btn:active {
  background: rgba(76, 201, 240, 0.15);
}

.toolbar-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

#btn-ai-scan.ai-loading {
  color: var(--color-primary);
  position: relative;
  overflow: hidden;
}

/* Traveling light around the button border */
#btn-ai-scan.ai-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from var(--ai-angle, 0deg),
      transparent 0%,
      var(--color-primary) 15%,
      transparent 30%,
      transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: ai-border-travel 1.5s linear infinite;
}

#btn-ai-scan.ai-loaded {
  color: var(--color-success);
}

@keyframes ai-border-travel {
  from {
    --ai-angle: 0deg;
  }

  to {
    --ai-angle: 360deg;
  }
}

@property --ai-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.btn-delete {
  display: none !important;
}

.btn-delete.visible {
  display: flex !important;
  color: var(--color-danger);
}

.btn-delete.visible:active {
  background: rgba(240, 112, 112, 0.15);
}

.toolbar-btn.active-toggle {
  background: rgba(76, 201, 240, 0.2);
  color: var(--color-primary);
}

/* --- Bottom Bar (4 main action buttons) --- */

#bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 18px 20px;
  padding-bottom: calc(18px + var(--safe-area-bottom));
  background: var(--color-surface);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  z-index: 10;
}

.bottom-bar-btn {
  position: relative;
  width: 62px;
  height: 62px;
  border: none;
  border-radius: 16px;
  background: rgba(76, 201, 240, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.bottom-bar-btn:active {
  transform: scale(0.92);
  background: rgba(76, 201, 240, 0.3);
}

/* View mode states on bottom bar button */
.bottom-bar-btn.view-simplified {
  background: rgba(76, 201, 240, 0.25);
  color: var(--color-primary);
}

.bottom-bar-btn.view-ai {
  background: rgba(76, 201, 240, 0.35);
  color: var(--color-primary);
}

/* --- AI Banner --- */

.ai-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-surface);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  animation: bannerSlideDown 0.25s ease;
  touch-action: pan-y;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@keyframes bannerSlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.ai-banner.dismissing {
  transform: translateY(-100%);
  opacity: 0;
}

.ai-banner-content {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.ai-banner-content svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

.ai-banner-content b {
  color: var(--color-primary);
}

.ai-banner-action {
  border: none;
  background: var(--color-primary);
  color: var(--color-bg);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* --- Canvas Area --- */

#canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

#canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--color-text-muted);
  font-size: 15px;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#empty-state:active {
  background: rgba(76, 201, 240, 0.04);
}

#empty-state svg {
  opacity: 0.4;
}

#empty-state p {
  margin: 0;
}

/* --- Floating Action Buttons (Google Maps style) --- */

.fab-stack {
  position: fixed;
  top: calc(var(--toolbar-height) + var(--safe-area-top) + 10px);
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
  animation: fabStackIn 0.2s ease;
}

@keyframes fabStackIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fab-small {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 14px;
  background: rgba(40, 50, 80, 0.85);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.fab-small:active {
  transform: scale(0.9);
}

.fab-danger {
  color: var(--color-danger);
}

.color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffff00;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.slider-popup {
  position: fixed;
  left: 62px;
  background: rgba(22, 33, 62, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 11;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  animation: fabStackIn 0.15s ease;
  touch-action: auto;
}

.slider-popup input[type="range"] {
  width: 120px;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

.slider-popup input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
}

#color-slider {
  background: linear-gradient(to right, #ffff00, #cc0000, #00ff88, #00aaff, #ff6600, #ff00ff, #ffffff) !important;
  border-radius: 4px !important;
  height: 8px !important;
}

#color-slider::-webkit-slider-thumb {
  width: 22px !important;
  height: 22px !important;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.slider-popup span {
  font-size: 12px;
  color: var(--color-text-muted);
  min-width: 20px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.setting-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
  min-width: 28px;
}

#font-size {
  flex: 1;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

#font-size::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
}

#font-size-value {
  font-size: 12px;
  color: var(--color-text-muted);
  min-width: 20px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Color Picker --- */

.color-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.color-swatches {
  display: flex;
  gap: 6px;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.color-swatch.active {
  border-color: var(--color-primary);
  transform: scale(1.15);
}

.color-swatch:active {
  transform: scale(0.9);
}

/* --- AI Command Modal --- */

.ai-cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.ai-cmd-modal {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 20px;
  width: calc(100% - 48px);
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.ai-cmd-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.ai-cmd-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
}

.ai-cmd-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-cmd-input-row input {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-size: 14px;
  outline: none;
}

.ai-cmd-input-row input:focus {
  border-color: var(--color-primary);
}

.ai-cmd-mic {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.ai-cmd-mic.recording {
  flex: 1;
  width: auto;
  height: 48px;
  border-radius: 12px;
  background: rgba(76, 201, 240, 0.15);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.4);
  animation: micPulse 1s ease-in-out infinite;
}

.ai-cmd-mic.recording svg {
  display: none;
}

.ai-cmd-mic.recording::after {
  content: 'Tap to send';
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
}

@keyframes micPulse {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(76, 201, 240, 0.2);
  }
}

@keyframes recDot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.ai-cmd-go {
  height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--color-primary);
  color: var(--color-bg);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ai-cmd-go:disabled {
  opacity: 0.4;
}

/* --- AI Toast --- */

.ai-toast {
  position: fixed;
  bottom: calc(110px + var(--safe-area-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(22, 33, 62, 0.92);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.ai-toast.toast-in {
  animation: toastIn 0.25s ease;
}

.ai-toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
}

.ai-toast-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(76, 201, 240, 0.3);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Text Input Overlay --- */

#text-input-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.text-input-container {
  width: 100%;
  max-width: 480px;
  background: var(--color-surface);
  border-radius: 16px 16px 0 0;
  padding: 20px 16px;
  padding-bottom: calc(16px + var(--safe-area-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#annotation-text {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  resize: none;
  transition: border-color 0.15s ease;
}

#annotation-text:focus {
  border-color: var(--color-primary);
}

#annotation-text::placeholder {
  color: var(--color-text-muted);
}

.text-input-actions {
  display: flex;
  gap: 8px;
}

.text-btn {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.text-btn:active {
  opacity: 0.7;
}

.text-btn.cancel {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-muted);
}

.text-btn.confirm {
  background: var(--color-primary);
  color: var(--color-bg);
}

/* --- Layer Button & Panel --- */

.layer-btn-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(22, 33, 62, 0.8);
}

.layer-panel {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  max-height: 320px;
  background: rgba(22, 33, 62, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  z-index: 11;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: layerPanelIn 0.15s ease;
}

@keyframes layerPanelIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.layer-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.layer-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.layer-panel-add {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(76, 201, 240, 0.15);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.layer-panel-add:active {
  background: rgba(76, 201, 240, 0.3);
}

.layer-list {
  overflow-y: auto;
  max-height: 260px;
  padding: 4px 0;
}

.layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.layer-row:active {
  background: rgba(255, 255, 255, 0.05);
}

.layer-row.active {
  background: rgba(76, 201, 240, 0.1);
}

.layer-row.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--color-primary);
}

/* Layer filter states */
.layer-row.layer-on {
  background: rgba(76, 201, 240, 0.1);
}

.layer-row.layer-off {
  opacity: 0.35;
}

.layer-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.layer-row-name {
  flex: 1;
  font-size: 13px;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.layer-row-count {
  font-size: 11px;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 8px;
  min-width: 20px;
  text-align: center;
}

.layer-row-visibility {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.layer-row-visibility.layer-hidden {
  color: rgba(255, 255, 255, 0.15);
}

.layer-row-delete {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.layer-row-delete:active {
  color: var(--color-danger);
}

/* Layer rename input (inline) */
.layer-rename-input {
  flex: 1;
  height: 24px;
  padding: 0 6px;
  border: 1.5px solid var(--color-primary);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

/* --- Layer Assignment (context actions) --- */

.layer-assign-dot {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(40, 50, 80, 0.85);
}

.layer-assign-popup {
  position: fixed;
  left: 62px;
  background: rgba(22, 33, 62, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  z-index: 11;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  animation: fabStackIn 0.15s ease;
  min-width: 160px;
  overflow: hidden;
}

.layer-assign-list {
  padding: 4px 0;
  max-height: 240px;
  overflow-y: auto;
}

.layer-assign-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  font-size: 13px;
  color: var(--color-text);
}

.layer-assign-row:active {
  background: rgba(255, 255, 255, 0.08);
}

.layer-assign-row.current {
  color: var(--color-primary);
}

.layer-assign-row .layer-assign-check {
  width: 16px;
  font-size: 12px;
  flex-shrink: 0;
}

/* --- Bottom Sheet (export/delete overlays) --- */

.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.bottom-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--color-surface);
  border-radius: 16px 16px 0 0;
  padding: 8px 16px;
  padding-bottom: calc(16px + var(--safe-area-bottom));
  animation: bottomSheetIn 0.25s ease;
}

@keyframes bottomSheetIn {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.bottom-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 auto 12px;
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.bottom-sheet-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.bottom-sheet-list {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.bottom-sheet-actions {
  display: flex;
  gap: 8px;
}

/* Export layer rows */
.export-layer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-size: 14px;
  color: var(--color-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.export-layer-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

.export-layer-select-all {
  font-weight: 600;
  color: var(--color-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
  margin-bottom: 2px;
}

.export-layer-name {
  flex: 1;
}

/* Delete layer option rows */
.layer-delete-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-size: 14px;
  color: var(--color-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.layer-delete-option.danger-option {
  color: var(--color-danger);
}

.layer-delete-select {
  flex: 1;
  height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.export-mode-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 14px;
}

.export-mode-btn {
  flex: 1;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.export-mode-btn.export-mode-active {
  background: var(--color-primary);
  color: var(--color-bg);
}

/* --- Photo Source Picker --- */

.photo-source-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.photo-source-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease;
}

.photo-source-btn:active {
  background: rgba(255, 255, 255, 0.08);
}

.photo-source-btn svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

/* --- Utility --- */