/* ============================================================
   CHROMA — Editor de color profesional
   Design tokens + sistema de componentes
   ============================================================ */

:root {
  /* Superficie: estudio oscuro, como una mesa de luz de diseñador */
  --surface-0: #0f1215;   /* fondo app */
  --surface-1: #161a1f;   /* paneles */
  --surface-2: #1d2229;   /* tarjetas / inputs */
  --surface-3: #262c35;   /* hover / elevado */
  --border: #2c333d;
  --border-strong: #3a424e;

  /* Texto */
  --text-hi: #f2f4f7;
  --text-mid: #a9b2bf;
  --text-low: #6b7481;

  /* Acento: cian de calibración de color (referencia a monitores/probetas de color) */
  --accent: #22d3c8;
  --accent-hover: #3ee4d9;
  --accent-soft: rgba(34, 211, 200, 0.12);
  --accent-ring: rgba(34, 211, 200, 0.35);

  /* Semánticos */
  --danger: #f2554f;
  --danger-hover: #ff6d67;
  --danger-soft: rgba(242, 85, 79, 0.12);
  --warn: #e8a33d;

  /* Tipografía */
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Forma */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-panel: 0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px rgba(0,0,0,0.35);
  --shadow-float: 0 12px 32px rgba(0,0,0,0.5);

  /* Layout */
  --col-tools-w: 300px;
  --col-props-w: 320px;
  --topbar-h: 56px;
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--surface-0);
  color: var(--text-hi);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; }

::selection { background: var(--accent-soft); color: var(--text-hi); }

/* Scrollbars discretos */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-low); }

/* ============================================================
   APP SHELL
   ============================================================ */

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  z-index: 20;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topbar-brand .mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #1a8f88);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-brand .mark svg { width: 15px; height: 15px; color: #06201d; }

.topbar-brand h1 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topbar-brand .subtitle {
  color: var(--text-low);
  font-size: 0.75rem;
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border);
}

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

/* ---- Shell de 3 columnas ---- */
.shell {
  flex: 1;
  display: flex;
  min-height: 0;
}

.col-tools, .col-props {
  width: var(--col-tools-w);
  min-width: var(--col-tools-w);
  background: var(--surface-1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.col-props {
  width: var(--col-props-w);
  min-width: var(--col-props-w);
  border-left: 1px solid var(--border);
}

.col-tools {
  border-right: 1px solid var(--border);
}

.col-canvas {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 25px 25px, rgba(255,255,255,0.03) 1px, transparent 0) 0 0/26px 26px,
    var(--surface-0);
}

/* ============================================================
   PANEL SECTIONS (columnas izquierda/derecha)
   ============================================================ */

.panel-section {
  padding: 1.1rem 1.1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}

.panel-section:last-child { border-bottom: none; }

.panel-section h2 {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-low);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.panel-section h2 svg { width: 13px; height: 13px; }

.panel-section p.hint {
  color: var(--text-low);
  font-size: 0.78rem;
  margin-top: 0.4rem;
  line-height: 1.45;
}

/* Navegación de propiedades por segmentos (reemplaza pestañas) */
.segmented {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.segmented button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-mid);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.45rem 0.5rem;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.segmented button.active {
  background: var(--surface-3);
  color: var(--text-hi);
}

.segmented button:not(.active):hover { color: var(--text-hi); }

.view-pane { display: none; }
.view-pane.active { display: block; }

/* ============================================================
   DROPZONE
   ============================================================ */

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.6rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface-2);
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone svg {
  width: 26px;
  height: 26px;
  color: var(--text-low);
  margin-bottom: 0.6rem;
}

.dropzone.drag-over svg, .dropzone:hover svg { color: var(--accent); }

.dropzone .dz-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-hi);
}

.dropzone .dz-sub {
  font-size: 0.72rem;
  color: var(--text-low);
  margin-top: 0.2rem;
}

.dropzone input[type="file"] { display: none; }

/* ============================================================
   BOTONES
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap;
  color: var(--text-hi);
  background: var(--surface-2);
  border-color: var(--border-strong);
}

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

.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface-2); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06201d;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-danger {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-mid);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text-hi); }

.btn-icon {
  padding: 0.45rem;
  width: 30px;
  height: 30px;
}

.btn-block { width: 100%; }
.btn-sm { padding: 0.35rem 0.6rem; font-size: 0.74rem; }

.btn-row { display: flex; gap: 0.5rem; }
.btn-row .btn { flex: 1; }

/* ============================================================
   CONTROLES DE FORMULARIO
   ============================================================ */

