:root {
  /* Truespar brand */
  --sky: #0EA5E9;
  --sky-hover: #38BDF8;
  --sky-active: #0284C7;
  --sky-bg: rgba(14, 165, 233, 0.08);
  --sky-bg-2: rgba(14, 165, 233, 0.15);

  /* Surfaces — deep navy */
  --bg: #0A1118;
  --surface: #121C26;
  --surface-2: #1A2834;
  --surface-3: #223040;
  --surface-hover: #1E2E3C;
  --border: #2A3A48;
  --border-subtle: #1E2E3A;

  /* Text — warm tones */
  --text: #ECE8E0;
  --text-2: #7E8C9C;
  --text-3: #5A6A78;

  /* Status */
  --green: #22C55E;
  --green-bg: rgba(34, 197, 94, 0.1);
  --amber: #D4952B;
  --amber-bg: rgba(212, 149, 43, 0.1);
  --rose: #E05652;
  --rose-bg: rgba(224, 86, 82, 0.1);
  --info: #4A8FD4;
  --info-bg: rgba(74, 143, 212, 0.1);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --text-base: 14px;

  /* Spacing & Radius */
  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Fit within site layout */
.sift-app {
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-base);
  overflow: hidden;
}
.hidden { display: none !important; }

/* ===== LANDING ===== */
.landing {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.landing-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 50% 35%, rgba(14, 165, 233, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at 65% 55%, rgba(14, 165, 233, 0.03) 0%, transparent 70%);
}

.landing-content {
  position: relative;
  text-align: center;
  max-width: 520px;
  width: 100%;
  padding: 32px;
}

.landing-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}

.logo-icon { line-height: 0; }

.landing-logo h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--text), var(--sky));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-tagline {
  color: var(--text-3);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 40px;
}

/* Dropzone */
.dropzone {
  position: relative;
  padding: 48px 32px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.dropzone-ring {
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, transparent 40%, var(--sky) 50%, transparent 60%);
  background-size: 300% 300%;
  -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;
  opacity: 0;
  transition: opacity 0.3s;
}

.dropzone:hover .dropzone-ring,
.dropzone.dragover .dropzone-ring {
  opacity: 1;
  animation: ring-sweep 2s linear infinite;
}

@keyframes ring-sweep {
  0% { background-position: 100% 0%; }
  100% { background-position: -100% 100%; }
}

.dropzone:hover, .dropzone.dragover {
  background: var(--surface-2);
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(14, 165, 233, 0.08);
}

.dropzone-inner {
  position: relative;
  z-index: 1;
}

.dropzone-inner svg {
  color: var(--text-3);
  margin-bottom: 12px;
  transition: color 0.3s;
}

.dropzone:hover .dropzone-inner svg { color: var(--sky); }

.dropzone-inner p {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 4px;
}

.dropzone-inner span {
  font-size: 13px;
  color: var(--text-3);
}

.browse-link {
  color: var(--sky);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.browse-link:hover { border-bottom-color: var(--sky); }

.landing-formats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.landing-formats span {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-3);
  background: var(--surface);
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
}

.landing-version {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--mono);
}

/* ===== LOADING ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 17, 24, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
}

.loading-card {
  text-align: center;
  padding: 40px;
}

.loading-pulse {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--sky);
  margin: 0 auto 20px;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.4; }
  50% { transform: scale(1.1); opacity: 1; }
}

.loading-card p {
  color: var(--text-2);
  font-size: 13px;
}

/* ===== INSPECTOR ===== */
.inspector {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 48px;
  min-height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--text-3);
}

.logo-small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--sky);
  font-size: 14px;
  font-weight: 600;
}

.topbar-file {
  flex: 1;
  min-width: 0;
}

.topbar-filename {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.badge {
  font-size: 11px;
  font-family: var(--mono);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-type { background: var(--sky-bg); color: var(--sky); }
.badge-size { background: var(--green-bg); color: var(--green); }
.badge-tags { background: var(--amber-bg); color: var(--amber); }
.badge-pages { background: var(--info-bg); color: var(--info); }

/* Layout */
.inspector-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all 0.12s;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--sky-bg-2);
  color: var(--sky);
}

.nav-item svg { flex-shrink: 0; }

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-family: var(--mono);
  background: var(--surface-3);
  color: var(--text-3);
  padding: 1px 6px;
  border-radius: 4px;
}

