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

:root {
  --bg: #0f0f13;
  --bg-surface: #1a1a22;
  --bg-hover: #252530;
  --bg-active: #0f3460;
  --text: #e0e0e8;
  --text-muted: #888894;
  --text-dim: #555560;
  --accent: #7bb8f5;
  --accent-green: #6dca8d;
  --accent-red: #f57b7b;
  --border: #2a2a36;
  --radius: 8px;
  --rail-width: 56px;
  --header-height: 52px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ── App Layout ── */
.app {
  display: grid;
  grid-template-columns: var(--rail-width) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Rail ── */
.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 8px 0;
  gap: 4px;
  overflow: hidden;
}

.rail-spacer {
  flex: 1;
}

.rail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.rail-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.rail-btn.active {
  background: var(--bg-active);
  color: var(--accent);
}

.rail-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ── Main Area ── */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
}

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

/* ── Pills ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.pill:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--text-dim);
}

.pill.active {
  background: var(--bg-active);
  color: var(--accent);
  border-color: var(--accent);
}

.pill-count {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-hover);
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 20px;
  text-align: center;
}

.pill.active .pill-count {
  background: rgba(123, 184, 245, 0.15);
  color: var(--accent);
}

/* ── Content Area ── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.content::-webkit-scrollbar {
  width: 6px;
}

.content::-webkit-scrollbar-track {
  background: transparent;
}

.content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ── Gallery Grid ── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-surface);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
}

.gallery-item:hover {
  transform: scale(1.02);
}

.gallery-item.selected {
  border-color: var(--accent);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s;
  display: block;
}

.gallery-item img.loaded {
  opacity: 1;
}

.gallery-item .item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.6) 100%);
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-item:hover .item-overlay {
  opacity: 1;
}

.gallery-item .item-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  cursor: pointer;
  z-index: 2;
}

.gallery-item:hover .item-checkbox,
.gallery-item.selected .item-checkbox {
  opacity: 1;
}

.gallery-item.selected .item-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.gallery-item.selected .item-checkbox::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-hover) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
  aspect-ratio: 1;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Load More Sentinel ── */
.load-sentinel {
  height: 1px;
  margin-top: 16px;
}

/* ── Loading Spinner ── */
.spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  color: var(--text-muted);
  gap: 8px;
}

.spinner-ring {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 32px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-dim);
  opacity: 0.5;
}

.empty-state p {
  font-size: 15px;
}

.empty-state small {
  font-size: 12px;
  color: var(--text-dim);
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.95);
  flex-direction: column;
}

.lightbox.open {
  display: flex;
}

.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 16px;
  gap: 8px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.3);
}

.lightbox-toolbar .toolbar-spacer {
  flex: 1;
}

.lb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

.lb-btn:hover {
  background: rgba(255,255,255,0.16);
}

.lb-btn svg {
  width: 18px;
  height: 18px;
}

.lightbox-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.lightbox-img-wrap {
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  transition: transform 0.2s;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  z-index: 2;
}

.lb-nav:hover {
  background: rgba(255,255,255,0.2);
}

.lb-nav svg {
  width: 20px;
  height: 20px;
}

.lb-nav.prev {
  left: 16px;
}

.lb-nav.next {
  right: 16px;
}

.lb-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

/* ── Placeholder Views ── */
.placeholder-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-muted);
}

.placeholder-view svg {
  width: 40px;
  height: 40px;
  color: var(--text-dim);
  opacity: 0.4;
}

.placeholder-view h2 {
  font-size: 16px;
  font-weight: 500;
}

.placeholder-view p {
  font-size: 13px;
  color: var(--text-dim);
}

/* ── Responsive: Mobile (bottom tab bar) ── */
@media (max-width: 767px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 56px;
  }

  .main {
    grid-row: 1;
    grid-column: 1;
    height: calc(100vh - 56px);
  }

  .rail {
    grid-row: 2;
    grid-column: 1;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 56px;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 0 8px;
    gap: 0;
  }

  .rail-spacer {
    display: none;
  }

  .rail-btn {
    width: 48px;
    height: 48px;
  }

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

  .content {
    padding: 8px;
  }

  .lb-nav.prev {
    left: 8px;
  }

  .lb-nav.next {
    right: 8px;
  }
}

/* ── Upload View ── */
.upload-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 0;
}

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.upload-zone svg {
  width: 40px;
  height: 40px;
  color: var(--text-dim);
}

.upload-zone-title {
  font-size: 15px;
  color: var(--text);
}

.upload-zone-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

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

.upload-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.upload-row[data-status="done"] {
  border-color: var(--accent-green);
}

.upload-row[data-status="error"] {
  border-color: var(--accent-red);
}