.field {
  margin-bottom: 0.85rem;
}
.field:last-child { margin-bottom: 0; }

.field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-mid);
  margin-bottom: 0.4rem;
}

.field label .val {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-hi);
  background: var(--surface-2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--surface-0);
  box-shadow: 0 0 0 1px var(--accent);
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--surface-0);
}

.color-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

input[type="color"] {
  -webkit-appearance: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  background: none;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }

.color-hex {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-mid);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  flex: 1;
  min-width: 0;
}

select, input[type="number"], input[type="text"] {
  background: var(--surface-2);
  color: var(--text-hi);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  width: 100%;
}
select:focus, input:focus { outline: none; border-color: var(--accent); }

.field-row { display: flex; gap: 0.6rem; }
.field-row .field { flex: 1; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-mid);
  cursor: pointer;
  padding: 0.3rem 0;
}
.checkbox-row input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

/* ============================================================
   REGLAS DE COLOR (tarjetas)
   ============================================================ */

.rule-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.8rem;
  margin-bottom: 0.6rem;
  transition: border-color 0.15s;
}
.rule-card:hover { border-color: var(--border-strong); }
.rule-card.expanded { border-color: var(--accent); }

.rule-card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
}

.rule-swatch-pair {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.15);
}
.swatch.transparent-swatch {
  background-image:
    linear-gradient(45deg, #555 25%, transparent 25%),
    linear-gradient(-45deg, #555 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #555 75%),
    linear-gradient(-45deg, transparent 75%, #555 75%);
  background-size: 6px 6px;
  background-position: 0 0, 0 3px, 3px -3px, -3px 0px;
  background-color: #333;
}

.rule-arrow { color: var(--text-low); flex-shrink: 0; }
.rule-arrow svg { width: 12px; height: 12px; }

.rule-meta {
  flex: 1;
  min-width: 0;
  font-size: 0.76rem;
  color: var(--text-mid);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rule-card-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.rule-card-body {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.rule-card.expanded .rule-card-body { display: block; }

.rules-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-low);
  font-size: 0.8rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

/* ============================================================
   CANVAS AREA
   ============================================================ */

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  flex-shrink: 0;
}

.canvas-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.canvas-toolbar-label {
  font-size: 0.72rem;
  color: var(--text-low);
  font-family: var(--font-mono);
}

.canvas-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.5rem;
  overflow: auto;
  min-height: 0;
}

.canvas-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.canvas-panel-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-low);
}

.canvas-frame {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-panel);
  background-image:
    linear-gradient(45deg, #23272e 25%, transparent 25%),
    linear-gradient(-45deg, #23272e 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #23272e 75%),
    linear-gradient(-45deg, transparent 75%, #23272e 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  background-color: #1a1e24;
}

.canvas-frame canvas {
  display: block;
  max-width: 60vw;
  max-height: 55vh;
  cursor: crosshair;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  color: var(--text-low);
  text-align: center;
  padding: 3rem;
}
.empty-state svg { width: 42px; height: 42px; opacity: 0.5; }
.empty-state .title { font-size: 0.95rem; color: var(--text-mid); font-weight: 500; }
.empty-state .sub { font-size: 0.8rem; max-width: 320px; }

.lupa {
  position: fixed;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: #000;
  pointer-events: none;
  display: none;
  z-index: 50;
  box-shadow: var(--shadow-float);
}

/* ============================================================
   COMPARADOR ANTES / DESPUÉS (slider tipo Adobe)
   ============================================================ */

.compare-widget {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-panel);
  max-width: 100%;
  user-select: none;
  background-image:
    linear-gradient(45deg, #23272e 25%, transparent 25%),
    linear-gradient(-45deg, #23272e 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #23272e 75%),
    linear-gradient(-45deg, transparent 75%, #23272e 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  background-color: #1a1e24;
}

.compare-widget canvas { display: block; max-width: 100%; height: auto; }

.compare-widget .layer-after {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  overflow: hidden;
}
.compare-widget .layer-after canvas { position: absolute; top: 0; left: 0; }

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  cursor: ew-resize;
  z-index: 5;
}
.compare-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--shadow-float);
}
.compare-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 2px;
  border-left: 2px solid #06201d;
  border-right: 2px solid #06201d;
  z-index: 6;
}

