/* ==========================================================================
   Venue Database - Pure Black & Graphite Grey Minimalist Dark Theme
   No blue tints — pure neutral blacks, dark graphites, and silvers.
   ========================================================================== */

:root {
  /* Pure Neutral Dark & Charcoal/Graphite Palette */
  --bg-main: #0a0a0a;
  --bg-gradient: radial-gradient(circle at 50% 0%, #161616 0%, #0a0a0a 60%, #050505 100%);
  --bg-card: #121212;
  --bg-card-hover: #1a1a1a;
  --bg-surface: #141414;
  --bg-nested-1: #0e0e0e;
  --bg-nested-2: #080808;
  --bg-nested-3: #121212;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(255, 255, 255, 0.25);
  --border-highlight: rgba(255, 255, 255, 0.35);

  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #666666;
  --text-accent: #ffffff;

  /* Software Family Colors (for file badges only) */
  --sw-soundvision: #06b6d4;
  --sw-arraycalc: #3b82f6;
  --sw-display3: #a855f7;
  --sw-display17: #e879f9;
  --sw-openarray: #f59e0b;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-full: 9999px;

  --transition-fast: 0.12s ease;
  --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

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

body {
  font-family: var(--font-main);
  background: var(--bg-main);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-size: 0.88rem;
}

/* Container */
.app-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
}

/* ==========================================================================
   Header & Hero (Compact)
   ========================================================================== */

.app-header {
  margin-bottom: 1rem;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.logo-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #333333, #1f1f1f, #141414);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  color: #fff;
  flex-shrink: 0;
}

.logo-text h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.15;
}

.last-updated {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 500;
  margin-top: 0.15rem;
}