.nav-item.active .nav-badge {
  background: var(--sky-bg);
  color: var(--sky);
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 12px;
}

.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-3);
  padding: 8px 12px 4px;
  font-weight: 600;
}

/* Content */
.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
  animation: slideUp 0.2s ease;
}

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

/* ===== PANELS ===== */

/* Metadata */
.meta-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  position: sticky;
  top: -24px;
  padding: 24px 0 12px;
  margin-top: -24px;
  background: var(--bg);
  z-index: 10;
}

.meta-search {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px 8px 36px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A6A78' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}

.meta-search:focus { border-color: var(--sky); }
.meta-search::placeholder { color: var(--text-3); }

.meta-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  min-width: 150px;
  cursor: pointer;
}

.meta-select:focus { border-color: var(--sky); }

.btn-export {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-export:hover { color: var(--text); border-color: var(--sky); }

.tag-group {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.tag-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}

.tag-group-header:hover { background: var(--surface-2); }

.tag-group-header .count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
}

.tag-group-header .chevron {
  transition: transform 0.2s;
  color: var(--text-3);
}

.tag-group.collapsed .chevron { transform: rotate(-90deg); }
.tag-group.collapsed .tag-group-body { display: none; }

.tag-group-body { background: var(--bg); }

.tag-row {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  transition: background 0.1s;
}

.tag-row:last-child { border-bottom: none; }
.tag-row:hover { background: var(--surface-2); }

.tag-name {
  width: 240px;
  min-width: 240px;
  padding: 5px 14px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 12px;
  border-right: 1px solid var(--border-subtle);
}

.tag-value {
  flex: 1;
  padding: 5px 14px;
  word-break: break-word;
  line-height: 1.5;
}

/* Thumbnail */
.thumb-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.thumb-container img {
  max-width: 100%;
  max-height: 500px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.thumb-container .no-data {
  color: var(--text-3);
  font-size: 13px;
}

/* GPS */
.gps-coords {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
}

.gps-coords .label { color: var(--text-3); margin-right: 8px; }
.gps-coords .value { color: var(--text); font-weight: 500; }

#map {
  height: 450px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Text */
.text-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.text-toolbar .page-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.12s;
}

.page-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.page-btn:disabled { opacity: 0.3; cursor: default; }

.page-indicator {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-3);
  min-width: 80px;
  text-align: center;
}

.text-mode-toggle {
  margin-left: auto;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.text-mode-toggle button {
  padding: 6px 12px;
  font-size: 12px;
  font-family: var(--font);
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.12s;
}

.text-mode-toggle button.active { background: var(--sky-bg-2); color: var(--sky); }
.text-mode-toggle button:hover:not(.active) { color: var(--text-2); }

.text-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  max-height: calc(100vh - 200px);
  overflow: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  tab-size: 4;
}

.copy-btn {
  margin-left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover { color: var(--text); border-color: var(--sky); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* Images gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.gallery-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.15s;
  cursor: pointer;
}

.gallery-card:hover {
  border-color: var(--sky);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.gallery-card .img-wrap {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060C12;
  overflow: hidden;
}

.gallery-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gallery-card .img-info {
  padding: 8px 10px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gallery-card .img-dim { color: var(--text-2); font-weight: 500; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 18, 0.92);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: fadeIn 0.15s ease;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.lightbox-info {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-2);
  background: var(--surface);
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Forms */
.form-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.form-stat {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex: 1;
}

.form-stat .stat-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--mono);
}

.form-stat .stat-label {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.form-field-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  background: var(--surface);
  transition: background 0.1s;
}

.form-field-card:hover { background: var(--surface-2); }

.field-type-badge {
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  min-width: 60px;
  text-align: center;
}

.field-type-badge.text { background: var(--sky-bg); color: var(--sky); }
.field-type-badge.checkbox, .field-type-badge.button { background: var(--green-bg); color: var(--green); }
.field-type-badge.choice { background: var(--amber-bg); color: var(--amber); }
.field-type-badge.signature { background: var(--rose-bg); color: var(--rose); }

.field-info { flex: 1; min-width: 0; }
.field-name { font-size: 13px; font-weight: 500; }
.field-value { font-size: 12px; color: var(--text-3); font-family: var(--mono); margin-top: 2px; }

.field-flags {
  display: flex;
  gap: 4px;
}

.field-flag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
}