.compare-tag {
  position: absolute;
  top: 0.6rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0,0,0,0.55);
  color: var(--text-hi);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 4;
}
.compare-tag.tag-before { left: 0.6rem; }
.compare-tag.tag-after { right: 0.6rem; }

/* ============================================================
   PALETAS Y SWATCHES
   ============================================================ */

.palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
}

.palette-swatch {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  position: relative;
  transition: transform 0.1s;
}
.palette-swatch:hover { transform: scale(1.1); z-index: 2; }

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.preset-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.3rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.preset-chip:hover { border-color: var(--accent); background: var(--surface-3); }
.preset-chip .swatch { width: 20px; height: 20px; }
.preset-chip span { font-size: 0.68rem; color: var(--text-mid); }

/* ============================================================
   GALERÍA DE LOTE
   ============================================================ */

.batch-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.batch-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 1;
}
.batch-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.batch-item .batch-item-name {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  font-size: 0.6rem;
  padding: 0.2rem 0.3rem;
  background: rgba(0,0,0,0.7);
  color: var(--text-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-item.processing { opacity: 0.5; }

.progress-bar {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.6rem;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s;
}

/* ============================================================
   TOASTS
   ============================================================ */

.toast-stack {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  color: var(--text-hi);
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toast-in 0.2s ease-out;
  max-width: 320px;
}
.toast svg { width: 15px; height: 15px; flex-shrink: 0; }
.toast.toast-error { border-color: var(--danger); }
.toast.toast-error svg { color: var(--danger); }
.toast.toast-success svg { color: var(--accent); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   BADGE "próximamente" (Fase 5 — arquitectura preparada)
   ============================================================ */

.badge-soon {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-3);
  color: var(--text-low);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

.feature-locked {
  opacity: 0.55;
  pointer-events: none;
  position: relative;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) and (min-width: 881px) {
  :root { --col-tools-w: 260px; --col-props-w: 280px; }
}

/* ------------------------------------------------------------
   MÓVIL / TABLET ESTRECHO (≤880px)
   Patrón: barra de pestañas inferior fija (Imagen / Reglas /
   Ajustes / Exportar). El canvas ocupa toda la pantalla y cada
   columna lateral se convierte en un panel de pantalla completa
   que se muestra/oculta por pestaña, en vez de apilarse en
   scroll infinito o tapar el resultado con un bottom-sheet.
   ------------------------------------------------------------ */
@media (max-width: 880px) {
  html, body { height: 100%; overflow: hidden; }

  .topbar { padding: 0 0.75rem; }
  .topbar-brand .subtitle { display: none; }
  .topbar-brand h1 { font-size: 0.9rem; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn-primary { padding: 0.5rem 0.6rem; }

  .shell {
    flex: none;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    height: calc(100vh - var(--topbar-h) - var(--mobile-tabbar-h, 58px));
    position: relative;
  }

  :root { --mobile-tabbar-h: 58px; }

  /* Columnas laterales pasan a ser paneles de pantalla completa,
     ocultos por defecto y mostrados solo cuando su pestaña está activa */
  .col-tools, .col-props {
    display: none;
    width: 100%;
    min-width: 0;
    max-height: none;
    height: 100%;
    border: none;
    position: absolute;
    inset: 0;
    z-index: 10;
    background: var(--surface-1);
  }
  .col-tools.mobile-active, .col-props.mobile-active {
    display: flex;
  }

  .col-canvas {
    width: 100%;
    height: 100%;
  }
  /* El canvas se oculta (no se destruye) cuando una pestaña lateral está activa,
     para no perder el estado de zoom/scroll al volver a "Imagen" */
  .col-canvas.mobile-hidden { display: none; }

  .canvas-frame canvas { max-width: 88vw; max-height: 42vh; }
  .canvas-stage { gap: 1.25rem; padding: 1rem 0.75rem; }
  #editorView { flex-direction: column; gap: 1.25rem !important; }

  .compare-widget { max-width: 92vw; }

  /* Barra de pestañas inferior fija, estilo app nativa */
  .mobile-tabbar {
    display: flex;
    height: var(--mobile-tabbar-h, 58px);
    border-top: 1px solid var(--border);
    background: var(--surface-1);
    flex-shrink: 0;
  }
  .mobile-tabbar button {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-low);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
  }
  .mobile-tabbar button svg { width: 19px; height: 19px; }
  .mobile-tabbar button.active { color: var(--accent); }
}

@media (min-width: 881px) {
  .mobile-tabbar { display: none !important; }
}