.upload-row-name {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.upload-bar-wrap {
  width: 80px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.upload-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.2s;
  width: 0;
}

.upload-row[data-status="done"] .upload-bar-fill {
  background: var(--accent-green);
}

.upload-row[data-status="error"] .upload-bar-fill {
  background: var(--accent-red);
}

.upload-row-status {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 48px;
  text-align: right;
}

.upload-row[data-status="done"] .upload-row-status {
  color: var(--accent-green);
}

.upload-row[data-status="error"] .upload-row-status {
  color: var(--accent-red);
  white-space: normal;
  max-width: 160px;
}

.upload-summary {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  text-align: center;
  background: var(--bg-surface);
  color: var(--text-muted);
}

.upload-summary.success {
  background: rgba(109, 202, 141, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(109, 202, 141, 0.3);
}

.upload-summary.partial {
  background: rgba(245, 123, 123, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(245, 123, 123, 0.3);
}

/* ── Tag Input / Typeahead ── */
.tag-input-wrap {
  position: relative;
}

.tag-input {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.tag-input:focus {
  border-color: var(--accent);
}

.tag-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 200;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  max-height: 240px;
  overflow-y: auto;
}

.tag-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  gap: 8px;
}

.tag-dropdown-item:hover,
.tag-dropdown-item.active {
  background: var(--bg-hover);
}

.tag-dropdown-item.tag-already-added {
  opacity: 0.4;
  pointer-events: none;
}

.tag-dropdown-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-dropdown-badge {
  font-size: 11px;
  color: var(--accent);
  background: rgba(123, 184, 245, 0.12);
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.tag-dropdown-count {
  font-size: 11px;
  color: var(--text-dim);
  min-width: 20px;
  text-align: right;
}

/* ── Tag Picker Overlay ── */
.tag-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tag-picker-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.tag-picker-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.tag-picker-input .tag-input-wrap {
  width: 100%;
}

.tag-picker-close {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  align-self: flex-start;
}

.tag-picker-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ── Management Views (Tags + Sections) ── */
.management-view {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.management-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.management-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.management-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.management-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.management-row-name {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.management-row-count {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.management-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.mgmt-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mgmt-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.mgmt-btn-primary {
  background: var(--bg-active);
  border-color: var(--accent);
  color: var(--accent);
}

.mgmt-btn-primary:hover {
  background: rgba(15, 52, 96, 0.8);
}

.mgmt-btn-danger {
  border-color: rgba(245,123,123,0.3);
  color: var(--accent-red);
}

.mgmt-btn-danger:hover {
  background: rgba(245,123,123,0.1);
}

.inline-edit-input {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
  padding: 2px 6px;
  width: 200px;
  outline: none;
}

/* ── Rule Builder ── */
.rule-builder {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rule-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rule-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rule-op-label {
  font-size: 13px;
  color: var(--text-muted);
}

.rule-op-select {
  padding: 4px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.rule-op-select:focus {
  border-color: var(--accent);
}

.rule-conditions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 8px;
}

.rule-condition {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rule-cond-type {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(123, 184, 245, 0.15);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rule-cond-not {
  background: rgba(245, 123, 123, 0.15);
  color: var(--accent-red);
}

.rule-cond-tag {
  font-size: 13px;
  color: var(--text);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 8px;
}

.rule-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.rule-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.rule-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.rule-btn-remove {
  border-color: rgba(245,123,123,0.3);
  color: var(--accent-red);
  padding: 2px 7px;
}

.rule-btn-remove:hover {
  background: rgba(245,123,123,0.1);
}

.rule-preview {
  font-size: 12px;
  color: var(--text-dim);
  font-family: monospace;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  word-break: break-word;
}

/* ── Section Editor Overlay ── */
.section-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 16px;
}

.section-editor-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.section-editor-panel h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.section-editor-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-editor-field label,
.section-editor-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-name-input {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  outline: none;
  width: 100%;
}

.section-name-input:focus {
  border-color: var(--accent);
}

.section-rule-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--bg);
}

.section-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ── Lightbox Tag Panel ── */
.lb-tags-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.lb-tag-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  align-items: center;
}

.lb-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(123, 184, 245, 0.12);
  border: 1px solid rgba(123, 184, 245, 0.3);
  border-radius: 12px;
  padding: 3px 8px 3px 10px;
  font-size: 12px;
  color: var(--accent);
}

.lb-tag-remove {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.lb-tag-remove:hover {
  opacity: 1;
}

.lb-no-tags {
  font-size: 12px;
  color: var(--text-dim);
}

.lb-tag-input-wrap {
  max-width: 260px;
}

.lb-tag-input-wrap .tag-input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}

.lb-tag-input-wrap .tag-input:focus {
  border-color: var(--accent);
}

/* ── Bulk Selection Toolbar ── */
.bulk-toolbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  white-space: nowrap;
}

.bulk-count {
  font-size: 13px;
  color: var(--text-muted);
}

.bulk-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-active);
  border-color: var(--accent);
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.bulk-btn:hover {
  background: rgba(15, 52, 96, 0.8);
}

.bulk-btn-cancel {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.bulk-btn-cancel:hover {
  background: var(--bg-hover);
  color: var(--text);
}

@media (max-width: 767px) {
  .bulk-toolbar {
    bottom: 72px; /* above mobile tab bar */
    left: 16px;
    right: 16px;
    transform: none;
    justify-content: space-between;
  }

  .upload-view {
    padding: 16px 0;
  }

  .section-editor-overlay {
    padding: 16px 8px;
  }
}