.last-updated-val {
  color: #d4d4d4;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #181818;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 550;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: #242424;
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

/* ==========================================================================
   Stats Counter Strip (3-Column Clean Monochrome)
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.95rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  transition: all var(--transition-fast);
}

.stat-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--card-accent, #737373);
  opacity: 0.9;
}

.stat-card.countries { --card-accent: #a3a3a3; }
.stat-card.cities { --card-accent: #737373; }
.stat-card.venues { --card-accent: #525252; }

.stat-info-compact {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* ==========================================================================
   Filter & Search Toolbar (Narrow / Compact Sticky)
   ========================================================================== */

.filter-toolbar {
  background: rgba(18, 18, 18, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  position: sticky;
  top: 0.5rem;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.toolbar-primary {
  display: grid;
  grid-template-columns: 2fr 1.1fr 1.1fr;
  gap: 0.6rem;
  align-items: center;
}

@media (max-width: 860px) {
  .toolbar-primary {
    grid-template-columns: 1fr;
  }
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: #0d0d0d;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.45rem 2rem 0.45rem 2.2rem;
  color: var(--text-primary);
  font-size: 0.84rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
  background: #141414;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--radius-full);
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear:hover {
  color: var(--text-primary);
}

.filter-select-wrapper {
  position: relative;
}

.filter-select {
  width: 100%;
  background: #0d0d0d;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.45rem 1.8rem 0.45rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all var(--transition-fast);
}

.filter-select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.35);
}

.filter-select:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.select-chevron {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Secondary toolbar: Software chips & Reset */
.toolbar-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.software-chips {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.chip-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-right: 0.15rem;
}

.chip {
  background: #171717;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chip:hover {
  background: #242424;
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.chip.active {
  background: #2a2a2a;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.btn-reset-filters {
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #f87171;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--transition-fast);
}

.btn-reset-filters:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #fff;
  border-color: #ef4444;
}

/* Match status alert bar */
.match-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0 0.25rem;
}

.match-count-highlight {
  color: #f5f5f5;
  font-weight: 700;
}

/* ==========================================================================
   Narrow Compact Hierarchy Accordion Tree
   ========================================================================== */

.venues-tree {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Country Node (Level 1) */
.country-node {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.country-node:hover {
  border-color: var(--border-medium);
}

.country-node.open {
  border-color: rgba(255, 255, 255, 0.25);
}

.country-header {
  padding: 0.42rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: #141414;
  transition: background var(--transition-fast);
}

.country-header:hover {
  background: #1c1c1c;
}

.node-title-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.country-flag {
  font-size: 1.15rem;
  line-height: 1;
}

.country-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.node-meta-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.badge-tag {
  font-size: 0.68rem;
  font-weight: 650;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.badge-cities {
  color: #e5e5e5;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.badge-venues {
  color: #d4d4d4;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.badge-files {
  color: #a3a3a3;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.chevron-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.country-node.open > .country-header .chevron-icon,
.city-node.open > .city-header .chevron-icon,
.venue-node.open > .venue-header .chevron-icon {
  transform: rotate(180deg);
  color: var(--text-primary);
}

.country-body {
  padding: 0.25rem 0.5rem 0.5rem;
  display: none;
  background: #0a0a0a;
}

.country-node.open > .country-body {
  display: block;
}

/* City Node (Level 2) */
.cities-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.city-node {
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.city-node:hover {
  border-color: var(--border-medium);
}

.city-node.open {
  border-color: rgba(255, 255, 255, 0.2);
}

.city-header {
  padding: 0.35rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: #111111;
}

.city-header:hover {
  background: #181818;
}

.city-name {
  font-size: 0.85rem;
  font-weight: 650;
  color: #e5e5e5;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.city-icon {
  color: #888888;
}

.city-body {
  padding: 0.2rem 0.45rem 0.45rem;
  display: none;
  background: #080808;
}

.city-node.open > .city-body {
  display: block;
}

/* Venue Node (Level 3) */
.venues-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.venue-node {
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.venue-node:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.venue-node.open {
  border-color: rgba(255, 255, 255, 0.25);
}

.venue-header {
  padding: 0.3rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: #0e0e0e;
}

.venue-header:hover {
  background: #161616;
}

.venue-name {
  font-size: 0.82rem;
  font-weight: 650;
  color: #f5f5f5;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.venue-icon {
  color: #737373;
}

.btn-venue-action {
  font-size: 0.68rem;
  font-weight: 650;
  padding: 0.15rem 0.45rem;
  background: #1e1e1e;
  border: 1px solid var(--border-subtle);
  color: #d4d4d4;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all var(--transition-fast);
}

.btn-venue-action:hover {
  background: #2a2a2a;
  color: #ffffff;
  border-color: var(--border-medium);
}

.venue-body {
  padding: 0.25rem 0.5rem 0.45rem;
  display: none;
  background: #050505;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.venue-node.open > .venue-body {
  display: block;
}

/* Files List (Level 4 - Narrow & Compact) */
.files-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.file-item {
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xs);
  padding: 0.28rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  transition: all var(--transition-fast);
}

.file-item:hover {
  background: #1c1c1c;
  border-color: rgba(255, 255, 255, 0.12);
}

.file-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}

/* Software pill tag */
.file-software-badge {
  font-size: 0.66rem;
  font-weight: 750;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-xs);
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.file-download-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  cursor: pointer;
}

.file-name {
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--text-primary);
  word-break: break-all;
}

.file-preview-link {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

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

.file-preview-link:hover {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: #31b7a4;
  text-underline-offset: 3px;
}

.file-preview-link:focus-visible,
.preview-tool-button:focus-visible,
.preview-icon-button:focus-visible {
  outline: 2px solid #31b7a4;
  outline-offset: 2px;
}

.file-meta-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.file-ext-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #a3a3a3;
  background: #1e1e1e;
  padding: 0.08rem 0.3rem;
  border-radius: var(--radius-xs);
}

.file-right-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Compact Neutral Download Button (No blue) */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #242424;
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-download:hover {
  background: #333333;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Search Highlight & Empty States
   ========================================================================== */

mark.search-highlight {
  background: rgba(250, 204, 21, 0.35);
  color: #fef08a;
  padding: 0.05em 0.25em;
  border-radius: 2px;
  font-weight: 700;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-top: 1rem;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto 1rem;
  font-size: 0.82rem;
}

/* Toast Notification (Neutral dark) */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toast {
  background: #1f1f1f;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .app-container {
    padding: 0.75rem 0.5rem 2.5rem;
  }
  .file-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .file-right-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.preview-dialog {
  width: min(1220px, calc(100vw - 2rem));
  height: min(860px, calc(100dvh - 2rem));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(191, 211, 208, 0.2);
  border-radius: 8px;
  background: #101516;
  color: #edf2f0;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.7);
}

.preview-dialog::backdrop {
  background: rgba(3, 7, 8, 0.82);
  backdrop-filter: blur(5px);
}

.preview-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(191, 211, 208, 0.13);
}

.preview-heading {
  min-width: 0;
}

.preview-eyebrow {
  color: #74c9b8;
  font: 600 0.62rem var(--font-mono);
  letter-spacing: 0.08em;
}

.preview-heading h2 {
  overflow: hidden;
  margin-top: 0.2rem;
  color: #f4f7f5;
  font-size: 1rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-icon-button,
.preview-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(191, 211, 208, 0.16);
  border-radius: 5px;
  background: #182020;
  color: #bac7c3;
  cursor: pointer;
}

.preview-icon-button:hover,
.preview-tool-button:hover,
.preview-tool-button.active {
  border-color: rgba(91, 194, 171, 0.56);
  background: #20302e;
  color: #91e0cf;
}

.preview-icon-button svg {
  width: 17px;
  height: 17px;
}

.preview-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 54px;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid rgba(191, 211, 208, 0.1);
  background: #131a1a;
}

.preview-mode-group {
  display: flex;
  gap: 0.3rem;
}

.preview-control-divider {
  width: 1px;
  height: 22px;
  margin: 0 0.25rem;
  background: rgba(191, 211, 208, 0.18);
}

.preview-tool-button {
  width: 34px;
  height: 34px;
  font-size: 0.72rem;
  font-weight: 700;
}

.preview-tool-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preview-text-tool {
  width: 42px;
}

.preview-reset-tool {
  margin-left: auto;
}

.preview-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  flex: 1;
  min-height: 0;
}

.preview-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #0c1011;
}

#preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#preview-canvas:active {
  cursor: grabbing;
}