.field-flag.required { background: var(--rose-bg); color: var(--rose); }
.field-flag.readonly { background: var(--surface-3); color: var(--text-3); }

/* Annotations */
.annot-card {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  background: var(--surface);
  transition: background 0.1s;
}

.annot-card:hover { background: var(--surface-2); }

.annot-type-badge {
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  height: fit-content;
}

.annot-type-badge.link { background: var(--sky-bg); color: var(--sky); }
.annot-type-badge.text, .annot-type-badge.freetext { background: var(--amber-bg); color: var(--amber); }
.annot-type-badge.highlight, .annot-type-badge.underline, .annot-type-badge.squiggly, .annot-type-badge.strikeout { background: var(--green-bg); color: var(--green); }
.annot-type-badge.widget { background: var(--info-bg); color: var(--info); }
.annot-type-badge.popup { background: var(--surface-3); color: var(--text-3); }

.annot-body { flex: 1; min-width: 0; }
.annot-page { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.annot-contents { font-size: 13px; margin-top: 4px; line-height: 1.4; }
.annot-dest { font-size: 12px; color: var(--sky); margin-top: 4px; font-family: var(--mono); word-break: break-all; }
.annot-meta { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* Structure tree */
.struct-tree { font-size: 13px; }

.struct-node {
  padding-left: 20px;
  position: relative;
}

.struct-node::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.struct-node-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  margin: 2px 0;
  border-radius: 4px;
  cursor: default;
  transition: background 0.1s;
}

.struct-node-label:hover { background: var(--surface-hover); }

.struct-type {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--sky);
}

.struct-text {
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
}

.struct-role-map {
  margin-top: 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.struct-role-map h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}

.role-row {
  display: flex;
  gap: 8px;
  font-size: 12px;
  font-family: var(--mono);
  padding: 3px 0;
  color: var(--text-3);
}

.role-row .from { color: var(--amber); }
.role-row .to { color: var(--green); }

/* Password */
.password-panel {
  max-width: 400px;
  margin: 60px auto;
  text-align: center;
}

.password-panel svg { color: var(--text-3); margin-bottom: 16px; }
.password-panel h3 { font-size: 16px; margin-bottom: 8px; }
.password-panel p { font-size: 13px; color: var(--text-3); margin-bottom: 24px; line-height: 1.6; }

.password-form {
  display: flex;
  gap: 8px;
}

.password-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
}

.password-input:focus { border-color: var(--sky); }
.password-input::placeholder { color: var(--text-3); }

.btn-unlock {
  background: var(--sky);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-unlock:hover { background: var(--sky-active); }

.password-error {
  color: var(--rose);
  font-size: 13px;
  margin-top: 12px;
}

.password-success {
  color: var(--green);
  font-size: 13px;
  margin-top: 12px;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-3);
  font-size: 13px;
}

.empty-state svg { margin-bottom: 12px; opacity: 0.4; }

/* Mini loader */
.panel-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

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

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* Leaflet dark tiles */
.leaflet-tile { filter: brightness(0.65) contrast(1.1) saturate(0.7) hue-rotate(10deg); }
.leaflet-control-attribution { font-size: 10px !important; }

/* Hide site footer on demo page — set by body class */
body.sift-demo-page .site-footer,
body.sift-demo-page footer { display: none; }

/* Remove main padding so demo fills the space */
body.sift-demo-page main { padding: 0; margin: 0; }

/* Back link */
.back-link {
  color: var(--sky);
  text-decoration: none;
  font-size: 13px;
  transition: opacity 0.15s;
}

.back-link:hover { opacity: 0.8; }

/* Make logo-small a proper link */
a.logo-small {
  text-decoration: none;
  transition: opacity 0.15s;
}

a.logo-small:hover { opacity: 0.8; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 52px; min-width: 52px; }
  .sidebar .nav-item span, .sidebar .nav-badge, .sidebar .nav-label { display: none; }
  .sidebar .nav-item { justify-content: center; padding: 10px; }
  .content { padding: 16px; }
  .tag-name { width: 140px; min-width: 140px; }
  .meta-toolbar { flex-wrap: wrap; }
}