.preview-status {
  position: absolute;
  top: 0.85rem;
  left: 0.9rem;
  max-width: calc(100% - 1.8rem);
  padding: 0.38rem 0.55rem;
  border: 1px solid rgba(191, 211, 208, 0.12);
  border-radius: 4px;
  background: rgba(12, 16, 17, 0.78);
  color: #b2c1bd;
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.preview-hint {
  position: absolute;
  right: 0.85rem;
  bottom: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  background: rgba(12, 16, 17, 0.76);
  color: #9baaa6;
  font-size: 0.66rem;
}

.preview-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1rem 0.85rem;
  border-left: 1px solid rgba(191, 211, 208, 0.12);
  background: #131a1a;
}

.preview-sidebar h3 {
  margin-bottom: 0.75rem;
  color: #dce5e1;
  font-size: 0.74rem;
  font-weight: 700;
}

.preview-layers {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 0;
  overflow: auto;
}

.preview-layer {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 28px;
  color: #b6c2be;
  font-size: 0.7rem;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.preview-layer input {
  accent-color: #4bb89f;
  flex: 0 0 auto;
}

.preview-layer-swatch {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 2px;
}

@media (max-width: 700px) {
  .preview-dialog {
    width: calc(100vw - 1rem);
    height: calc(100dvh - 1rem);
  }

  .preview-header {
    min-height: 62px;
    padding: 0.7rem 0.8rem;
  }

  .preview-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .preview-sidebar {
    max-height: 140px;
    padding: 0.55rem 0.8rem;
    border-top: 1px solid rgba(191, 211, 208, 0.12);
    border-left: 0;
  }

  .preview-sidebar h3 {
    margin-bottom: 0.35rem;
  }

  .preview-layers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.1rem 0.5rem;
  }

  .preview-hint {
    right: 0.5rem;
    bottom: 0.5rem;
    max-width: calc(100% - 1rem);
    font-size: 0.6rem;
  }
}
